Re: [PATCH] ACPI: fix acpi_power_off lockdep splat

From: Rafael J. Wysocki
Date: Sun Jul 03 2011 - 04:35:51 EST


On Sunday, July 03, 2011, Florian Mickler wrote:
> On Sun, 3 Jul 2011 08:58:41 +0200
> "Rafael J. Wysocki" <rjw@xxxxxxx> wrote:
>
> > On Saturday, July 02, 2011, Andrea Righi wrote:
> > > Implement acpi_os_create_lock() as a C-preprocessor macro to assign
> > > unique lock_class_key to dynamically allocated locks and suppress wrong
> > > lockdep warnings.
> > >
> > > This fixes:
> > > https://bugzilla.kernel.org/show_bug.cgi?id=38152
> > >
> > > Reported-by: Borislav Petkov <bp@xxxxxxxxx>
> > > Signed-off-by: Andrea Righi <andrea@xxxxxxxxxxxxxxx>
> >
> > So, how exactly does it work?
>
> The spin_lock_init macro stringifies it's argument and uses that as a
> name for the lock in the debugging.
>
> By re-executing spin_lock_init (have not checked if that harms
> anything, but it should be ok) in the _macro_ the key changes from
> "lock" for all three locks to the actual argument
> "&acpi_gbl_global_lock_pending_lock", "&acpi_gbl_gpe_lock" or
> "&acpi_gbl_hardware_lock".

OK, thanks for the explanation.

The proposed solution doesn't seem to be extremely straightforward,
but perhaps it's the simplest one. I need to think about it a bit more.

Thanks,
Rafael
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/