]> git.baikalelectronics.ru Git - kernel.git/commit
Revert "char: pcmcia: cm4000_cs: Replace mdelay with usleep_range in set_protocol"
authorDuoming Zhou <duoming@zju.edu.cn>
Wed, 18 Jan 2023 14:10:00 +0000 (22:10 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 10 Mar 2023 08:33:32 +0000 (09:33 +0100)
commitab4940d6a64ff8df5eb227c2550ca6769c260ac7
treef2eb90ee503447cde0a62b4ed86300bf112a899c
parent8f159a848a614fe515dcd7a3e7263e43d992e5b7
Revert "char: pcmcia: cm4000_cs: Replace mdelay with usleep_range in set_protocol"

[ Upstream commit 31ecf177fd1234b9d428ba82145c5b988e9055d4 ]

This reverts commit cc13ee22cd297b0b7bbc81b250b1bd3e6c83d853.

The function monitor_card() is a timer handler that runs in an
atomic context, but it calls usleep_range() that can sleep.
As a result, the sleep-in-atomic-context bugs will happen.
The process is shown below:

    (atomic context)
monitor_card()
  set_protocol()
    usleep_range() //sleep

The origin commit 4e1f43d0aca0 ("[PATCH] New Omnikey Cardman
4000 driver") works fine.

Fixes: cc13ee22cd29 ("char: pcmcia: cm4000_cs: Replace mdelay with usleep_range in set_protocol")
Signed-off-by: Duoming Zhou <duoming@zju.edu.cn>
Link: https://lore.kernel.org/r/20230118141000.5580-1-duoming@zju.edu.cn
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/char/pcmcia/cm4000_cs.c