]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commitdiff
rts5208: Fix a sleep-in-atomic bug in sd_power_off_card3v3
authorJia-Ju Bai <baijiaju1990@163.com>
Thu, 1 Jun 2017 03:49:08 +0000 (11:49 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 3 Jun 2017 08:52:00 +0000 (17:52 +0900)
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@163.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/rts5208/sd.c

index bdd35b611f2736d10bcc91cfd7188b886d261444..aa144542e4e3d3dacea46cb8507250d90462987d 100644 (file)
@@ -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) {