staging: rt5208: Fix a sleep-in-atomic bug in xd_copy_page
commit498c4b4e9c23855d17ecc2a108d949bb68020481
authorJia-Ju Bai <baijiaju1990@163.com>
Mon, 5 Jun 2017 07:30:16 +0000 (5 15:30 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 6 Jun 2017 14:16:10 +0000 (6 16:16 +0200)
tree1ca886f9c22960514b49587cd018c1e602315bc0
parentac669251087d876d6e51eb648f98e575f0d0499d
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 <baijiaju1990@163.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/rts5208/xd.c