spi: sh-msiof: Fix invalid SPI use during system suspend
authorGaku Inami <gaku.inami.xw@bp.renesas.com>
Wed, 5 Sep 2018 08:49:36 +0000 (10:49 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 4 Oct 2018 00:00:54 +0000 (17:00 -0700)
commitd120858fca5f631195fbb7e2c2768d525d1c80da
tree5803b116acc274c9a482333770f9905a867a4f36
parent429773341c34cde3caacbc3992e2dcb1d7ccea86
spi: sh-msiof: Fix invalid SPI use during system suspend

commit ffa69d6a16f686efe45269342474e421f2aa58b2 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.

Signed-off-by: Gaku Inami <gaku.inami.xw@bp.renesas.com>
Signed-off-by: Hiromitsu Yamasaki <hiromitsu.yamasaki.ym@renesas.com>
[geert: Cleanup, reword]
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-sh-msiof.c