All of lore.kernel.org
 help / color / mirror / Atom feed
From: Felipe Balbi <felipe.balbi-VuQAYsv1563Yd54FQh9/CA@public.gmane.org>
To: Tony Lindgren <tony-4v6yS6AI5VpBDgjK7y7TUQ@public.gmane.org>,
	Harish Jenny K N
	<harish_kandiga-nmGgyN9QBj3QT0dZR+AlfA@public.gmane.org>
Cc: Jim Baxter <jim_baxter-nmGgyN9QBj3QT0dZR+AlfA@public.gmane.org>,
	Greg Kroah-Hartman
	<gregkh-hQyY1W1yCW8ekmWlsbkhG0B+6BGkLq7r@public.gmane.org>,
	linux-usb-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	linux-omap-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Subject: Re: Gadget regression with u_ether in Linux next
Date: Mon, 19 Sep 2016 11:19:07 +0300	[thread overview]
Message-ID: <87h99c4804.fsf@linux.intel.com> (raw)
In-Reply-To: <20160916220355.w6whbd75eqegrz3q-4v6yS6AI5VpBDgjK7y7TUQ@public.gmane.org>

[-- Attachment #1: Type: text/plain, Size: 2327 bytes --]


Hi Greg,

Tony Lindgren <tony-4v6yS6AI5VpBDgjK7y7TUQ@public.gmane.org> 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-nmGgyN9QBj3QT0dZR+AlfA@public.gmane.org>
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-nmGgyN9QBj3QT0dZR+AlfA@public.gmane.org>
    Signed-off-by: Harish Jenny K N <harish_kandiga-nmGgyN9QBj3QT0dZR+AlfA@public.gmane.org>
    Signed-off-by: Felipe Balbi <felipe.balbi-VuQAYsv1563Yd54FQh9/CA@public.gmane.org>

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 #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 800 bytes --]

  parent reply	other threads:[~2016-09-19  8:19 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-09-16 22:03 Gadget regression with u_ether in Linux next Tony Lindgren
     [not found] ` <20160916220355.w6whbd75eqegrz3q-4v6yS6AI5VpBDgjK7y7TUQ@public.gmane.org>
2016-09-18 20:26   ` Harish Jenny K N
2016-09-19  8:19   ` Felipe Balbi [this message]
     [not found]     ` <87h99c4804.fsf-VuQAYsv1563Yd54FQh9/CA@public.gmane.org>
2016-09-19  9:07       ` Greg Kroah-Hartman

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87h99c4804.fsf@linux.intel.com \
    --to=felipe.balbi-vuqaysv1563yd54fqh9/ca@public.gmane.org \
    --cc=gregkh-hQyY1W1yCW8ekmWlsbkhG0B+6BGkLq7r@public.gmane.org \
    --cc=harish_kandiga-nmGgyN9QBj3QT0dZR+AlfA@public.gmane.org \
    --cc=jim_baxter-nmGgyN9QBj3QT0dZR+AlfA@public.gmane.org \
    --cc=linux-omap-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=linux-usb-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=tony-4v6yS6AI5VpBDgjK7y7TUQ@public.gmane.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.