Skip to contentSkip to conversation

usb: fix breakage on systems without ACPI

PATCH In review Sasha Levin 3 participants 3 messages May 16, 2012 USB

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 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.

---
 drivers/usb/core/usb.c |    5 +----
 1 files changed, 1 insertions(+), 4 deletions(-)
drivers/usb/core/usb.c +1 -4
index 7998a67..25d0c61 100644
@@ -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;
Signature · 1 line
1.7.8.6
maintainer
#1 lore raw
Quoted 11 lines · Sasha Levin

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

#2 lore raw
Quoted 10 lines · Greg KH
Quoted 9 lines · Sasha Levin

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.

Quoted 6 lines
Quoted 2 lines

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