From: Jim Radford <radford@blackbean.org>
To: Matthew Garrett <mjg59@srcf.ucam.org>
Cc: linux-kernel@vger.kernel.org
Subject: [PATCH] Re: IBM-ACPI broken in 2.6.10
Date: Sat, 15 Jan 2005 07:55:19 -0800 [thread overview]
Message-ID: <20050115155519.GA29719@blackbean.org> (raw)
In-Reply-To: <1105744800.7565.4.camel@tyrosine>
> 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@blackbean.org>
--- 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;
prev parent reply other threads:[~2005-01-15 15:55 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-01-14 23:20 Matthew Garrett
2005-01-15 15:55 ` Jim Radford [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20050115155519.GA29719@blackbean.org \
--to=radford@blackbean.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mjg59@srcf.ucam.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Powered by JetHome