gpio: aspeed-sgpio: Convert aspeed_sgpio.lock to raw_spinlock
authorIwona Winiarska <iwona.winiarska@intel.com>
Sat, 4 Dec 2021 17:10:27 +0000 (18:10 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 27 Jan 2022 10:04:38 +0000 (11:04 +0100)
commit8bb1290e90504203c2909113e1af1828948b1b7a
tree3cdc57f0217a0c03a40bd4dea197e9aa7560dca0
parentd9332eab23381364b70e13eb17e7bf0a709504c5
gpio: aspeed-sgpio: Convert aspeed_sgpio.lock to raw_spinlock

[ Upstream commit ab39d6988dd53f354130438d8afa5596a2440fed ]

The gpio-aspeed-sgpio driver implements an irq_chip which need to be
invoked from hardirq context. Since spin_lock() can sleep with
PREEMPT_RT, it is no longer legal to invoke it while interrupts are
disabled.
This also causes lockdep to complain about:
[   25.919465] [ BUG: Invalid wait context ]
because aspeed_sgpio.lock (spin_lock_t) is taken under irq_desc.lock
(raw_spinlock_t).
Let's use of raw_spinlock_t instead of spinlock_t.

Signed-off-by: Iwona Winiarska <iwona.winiarska@intel.com>
Signed-off-by: Bartosz Golaszewski <brgl@bgdev.pl>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/gpio/gpio-aspeed-sgpio.c