]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
staging: wfx: fix init/remove vs IRQ race
authorMichał Mirosław <mirq-linux@rere.qmqm.pl>
Tue, 11 Feb 2020 10:35:01 +0000 (11:35 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 1 Apr 2020 09:00:25 +0000 (11:00 +0200)
commit09edb7ab024df37bd62eda961798c378f520da0c
tree7667f26cc925e4f07325914fb4bb35872252d9d6
parent46dda536e89bfb1f557a589e7c94e1d534115ed0
staging: wfx: fix init/remove vs IRQ race

commit 4033714d6cbe04893aa0708d1fcaa45dd8eb3f53 upstream.

Current code races in init/exit with interrupt handlers. This is noticed
by the warning below. Fix it by using devres for ordering allocations and
IRQ de/registration.

WARNING: CPU: 0 PID: 827 at drivers/staging/wfx/bus_spi.c:142 wfx_spi_irq_handler+0x5c/0x64 [wfx]
race condition in driver init/deinit

Cc: stable@vger.kernel.org
Fixes: 0096214a59a7 ("staging: wfx: add support for I/O access")
Signed-off-by: Michał Mirosław <mirq-linux@rere.qmqm.pl>
Reviewed-by: Jérôme Pouiller <jerome.pouiller@silabs.com>
Link: https://lore.kernel.org/r/f0c66cbb3110c2736cd4357c753fba8c14ee3aee.1581416843.git.mirq-linux@rere.qmqm.pl
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/wfx/bus_sdio.c
drivers/staging/wfx/bus_spi.c
drivers/staging/wfx/main.c
drivers/staging/wfx/main.h