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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <TYBPR01MB534137D6807C750DEDCEE867D8259@TYBPR01MB5341.jpnprd01.prod.outlook.com>
Date:   Mon, 31 Jan 2022 02:17:06 +0000
From:   Yoshihiro Shimoda <yoshihiro.shimoda.uh@...esas.com>
To:     Adam Ford <aford173@...il.com>
CC:     "linux-usb@...r.kernel.org" <linux-usb@...r.kernel.org>,
        "linux-renesas-soc@...r.kernel.org" 
        <linux-renesas-soc@...r.kernel.org>,
        "cstevens@...conembedded.com" <cstevens@...conembedded.com>,
        "aford@...conembedded.com" <aford@...conembedded.com>,
        Felipe Balbi <balbi@...nel.org>,
        Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
        Biju Das <biju.das@...renesas.com>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: RE: [PATCH] usb: gadget: udc: renesas_usb3: Fix host to USB_ROLE_NONE
 transition

Hi Adam-san,

> From: Adam Ford, Sent: Monday, January 31, 2022 10:01 AM
> 
> On Sun, Jan 30, 2022 at 6:23 PM Yoshihiro Shimoda
> <yoshihiro.shimoda.uh@...esas.com> wrote:
<snip>
> > > diff --git a/drivers/usb/gadget/udc/renesas_usb3.c b/drivers/usb/gadget/udc/renesas_usb3.c
> > > index 57d417a7c3e0..601829a6b4ba 100644
> > > --- a/drivers/usb/gadget/udc/renesas_usb3.c
> > > +++ b/drivers/usb/gadget/udc/renesas_usb3.c
> > > @@ -2378,6 +2378,8 @@ static void handle_ext_role_switch_states(struct device *dev,
> > >       switch (role) {
> > >       case USB_ROLE_NONE:
> > >               usb3->connection_state = USB_ROLE_NONE;
> > > +             if (cur_role == USB_ROLE_HOST)
> > > +                     device_release_driver(host);
> >
> > The handle_ext_role_switch_states() with role = USB_ROLE_NONE seems
> > to be called multiple times. So, we have to avoid multiple calling of
> > device_release_driver() somehow.
> 
> From what I can tell, it appears that device_release_driver ultimately
> calls __device_release_driver which checks for a NULL, and during the
> release sets it to NULL, so subsequent releases should just get
> ignored.  Maybe I am missing something.

Thank you for your comment. You're correct. I'm sorry, I didn't check
the __device_release_driver() behavior. This patch looks good to me. So,

Reviewed-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@...esas.com>

Best regards,
Yoshihiro Shimoda

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ