Re: [PATCH v13 06/12] usb: xhci: use bus->sysdev for DMA configuration
From: Roger Quadros
Date: Wed Feb 15 2017 - 03:19:32 EST
Peter,
On 15/02/17 03:35, Peter Chen wrote:
> On Tue, Feb 14, 2017 at 01:58:40PM +0100, Arnd Bergmann wrote:
>> On Tue, Feb 14, 2017 at 1:26 PM, Roger Quadros <rogerq@xxxxxx> wrote:
>>> On 14/02/17 13:44, Arnd Bergmann wrote:
>>>> On Tue, Feb 14, 2017 at 11:36 AM, Roger Quadros <rogerq@xxxxxx> wrote:
>>
>>>>> Why are we using sysdev to read DT property? We should be using the
>>>>> XHCI device (&pdev->dev) here, no?
>>>>
>>>> If I remember correctly, this is one of the cases where pdev does not
>>>> have a device node attached to it because it was created by the driver
>>>> of the parent device on the fly in case of dwc3. When you have a pure xhci
>>>> device in DT, the two pointers are the same.
>>>
>>> From drivers/usb/dwc3/host.c
>>>
>>>> if (dwc->usb3_lpm_capable) {
>>>> props[0].name = "usb3-lpm-capable";
>>>> ret = platform_device_add_properties(xhci, props);
>>>> if (ret) {
>>>> dev_err(dwc->dev, "failed to add properties to xHCI\n");
>>>> goto err1;
>>>> }
>>>> }
>>>
>>> So it is setting the usb3-lpm-capable property into the xhci platform device
>>> and we should be reading the property from there.
>
> Why dwc3 needs another "snps,usb3_lpm_capable"? Why not using
> "usb3-lpm-capable" at firmware directly?
dwc3 is not setting "snps,usb3_lpm_capable" but "usb3-lpm-capable" for the
xhci platform device.
What did you mean by firmware? Did you mean something like BIOS?
At least TI platforms don't use any firmware like BIOS. So dwc3 driver
needs to create a platform device for xhci on the fly and set the DT properties.
>
> Peter
>
>>
>> Hmm, ideally we would only have properties on one of the two, since we
>> refer to the sysdev for the properties regarding DMA and PHY among other
>> things, but I guess that's not an option here, since we can't call
>> platform_device_add_properties() on a dwc_pci device and have to
>> use the xhci pdev instead.
>>
>> Arnd
>>
--
cheers,
-roger