* [PATCH 1/2] dell-wmi - properly handle errors returned by wmi_install_notify_handler()
@ 2009-12-29 8:34 Dmitry Torokhov
2009-12-29 8:34 ` [PATCH 2/2] hp-wmi " Dmitry Torokhov
` (2 more replies)
0 siblings, 3 replies; 5+ messages in thread
From: Dmitry Torokhov @ 2009-12-29 8:34 UTC (permalink / raw)
To: Len Brown, Matthew Garrett; +Cc: linux-acpi, Paul Rolland
wmi_install_notify_handler() retruns ACPI error codes instead of standard
Exxxx error codes and they should not be propagated unchanged to the upper
layers.
Reported-by: Paul Rolland <rol@as2917.net>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
---
drivers/platform/x86/dell-wmi.c | 11 ++++++-----
1 files changed, 6 insertions(+), 5 deletions(-)
diff --git a/drivers/platform/x86/dell-wmi.c b/drivers/platform/x86/dell-wmi.c
index ff67a78..79bb1f1 100644
--- a/drivers/platform/x86/dell-wmi.c
+++ b/drivers/platform/x86/dell-wmi.c
@@ -265,6 +265,7 @@ static void __init find_hk_type(const struct dmi_header *dm, void *dummy)
static int __init dell_wmi_init(void)
{
+ acpi_status status;
int err;
if (!wmi_has_guid(DELL_EVENT_GUID)) {
@@ -279,12 +280,12 @@ static int __init dell_wmi_init(void)
if (err)
return err;
- err = wmi_install_notify_handler(DELL_EVENT_GUID,
- dell_wmi_notify, NULL);
- if (err) {
+ status = wmi_install_notify_handler(DELL_EVENT_GUID,
+ dell_wmi_notify, NULL);
+ if (!ACPI_SUCCESS(status)) {
dell_wmi_input_destroy();
- pr_err("Unable to register notify handler - %d\n", err);
- return err;
+ pr_err("Unable to register notify handler - %d\n", status);
+ return -EIO;
}
return 0;
^ permalink raw reply related [flat|nested] 5+ messages in thread* [PATCH 2/2] hp-wmi - properly handle errors returned by wmi_install_notify_handler()
2009-12-29 8:34 [PATCH 1/2] dell-wmi - properly handle errors returned by wmi_install_notify_handler() Dmitry Torokhov
@ 2009-12-29 8:34 ` Dmitry Torokhov
2009-12-29 8:56 ` [PATCH 1/2] dell-wmi " Dmitry Torokhov
2009-12-29 8:57 ` Paul Rolland
2 siblings, 0 replies; 5+ messages in thread
From: Dmitry Torokhov @ 2009-12-29 8:34 UTC (permalink / raw)
To: Len Brown, Matthew Garrett; +Cc: linux-acpi, Paul Rolland
wmi_install_notify_handler() retruns ACPI error codes instead of standard
Exxxx error codes so let's test the error condition properly.
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
---
drivers/platform/x86/hp-wmi.c | 7 ++++---
1 files changed, 4 insertions(+), 3 deletions(-)
diff --git a/drivers/platform/x86/hp-wmi.c b/drivers/platform/x86/hp-wmi.c
index 1d8a073..88458f3 100644
--- a/drivers/platform/x86/hp-wmi.c
+++ b/drivers/platform/x86/hp-wmi.c
@@ -589,12 +589,13 @@ static int hp_wmi_resume_handler(struct device *device)
static int __init hp_wmi_init(void)
{
+ acpi_status status;
int err;
if (wmi_has_guid(HPWMI_EVENT_GUID)) {
- err = wmi_install_notify_handler(HPWMI_EVENT_GUID,
- hp_wmi_notify, NULL);
- if (!err)
+ status = wmi_install_notify_handler(HPWMI_EVENT_GUID,
+ hp_wmi_notify, NULL);
+ if (ACPI_SUCCESS(status))
hp_wmi_input_setup();
}
^ permalink raw reply related [flat|nested] 5+ messages in thread* Re: [PATCH 1/2] dell-wmi - properly handle errors returned by wmi_install_notify_handler()
2009-12-29 8:34 [PATCH 1/2] dell-wmi - properly handle errors returned by wmi_install_notify_handler() Dmitry Torokhov
2009-12-29 8:34 ` [PATCH 2/2] hp-wmi " Dmitry Torokhov
@ 2009-12-29 8:56 ` Dmitry Torokhov
2009-12-29 8:57 ` Paul Rolland
2 siblings, 0 replies; 5+ messages in thread
From: Dmitry Torokhov @ 2009-12-29 8:56 UTC (permalink / raw)
To: Len Brown, Matthew Garrett; +Cc: linux-acpi, Paul Rolland
On Tue, Dec 29, 2009 at 12:34:14AM -0800, Dmitry Torokhov wrote:
> wmi_install_notify_handler() retruns ACPI error codes instead of standard
> Exxxx error codes and they should not be propagated unchanged to the upper
> layers.
>
Ah, ignore me, I see both already fixed in acpi-test...
--
Dmitry
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH 1/2] dell-wmi - properly handle errors returned by wmi_install_notify_handler()
2009-12-29 8:34 [PATCH 1/2] dell-wmi - properly handle errors returned by wmi_install_notify_handler() Dmitry Torokhov
2009-12-29 8:34 ` [PATCH 2/2] hp-wmi " Dmitry Torokhov
2009-12-29 8:56 ` [PATCH 1/2] dell-wmi " Dmitry Torokhov
@ 2009-12-29 8:57 ` Paul Rolland
2009-12-29 9:21 ` Dmitry Torokhov
2 siblings, 1 reply; 5+ messages in thread
From: Paul Rolland @ 2009-12-29 8:57 UTC (permalink / raw)
To: Dmitry Torokhov; +Cc: Len Brown, Matthew Garrett, linux-acpi
Hello,
On Tue, 29 Dec 2009 00:34:14 -0800
Dmitry Torokhov <dmitry.torokhov@gmail.com> wrote:
> wmi_install_notify_handler() retruns ACPI error codes instead of standard
> Exxxx error codes and they should not be propagated unchanged to the upper
> layers.
>
> Reported-by: Paul Rolland <rol@as2917.net>
> Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
Tested-by: Paul Rolland <rol@as2917.net>
This is causing :
[root@tux ~]# modprobe dell-wmi
FATAL: Error inserting dell_wmi (/lib/modules/2.6.33-rc2/kernel/drivers/platform/x86/dell-wmi.ko): Input/output error
and
Dec 29 09:54:54 tux kernel: ACPI: WMI: Mapper loaded
Dec 29 09:54:54 tux kernel: input: Dell WMI hotkeys as /devices/virtual/input/input13
Dec 29 09:54:54 tux kernel: dell-wmi: Unable to register notify handler - 6
which looks Ok as my machine doesn't seem to have the corresponding stuff.
Anyway, this still needs the changes I sent for wmi.c to avoid the Oops.
Paul
> ---
>
> drivers/platform/x86/dell-wmi.c | 11 ++++++-----
> 1 files changed, 6 insertions(+), 5 deletions(-)
>
> diff --git a/drivers/platform/x86/dell-wmi.c
> b/drivers/platform/x86/dell-wmi.c index ff67a78..79bb1f1 100644
> --- a/drivers/platform/x86/dell-wmi.c
> +++ b/drivers/platform/x86/dell-wmi.c
> @@ -265,6 +265,7 @@ static void __init find_hk_type(const struct
> dmi_header *dm, void *dummy)
> static int __init dell_wmi_init(void)
> {
> + acpi_status status;
> int err;
>
> if (!wmi_has_guid(DELL_EVENT_GUID)) {
> @@ -279,12 +280,12 @@ static int __init dell_wmi_init(void)
> if (err)
> return err;
>
> - err = wmi_install_notify_handler(DELL_EVENT_GUID,
> - dell_wmi_notify, NULL);
> - if (err) {
> + status = wmi_install_notify_handler(DELL_EVENT_GUID,
> + dell_wmi_notify, NULL);
> + if (!ACPI_SUCCESS(status)) {
> dell_wmi_input_destroy();
> - pr_err("Unable to register notify handler - %d\n", err);
> - return err;
> + pr_err("Unable to register notify handler - %d\n",
> status);
> + return -EIO;
> }
>
> return 0;
>
--
Paul Rolland E-Mail : rol(at)witbe.net
CTO - Witbe.net SA Tel. +33 (0)1 47 67 77 77
Les Collines de l'Arche Fax. +33 (0)1 47 67 77 99
F-92057 Paris La Defense RIPE : PR12-RIPE
Please no HTML, I'm not a browser - Pas d'HTML, je ne suis pas un
navigateur "Some people dream of success... while others wake up and work
hard at it"
"I worry about my child and the Internet all the time, even though she's
too young to have logged on yet. Here's what I worry about. I worry that 10
or 15 years from now, she will come to me and say 'Daddy, where were you
when they took freedom of the press away from the Internet?'"
--Mike Godwin, Electronic Frontier Foundation
^ permalink raw reply [flat|nested] 5+ messages in thread* Re: [PATCH 1/2] dell-wmi - properly handle errors returned by wmi_install_notify_handler()
2009-12-29 8:57 ` Paul Rolland
@ 2009-12-29 9:21 ` Dmitry Torokhov
0 siblings, 0 replies; 5+ messages in thread
From: Dmitry Torokhov @ 2009-12-29 9:21 UTC (permalink / raw)
To: Paul Rolland; +Cc: Len Brown, Matthew Garrett, linux-acpi
On Tue, Dec 29, 2009 at 09:57:06AM +0100, Paul Rolland wrote:
> Hello,
>
> On Tue, 29 Dec 2009 00:34:14 -0800
> Dmitry Torokhov <dmitry.torokhov@gmail.com> wrote:
>
> > wmi_install_notify_handler() retruns ACPI error codes instead of standard
> > Exxxx error codes and they should not be propagated unchanged to the upper
> > layers.
> >
> > Reported-by: Paul Rolland <rol@as2917.net>
> > Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
> Tested-by: Paul Rolland <rol@as2917.net>
>
> This is causing :
> [root@tux ~]# modprobe dell-wmi
> FATAL: Error inserting dell_wmi (/lib/modules/2.6.33-rc2/kernel/drivers/platform/x86/dell-wmi.ko): Input/output error
>
> and
>
> Dec 29 09:54:54 tux kernel: ACPI: WMI: Mapper loaded
> Dec 29 09:54:54 tux kernel: input: Dell WMI hotkeys as /devices/virtual/input/input13
> Dec 29 09:54:54 tux kernel: dell-wmi: Unable to register notify handler - 6
>
> which looks Ok as my machine doesn't seem to have the corresponding stuff.
>
> Anyway, this still needs the changes I sent for wmi.c to avoid the Oops.
>
Yes, Len already has similar patches lined up in acpi-test branch.
--
Dmitry
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2009-12-29 9:22 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-12-29 8:34 [PATCH 1/2] dell-wmi - properly handle errors returned by wmi_install_notify_handler() Dmitry Torokhov
2009-12-29 8:34 ` [PATCH 2/2] hp-wmi " Dmitry Torokhov
2009-12-29 8:56 ` [PATCH 1/2] dell-wmi " Dmitry Torokhov
2009-12-29 8:57 ` Paul Rolland
2009-12-29 9:21 ` Dmitry Torokhov
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox