[<prev] [next>] [day] [month] [year] [list]
Message-Id: <1496288948-31949-1-git-send-email-baijiaju1990@163.com>
Date: Thu, 1 Jun 2017 11:49:08 +0800
From: Jia-Ju Bai <baijiaju1990@....com>
To: gregkh@...uxfoundation.org, wporter82@...il.com,
sergio.paracuellos@...il.com, aquannie@...il.com
Cc: devel@...verdev.osuosl.org, linux-kernel@...r.kernel.org,
Jia-Ju Bai <baijiaju1990@....com>
Subject: [PATCH] rts5208: Fix a sleep-in-atomic bug in sd_power_off_card3v3
The driver may sleep under a spin lock, and the function call path is:
rtsx_exclusive_enter_ss (acquire the lock by spin_lock)
rtsx_enter_ss
rtsx_power_off_card
sd_power_off_card3v3
wait_timeout
schedule_timeout --> may sleep
To fix it, "wait_timeout" is replaced with mdelay in sd_power_off_card3v3.
Signed-off-by: Jia-Ju Bai <baijiaju1990@....com>
---
drivers/staging/rts5208/sd.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/staging/rts5208/sd.c b/drivers/staging/rts5208/sd.c
index bdd35b6..aa14454 100644
--- a/drivers/staging/rts5208/sd.c
+++ b/drivers/staging/rts5208/sd.c
@@ -5231,7 +5231,7 @@ int sd_power_off_card3v3(struct rtsx_chip *chip)
return STATUS_FAIL;
}
- wait_timeout(50);
+ mdelay(50);
}
if (chip->asic_code) {
--
1.7.9.5
Powered by blists - more mailing lists