* Andrew Morton <akpm@xxxxxxxx> wrote:
> > It complains about this only the 1st time, even though
> > this same code sequence runs for every (subsequent) ACPI interrupt.
that is because the lock validator turns itself off after the first
complaint.
> Yes, lockdep uses the callsite of spin_lock_init() to detect the
> "type" of a lock.
>
> But the ACPI obfuscation layers use the same spin_lock_init() site to
> initialise two not-the-same locks, so lockdep decides those two locks
> are of the same "type" and gets confused.
>
> We had earlier decided to remove that ACPI code which kmallocs a
> single spinlock. When that's done, lockdep will become unconfused.
>
> AFACIT it's all used for just two statically allocated locks anwyay.
Ok, great! Find below the (tested) cleanup that also fixes the validator
problem.
(if ACPI wants to turn this into platform-independent code it should be
a build-time and type-correct translation layer that understands things
like DEFINE_SPINLOCK as well.)
Ingo