forked from luck/tmp_suning_uos_patched
gpio: mlxbf2: Fix sleeping while holding spinlock
mutex_lock() can sleep, don't call mutex_lock() while holding spin_lock.
Fixes: bc0ae0e737
("gpio: add driver for Mellanox BlueField 2 GPIO controller")
Signed-off-by: Axel Lin <axel.lin@ingics.com>
Acked-by: asmaa@mellanox.com
Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
This commit is contained in:
parent
e75dfba311
commit
e6862430fa
|
@ -127,8 +127,8 @@ static int mlxbf2_gpio_lock_acquire(struct mlxbf2_gpio_context *gs)
|
|||
{
|
||||
u32 arm_gpio_lock_val;
|
||||
|
||||
spin_lock(&gs->gc.bgpio_lock);
|
||||
mutex_lock(yu_arm_gpio_lock_param.lock);
|
||||
spin_lock(&gs->gc.bgpio_lock);
|
||||
|
||||
arm_gpio_lock_val = readl(yu_arm_gpio_lock_param.io);
|
||||
|
||||
|
@ -136,8 +136,8 @@ static int mlxbf2_gpio_lock_acquire(struct mlxbf2_gpio_context *gs)
|
|||
* When lock active bit[31] is set, ModeX is write enabled
|
||||
*/
|
||||
if (YU_LOCK_ACTIVE_BIT(arm_gpio_lock_val)) {
|
||||
mutex_unlock(yu_arm_gpio_lock_param.lock);
|
||||
spin_unlock(&gs->gc.bgpio_lock);
|
||||
mutex_unlock(yu_arm_gpio_lock_param.lock);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
|
@ -152,8 +152,8 @@ static int mlxbf2_gpio_lock_acquire(struct mlxbf2_gpio_context *gs)
|
|||
static void mlxbf2_gpio_lock_release(struct mlxbf2_gpio_context *gs)
|
||||
{
|
||||
writel(YU_ARM_GPIO_LOCK_RELEASE, yu_arm_gpio_lock_param.io);
|
||||
mutex_unlock(yu_arm_gpio_lock_param.lock);
|
||||
spin_unlock(&gs->gc.bgpio_lock);
|
||||
mutex_unlock(yu_arm_gpio_lock_param.lock);
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
Loading…
Reference in New Issue
Block a user