Re: Gadget regression with u_ether in Linux next

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

 



Hi Greg,

Tony Lindgren <tony@xxxxxxxxxxx> writes:
> Hi,
>
> Looks like commit c9ffc78745f8 ("usb: gadget: NCM: Protect dev->port_usb
> using dev->lock") causes hangs for me with Linux next.
>
> Reverting c9ffc78745f8 makes the issues go away, some more info below.

Can you revert this commit from your tree?

Here's the full commit for reference:

commit c9ffc78745f89e300fe704348dd8e6800acf4d18
Author: Harish Jenny K N <harish_kandiga@xxxxxxxxxx>
Date:   Fri Sep 9 11:30:42 2016 +0200

    usb: gadget: NCM: Protect dev->port_usb using dev->lock
    
    This commit incorporates findings from
    https://lkml.org/lkml/2016/4/25/594
    
    The function has been modified to make sure we hold
    the dev lock when accessing the net device pointer.
    
    Acked-by: Jim Baxter <jim_baxter@xxxxxxxxxx>
    Signed-off-by: Harish Jenny K N <harish_kandiga@xxxxxxxxxx>
    Signed-off-by: Felipe Balbi <felipe.balbi@xxxxxxxxxxxxxxx>

diff --git a/drivers/usb/gadget/function/u_ether.c b/drivers/usb/gadget/function/u_ether.c
index 9c8c9ed1dc9e..8cb08033b7c1 100644
--- a/drivers/usb/gadget/function/u_ether.c
+++ b/drivers/usb/gadget/function/u_ether.c
@@ -553,14 +553,16 @@ static netdev_tx_t eth_start_xmit(struct sk_buff *skb,
                spin_lock_irqsave(&dev->lock, flags);
                if (dev->port_usb)
                        skb = dev->wrap(dev->port_usb, skb);
-               spin_unlock_irqrestore(&dev->lock, flags);
                if (!skb) {
                        /* Multi frame CDC protocols may store the frame for
                         * later which is not a dropped frame.
                         */
                        if (dev->port_usb &&
-                                       dev->port_usb->supports_multi_frame)
+                                       dev->port_usb->supports_multi_frame) {
+                               spin_unlock_irqrestore(&dev->lock, flags);
                                goto multiframe;
+                       }
+                       spin_unlock_irqrestore(&dev->lock, flags);
                        goto drop;
                }
        }

-- 
balbi

Attachment: signature.asc
Description: PGP 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