linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] usb/gadget/fsl_udc_core.c: fix oops on resume
@ 2012-01-11  8:46 Michael Thalmeier
  2012-01-13  1:35 ` Peter Chen
  0 siblings, 1 reply; 2+ messages in thread
From: Michael Thalmeier @ 2012-01-11  8:46 UTC (permalink / raw)
  To: Li Yang, Felipe Balbi; +Cc: Michael Thalmeier, linux-usb, linux-kernel, michael

Sometimes the fsl_udc_irq function oopses when waking up from suspend.

Signed-off-by: Michael Thalmeier <michael.thalmeier@hale.at>
---
 drivers/usb/gadget/fsl_udc_core.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/usb/gadget/fsl_udc_core.c b/drivers/usb/gadget/fsl_udc_core.c
index d7ea6c0..4070c7a 100644
--- a/drivers/usb/gadget/fsl_udc_core.c
+++ b/drivers/usb/gadget/fsl_udc_core.c
@@ -1749,7 +1749,7 @@ static void suspend_irq(struct fsl_udc *udc)
 	udc->usb_state = USB_STATE_SUSPENDED;
 
 	/* report suspend to the driver, serial.c does not support this */
-	if (udc->driver->suspend)
+	if (udc->driver && udc->driver->suspend)
 		udc->driver->suspend(&udc->gadget);
 }
 
@@ -1759,7 +1759,7 @@ static void bus_resume(struct fsl_udc *udc)
 	udc->resume_state = 0;
 
 	/* report resume to the driver, serial.c does not support this */
-	if (udc->driver->resume)
+	if (udc->driver && udc->driver->resume)
 		udc->driver->resume(&udc->gadget);
 }
 
-- 
1.7.7.5



--
Scanned by MailScanner.


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] usb/gadget/fsl_udc_core.c: fix oops on resume
  2012-01-11  8:46 [PATCH] usb/gadget/fsl_udc_core.c: fix oops on resume Michael Thalmeier
@ 2012-01-13  1:35 ` Peter Chen
  0 siblings, 0 replies; 2+ messages in thread
From: Peter Chen @ 2012-01-13  1:35 UTC (permalink / raw)
  To: Michael Thalmeier; +Cc: Li Yang, Felipe Balbi, linux-usb, linux-kernel, michael

On Wed, Jan 11, 2012 at 09:46:17AM +0100, Michael Thalmeier wrote:
> Sometimes the fsl_udc_irq function oopses when waking up from suspend.
What's the situation it will happen? The udc driver will bind with gadget
first, then open the interrupt enable. When unload gadget driver, it will
disable all interrupt bits first, then unbind the gadget driver.
> 
> Signed-off-by: Michael Thalmeier <michael.thalmeier@hale.at>
> ---
>  drivers/usb/gadget/fsl_udc_core.c |    4 ++--
>  1 files changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/usb/gadget/fsl_udc_core.c b/drivers/usb/gadget/fsl_udc_core.c
> index d7ea6c0..4070c7a 100644
> --- a/drivers/usb/gadget/fsl_udc_core.c
> +++ b/drivers/usb/gadget/fsl_udc_core.c
> @@ -1749,7 +1749,7 @@ static void suspend_irq(struct fsl_udc *udc)
>  	udc->usb_state = USB_STATE_SUSPENDED;
>  
>  	/* report suspend to the driver, serial.c does not support this */
> -	if (udc->driver->suspend)
> +	if (udc->driver && udc->driver->suspend)
>  		udc->driver->suspend(&udc->gadget);
>  }
>  
> @@ -1759,7 +1759,7 @@ static void bus_resume(struct fsl_udc *udc)
>  	udc->resume_state = 0;
>  
>  	/* report resume to the driver, serial.c does not support this */
> -	if (udc->driver->resume)
> +	if (udc->driver && udc->driver->resume)
>  		udc->driver->resume(&udc->gadget);
>  }
>  
> -- 
> 1.7.7.5
> 
> 
> 
> --
> Scanned by MailScanner.
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-usb" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> 

-- 

Best Regards,
Peter Chen


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2012-01-13  1:35 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-01-11  8:46 [PATCH] usb/gadget/fsl_udc_core.c: fix oops on resume Michael Thalmeier
2012-01-13  1:35 ` Peter Chen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).