[PATCH 4/5] usb: ehci-hcd: use mdelay_non_inerruptible()

Jean-Christophe PLAGNIOL-VILLARD plagnioj at jcrosoft.com
Wed Oct 7 08:40:24 PDT 2015


On 17:40 Wed 07 Oct     , Peter Mamonov wrote:
> On Wed, 7 Oct 2015 15:47:03 +0200
> Jean-Christophe PLAGNIOL-VILLARD <plagnioj at jcrosoft.com> wrote:
> 
> > On 18:58 Tue 22 Sep     , Peter Mamonov wrote:
> > > Signed-off-by: Peter Mamonov <pmamonov at gmail.com>
> > > ---
> > >  drivers/usb/host/ehci-hcd.c | 6 +++---
> > >  1 file changed, 3 insertions(+), 3 deletions(-)
> > > 
> > > diff --git a/drivers/usb/host/ehci-hcd.c
> > > b/drivers/usb/host/ehci-hcd.c index d6df7b8..03d6150 100644
> > > --- a/drivers/usb/host/ehci-hcd.c
> > > +++ b/drivers/usb/host/ehci-hcd.c
> > > @@ -684,7 +684,7 @@ ehci_submit_root(struct usb_device *dev,
> > > unsigned long pipe, void *buffer,
> > >  				 * root
> > >  				 */
> > >  				ehci_powerup_fixup(ehci);
> > > -				mdelay(50);
> > > +				mdelay_non_interruptible(50);
> > >  				ehci->portreset |= 1 << port;
> > >  				/* terminate the reset */
> > >  				ehci_writel(status_reg, reg &
> > > ~EHCI_PS_PR); @@ -747,7 +747,7 @@ ehci_submit_root(struct
> > > usb_device *dev, unsigned long pipe, void *buffer, goto unknown;
> > >  	}
> > >  
> > > -	mdelay(1);
> > > +	mdelay_non_interruptible(1);
> > >  	len = min3(srclen, (int)le16_to_cpu(req->length), length);
> > >  	if (srcptr != NULL && len > 0)
> > >  		memcpy(buffer, srcptr, len);
> > > @@ -889,7 +889,7 @@ static int ehci_init(struct usb_host *host)
> > >  	ehci_writel(&ehci->hcor->or_configflag, cmd);
> > >  	/* unblock posted write */
> > >  	cmd = ehci_readl(&ehci->hcor->or_usbcmd);
> > > -	mdelay(5);
> > > +	mdelay_non_interruptible(5);
> > why do you need that much non interruptible delau?
> 
> Non-interruptible delays are needed here to prevent ehci_* functions
> re-entrance. The re-entrance occurs during a usb bus scan, after
> detection of a usb keyboard. As soon as a USB keyboard is detected, it's
> driver starts the poller, which interferes with the process of usb bus scan.
> However that last one delay may be interruptible.

my problem is as soon as you start a usb control msg you block everything

nothing else can run in barebox

can slow down barebox boot

I do think we need a real mdelay_non_interruptible feature but just forbidden
to recall usb control msg.
But the rest of barebox can run durring those 5ms

Best Regards,
J.



More information about the barebox mailing list