diff mbox

[PATCHv2] usb: musb: Fix unbalanced platform_disable

Message ID 20160920183701.nxme7yxgc6jpmgio@atomide.com (mailing list archive)
State New, archived
Headers show

Commit Message

Tony Lindgren Sept. 20, 2016, 6:37 p.m. UTC
* Tony Lindgren <tony@atomide.com> [160920 10:11]:
> * Laurent Pinchart <laurent.pinchart@ideasonboard.com> [160919 23:36]:
> > No, I perform the following steps:
> > 
> > - Connect the panda board to the USB through USB (which powers the board on)
> > - Let the board boot over NFS
> > - Log in as root, run 'reboot'
> > 
> > The second boot produces the warning.
> 
> Oh I was looking at the errors while shutting down things.. OK yeah I get
> that too along with a bunch of DSS related warnings with your .config.
> Probably I did not notice it earlier because of the DSS warnings. Will
> take a look.

The patch below fixes the issue for me, care to give it a try?

If that works for you I'll repost with a proper patch description.

Regards,

Tony

8< ------------------------
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Comments

Tony Lindgren Sept. 28, 2016, 6:42 p.m. UTC | #1
* Tony Lindgren <tony@atomide.com> [160920 11:37]:
> * Tony Lindgren <tony@atomide.com> [160920 10:11]:
> > * Laurent Pinchart <laurent.pinchart@ideasonboard.com> [160919 23:36]:
> > > No, I perform the following steps:
> > > 
> > > - Connect the panda board to the USB through USB (which powers the board on)
> > > - Let the board boot over NFS
> > > - Log in as root, run 'reboot'
> > > 
> > > The second boot produces the warning.
> > 
> > Oh I was looking at the errors while shutting down things.. OK yeah I get
> > that too along with a bunch of DSS related warnings with your .config.
> > Probably I did not notice it earlier because of the DSS warnings. Will
> > take a look.
> 
> The patch below fixes the issue for me, care to give it a try?
> 
> If that works for you I'll repost with a proper patch description.

Laurent, any news on when you may be able to test this one?

Regards,

Tony

> 8< ------------------------
> diff --git a/drivers/usb/musb/musb_gadget.c b/drivers/usb/musb/musb_gadget.c
> --- a/drivers/usb/musb/musb_gadget.c
> +++ b/drivers/usb/musb/musb_gadget.c
> @@ -1255,6 +1255,7 @@ static int musb_gadget_queue(struct usb_ep *ep, struct usb_request *req,
>  
>  	map_dma_buffer(request, musb, musb_ep);
>  
> +	pm_runtime_get_sync(musb->controller);
>  	spin_lock_irqsave(&musb->lock, lockflags);
>  
>  	/* don't queue if the ep is down */
> @@ -1275,6 +1276,9 @@ static int musb_gadget_queue(struct usb_ep *ep, struct usb_request *req,
>  
>  unlock:
>  	spin_unlock_irqrestore(&musb->lock, lockflags);
> +	pm_runtime_mark_last_busy(musb->controller);
> +	pm_runtime_put_autosuspend(musb->controller);
> +
>  	return status;
>  }
>  
> --
> To unsubscribe from this list: send the line "unsubscribe linux-omap" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Laurent Pinchart Sept. 29, 2016, 9:38 a.m. UTC | #2
Hi Tony,

On Wednesday 28 Sep 2016 11:42:35 Tony Lindgren wrote:
> * Tony Lindgren <tony@atomide.com> [160920 11:37]:
> > * Tony Lindgren <tony@atomide.com> [160920 10:11]:
> >> * Laurent Pinchart <laurent.pinchart@ideasonboard.com> [160919 23:36]:
> >>> No, I perform the following steps:
> >>> 
> >>> - Connect the panda board to the USB through USB (which powers the
> >>> board on) - Let the board boot over NFS
> >>> - Log in as root, run 'reboot'
> >>> 
> >>> The second boot produces the warning.
> >> 
> >> Oh I was looking at the errors while shutting down things.. OK yeah I
> >> get that too along with a bunch of DSS related warnings with your
> >> .config. Probably I did not notice it earlier because of the DSS
> >> warnings. Will take a look.
> > 
> > The patch below fixes the issue for me, care to give it a try?
> > 
> > If that works for you I'll repost with a proper patch description.
> 
> Laurent, any news on when you may be able to test this one?

I just did and your patch fixes the problem for me, thanks.

Tested-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>

> > 8< ------------------------
> > diff --git a/drivers/usb/musb/musb_gadget.c
> > b/drivers/usb/musb/musb_gadget.c --- a/drivers/usb/musb/musb_gadget.c
> > +++ b/drivers/usb/musb/musb_gadget.c
> > @@ -1255,6 +1255,7 @@ static int musb_gadget_queue(struct usb_ep *ep,
> > struct usb_request *req,
> >  	map_dma_buffer(request, musb, musb_ep);
> > 
> > +	pm_runtime_get_sync(musb->controller);
> >  	spin_lock_irqsave(&musb->lock, lockflags);
> >  	
> >  	/* don't queue if the ep is down */
> > @@ -1275,6 +1276,9 @@ static int musb_gadget_queue(struct usb_ep *ep,
> > struct usb_request *req,> 
> >  unlock:
> >  	spin_unlock_irqrestore(&musb->lock, lockflags);
> > 
> > +	pm_runtime_mark_last_busy(musb->controller);
> > +	pm_runtime_put_autosuspend(musb->controller);
> > +
> >  	return status;
> >  }
Tony Lindgren Sept. 30, 2016, 5:43 p.m. UTC | #3
* Laurent Pinchart <laurent.pinchart@ideasonboard.com> [160929 02:38]:
> Hi Tony,
> 
> On Wednesday 28 Sep 2016 11:42:35 Tony Lindgren wrote:
> > * Tony Lindgren <tony@atomide.com> [160920 11:37]:
> > > * Tony Lindgren <tony@atomide.com> [160920 10:11]:
> > >> * Laurent Pinchart <laurent.pinchart@ideasonboard.com> [160919 23:36]:
> > >>> No, I perform the following steps:
> > >>> 
> > >>> - Connect the panda board to the USB through USB (which powers the
> > >>> board on) - Let the board boot over NFS
> > >>> - Log in as root, run 'reboot'
> > >>> 
> > >>> The second boot produces the warning.
> > >> 
> > >> Oh I was looking at the errors while shutting down things.. OK yeah I
> > >> get that too along with a bunch of DSS related warnings with your
> > >> .config. Probably I did not notice it earlier because of the DSS
> > >> warnings. Will take a look.
> > > 
> > > The patch below fixes the issue for me, care to give it a try?
> > > 
> > > If that works for you I'll repost with a proper patch description.
> > 
> > Laurent, any news on when you may be able to test this one?
> 
> I just did and your patch fixes the problem for me, thanks.
> 
> Tested-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>

OK thanks for testing, will send out the two pending fixes today.

Regards,

Tony
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/drivers/usb/musb/musb_gadget.c b/drivers/usb/musb/musb_gadget.c
--- a/drivers/usb/musb/musb_gadget.c
+++ b/drivers/usb/musb/musb_gadget.c
@@ -1255,6 +1255,7 @@  static int musb_gadget_queue(struct usb_ep *ep, struct usb_request *req,
 
 	map_dma_buffer(request, musb, musb_ep);
 
+	pm_runtime_get_sync(musb->controller);
 	spin_lock_irqsave(&musb->lock, lockflags);
 
 	/* don't queue if the ep is down */
@@ -1275,6 +1276,9 @@  static int musb_gadget_queue(struct usb_ep *ep, struct usb_request *req,
 
 unlock:
 	spin_unlock_irqrestore(&musb->lock, lockflags);
+	pm_runtime_mark_last_busy(musb->controller);
+	pm_runtime_put_autosuspend(musb->controller);
+
 	return status;
 }