netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: David Brownell <david-b-yBeKhBN/0LDR7s880joybQ@public.gmane.org>
To: Neil Jones <neiljay-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
Cc: linux-usb-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	netdev-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Subject: Re: rndis gadget: Inconsistent locking
Date: Sun, 26 Dec 2010 15:49:01 -0800	[thread overview]
Message-ID: <1293407341.2255.1038.camel@helium> (raw)
In-Reply-To: <AANLkTi==UqNNzokLcLWDpjM0cqM6aXjppsi4p6ogMAqX-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>

On Wed, 2010-12-08 at 15:11 +0000, Neil Jones wrote:
> 
> Im getting another lockdep warning when using the RNDIS gadget:



Probably this is either


 (a) a recent regression, maybe caused by a change ISTR in the network
layer stats handling ... which broke another USB + NET driver in much
the same way, wish I remembered details of which driver, the fix
there was simple and maybe a good model for fixing this one.

or (b)  ... maybe a
DWC-specific USB device controller driver oddity.  (Seemed less likely
to me when I glanced at the stackdumps below.

Has this shown up with other USB device controller drivers, or just the
DWC (DesignWare)? UDC driver?

I'll say I'm not keen on adding a thread to the driver.  It's worked
fine without one for many years, even running lockdep.  Whatever change
(network stack or using DWC) caused the locking issue can be fixed
without a new thread.

- Dave



The first thing I noticed was that very little of the dumped stack
context was part of the RNDIS gadget ... often a sign that the issue
is in the call down to the code dumping its stack (or its context).

(Or if my recollection is right ... that there was an incompatible
change in a network statistics call, and whoever changed that didn't
update all affected callers.  (ergo breakage here and in another driver.
> 
>  WARNING: at kernel/softirq.c:98 ___local_bh_disable+0xc4/0xd0()
>  Modules linked in: g_ether
> 
>  Call trace:
>  [<40003bf8>] _show_stack+0x68/0x7c
>  [<40003c20>] _dump_stack+0x14/0x28
>  [<40013c3c>] _warn_slowpath_common+0x5c/0x7c
>  [<40013c74>] _warn_slowpath_null+0x18/0x2c
>  [<4001b17c>] ___local_bh_disable+0xc0/0xd0
>  [<4001b1a0>] _local_bh_disable+0x14/0x28
>  [<402e57f8>] __raw_spin_lock_bh+0x18/0x54
>  [<40257f4c>] _dev_txq_stats_fold+0x7c/0x13c
>  [<402580c4>] _dev_get_stats+0xb8/0xc0
>  [<781d4e60>] _rndis_msg_parser+0x288/0xa04 [g_ether]
>  [<781d5600>] _rndis_command_complete+0x24/0x70 [g_ether]
>  [<401d66fc>] _dwc_otg_request_done+0xd8/0x220
>  [<401d928c>] _ep0_complete_request+0x3f4/0x578
>  [<401d95bc>] _handle_ep0+0x1ac/0x146c
>  [<401daf7c>] _dwc_otg_pcd_handle_in_ep_intr+0x1c0/0x8bc
>  [<401db8dc>] _dwc_otg_pcd_handle_intr+0x264/0x294
>  [<401d6288>] _dwc_otg_pcd_irq+0x10/0x30
>  [<40054cf4>] _handle_IRQ_event+0x4c/0x184
>  [<40057b4c>] _handle_level_irq+0xac/0x15c
>  [<4000b204>] _metag_soc_irq_demux+0xac/0xb4
>  [<40002dd4>] _do_IRQ+0x4c/0x78
>  [<40004000>] _trigger_handler+0x38/0xac
>  [<40000b18>] ___TBIBoingVec+0xc/0x10
>  [<40003588>] _cpu_idle+0x54/0x78
> 
>  no locks held by swapper/0.
>  ---[ end trace 77ac3cfee0ae5b25 ]---
> 
> It looks like we are calling spin_lock_bh in the completion function
> which is running in hard_irq, I think the driver should defer handling
> this msg (and maybe all requests) to a workqueue?
> 
> Cheers
> 
> Neil
> 
> 
> 
> On Wed, Dec 8, 2010 at 3:03 PM, Neil Jones <neiljay-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
> > Hi,
> >
> > Im getting another lockdep warning when using the RNDIS gadget:
> >
> >  WARNING: at kernel/softirq.c:98 ___local_bh_disable+0xc4/0xd0()
> >  Modules linked in: g_ether
> >
> >  Call trace:
> >  [<40003bf8>] _show_stack+0x68/0x7c
> >  [<40003c20>] _dump_stack+0x14/0x28
> >  [<40013c3c>] _warn_slowpath_common+0x5c/0x7c
> >  [<40013c74>] _warn_slowpath_null+0x18/0x2c
> >  [<4001b17c>] ___local_bh_disable+0xc0/0xd0
> >  [<4001b1a0>] _local_bh_disable+0x14/0x28
> >  [<402e57f8>] __raw_spin_lock_bh+0x18/0x54
> >  [<40257f4c>] _dev_txq_stats_fold+0x7c/0x13c
> >  [<402580c4>] _dev_get_stats+0xb8/0xc0
> >  [<781d4e60>] _rndis_msg_parser+0x288/0xa04 [g_ether]
> >  [<781d5600>] _rndis_command_complete+0x24/0x70 [g_ether]
> >  [<401d66fc>] _dwc_otg_request_done+0xd8/0x220
> >  [<401d928c>] _ep0_complete_request+0x3f4/0x578
> >  [<401d95bc>] _handle_ep0+0x1ac/0x146c
> >  [<401daf7c>] _dwc_otg_pcd_handle_in_ep_intr+0x1c0/0x8bc
> >  [<401db8dc>] _dwc_otg_pcd_handle_intr+0x264/0x294
> >  [<401d6288>] _dwc_otg_pcd_irq+0x10/0x30
> >  [<40054cf4>] _handle_IRQ_event+0x4c/0x184
> >  [<40057b4c>] _handle_level_irq+0xac/0x15c
> >  [<4000b204>] _metag_soc_irq_demux+0xac/0xb4
> >  [<40002dd4>] _do_IRQ+0x4c/0x78
> >  [<40004000>] _trigger_handler+0x38/0xac
> >  [<40000b18>] ___TBIBoingVec+0xc/0x10
> >  [<40003588>] _cpu_idle+0x54/0x78
> >
> >  no locks held by swapper/0.
> >  ---[ end trace 77ac3cfee0ae5b25 ]---
> >
> > It
> >
> --
> To unsubscribe from this list: send the line "unsubscribe linux-usb" in
> the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html



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

  parent reply	other threads:[~2010-12-26 23:49 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-12-08 15:03 rndis gadget: Inconsistent locking Neil Jones
2010-12-08 15:11 ` Neil Jones
2010-12-08 17:15   ` Michał Nazarewicz
2010-12-09 17:00     ` Neil Jones
     [not found]       ` <AANLkTinE1srqkpib0+8Q63XjnhRYEWaaDsX70tc_OeUm-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2010-12-10 10:01         ` Michał Nazarewicz
     [not found]   ` <AANLkTi==UqNNzokLcLWDpjM0cqM6aXjppsi4p6ogMAqX-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2010-12-26 23:49     ` David Brownell [this message]
2011-01-07  9:30       ` Neil Jones
2011-01-07 11:20         ` David Brownell
2011-01-10 11:32           ` Neil Jones
2011-01-10 12:14             ` David Brownell
2011-01-12 12:28               ` Jarek Poplawski
     [not found]                 ` <20110112122811.GA9513-8HppEYmqbBCE+EvaaNYduQ@public.gmane.org>
2011-01-12 13:07                   ` Eric Dumazet
2011-01-12 13:23                     ` Jarek Poplawski
2011-01-12 13:32                       ` Eric Dumazet
2011-01-12 13:41                         ` Jarek Poplawski
2011-01-12 13:52                         ` Eric Dumazet
2011-01-12 15:02                           ` [PATCH] net: remove dev_txq_stats_fold() Eric Dumazet
2011-01-12 21:05                             ` Jarek Poplawski
     [not found]                               ` <20110112210518.GA2152-qLhEM4ewh5CNj9Bq2fkWzw@public.gmane.org>
2011-01-12 21:18                                 ` Jarek Poplawski
2011-01-12 22:13                                   ` Eric Dumazet
2011-01-14  5:45                                     ` David Miller

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=1293407341.2255.1038.camel@helium \
    --to=david-b-ybekhbn/0ldr7s880joybq@public.gmane.org \
    --cc=linux-usb-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=neiljay-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
    --cc=netdev-u79uwXL29TY76Z2rM5mHXA@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).