lkml.org 
[lkml]   [2016]   [Mar]   [7]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] usbhid: Fix lockdep unannotated irqs-off warning
On Mon, 7 Mar 2016 11:41:37 -0500 (EST)
Alan Stern <stern@rowland.harvard.edu> wrote:

> It's hard to call this a compiler bug, but perhaps it is -- I don't
> know how programmers are supposed to tell CLANG that a subroutine
> modifies the Interrupt Flag in a way that the compiler shouldn't mess
> up.


Really! This is what's is happening??

Clang takes this:

if (!--hid->open) {
spin_unlock_irq(X);
do_something();
} else {
spin_unlock_irq(X);
}

Thus it's basically doing:

FLAG = !--hid->open;
push flags;
spin_unlock_irq(X)
pop flags;
if (FLAG zero set) {
do_something();
}


OUCH!!! There's gotta be a way to turn that off, otherwise Clang can
not be used to compile the kernel.

Nice detective work.

-- Steve

\
 
 \ /
  Last update: 2016-03-07 18:41    [W:0.083 / U:0.064 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site