Re: [PATCH] x86: EuroBraille/Iris power off

From: Samuel Thibault
Date: Mon Sep 13 2010 - 11:32:42 EST


Valdis.Kletnieks@xxxxxx, le Mon 13 Sep 2010 11:10:47 -0400, a écrit :
> On Mon, 13 Sep 2010 12:07:19 +0200, Shérab said:
>
> > +static int iris_init(void)
> > +{
> > + unsigned char status = inb(IRIS_GIO_INPUT);
> > + if (status == IRIS_GIO_NODEV) {
> > + printk(KERN_ERR "This machine does not seem to be an Iris. Power_off handler not installed.\n");
> > + return -ENODEV;
> > + }
>
> Is it actually safe to assume that this will do the right thing on a machine that
> is a non-Iris that has something *else* at that I/O address?

No.

> Any further sanity checking we can do?

No. The format of the value there is quite unknown, it's just quite sure
it won't be 0xff on the Iris.

Again, I'm not sure we really should try hard to make it automatically
detected (and thus always enabled). Having to pass a kernel parameter
to enable the functionality is completely fine, since installing Linux
on this device requires quite some tinkering already.

Samuel
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/