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>
Thu, 4 Oct 2018 00:00:55 +0000 (17:00 -0700)
commit082e34f367a5493b46658ff8bee1b9fba48c3fc0
tree4d3b142476c7f8f583ea278e5bae6f48d9e3379d
parent6074b71d617ddfafc15164f4b6e320c7db4d24d7
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