2012-05-16 12:10:13

by Sasha Levin

[permalink] [raw]
Subject: [PATCH] usb: fix breakage on systems without ACPI

Commit da0af6e ("usb: Bind devices to ACPI devices when possible") really
tries to force-bind devices even when impossible, unlike what it says in
the subject.

CONFIG_ACPI is not an indication that ACPI tables are actually present, nor
is an indication that any USB relevant information is present in them. There
is no reason to fail the creation of a USB bus if it can't bind it to
ACPI device during initialization.

On systems with CONFIG_ACPI set but without ACPI tables it would cause a
boot panic.

Signed-off-by: Sasha Levin <[email protected]>
---
drivers/usb/core/usb.c | 5 +----
1 files changed, 1 insertions(+), 4 deletions(-)

diff --git a/drivers/usb/core/usb.c b/drivers/usb/core/usb.c
index 7998a67..25d0c61 100644
--- a/drivers/usb/core/usb.c
+++ b/drivers/usb/core/usb.c
@@ -1015,9 +1015,7 @@ static int __init usb_init(void)
if (retval)
goto out;

- retval = usb_acpi_register();
- if (retval)
- goto acpi_register_failed;
+ usb_acpi_register();
retval = bus_register(&usb_bus_type);
if (retval)
goto bus_register_failed;
@@ -1053,7 +1051,6 @@ bus_notifier_failed:
bus_unregister(&usb_bus_type);
bus_register_failed:
usb_acpi_unregister();
-acpi_register_failed:
usb_debugfs_cleanup();
out:
return retval;
--
1.7.8.6


2012-05-16 12:21:59

by Greg Kroah-Hartman

[permalink] [raw]
Subject: Re: [PATCH] usb: fix breakage on systems without ACPI

On Wed, May 16, 2012 at 02:11:15PM +0200, Sasha Levin wrote:
> Commit da0af6e ("usb: Bind devices to ACPI devices when possible") really
> tries to force-bind devices even when impossible, unlike what it says in
> the subject.
>
> CONFIG_ACPI is not an indication that ACPI tables are actually present, nor
> is an indication that any USB relevant information is present in them. There
> is no reason to fail the creation of a USB bus if it can't bind it to
> ACPI device during initialization.
>
> On systems with CONFIG_ACPI set but without ACPI tables it would cause a
> boot panic.

Nice catch, sorry about that, I'll go queue this up.

greg k-h

2012-05-16 14:05:06

by Lan Tianyu

[permalink] [raw]
Subject: Re: [PATCH] usb: fix breakage on systems without ACPI

On 2012年5月16日 20:21:53, Greg KH wrote:
> On Wed, May 16, 2012 at 02:11:15PM +0200, Sasha Levin wrote:
>> Commit da0af6e ("usb: Bind devices to ACPI devices when possible") really
>> tries to force-bind devices even when impossible, unlike what it says in
>> the subject.
>>
>> CONFIG_ACPI is not an indication that ACPI tables are actually present, nor
>> is an indication that any USB relevant information is present in them. There
>> is no reason to fail the creation of a USB bus if it can't bind it to
>> ACPI device during initialization.
>>
>> On systems with CONFIG_ACPI set but without ACPI tables it would cause a
>> boot panic.
>
> Nice catch, sorry about that, I'll go queue this up.
>
> greg k-h

Oh. Sorry for this. I just test it on some my machines that have usb
descriptor.
bring trouble for you.

--
Best Regards
Tianyu Lan
linux kernel enabling team