Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1582213

Re: [PATCH v13 06/12] usb: xhci: use bus->sysdev for DMA configuration

Path csiph.com!news.mixmin.net!news.unit0.net!news.panservice.it!diesel.cu.mi.it!bofh.it!news.nic.it!robomod
From Peter Chen <hzpeterchen@gmail.com>
Newsgroups linux.kernel
Subject Re: [PATCH v13 06/12] usb: xhci: use bus->sysdev for DMA configuration
Date Thu, 16 Feb 2017 02:30:01 +0100
Message-ID <tbj3r-7Db-3@gated-at.bofh.it> (permalink)
References <taE0i-5U6-5@gated-at.bofh.it> <taIGC-HJ-17@gated-at.bofh.it> <taJMl-1mX-7@gated-at.bofh.it> <taKp3-1Pw-17@gated-at.bofh.it> <taKS6-1ZI-9@gated-at.bofh.it> <taWJz-17N-11@gated-at.bofh.it> <tb2YF-5LQ-9@gated-at.bofh.it> <tb3Bn-678-19@gated-at.bofh.it> <tb4QN-75a-7@gated-at.bofh.it> <tb6pz-7Tn-21@gated-at.bofh.it>
X-Original-To Felipe Balbi <balbi@kernel.org>
Dkim-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=XT2fOq2B9p9LJZ6EqjYwodTIPM842zRcD3/23fVeMM4=; b=br5qHQ+wQ8dtuVAAlIxXde1BYcTEkdQWW3/YdDnsV78k7e7rGS9qQPbLKt85XwXuCR 20YVAgqbKcROchXA7TMOJzIb/0r7tgczMHh+y7OM5MNi9oNhooNlJW9l66X4yjdDD0BS qPTe+VyRBe5mmg/GA/Wu91fVhYPKGLv3yObaIrogy7XtCbzzJl3CSs4mhYbUyA8VFq9i Dw8DB/de2qa4V3WQEPItMsiPTpVenSpDi3pCFrKIsJkHV6qBLjS3JdO6F5tcVpokZAu7 gg2c5jn+ZY5HSPLe5eIHsSUsZ3jf7331QsI1bWx0rUNibZQigBedpnih5L5wLdkGFrPS 1oKg==
X-Google-Dkim-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=XT2fOq2B9p9LJZ6EqjYwodTIPM842zRcD3/23fVeMM4=; b=CCnt/A7oQWa0mcuLzsF8JCTcRKpZSxyMxPgBukknbZkmWIEL+df8y8FYGBsc0FTdcq a13HoXEx9Eq98WgnpWwkanXANzs+MXE7NOO0aVSRq7K2t/X/iA4HH73Z0qM9QPQBqYg5 NU9ndbsRnKkdkVQPKIEE4mYL9F+Vqkx4H62/wJcvLFjiQDTgkFs2uwAgQKMnuMFYNrtq Ui7Q54W0BAg7QUzgAFvQ4g/2C0VZdOiBC7iNLDtyl5mtoIU8sXb8rJhPRHGCLD3BXM9D SLdEfT0c3o+Qg/mNdG0Dd4zUrVpxGDG2y3V/IYKbQr+y6dKzGr+SM1CWmkL7cHMLWVjV KF9w==
X-Gm-Message-State AMke39mErp8UyW3WYTfx6I3VSFvaJE1pKAC0YunMYfAi3vEoyT36PI3RLg9pfSJtTXFdWg==
X-Received by 10.84.218.11 with SMTP id q11mr41163773pli.141.1487208209945; Wed, 15 Feb 2017 17:23:29 -0800 (PST)
MIME-Version 1.0
Content-Type text/plain; charset=us-ascii
Content-Disposition inline
User-Agent Mutt/1.5.24 (2015-08-30)
Sender robomod@news.nic.it
List-ID <linux-kernel.vger.kernel.org>
X-Mailing-List linux-kernel@vger.kernel.org
Approved robomod@news.nic.it
Lines 60
Organization linux.* mail to news gateway
X-Original-Cc Roger Quadros <rogerq@ti.com>, Arnd Bergmann <arnd@arndb.de>, Mark Rutland <mark.rutland@arm.com>, Peter Chen <peter.chen@nxp.com>, Ulf Hansson <ulf.hansson@linaro.org>, Heiko Stuebner <heiko@sntech.de>, stephen.boyd@linaro.org, frank.li@nxp.com, Linux Kernel Mailing List <linux-kernel@vger.kernel.org>, gary.bisson@boundarydevices.com, Vivek Gautam <vivek.gautam@codeaurora.org>, Sriram Dash <sriram.dash@nxp.com>, festevam@gmail.com, stillcompiling@gmail.com, dbaryshkov@gmail.com, vaibhav.hiremath@linaro.org, Krzysztof Kozlowski <krzk@kernel.org>, 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 <robh+dt@kernel.org>, Alexander Sverdlin <alexander.sverdlin@nokia.com>, oscar@naiandei.net, Linux ARM <linux-arm-kernel@lists.infradead.org>, hverkuil@xs4all.nl, Mathias Nyman <mathias.nyman@linux.intel.com>, Baolin Wang <baolin.wang@linaro.org>, gregkh <gregkh@linuxfoundation.org>, linux-usb@vger.kernel.org, rjw@rjwysocki.net, sre@kernel.org, Mark Brown <broonie@kernel.org>, p.zabel@pengutronix.de, Shawn Guo <shawnguo@kernel.org>, jun.li@nxp.com
X-Original-Date Thu, 16 Feb 2017 09:23:07 +0800
X-Original-Message-ID <20170216012307.GA30290@b29397-desktop>
X-Original-References <1486776443-2280-7-git-send-email-peter.chen@nxp.com> <e532a212-cd15-ab42-6188-fc11a12633af@ti.com> <CAK8P3a1D1v=LXrW=-t-fRJjbo_C6OpSuoqiGuZPOaBzQYCT-kA@mail.gmail.com> <cb7182c6-0236-26f2-4f96-9bc001994728@ti.com> <CAK8P3a22f=sQXt+3-PeAuBFQN7_4iXDQhu41teExd6bxJXxDAQ@mail.gmail.com> <20170215013514.GA6579@b29397-desktop> <cb3ee971-6d97-fff1-64f7-1b527559b047@ti.com> <20170215085127.GA26227@b29397-desktop> <2a3d2d65-e531-aaca-d5a1-a71f818cec61@ti.com> <87mvdnoenw.fsf@linux.intel.com>
X-Original-Sender linux-kernel-owner@vger.kernel.org
Xref csiph.com linux.kernel:1582213

Show key headers only | View raw


On Wed, Feb 15, 2017 at 01:51:31PM +0200, Felipe Balbi wrote:
> 
> Hi,
> 
> Roger Quadros <rogerq@ti.com> writes:
> >>>>>>>> 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?
> >> 
> >
> > Felipe, any comments?
> 
> Won't work. We have quirk flags which are based on DWC3's revision which
> is not accessible by xhci-plat. Also, we can't call
> device_add_property() because it's not really *adding*. It's *setting*,
> meaning that we would loose all other properties.
> 

Sorry, I am not clear by reading the code, here we just discuss
"usb3-lpm-capable" property from DT or other firmwares.

-- 

Best Regards,
Peter Chen

Back to linux.kernel | Previous | Next — Previous in thread | Find similar | Unroll thread


Thread

Re: [PATCH v13 06/12] usb: xhci: use bus->sysdev for DMA  configuration Roger Quadros <rogerq@ti.com> - 2017-02-14 11:40 +0100
  Re: [PATCH v13 06/12] usb: xhci: use bus->sysdev for DMA configuration Arnd Bergmann <arnd@arndb.de> - 2017-02-14 12:50 +0100
    Re: [PATCH v13 06/12] usb: xhci: use bus->sysdev for DMA  configuration Roger Quadros <rogerq@ti.com> - 2017-02-14 13:30 +0100
      Re: [PATCH v13 06/12] usb: xhci: use bus->sysdev for DMA configuration Arnd Bergmann <arnd@arndb.de> - 2017-02-14 14:00 +0100
        Re: [PATCH v13 06/12] usb: xhci: use bus->sysdev for DMA  configuration Peter Chen <hzpeterchen@gmail.com> - 2017-02-15 02:40 +0100
          Re: [PATCH v13 06/12] usb: xhci: use bus->sysdev for DMA  configuration Roger Quadros <rogerq@ti.com> - 2017-02-15 09:20 +0100
            Re: [PATCH v13 06/12] usb: xhci: use bus->sysdev for DMA  configuration Peter Chen <hzpeterchen@gmail.com> - 2017-02-15 10:00 +0100
              Re: [PATCH v13 06/12] usb: xhci: use bus->sysdev for DMA  configuration Roger Quadros <rogerq@ti.com> - 2017-02-15 11:20 +0100
                Re: [PATCH v13 06/12] usb: xhci: use bus->sysdev for DMA configuration Felipe Balbi <balbi@kernel.org> - 2017-02-15 13:00 +0100
                Re: [PATCH v13 06/12] usb: xhci: use bus->sysdev for DMA  configuration Peter Chen <hzpeterchen@gmail.com> - 2017-02-16 02:30 +0100

csiph-web