From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751480AbdBOIvx (ORCPT ); Wed, 15 Feb 2017 03:51:53 -0500 Received: from mail-pf0-f195.google.com ([209.85.192.195]:34094 "EHLO mail-pf0-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751421AbdBOIvu (ORCPT ); Wed, 15 Feb 2017 03:51:50 -0500 Date: Wed, 15 Feb 2017 16:51:27 +0800 From: Peter Chen To: Roger Quadros Cc: Arnd Bergmann , Mark Rutland , Peter Chen , Ulf Hansson , Heiko Stuebner , stephen.boyd@linaro.org, frank.li@nxp.com, Linux Kernel Mailing List , gary.bisson@boundarydevices.com, Vivek Gautam , Sriram Dash , festevam@gmail.com, stillcompiling@gmail.com, dbaryshkov@gmail.com, vaibhav.hiremath@linaro.org, Krzysztof Kozlowski , mka@chromium.org, stern@rowland.harvard.edu, devicetree@vger.kernel.org, mail@maciej.szmigiero.name, pawel.moll@arm.com, linux-pm@vger.kernel.org, s.hauer@pengutronix.de, troy.kisky@boundarydevices.com, Rob Herring , Alexander Sverdlin , oscar@naiandei.net, Linux ARM , hverkuil@xs4all.nl, Mathias Nyman , Baolin Wang , gregkh , linux-usb@vger.kernel.org, rjw@rjwysocki.net, sre@kernel.org, Mark Brown , p.zabel@pengutronix.de, Shawn Guo , jun.li@nxp.com Subject: Re: [PATCH v13 06/12] usb: xhci: use bus->sysdev for DMA configuration Message-ID: <20170215085127.GA26227@b29397-desktop> References: <1486776443-2280-1-git-send-email-peter.chen@nxp.com> <1486776443-2280-7-git-send-email-peter.chen@nxp.com> <20170215013514.GA6579@b29397-desktop> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 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. > > > > 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