Skip to content

Commit 498c4b4

Browse files
XidianGeneralgregkh
authored andcommitted
staging: rt5208: Fix a sleep-in-atomic bug in xd_copy_page
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 xd_cleanup_work xd_delay_write xd_finish_write xd_copy_page wait_timeout schedule_timeout --> may sleep To fix it, "wait_timeout" is replaced with mdelay in xd_copy_page. Signed-off-by: Jia-Ju Bai <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent ac66925 commit 498c4b4

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

  • drivers/staging/rts5208

drivers/staging/rts5208/xd.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1268,7 +1268,7 @@ static int xd_copy_page(struct rtsx_chip *chip, u32 old_blk, u32 new_blk,
12681268
reg = 0;
12691269
rtsx_read_register(chip, XD_CTL, &reg);
12701270
if (reg & (XD_ECC1_ERROR | XD_ECC2_ERROR)) {
1271-
wait_timeout(100);
1271+
mdelay(100);
12721272

12731273
if (detect_card_cd(chip,
12741274
XD_CARD) != STATUS_SUCCESS) {

0 commit comments

Comments
 (0)