]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/commit
rts5208: Fix a sleep-in-atomic bug in rtsx_exclusive_enter_ss
authorJia-Ju Bai <baijiaju1990@163.com>
Thu, 1 Jun 2017 03:43:35 +0000 (11:43 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 3 Jun 2017 08:52:00 +0000 (17:52 +0900)
commited99f0141b6a7ac0d197c28b814e67d85ac42452
tree32e0da569647b078e76fc42f06fdcb3b54312524
parent385cab7c7131083cbe09d5f1d06df4544caa272d
rts5208: Fix a sleep-in-atomic bug in rtsx_exclusive_enter_ss

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_cleanup_work
        sd_stop_seq_mode
          sd_switch_clock
            sd_ddr_tuning
              sd_ddr_pre_tuning_tx
                sd_change_phase
                  wait_timeout
                    schedule_timeout --> may sleep

To fix it, "wait_timeout" is replaced with mdelay in sd_change_phase.

Signed-off-by: Jia-Ju Bai <baijiaju1990@163.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/rts5208/sd.c