Re: [RFC PATCH 2/2] USB: Set usb port's DevicerRemovable according acpi information in EHCI

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



于 2012/8/27 22:20, Alan Stern 写道:
On Mon, 27 Aug 2012, Lan Tianyu wrote:

Now I see the problem.  The code you're adding to ehci-hub.c relies on
the hub driver knowing about the root hub's ports beforehand.  So
you've got a circular dependency:

	ehci-hub.c depends on the hub driver knowing about the
	root hub's ports;

	The hub driver learns the root-hub port connectivity
	information by asking ehci-hub.c.

The way to break this circle is to make ehci-hub.c use the ACPI
information directly rather than going through the hub driver's data
structures.
But it's necessary to bind usb port with ACPI before using ACPI
information. Otherwise there is no bright between usb port and it's ACPI
information. Binding will be done during port's devices creating.

Why can't the binding be done earlier, such as when the root hub is
first created?  Yes, I realize the port devices won't exist at that
time.  So what?  The connection between the root hub and the ACPI
information should exist regardless of the port devices or the hub
driver.

The main operation of binding is to store usb port's acpi_handle into
struct device->archdata.acpi_handle. So binding must be after usb port's
device being created and this is due to acpi binding glue infrastructure(
in the driver/acpi/glue.c). The port connection acpi information can be
access via port's acpi handle.

root hub also has its own acpi handle. When the root hub is created, its
acpi handle will be stored and at that time, we can get ports' acpi handles
(port number is needed.)but where they should store and this will look strange
since port's acpi handle will be stored in the its device->archdata.acpi_handle.
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux