[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <f89cd87c-7d1c-d8e6-ed95-6876f0201872@igalia.com>
Date: Thu, 1 Sep 2022 12:59:36 -0300
From: "Guilherme G. Piccoli" <gpiccoli@...lia.com>
To: Greg KH <gregkh@...uxfoundation.org>, evgreen@...omium.org
Cc: arnd@...db.de, linux-efi@...r.kernel.org,
linux-kernel@...r.kernel.org, kernel@...ccoli.net, ardb@...nel.org,
davidgow@...gle.com, jwerner@...omium.org,
Petr Mladek <pmladek@...e.com>
Subject: Re: [PATCH V3] firmware: google: Test spinlock on panic path to avoid
lockups
+ Petr, since this was extensively discussed in the original thread [0]
and maybe he can help with the argument.
[0]
https://lore.kernel.org/lkml/20220427224924.592546-1-gpiccoli@igalia.com/
On 01/09/2022 12:52, Greg KH wrote:
> [...]
>> + * Perform the lock check before effectively trying
>> + * to acquire it on gsmi_shutdown_reason() to avoid
>> + * potential lockups in atomic context.
>> + */
>> + if (spin_is_locked(&gsmi_dev.lock))
>> + return NOTIFY_DONE;
>> +
>
> What happens if the lock is grabbed right after testing for it?
> Shouldn't you use lockdep_assert_held() instead as the documentation
> says to?
How, if in this point only a single CPU (this one, executing the code)
is running?
Remember this is the panic path - before this point we disabled all
other CPUs, except this one executing the code. So, either the lock was
taken (and we bail), or it wasn't and it's safe to continue.
Powered by blists - more mailing lists