From mboxrd@z Thu Jan 1 00:00:00 1970 From: Arnd Bergmann Subject: Re: [PATCH v13 06/12] usb: xhci: use bus->sysdev for DMA configuration Date: Tue, 14 Feb 2017 13:58:40 +0100 Message-ID: References: <1486776443-2280-1-git-send-email-peter.chen@nxp.com> <1486776443-2280-7-git-send-email-peter.chen@nxp.com> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Return-path: In-Reply-To: Sender: linux-pm-owner@vger.kernel.org To: Roger Quadros Cc: Peter Chen , gregkh , stern@rowland.harvard.edu, Ulf Hansson , Mark Brown , sre@kernel.org, Rob Herring , Shawn Guo , rjw@rjwysocki.net, dbaryshkov@gmail.com, Mark Rutland , Heiko Stuebner , stephen.boyd@linaro.org, frank.li@nxp.com, gary.bisson@boundarydevices.com, Vivek Gautam , Sriram Dash , festevam@gmail.com, stillcompiling@gmail.com, vaibhav.hiremath@linaro.org, Krzysztof Kozlowski , mka@chromium.org, devicetree@vger.kernel.org, mail@maciej.szmigiero.name, pawel.moll@arm.com, linux-pm@vger.kernel.org, s.hauer@pengutronix.de List-Id: devicetree@vger.kernel.org On Tue, Feb 14, 2017 at 1:26 PM, Roger Quadros wrote: > On 14/02/17 13:44, Arnd Bergmann wrote: >> On Tue, Feb 14, 2017 at 11:36 AM, Roger Quadros 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. 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