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] [thread-next>] [day] [month] [year] [list]
Message-ID: <20210121071131.GA84462@ubuntu>
Date:   Thu, 21 Jan 2021 16:11:31 +0900
From:   Jung Daehwan <dh10.jung@...sung.com>
To:     Felipe Balbi <balbi@...nel.org>
Cc:     Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
        "open list:DESIGNWARE USB3 DRD IP DRIVER" <linux-usb@...r.kernel.org>,
        open list <linux-kernel@...r.kernel.org>
Subject: Re: usb: dwc3: gadget: skip pullup and set_speed after suspend

Hi,

On Thu, Jan 21, 2021 at 01:00:32AM +0000, Thinh Nguyen wrote:
> Hi,
> 
> Daehwan Jung wrote:
> > Sometimes dwc3_gadget_pullup and dwc3_gadget_set_speed are called after
> > entering suspend. That's why it needs to check whether suspend
> >
> > 1. dwc3 sends disconnect uevent and turn off. (suspend)
> > 2. Platform side causes pullup or set_speed(e.g., adbd closes ffs node)
> > 3. It causes unexpected behavior like ITMON error.
> >
> > Signed-off-by: Daehwan Jung <dh10.jung@...sung.com>
> > ---
> >  drivers/usb/dwc3/gadget.c | 6 ++++++
> >  1 file changed, 6 insertions(+)
> >
> > diff --git a/drivers/usb/dwc3/gadget.c b/drivers/usb/dwc3/gadget.c
> > index ee44321..d7d4202 100644
> > --- a/drivers/usb/dwc3/gadget.c
> > +++ b/drivers/usb/dwc3/gadget.c
> > @@ -2093,6 +2093,9 @@ static int dwc3_gadget_pullup(struct usb_gadget *g, int is_on)
> >  	unsigned long		flags;
> >  	int			ret;
> >  
> > +	if (pm_runtime_suspended(dwc->dev))
> > +		return 0;
> > +
> >  	is_on = !!is_on;
> >  
> >  	/*
> > @@ -2403,6 +2406,9 @@ static void dwc3_gadget_set_speed(struct usb_gadget *g,
> >  	unsigned long		flags;
> >  	u32			reg;
> >  
> > +	if (pm_runtime_suspended(dwc->dev))
> > +		return;
> > +
> >  	spin_lock_irqsave(&dwc->lock, flags);
> >  	reg = dwc3_readl(dwc->regs, DWC3_DCFG);
> >  	reg &= ~(DWC3_DCFG_SPEED_MASK);
> 
> This is already addressed in Wesley Cheng's patches. Can you try the
> latest changes of DWC3 in Greg's usb-next branch?
> 
> Thanks,
> Thinh

I checked Wesly Cheng's pathces but it's not same.
What I want to do for this patch is to avoid pullup from platform side.
(android in my case)

It's possible that platform side tries to pullup by UDC_Store after usb is already disconnected.
It can finally run controller and enable irq.

I think we have to avoid it and other possible things related to platform side.

BR,
Jung Daehwan


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ