OSDN Git Service

spi: rspi: Fix invalid SPI use during system suspend
authorGeert Uytterhoeven <geert+renesas@glider.be>
Wed, 5 Sep 2018 08:49:38 +0000 (10:49 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 3 Oct 2018 23:59:18 +0000 (16:59 -0700)
commitf9ca5597ab702405fee8138a9be7108017d72828
treef0ac6fa69c02fb3333e4bda12b84b876435079a4
parent2469b01fa5143a88c632248283d9fee788ceceb2
spi: rspi: Fix invalid SPI use during system suspend

commit c1ca59c22c56930b377a665fdd1b43351887830b upstream.

If the SPI queue is running during system suspend, the system may lock
up.

Fix this by stopping/restarting the queue during system suspend/resume,
by calling spi_master_suspend()/spi_master_resume() from the PM
callbacks.  In-kernel users will receive an -ESHUTDOWN error while
system suspend/resume is in progress.

Based on a patch for sh-msiof by Gaku Inami.

Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Signed-off-by: Mark Brown <broonie@kernel.org>
Cc: stable@vger.kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/spi/spi-rspi.c