lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20170215085127.GA26227@b29397-desktop>
Date:   Wed, 15 Feb 2017 16:51:27 +0800
From:   Peter Chen <hzpeterchen@...il.com>
To:     Roger Quadros <rogerq@...com>
Cc:     Arnd Bergmann <arnd@...db.de>, Mark Rutland <mark.rutland@....com>,
        Peter Chen <peter.chen@....com>,
        Ulf Hansson <ulf.hansson@...aro.org>,
        Heiko Stuebner <heiko@...ech.de>, stephen.boyd@...aro.org,
        frank.li@....com,
        Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
        gary.bisson@...ndarydevices.com,
        Vivek Gautam <vivek.gautam@...eaurora.org>,
        Sriram Dash <sriram.dash@....com>, festevam@...il.com,
        stillcompiling@...il.com, dbaryshkov@...il.com,
        vaibhav.hiremath@...aro.org, Krzysztof Kozlowski <krzk@...nel.org>,
        mka@...omium.org, stern@...land.harvard.edu,
        devicetree@...r.kernel.org, mail@...iej.szmigiero.name,
        pawel.moll@....com, linux-pm@...r.kernel.org,
        s.hauer@...gutronix.de, troy.kisky@...ndarydevices.com,
        Rob Herring <robh+dt@...nel.org>,
        Alexander Sverdlin <alexander.sverdlin@...ia.com>,
        oscar@...andei.net,
        Linux ARM <linux-arm-kernel@...ts.infradead.org>,
        hverkuil@...all.nl, Mathias Nyman <mathias.nyman@...ux.intel.com>,
        Baolin Wang <baolin.wang@...aro.org>,
        gregkh <gregkh@...uxfoundation.org>, linux-usb@...r.kernel.org,
        rjw@...ysocki.net, sre@...nel.org, Mark Brown <broonie@...nel.org>,
        p.zabel@...gutronix.de, Shawn Guo <shawnguo@...nel.org>,
        jun.li@....com
Subject: Re: [PATCH v13 06/12] usb: xhci: use bus->sysdev for DMA
 configuration

On Wed, Feb 15, 2017 at 10:18:03AM +0200, Roger Quadros wrote:
> 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@...com> wrote:
> >>> On 14/02/17 13:44, Arnd Bergmann wrote:
> >>>> On Tue, Feb 14, 2017 at 11:36 AM, Roger Quadros <rogerq@...com> 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.
> 

By readying code, the dwc3 calls dwc3_get_properties to set
dwc->usb3_lpm_capable, and at dwc3/host.c, it sets property
"usb3-lpm-capable" according to this flag, why not let common
code xhci-plat.c to get this property from sysdev which is DT
nodes for dwc3?

-- 

Best Regards,
Peter Chen

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ