]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commit
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)
committerJuerg Haefliger <juergh@canonical.com>
Wed, 24 Jul 2019 01:51:15 +0000 (19:51 -0600)
commitb3c1f26ba340aa107171b79f9afe5c64d97b6efa
treea53f32e837f78d60c8aa114a04bdc640b9a44cf7
parentce49664c6485dcd5296a0ba4e2e05d63c09f39d6
spi: rspi: Fix invalid SPI use during system suspend

BugLink: https://bugs.launchpad.net/bugs/1836287
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>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Khalid Elmously <khalid.elmously@canonical.com>
drivers/spi/spi-rspi.c