[PATCH] Re: IBM-ACPI broken in 2.6.10

From: Jim Radford
Date: Sat Jan 15 2005 - 10:58:22 EST


> The ibm-acpi module included in 2.6.10 doesn't appear to parse
> parameters correctly. This seems to be due to a patch from Rusty
> Russell [1] which attempted to fix up the parameter parsing.

> What's the right way of fixing this?

I'm not sure about the "right" way, but this is what I came up with.
I sent a copy of this patch to Borislav Deianov a few weeks ago with
no resposne. Maybe someone else will pick it up.

With this fix "insmod ibm_acpi light=on" works for me again.

-Jim

Module params don't work for me with 2.6.10 because the callbacks get
called before ibm_acpi_init so that the acpi_handle's are still NULL.

Here's a patch to force the param callbacks to be called after the
module is inited so that cmos_handle et al will be defined.

Signed-Off-By: Jim Radford <radford@xxxxxxxxxxxxx>

--- linux-2.6.10/drivers/acpi/ibm_acpi.c.orig 2004-12-25 09:33:48.000000000 -0800
+++ linux-2.6.10/drivers/acpi/ibm_acpi.c 2004-12-26 14:17:16.000000000 -0800
@@ -153,6 +153,8 @@
} state;

int experimental;
+
+ const char *param;
};

struct proc_dir_entry *proc_dir = NULL;
@@ -1150,17 +1152,11 @@
static int set_ibm_param(const char *val, struct kernel_param *kp)
{
unsigned int i;
- char arg_with_comma[32];
-
- if (strlen(val) > 30)
- return -ENOSPC;
-
- strcpy(arg_with_comma, val);
- strcat(arg_with_comma, ",");
-
for (i=0; i<NUM_IBMS; i++)
- if (strcmp(ibms[i].name, kp->name) == 0)
- return ibms[i].write(&ibms[i], arg_with_comma);
+ if (strcmp(ibms[i].name, kp->name) == 0) {
+ ibms[i].param = val;
+ return 0;
+ }
BUG();
return -EINVAL;
}
@@ -1215,6 +1211,14 @@

for (i=0; i<NUM_IBMS; i++) {
ret = ibm_init(&ibms[i]);
+ if (ret >= 0 && ibms[i].param) {
+ char arg_with_comma[32];
+ if (strlen(ibms[i].param) > sizeof(arg_with_comma)-2)
+ return -ENOSPC;
+ strcpy(arg_with_comma, ibms[i].param);
+ strcat(arg_with_comma, ",");
+ ret = ibms[i].write(&ibms[i], arg_with_comma);
+ }
if (ret < 0) {
acpi_ibm_exit();
return ret;




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