serial: 8250: omap: Flush PM QOS work on remove
authorTony Lindgren <tony@atomide.com>
Fri, 28 Oct 2022 11:00:44 +0000 (14:00 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 25 Nov 2022 16:35:39 +0000 (17:35 +0100)
[ Upstream commit d0b68629bd2fb61e0171a62f2e8da3db322f5cf6 ]

Rebinding 8250_omap in a loop will at some point produce a warning for
kernel/power/qos.c:296 cpu_latency_qos_update_request() with error
"cpu_latency_qos_update_request called for unknown object". Let's flush
the possibly pending PM QOS work scheduled from omap8250_runtime_suspend()
before we disable runtime PM.

Fixes: 61929cf0169d ("tty: serial: Add 8250-core based omap driver")
Signed-off-by: Tony Lindgren <tony@atomide.com>
Link: https://lore.kernel.org/r/20221028110044.54719-1-tony@atomide.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/tty/serial/8250/8250_omap.c

index cecc266b3640b986172acc0aeb4b370391295544..d5962162c5906e9189612ef85d8cc733ea9b0e91 100644 (file)
@@ -1234,6 +1234,7 @@ static int omap8250_remove(struct platform_device *pdev)
 
        pm_runtime_dont_use_autosuspend(&pdev->dev);
        pm_runtime_put_sync(&pdev->dev);
+       flush_work(&priv->qos_work);
        pm_runtime_disable(&pdev->dev);
        serial8250_unregister_port(priv->line);
        pm_qos_remove_request(&priv->pm_qos_request);