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)
committerMark Brown <broonie@kernel.org>
Wed, 5 Sep 2018 11:40:06 +0000 (12:40 +0100)
commitc1ca59c22c56930b377a665fdd1b43351887830b
tree8a20b9aa37193e855d08b24bd009c7b7f1d5962a
parent31a5fae4c5a009898da6d177901d5328051641ff
spi: rspi: Fix invalid SPI use during system suspend

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
drivers/spi/spi-rspi.c