Re: [PATCH v8 8/8] usb: chipidea: udc: fix the oops when plugs in usb cable after rmmod gadget

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, Feb 26, 2013 at 08:21:41PM +0200, Felipe Balbi wrote:
> Hi,
> 
> On Sun, Feb 17, 2013 at 11:09:53AM +0800, Peter Chen wrote:
> > @@ -1373,6 +1375,8 @@ static int ci13xxx_vbus_session(struct usb_gadget *_gadget, int is_active)
> >  			hw_device_state(ci, ci->ep0out->qh.dma);
> >  			dev_dbg(ci->dev, "Connected to host\n");
> >  		} else {
> > +			if (ci->driver)
> > +				ci->driver->disconnect(&ci->gadget);
> 
> This looks wrong. Why do you need to call ->disconnect() here ?

When we disconnect usb cable from the host, we need to notify gadget module 
disconnection occurs, the gadget module may not be unloaded in future.

If the disconnection is not notified, the gadget module may still call
struct usb_ep_ops's API to visit hardware at its thread but the controller 
may already enter low power mode.

In fact, a common problem is how can we make sure the gadget will not
visit register if the controller enters low power mode, currently,
there is no prefect solution.  
> 
> -- 
> balbi



-- 

Best Regards,
Peter Chen

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


[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux