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>] [day] [month] [year] [list]
Message-ID: <582f63b8140a01e75a79c96ec569c3a68f434c61.camel@suse.de>
Date:   Tue, 09 Jun 2020 13:19:57 +0200
From:   Nicolas Saenz Julienne <nsaenzjulienne@...e.de>
To:     Andy Shevchenko <andy.shevchenko@...il.com>
Cc:     "f.fainelli@...il.com" <f.fainelli@...il.com>,
        "gregkh@...uxfoundation.org" <gregkh@...uxfoundation.org>,
        "wahrenst@....net" <wahrenst@....net>,
        "robh@...nel.org" <robh@...nel.org>,
        "mathias.nyman@...ux.intel.com" <mathias.nyman@...ux.intel.com>,
        Eric Anholt <eric@...olt.net>,
        "bcm-kernel-feedback-list@...adcom.com" 
        <bcm-kernel-feedback-list@...adcom.com>,
        "linux-rpi-kernel@...ts.infradead.org" 
        <linux-rpi-kernel@...ts.infradead.org>,
        "linux-arm-kernel@...ts.infradead.org" 
        <linux-arm-kernel@...ts.infradead.org>,
        "devicetree@...r.kernel.org" <devicetree@...r.kernel.org>,
        "linux-pci@...r.kernel.org" <linux-pci@...r.kernel.org>,
        "linux-usb@...r.kernel.org" <linux-usb@...r.kernel.org>,
        Mathias Nyman <mathias.nyman@...el.com>,
        Philipp Zabel <p.zabel@...gutronix.de>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
        "tim.gover@...pberrypi.org" <tim.gover@...pberrypi.org>,
        "helgaas@...nel.org" <helgaas@...nel.org>,
        "lorenzo.pieralisi@....com" <lorenzo.pieralisi@....com>
Subject: Re: [PATCH 5/9] usb: xhci-pci: Add support for reset controllers

On Mon, 2020-06-08 at 22:44 +0300, Andy Shevchenko wrote:
> 
> 
> On Monday, June 8, 2020, Nicolas Saenz Julienne <nsaenzjulienne@...e.de>
> wrote:
> > Some atypical users of xhci-pci might need to manually reset their xHCI
> > controller before starting the HCD setup. Check if a reset controller
> > device is available to the PCI bus and trigger a reset.
> > 
> > Signed-off-by: Nicolas Saenz Julienne <nsaenzjulienne@...e.de>
> > ---
> >  drivers/usb/host/xhci-pci.c | 9 +++++++++
> >  1 file changed, 9 insertions(+)
> > 
> > diff --git a/drivers/usb/host/xhci-pci.c b/drivers/usb/host/xhci-pci.c
> > index ef513c2fb843..45f70facdfcd 100644
> > --- a/drivers/usb/host/xhci-pci.c
> > +++ b/drivers/usb/host/xhci-pci.c
> > @@ -12,6 +12,7 @@
> >  #include <linux/slab.h>
> >  #include <linux/module.h>
> >  #include <linux/acpi.h>
> > +#include <linux/reset.h>
> > 
> >  #include "xhci.h"
> >  #include "xhci-trace.h"
> > @@ -339,6 +340,7 @@ static int xhci_pci_probe(struct pci_dev *dev, const
> > struct pci_device_id *id)
> >         struct xhci_hcd *xhci;
> >         struct usb_hcd *hcd;
> >         struct xhci_driver_data *driver_data;
> > +       struct reset_control *reset;
> > 
> >         driver_data = (struct xhci_driver_data *)id->driver_data;
> >         if (driver_data && driver_data->quirks & XHCI_RENESAS_FW_QUIRK) {
> > @@ -347,6 +349,13 @@ static int xhci_pci_probe(struct pci_dev *dev, const
> > struct pci_device_id *id)
> >                         return retval;
> >         }
> > 
> > +       reset = devm_reset_control_get(&dev->bus->dev, NULL);
> 
>  
> > +       if (IS_ERR(reset)) {
> > +               retval = PTR_ERR(reset);
> > +               return retval;
> > +       }
> 
> These four can be two, we have too many LOCs in the kernel for no reason.

Noted

>  
> > +       reset_control_reset(reset);
> > +
> >         /* Prevent runtime suspending between USB-2 and USB-3 initialization
> > */
> >         pm_runtime_get_noresume(&dev->dev);
> >  
> > -- 
> > 2.26.2
> > 
> > 
> 
> 


Download attachment "signature.asc" of type "application/pgp-signature" (489 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ