Re: [PATCH] usb: gadget: net22xx: fix ->disconnect reporting

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

 



On Wed, Mar 20, 2013 at 06:04:55PM +0400, Sergei Shtylyov wrote:
> Hello.
> 
> On 20-03-2013 17:55, Felipe Balbi wrote:
> 
> >>>with the latest udc_start/udc_stop conversion,
> >>>too much code was deleted which ended up creating
> >>>a regression in net2272 and net2280 drivers.
> 
> >>>To fix the regression we revert one hunk of the
> >>>original commits.
> 
> >>>Signed-off-by: Felipe Balbi <balbi@xxxxxx>
> >>>---
> >>>  drivers/usb/gadget/net2272.c | 7 +++++++
> >>>  drivers/usb/gadget/net2280.c | 7 +++++++
> >>>  2 files changed, 14 insertions(+)
> 
> >>[...]
> >>>diff --git a/drivers/usb/gadget/net2280.c b/drivers/usb/gadget/net2280.c
> >>>index a1b650e..3665e5e 100644
> >>>--- a/drivers/usb/gadget/net2280.c
> >>>+++ b/drivers/usb/gadget/net2280.c
> >>>@@ -1946,6 +1946,13 @@ stop_activity (struct net2280 *dev, struct usb_gadget_driver *driver)
> >>>  	for (i = 0; i < 7; i++)
> >>>  		nuke (&dev->ep [i]);
> >>>
> >>>+	/* report disconnect; the driver is already quiesced */
> >>>+	if (driver) {
> >>>+		spin_unlock (&dev->lock);
> >>>+		driver->disconnect (&dev->gadget);
> >>>+		spin_lock (&dev->lock);
> >>
> >>    Spaces befere ( not allowed by scripts/checkpatch.pl.
> 
> >Thanks, I have fixed it in the branch, here's newer version:
> 
> >commit c934fb9e86332e596b571954171a238bf7c93561
> >Author: Felipe Balbi <balbi@xxxxxx>
> >Date:   Mon Mar 18 10:14:47 2013 +0200
> 
> >     usb: gadget: net22xx: fix ->disconnect reporting
> 
> >     with the latest udc_start/udc_stop conversion,
> >     too much code was deleted which ended up creating
> >     a regression in net2272 and net2280 drivers.
> 
> >     To fix the regression we revert one hunk of the
> >     original commits.
> 
> >     Signed-off-by: Felipe Balbi <balbi@xxxxxx>
> 
> [...]
> >diff --git a/drivers/usb/gadget/net2280.c b/drivers/usb/gadget/net2280.c
> >index a1b650e..3665e5e 100644
> >--- a/drivers/usb/gadget/net2280.c
> >+++ b/drivers/usb/gadget/net2280.c
> >@@ -1946,6 +1946,13 @@ stop_activity (struct net2280 *dev, struct usb_gadget_driver *driver)
> >  	for (i = 0; i < 7; i++)
> >  		nuke (&dev->ep [i]);
> >
> >+	/* report disconnect; the driver is already quiesced */
> >+	if (driver) {
> >+		spin_unlock (&dev->lock);
> >+		driver->disconnect (&dev->gadget);
> >+		spin_lock (&dev->lock);
> 
>    Frankly speaking, I don't see any changes. :-P

another try:

commit 699412d951e6dd4dec48db88f33dc27b361582f0
Author: Felipe Balbi <balbi@xxxxxx>
Date:   Mon Mar 18 10:14:47 2013 +0200

    usb: gadget: net22xx: fix ->disconnect reporting
    
    with the latest udc_start/udc_stop conversion,
    too much code was deleted which ended up creating
    a regression in net2272 and net2280 drivers.
    
    To fix the regression we revert one hunk of the
    original commits.
    
    Signed-off-by: Felipe Balbi <balbi@xxxxxx>

diff --git a/drivers/usb/gadget/net2272.c b/drivers/usb/gadget/net2272.c
index d226058..17628337 100644
--- a/drivers/usb/gadget/net2272.c
+++ b/drivers/usb/gadget/net2272.c
@@ -1495,6 +1495,13 @@ stop_activity(struct net2272 *dev, struct usb_gadget_driver *driver)
 	for (i = 0; i < 4; ++i)
 		net2272_dequeue_all(&dev->ep[i]);
 
+	/* report disconnect; the driver is already quiesced */
+	if (driver) {
+		spin_unlock(&dev->lock);
+		driver->disconnect(&dev->gadget);
+		spin_lock(&dev->lock);
+	}
+
 	net2272_usb_reinit(dev);
 }
 
diff --git a/drivers/usb/gadget/net2280.c b/drivers/usb/gadget/net2280.c
index a1b650e..3105a4d 100644
--- a/drivers/usb/gadget/net2280.c
+++ b/drivers/usb/gadget/net2280.c
@@ -1946,6 +1946,13 @@ stop_activity (struct net2280 *dev, struct usb_gadget_driver *driver)
 	for (i = 0; i < 7; i++)
 		nuke (&dev->ep [i]);
 
+	/* report disconnect; the driver is already quiesced */
+	if (driver) {
+		spin_unlock(&dev->lock);
+		driver->disconnect(&dev->gadget);
+		spin_lock(&dev->lock);
+	}
+
 	usb_reinit (dev);
 }
 

-- 
balbi

Attachment: signature.asc
Description: Digital signature


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

  Powered by Linux