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 23:00, Lan Tianyu 写道:
于 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.
Hi Alan:
	Do you have some advices on this patch? I current have two proposals.
	1) Add a new routine to get port connection before port's device being
created and being bound with ACPI. The routine first need to get port's acpi
handle and then get connection information. The routine doesn't save port's acpi
handle.
	2) keep my current code except the second time of getting hub descriptor,
Set DeviceRemovable in the hub_configue() after ports' device being created.
	Looking forward for your comments. Thanks.

Best Regards
Tianyu Lan


	
--
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