PM: cpu: Make notifier chain use a raw_spinlock_t
authorValentin Schneider <valentin.schneider@arm.com>
Wed, 11 Aug 2021 20:14:31 +0000 (21:14 +0100)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Mon, 16 Aug 2021 16:55:32 +0000 (18:55 +0200)
commitb2f6662ac08d0e7c25574ce53623c71bdae9dd78
treeb3c6f49796e96e69cb52f70fe7f16d2fec4b76ef
parent7c60610d476766e128cc4284bb6349732cbd6606
PM: cpu: Make notifier chain use a raw_spinlock_t

Invoking atomic_notifier_chain_notify() requires acquiring a spinlock_t,
which can block under CONFIG_PREEMPT_RT. Notifications for members of the
cpu_pm notification chain will be issued by the idle task, which can never
block.

Making *all* atomic_notifiers use a raw_spinlock is too big of a hammer, as
only notifications issued by the idle task are problematic.

Special-case cpu_pm_notifier_chain by kludging a raw_notifier and
raw_spinlock_t together, matching the atomic_notifier behavior with a
raw_spinlock_t.

Fixes: 70d932985757 ("notifier: Fix broken error handling pattern")
Signed-off-by: Valentin Schneider <valentin.schneider@arm.com>
Acked-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
kernel/cpu_pm.c