lkml.org 
[lkml]   [2010]   [Sep]   [13]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH] x86: EuroBraille/Iris power off
From
Date
On Mon, 13 Sep 2010 17:22:49 +0200, Samuel Thibault said:

> 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.

I'm agreeing that if iris_init() checks that the user passed 'irisinit.force=1'
on the command line or as a module parameter, and bailed immediately if it
wasn't passed, then doing the inb() and testing it should be safe enough. Doing
stuff that's only known safe on an Iris is no great sin if the user has said
"Yes, you're on a Iris" - at that point it's the user's fault.

static int iris_init(void)
{
unsigned char status;
if (!irisinit.force) return; /* or whatever the appropriate test is */
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;
}
That look safe enough to everybody? That way, even if a distro turns on every
CONFIG_FOO that compiles (you guys know who you are ;), it should still DTRT on
all platforms.

[unhandled content-type:application/pgp-signature]
\
 
 \ /
  Last update: 2010-09-14 03:49    [from the cache]
©2003-2014 Jasper Spaans. Advertise on this site