Re: Gadget regression with u_ether in Linux next
On Mon, Sep 19, 2016 at 11:19:07AM +0300, Felipe Balbi wrote: > > Hi Greg, > > Tony Lindgrenwrites: > > 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 > 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 > Signed-off-by: Harish Jenny K N > Signed-off-by: Felipe Balbi Now reverted, thanks. greg k-h -- To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: Gadget regression with u_ether in Linux next
Hi Greg, Tony Lindgrenwrites: > 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 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 Signed-off-by: Harish Jenny K N Signed-off-by: Felipe Balbi 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(>lock, flags); if (dev->port_usb) skb = dev->wrap(dev->port_usb, skb); - spin_unlock_irqrestore(>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(>lock, flags); goto multiframe; + } + spin_unlock_irqrestore(>lock, flags); goto drop; } } -- balbi signature.asc Description: PGP signature
Re: Gadget regression with u_ether in Linux next
> On Saturday 17 September 2016 12:03 AM, Tony Lindgren wrote: > 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. > > Regards, > > Tony Sorry. There was a mistake with the commit. spinlock not acquired in if (dev->wrap) condition was also being tried to get unlocked. Please revert/remove the commit. Thanks, Harish -- To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Gadget regression with u_ether in Linux next
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. Regards, Tony 8< With gadgets configured and after connecting the cable: configfs-gadget gadget: high-speed config #1: c configfs-gadget gadget: init ecm configfs-gadget gadget: notify connect false configfs-gadget gadget: reset acm ttyGS0 configfs-gadget gadget: activate acm ttyGS0 gserial_connect: start ttyGS0 configfs-gadget gadget: acm ttyGS0 serial state 0003 configfs-gadget gadget: notify speed 425984000 configfs-gadget gadget: activate ecm usb0: qlen 10 configfs-gadget gadget: ecm_open usb0: eth_start configfs-gadget gadget: packet filter 0c configfs-gadget gadget: ecm req21.43 v000c i l0 configfs-gadget gadget: acm ttyGS0 req21.20 v i0002 l7 IPv6: ADDRCONF(NETDEV_CHANGE): usb0: link becomes ready configfs-gadget gadget: packet filter 0e configfs-gadget gadget: ecm req21.43 v000e i l0 configfs-gadget gadget: notify connect true configfs-gadget gadget: notify speed 425984000 BUG: spinlock lockup suspected on CPU#0, swapper/0/0 lock: 0xdd4f7e00, .magic: dead4ead, .owner: /-1, .owner_cpu: -1 CPU: 0 PID: 0 Comm: swapper/0 Not tainted 4.8.0-rc6-next-20160915+ #608 Hardware name: Generic OMAP36xx (Flattened Device Tree) [] (unwind_backtrace) from [] (show_stack+0x10/0x14) [] (show_stack) from [] (dump_stack+0xb0/0xe4) [] (dump_stack) from [] (do_raw_spin_lock+0x114/0x1b8) [] (do_raw_spin_lock) from [] (_raw_spin_lock_irqsave+0x40/0x4c) [] (_raw_spin_lock_irqsave) from [] (rx_submit+0x14/0x1a0 [u_ether]) [] (rx_submit [u_ether]) from [] (usb_gadget_giveback_request+0x64/0) [] (usb_gadget_giveback_request [udc_core]) from [] (musb_g_giveback) [] (musb_g_giveback [musb_hdrc]) from [] (musb_interrupt+0x174/0x30c) [] (musb_interrupt [musb_hdrc]) from [] (omap2430_musb_interrupt+0x8) [] (omap2430_musb_interrupt [omap2430]) from [] (__handle_irq_event_) [] (__handle_irq_event_percpu) from [] (handle_irq_event_percpu+0x1c) [] (handle_irq_event_percpu) from [] (handle_irq_event+0x38/0x5c) [] (handle_irq_event) from [] (handle_level_irq+0xb8/0x144) [] (handle_level_irq) from [] (generic_handle_irq+0x20/0x34) [] (generic_handle_irq) from [] (__handle_domain_irq+0x64/0xdc) [] (__handle_domain_irq) from [] (__irq_svc+0x70/0x98) [] (__irq_svc) from [] (cpuidle_enter_state+0xb8/0x3c4) [] (cpuidle_enter_state) from [] (cpu_startup_entry+0x130/0x220) [] (cpu_startup_entry) from [] (start_kernel+0x354/0x3c8) -- To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html