Re: [PATCH 13/13] usb: host: xhci-plat: Use of_device_get_match_data() helper

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, Oct 05, 2017 at 05:03:36PM +0300, Mathias Nyman wrote:
> On 05.10.2017 16:59, Mathias Nyman wrote:
> > On 05.10.2017 16:00, Geert Uytterhoeven wrote:
> > > Hi Greg,
> > > 
> > > On Thu, Oct 5, 2017 at 2:52 PM, Greg KH <gregkh@xxxxxxxxxxxxxxxxxxx> wrote:
> > > > On Thu, Oct 05, 2017 at 11:21:49AM +0300, Mathias Nyman wrote:
> > > > > From: Geert Uytterhoeven <geert+renesas@xxxxxxxxx>
> > > > > 
> > > > > Use the of_device_get_match_data() helper instead of open coding.
> > > > > 
> > > > > Signed-off-by: Geert Uytterhoeven <geert+renesas@xxxxxxxxx>
> > > > > Signed-off-by: Mathias Nyman <mathias.nyman@xxxxxxxxxxxxxxx>
> > > > > ---
> > > > >   drivers/usb/host/xhci-plat.c | 8 ++++----
> > > > >   1 file changed, 4 insertions(+), 4 deletions(-)
> > > > > 
> > > > > diff --git a/drivers/usb/host/xhci-plat.c b/drivers/usb/host/xhci-plat.c
> > > > > index d0625fa..6804cd4 100644
> > > > > --- a/drivers/usb/host/xhci-plat.c
> > > > > +++ b/drivers/usb/host/xhci-plat.c
> > > > > @@ -16,6 +16,7 @@
> > > > >   #include <linux/module.h>
> > > > >   #include <linux/pci.h>
> > > > >   #include <linux/of.h>
> > > > > +#include <linux/of_device.h>
> > > > >   #include <linux/platform_device.h>
> > > > >   #include <linux/usb/phy.h>
> > > > >   #include <linux/slab.h>
> > > > > @@ -152,7 +153,7 @@ MODULE_DEVICE_TABLE(of, usb_xhci_of_match);
> > > > > 
> > > > >   static int xhci_plat_probe(struct platform_device *pdev)
> > > > >   {
> > > > > -     const struct of_device_id *match;
> > > > > +     const struct xhci_plat_priv *priv_match;
> > > > >        const struct hc_driver  *driver;
> > > > >        struct device           *sysdev;
> > > > >        struct xhci_hcd         *xhci;
> > > > > @@ -238,9 +239,8 @@ static int xhci_plat_probe(struct platform_device *pdev)
> > > > >        }
> > > > > 
> > > > >        xhci = hcd_to_xhci(hcd);
> > > > > -     match = of_match_node(usb_xhci_of_match, pdev->dev.of_node);
> > > > > -     if (match) {
> > > > > -             const struct xhci_plat_priv *priv_match = match->data;
> > > > > +     priv_match = of_device_get_match_data(&pdev->dev);
> > > > > +     if (priv_match) {
> > > > >                struct xhci_plat_priv *priv = hcd_to_xhci_priv(hcd);
> > > > > 
> > > > >                /* Just copy data for now */
> > > > 
> > > > kbuild just spit out the following warning for this patch:
> > > > 
> > > > drivers/usb/host/max3421-hcd.c:1707:2-8: preceding lock on line 1702
> > > > 
> > > > Error ids grouped by kconfigs:
> > > > 
> > > > recent_errors
> > > > └── i386-allmodconfig
> > > >      └── drivers-usb-host-max3421-hcd.c:preceding-lock-on-line
> > > > 
> > > > 
> > > > 
> > > > I don't really know what it means, any ideas?
> > > 
> > > Me neither.
> > > 
> > > I find it hard to believe this was caused by my patch, as it doesn't change
> > > locking behavior (of_match_node() takes a lock, but of_device_get_match_data()
> > > calls into of_match_node(), too).
> > > 
> > > This report seems like a summary report from kbuild?
> > > Where is the report about this particular failure?
> > > Google found a similar warning in
> > > https://www.mail-archive.com/linux-kernel@xxxxxxxxxxxxxxx/msg1205736.html
> > > showing more context. Where's the context?
> > > 
> > > Finally, which version of drivers/usb/host/max3421-hcd.c in which tree
> > > was used? There's no locking at line 1707 or 1702 in my copy...
> > > 
> > 
> > Looking at the usb-testing branch it takes a lock at 1702 in max3421-hcd.c
> > and returns without releasing it at 1707.
> > 
> > Must be some other patch causing this
> > 
> 
> It's commit 721fdc83b31b1b22c34b2d77304890877c624c6b
> usb: max3421: Add devicetree support
> 
> returns without releasing the lock

Ah, nice digging.  Ok, this wasn't due to this patch, I'll merge this
into my usb-next branch and then go poke the author of that patch to fix
it :)

thanks,

greg k-h
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux