From: Pi-Hsun Shih Date: Tue, 15 Jun 2021 03:29:24 +0000 (+0800) Subject: drm/bridge: anx7625: Make hpd workqueue freezable X-Git-Tag: v5.15~303^2~28^2~161 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=f03ab6629c7b410d874151cf1d8570899a65fdda;p=platform%2Fkernel%2Flinux-starfive.git drm/bridge: anx7625: Make hpd workqueue freezable There were still a race condition between hpd work and suspend, since the workqueue work can still be run after anx7625 had powered off in suspend. Since we never want hpd work to run while suspending, and there's no harm to delay them to be run after resume, mark the workqueue as WQ_FREEZABLE so all works won't run while suspending. Fixes: 409776fa3c42 ("drm/bridge: anx7625: add suspend / resume hooks") Signed-off-by: Pi-Hsun Shih Reviewed-by: Tzung-Bi Shih Signed-off-by: Robert Foss Link: https://patchwork.freedesktop.org/patch/msgid/20210615032937.2328468-1-pihsun@chromium.org --- diff --git a/drivers/gpu/drm/bridge/analogix/anx7625.c b/drivers/gpu/drm/bridge/analogix/anx7625.c index 98e1755..a3d8237 100644 --- a/drivers/gpu/drm/bridge/analogix/anx7625.c +++ b/drivers/gpu/drm/bridge/analogix/anx7625.c @@ -1730,7 +1730,6 @@ static int __maybe_unused anx7625_suspend(struct device *dev) if (!pm_runtime_enabled(dev) || !pm_runtime_suspended(dev)) { anx7625_runtime_pm_suspend(dev); disable_irq(ctx->pdata.intp_irq); - flush_workqueue(ctx->workqueue); } return 0; @@ -1790,7 +1789,8 @@ static int anx7625_i2c_probe(struct i2c_client *client, platform->pdata.intp_irq = client->irq; if (platform->pdata.intp_irq) { INIT_WORK(&platform->work, anx7625_work_func); - platform->workqueue = create_workqueue("anx7625_work"); + platform->workqueue = alloc_workqueue("anx7625_work", + WQ_FREEZABLE | WQ_MEM_RECLAIM, 1); if (!platform->workqueue) { DRM_DEV_ERROR(dev, "fail to create work queue\n"); ret = -ENOMEM;