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]

 



On 2012年08月27日 14:57, Lan Tianyu wrote:
> On 2012年08月27日 03:18, Alan Stern wrote:
>> On Sun, 26 Aug 2012, Lan Tianyu wrote:
>>
>>> �� 2012/8/24 22:45, Alan Stern �:
>>>> On Fri, 24 Aug 2012, Lan Tianyu wrote:
>>>>
>>>>>>> But if other places got hub descriptor, they can't get DeviceRemovable
>>>>>>> value since we only set DeviceRemovable in the hub_configure().(e.g lsusb).
>>>>
>>>> Note: This isn't true.  You now set desc->u.hs.DeviceRemovable in
>>>> ehci_hub_descriptor().
>>> Oh. Sorry. I maybe confuse you or make you misunderstand due to my broken
>>> descriptor. Do you agree set desc->u.hs.DeviceRemovable in ehci_hub_descriptor()?
>>
>> Yes.  Ideally, those bits should be set even if the hub driver isn't
>> bound to the root hub device.
>>
>>> At the first time, the hub->maxchild is not set and port's device was not
>>> created so usb port has not been bound with acpi. usb port's ACPI information is
>>> not accessible at that time. The usb_get_hub_port_connect_type will return
>>> type_unkown.
>>> The value returned by first time of call get_hub_descriptor()  will not be correct.
>>
>> 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
Excuse me, a typo "bright" => "bridge"
> information. Binding will be done during port's devices creating.
> Creating port's devices need port number of the root hub. So this must
> happen after first time of calling get_hub_descriptor.
> In short, there is a sequence of following steps.
> 
> call get_hub_descriptor()
> 	||
> get port number, create port's device
> 	||
> bind usb ports with acpi and get ACPI information
> 	||
> set desc->u.hs.DeviceRemovable
> 
>>
>> Alan Stern
>>
> 
> 


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