mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Peter Zijlstra <peterz@infradead.org>
To: Steven Rostedt <rostedt@goodmis.org>
Cc: Sedat Dilek <sedat.dilek@gmail.com>,
	Jiri Kosina <jikos@kernel.org>, Tejun Heo <tj@kernel.org>,
	Lai Jiangshan <jiangshanlai@gmail.com>,
	Benjamin Tissoires <benjamin.tissoires@redhat.com>,
	Paul McKenney <paulmck@linux.vnet.ibm.com>,
	Andy Lutomirski <luto@kernel.org>,
	LKML <linux-kernel@vger.kernel.org>,
	linux-usb@vger.kernel.org,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Alan Stern <stern@rowland.harvard.edu>,
	Felipe Balbi <balbi@ti.com>, Ingo Molnar <mingo@redhat.com>
Subject: Re: [PATCH] usbhid: Fix lockdep unannotated irqs-off warning
Date: Tue, 1 Mar 2016 16:17:00 +0100	[thread overview]
Message-ID: <20160301151700.GU6356@twins.programming.kicks-ass.net> (raw)
In-Reply-To: <20160301100740.759440b7@gandalf.local.home>

On Tue, Mar 01, 2016 at 10:07:40AM -0500, Steven Rostedt wrote:
> On Tue, 1 Mar 2016 11:05:42 +0100
> Sedat Dilek <sedat.dilek@gmail.com> wrote:
> 
> 
> > [ FACT #3: TEST-CASE #2 ]
> > 
> > The most reliable test-case is to simply unplug my external Logitech
> > USB mouse - saw this by accident.
> > YES, it was so simple.
> 
> Just to clarify, this happens on gcc and clang?

Just clang from what I gather.

> > --- dmesg_4.5.0-rc6-2-llvmlinux-amd64.txt       2016-02-29
> > 21:23:56.399691975 +0100
> > +++ dmesg_4.5.0-rc6-2-llvmlinux-amd64_usbmouse-unplugged.txt
> > 2016-02-29 21:28:14.401832240 +0100
> > @@ -832,3 +832,75 @@
> >  [   66.529779] PPP BSD Compression module registered
> >  [   66.563013] PPP Deflate Compression module registered
> >  [   66.978977] usb 2-1.5: USB disconnect, device number 4
> > +[  321.937369] usb 2-1.4: USB disconnect, device number 3
> > +[  321.950810] BUG: sleeping function called from invalid context at
> > kernel/workqueue.c:2785
> > +[  321.950816] in_atomic(): 0, irqs_disabled(): 1, pid: 44, name: kworker/2:1
> > +[  321.950819] 9 locks held by kworker/2:1/44:
> > +[  321.950820]  #0:  ("usb_hub_wq"){.+.+.+}, at: [<ffffffff810a7c5f>]
> > process_one_work+0x30f/0x8d0
> > +[  321.950830]  #1:  ((&hub->events)){+.+.+.}, at:
> > [<ffffffff810a7c8c>] process_one_work+0x33c/0x8d0
> > +[  321.950836]  #2:  (&dev->mutex){......}, at: [<ffffffff816fb0e0>]
> > hub_event+0x50/0x15b0
> > +[  321.950844]  #3:  (&dev->mutex){......}, at: [<ffffffff816f686f>]
> > usb_disconnect+0x5f/0x2c0
> > +[  321.950849]  #4:  (&dev->mutex){......}, at: [<ffffffff816245a2>]
> > device_release_driver+0x22/0x40
> > +[  321.950856]  #5:  (&dev->mutex){......}, at: [<ffffffff816245a2>]
> > device_release_driver+0x22/0x40
> > +[  321.950862]  #6:  (input_mutex){+.+.+.}, at: [<ffffffff8175171a>]
> > __input_unregister_device+0x9a/0x190
> > +[  321.950869]  #7:  (&dev->mutex#2){+.+...}, at:
> > [<ffffffff8174fe27>] input_close_device+0x27/0x70
> > +[  321.950875]  #8:  (hid_open_mut){+.+...}, at: [<ffffffffa0057388>]
> > usbhid_close+0x28/0xb0 [usbhid]
> > +[  321.950883] irq event stamp: 47770
> > +[  321.950885] hardirqs last  enabled at (47769):
> > [<ffffffff819426a2>] _raw_spin_unlock_irq+0x32/0x60
> > +[  321.950889] hardirqs last disabled at (47770):
> > [<ffffffff81115bdc>] del_timer_sync+0x3c/0x110
> 
> According to lockdep, interrupts were last disabled in del_timer_sync,
> and they were never enabled. The numbers in parenthesis show the order
> of events. _raw_spin_unlock_irq() at 47769, then del_timer_sync at
> 47770.
> 
> But why did they not get enabled again? We have:
> 
> 	local_irq_save(flags);
> 	lock_map_acquire(&timer->lockdep_map);
> 	lock_map_release(&timer->lockdep_map);
> 	local_irq_restore(flags);
> 
> If this caused an issue, then you would have a lockdep splat. But
> perhaps something corrupted "flags", and interrupts were not re-enabled?

Right, most odd. Sedat, could you provide objdump -D of the relevant
sections of vmlinux ?

  reply	other threads:[~2016-03-01 15:17 UTC|newest]

Thread overview: 46+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <1443427804-2957-1-git-send-email-sedat.dilek@gmail.com>
     [not found] ` <alpine.LNX.2.00.1509281329261.30132@pobox.suse.cz>
     [not found]   ` <CA+icZUWXcNue2kx0nLzAmJeaYVgcpqT3Zz8cuRkQDcT93n4U+w@mail.gmail.com>
     [not found]     ` <alpine.LNX.2.00.1509291117280.30132@pobox.suse.cz>
     [not found]       ` <CA+icZUWH2vR_vpYu4hCS578U3ssmoiF0pLYUfM-Xo-57e8uN=g@mail.gmail.com>
     [not found]         ` <alpine.LNX.2.00.1509300918090.30132@pobox.suse.cz>
     [not found]           ` <20150930045655.1c52eecd@gandalf.local.home>
     [not found]             ` <CA+icZUUnoD8_=Wm+OM2pN0ZS-rwqjLHtTw5xCWe5epNqSTZSiQ@mail.gmail.com>
     [not found]               ` <20150930061351.06f06abd@gandalf.local.home>
     [not found]                 ` <CA+icZUXSzScTmMgLZwPQq9RMH9cUsD5_iDxKTVuG0rrGqH-8Cw@mail.gmail.com>
     [not found]                   ` <20150930220153.7a75c4fc@grimm.local.home>
     [not found]                     ` <CA+icZUV7pxXoApuLdc7Z=kMHiKG=diHNqsnR5-MHpER=XkjQVQ@mail.gmail.com>
     [not found]                       ` <CA+icZUUyaHqHP2v52juhGhoTNS9xX7LT2YxkOppLz6f9Z+FBEA@mail.gmail.com>
     [not found]                         ` <CA+icZUWagGMVNs5gBPRBhYO0LsY2A1hK3KSLabp9ZpDVOTmtig@mail.gmail.com>
     [not found]                           ` <20151012205755.7ad86f4c@grimm.local.home>
2016-03-01 10:05                             ` Sedat Dilek
2016-03-01 15:07                               ` Steven Rostedt
2016-03-01 15:17                                 ` Peter Zijlstra [this message]
2016-03-02 15:00                                   ` Sedat Dilek
2016-03-02 15:17                                     ` Peter Zijlstra
2016-03-02 15:34                                       ` Sedat Dilek
2016-03-02 15:53                                       ` Sedat Dilek
2016-03-02 15:56                                         ` Steven Rostedt
2016-03-02 16:08                                           ` Sedat Dilek
2016-03-02 16:11                                             ` Sedat Dilek
2016-03-02 16:21                                               ` Sedat Dilek
2016-03-02 16:24                                         ` Peter Zijlstra
2016-03-02 16:35                                           ` Steven Rostedt
2016-03-02 16:42                                             ` Peter Zijlstra
2016-03-02 16:42                                           ` Sedat Dilek
2016-03-02 16:52                                             ` Sedat Dilek
2016-03-01 15:59                               ` Alan Stern
2016-03-02  6:25                                 ` Sedat Dilek
2016-03-04 16:04                                   ` Alan Stern
2016-03-05 22:30                                     ` Sedat Dilek
2016-03-06  8:51                                       ` Sedat Dilek
2016-03-06 17:23                                       ` Alan Stern
2016-03-02  6:36                                 ` Sedat Dilek
2016-03-02  8:34                                   ` Sedat Dilek
2016-03-02  8:37                                     ` Jiri Kosina
2016-03-02  9:11                                       ` Sedat Dilek
2016-03-07 15:59 Sedat Dilek
2016-03-07 16:28 ` Sedat Dilek
2016-03-07 16:41 ` Alan Stern
2016-03-07 17:03   ` Steven Rostedt
2016-03-07 17:05   ` Jiri Kosina
2016-03-07 17:15     ` Sedat Dilek
2016-03-07 17:27       ` David Laight
2016-03-07 18:07         ` Alan Stern
2016-03-07 18:30           ` Linus Torvalds
2016-06-27 19:50             ` Sedat Dilek
2016-06-27 20:03               ` Sedat Dilek
2016-06-27 20:14               ` Linus Torvalds
2016-06-27 20:27                 ` Sedat Dilek
2016-06-27 20:36                   ` Linus Torvalds
2016-03-07 17:11   ` Steven Rostedt
2016-03-07 17:18   ` Sedat Dilek
2016-03-07 17:24     ` Jiri Kosina
2016-03-07 17:30       ` Steven Rostedt
2016-03-07 18:04         ` Andy Lutomirski
2016-03-07 19:10           ` Steven Rostedt

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=20160301151700.GU6356@twins.programming.kicks-ass.net \
    --to=peterz@infradead.org \
    --cc=balbi@ti.com \
    --cc=benjamin.tissoires@redhat.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=jiangshanlai@gmail.com \
    --cc=jikos@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=luto@kernel.org \
    --cc=mingo@redhat.com \
    --cc=paulmck@linux.vnet.ibm.com \
    --cc=rostedt@goodmis.org \
    --cc=sedat.dilek@gmail.com \
    --cc=stern@rowland.harvard.edu \
    --cc=tj@kernel.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

all inboxes | Powered by JetHome®