]> git.proxmox.com Git - mirror_ubuntu-eoan-kernel.git/commitdiff
spi: Add missing pm_runtime_put_noidle() after failed get
authorTony Lindgren <tony@atomide.com>
Fri, 18 May 2018 17:30:07 +0000 (10:30 -0700)
committerMark Brown <broonie@kernel.org>
Mon, 21 May 2018 15:44:25 +0000 (16:44 +0100)
If pm_runtime_get_sync() fails we should call pm_runtime_put_noidle().
This is probably not a critical fix as we should only hit this when
things are broken elsewhere.

Signed-off-by: Tony Lindgren <tony@atomide.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
drivers/spi/spi.c

index 8ee1ba13eb23464f0dfbaefe052e5105b560eceb..20b5b2754830ecd2fb459a6e2f8fa8f6f569f9b2 100644 (file)
@@ -1212,6 +1212,7 @@ static void __spi_pump_messages(struct spi_controller *ctlr, bool in_kthread)
        if (!was_busy && ctlr->auto_runtime_pm) {
                ret = pm_runtime_get_sync(ctlr->dev.parent);
                if (ret < 0) {
+                       pm_runtime_put_noidle(ctlr->dev.parent);
                        dev_err(&ctlr->dev, "Failed to power device: %d\n",
                                ret);
                        mutex_unlock(&ctlr->io_mutex);