diff options
author | James Morse <james.morse@arm.com> | 2020-02-21 16:35:06 +0000 |
---|---|---|
committer | Catalin Marinas <catalin.marinas@arm.com> | 2020-02-27 17:14:12 +0000 |
commit | 6ded0b61cf638bf9f8efe60ab8ba23db60ea9763 (patch) | |
tree | 5786bb7b077bb3c4ec9573a24863d28d69305a09 /crypto/michael_mic.c | |
parent | f8788d86ab28f61f7b46eb6be375f8a726783636 (diff) | |
download | linux-6ded0b61cf638bf9f8efe60ab8ba23db60ea9763.tar.bz2 |
firmware: arm_sdei: fix double-lock on hibernate with shared events
SDEI has private events that must be registered on each CPU. When
CPUs come and go they must re-register and re-enable their private
events. Each event has flags to indicate whether this should happen
to protect against an event being registered on a CPU coming online,
while all the others are unregistering the event.
These flags are protected by the sdei_list_lock spinlock, because
the cpuhp callbacks can't take the mutex.
Hibernate needs to unregister all events, but keep the in-memory
re-register and re-enable as they are. sdei_unregister_shared()
takes the spinlock to walk the list, then calls _sdei_event_unregister()
on each shared event. _sdei_event_unregister() tries to take the
same spinlock to update re-register and re-enable. This doesn't go
so well.
Push the re-register and re-enable updates out to their callers.
sdei_unregister_shared() doesn't want these values updated, so
doesn't need to do anything.
This also fixes shared events getting lost over hibernate as this
path made them look unregistered.
Fixes: da351827240e ("firmware: arm_sdei: Add support for CPU and system power states")
Reported-by: Liguang Zhang <zhangliguang@linux.alibaba.com>
Signed-off-by: James Morse <james.morse@arm.com>
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
Diffstat (limited to 'crypto/michael_mic.c')
0 files changed, 0 insertions, 0 deletions