Message ID | 75e8ba40076ad707d47e3a3670e6b23c1b8b11bc.1633874223.git.christophe.jaillet@wanadoo.fr (mailing list archive) |
---|---|
State | Not Applicable |
Headers | show |
Series | drm: Remove redundant 'flush_workqueue()' calls | expand |
On 2021-10-10 16:59, Christophe JAILLET wrote: > 'destroy_workqueue()' already drains the queue before destroying it, so > there is no need to flush it explicitly. > > Remove the redundant 'flush_workqueue()' calls. > > This was generated with coccinelle: > > @@ > expression E; > @@ > - flush_workqueue(E); > destroy_workqueue(E); > > Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr> For tilcdc Acked-by: Jyri Sarha <jyri.sarha@iki.fi> Thanks, Jyri > --- > drivers/gpu/drm/etnaviv/etnaviv_gpu.c | 1 - > drivers/gpu/drm/msm/dsi/dsi_host.c | 1 - > drivers/gpu/drm/msm/edp/edp_ctrl.c | 1 - > drivers/gpu/drm/msm/hdmi/hdmi.c | 4 +--- > drivers/gpu/drm/tilcdc/tilcdc_drv.c | 4 +--- > drivers/gpu/drm/vmwgfx/ttm_memory.c | 1 - > 6 files changed, 2 insertions(+), 10 deletions(-) > > diff --git a/drivers/gpu/drm/etnaviv/etnaviv_gpu.c > b/drivers/gpu/drm/etnaviv/etnaviv_gpu.c > index 789acae37f55..06bde46df451 100644 > --- a/drivers/gpu/drm/etnaviv/etnaviv_gpu.c > +++ b/drivers/gpu/drm/etnaviv/etnaviv_gpu.c > @@ -1733,7 +1733,6 @@ static void etnaviv_gpu_unbind(struct device > *dev, struct device *master, > > DBG("%s", dev_name(gpu->dev)); > > - flush_workqueue(gpu->wq); > destroy_workqueue(gpu->wq); > > etnaviv_sched_fini(gpu); > diff --git a/drivers/gpu/drm/msm/dsi/dsi_host.c > b/drivers/gpu/drm/msm/dsi/dsi_host.c > index c86b5090fae6..462ea65ebf89 100644 > --- a/drivers/gpu/drm/msm/dsi/dsi_host.c > +++ b/drivers/gpu/drm/msm/dsi/dsi_host.c > @@ -1925,7 +1925,6 @@ void msm_dsi_host_destroy(struct mipi_dsi_host > *host) > DBG(""); > dsi_tx_buf_free(msm_host); > if (msm_host->workqueue) { > - flush_workqueue(msm_host->workqueue); > destroy_workqueue(msm_host->workqueue); > msm_host->workqueue = NULL; > } > diff --git a/drivers/gpu/drm/msm/edp/edp_ctrl.c > b/drivers/gpu/drm/msm/edp/edp_ctrl.c > index fe1366b4c49f..07129a6e5dbb 100644 > --- a/drivers/gpu/drm/msm/edp/edp_ctrl.c > +++ b/drivers/gpu/drm/msm/edp/edp_ctrl.c > @@ -1190,7 +1190,6 @@ void msm_edp_ctrl_destroy(struct edp_ctrl *ctrl) > return; > > if (ctrl->workqueue) { > - flush_workqueue(ctrl->workqueue); > destroy_workqueue(ctrl->workqueue); > ctrl->workqueue = NULL; > } > diff --git a/drivers/gpu/drm/msm/hdmi/hdmi.c > b/drivers/gpu/drm/msm/hdmi/hdmi.c > index 737453b6e596..5ba7c8f28419 100644 > --- a/drivers/gpu/drm/msm/hdmi/hdmi.c > +++ b/drivers/gpu/drm/msm/hdmi/hdmi.c > @@ -61,10 +61,8 @@ static void msm_hdmi_destroy(struct hdmi *hdmi) > * at this point, hpd has been disabled, > * after flush workq, it's safe to deinit hdcp > */ > - if (hdmi->workq) { > - flush_workqueue(hdmi->workq); > + if (hdmi->workq) > destroy_workqueue(hdmi->workq); > - } > msm_hdmi_hdcp_destroy(hdmi); > > if (hdmi->phy_dev) { > diff --git a/drivers/gpu/drm/tilcdc/tilcdc_drv.c > b/drivers/gpu/drm/tilcdc/tilcdc_drv.c > index 6b03f89a98d4..3ddb7c710a3d 100644 > --- a/drivers/gpu/drm/tilcdc/tilcdc_drv.c > +++ b/drivers/gpu/drm/tilcdc/tilcdc_drv.c > @@ -186,10 +186,8 @@ static void tilcdc_fini(struct drm_device *dev) > if (priv->mmio) > iounmap(priv->mmio); > > - if (priv->wq) { > - flush_workqueue(priv->wq); > + if (priv->wq) > destroy_workqueue(priv->wq); > - } > > dev->dev_private = NULL; > > diff --git a/drivers/gpu/drm/vmwgfx/ttm_memory.c > b/drivers/gpu/drm/vmwgfx/ttm_memory.c > index edd17c30d5a5..7f7fe35fc21d 100644 > --- a/drivers/gpu/drm/vmwgfx/ttm_memory.c > +++ b/drivers/gpu/drm/vmwgfx/ttm_memory.c > @@ -468,7 +468,6 @@ void ttm_mem_global_release(struct ttm_mem_global > *glob) > struct ttm_mem_zone *zone; > unsigned int i; > > - flush_workqueue(glob->swap_queue); > destroy_workqueue(glob->swap_queue); > glob->swap_queue = NULL; > for (i = 0; i < glob->num_zones; ++i) {
On Sun, Oct 10, 2021 at 7:07 AM Christophe JAILLET <christophe.jaillet@wanadoo.fr> wrote: > > 'destroy_workqueue()' already drains the queue before destroying it, so > there is no need to flush it explicitly. > > Remove the redundant 'flush_workqueue()' calls. > > This was generated with coccinelle: > > @@ > expression E; > @@ > - flush_workqueue(E); > destroy_workqueue(E); > > Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr> For drm/msm: Reviewed-by: Rob Clark <robdclark@gmail.com> > --- > drivers/gpu/drm/etnaviv/etnaviv_gpu.c | 1 - > drivers/gpu/drm/msm/dsi/dsi_host.c | 1 - > drivers/gpu/drm/msm/edp/edp_ctrl.c | 1 - > drivers/gpu/drm/msm/hdmi/hdmi.c | 4 +--- > drivers/gpu/drm/tilcdc/tilcdc_drv.c | 4 +--- > drivers/gpu/drm/vmwgfx/ttm_memory.c | 1 - > 6 files changed, 2 insertions(+), 10 deletions(-) > > diff --git a/drivers/gpu/drm/etnaviv/etnaviv_gpu.c b/drivers/gpu/drm/etnaviv/etnaviv_gpu.c > index 789acae37f55..06bde46df451 100644 > --- a/drivers/gpu/drm/etnaviv/etnaviv_gpu.c > +++ b/drivers/gpu/drm/etnaviv/etnaviv_gpu.c > @@ -1733,7 +1733,6 @@ static void etnaviv_gpu_unbind(struct device *dev, struct device *master, > > DBG("%s", dev_name(gpu->dev)); > > - flush_workqueue(gpu->wq); > destroy_workqueue(gpu->wq); > > etnaviv_sched_fini(gpu); > diff --git a/drivers/gpu/drm/msm/dsi/dsi_host.c b/drivers/gpu/drm/msm/dsi/dsi_host.c > index c86b5090fae6..462ea65ebf89 100644 > --- a/drivers/gpu/drm/msm/dsi/dsi_host.c > +++ b/drivers/gpu/drm/msm/dsi/dsi_host.c > @@ -1925,7 +1925,6 @@ void msm_dsi_host_destroy(struct mipi_dsi_host *host) > DBG(""); > dsi_tx_buf_free(msm_host); > if (msm_host->workqueue) { > - flush_workqueue(msm_host->workqueue); > destroy_workqueue(msm_host->workqueue); > msm_host->workqueue = NULL; > } > diff --git a/drivers/gpu/drm/msm/edp/edp_ctrl.c b/drivers/gpu/drm/msm/edp/edp_ctrl.c > index fe1366b4c49f..07129a6e5dbb 100644 > --- a/drivers/gpu/drm/msm/edp/edp_ctrl.c > +++ b/drivers/gpu/drm/msm/edp/edp_ctrl.c > @@ -1190,7 +1190,6 @@ void msm_edp_ctrl_destroy(struct edp_ctrl *ctrl) > return; > > if (ctrl->workqueue) { > - flush_workqueue(ctrl->workqueue); > destroy_workqueue(ctrl->workqueue); > ctrl->workqueue = NULL; > } > diff --git a/drivers/gpu/drm/msm/hdmi/hdmi.c b/drivers/gpu/drm/msm/hdmi/hdmi.c > index 737453b6e596..5ba7c8f28419 100644 > --- a/drivers/gpu/drm/msm/hdmi/hdmi.c > +++ b/drivers/gpu/drm/msm/hdmi/hdmi.c > @@ -61,10 +61,8 @@ static void msm_hdmi_destroy(struct hdmi *hdmi) > * at this point, hpd has been disabled, > * after flush workq, it's safe to deinit hdcp > */ > - if (hdmi->workq) { > - flush_workqueue(hdmi->workq); > + if (hdmi->workq) > destroy_workqueue(hdmi->workq); > - } > msm_hdmi_hdcp_destroy(hdmi); > > if (hdmi->phy_dev) { > diff --git a/drivers/gpu/drm/tilcdc/tilcdc_drv.c b/drivers/gpu/drm/tilcdc/tilcdc_drv.c > index 6b03f89a98d4..3ddb7c710a3d 100644 > --- a/drivers/gpu/drm/tilcdc/tilcdc_drv.c > +++ b/drivers/gpu/drm/tilcdc/tilcdc_drv.c > @@ -186,10 +186,8 @@ static void tilcdc_fini(struct drm_device *dev) > if (priv->mmio) > iounmap(priv->mmio); > > - if (priv->wq) { > - flush_workqueue(priv->wq); > + if (priv->wq) > destroy_workqueue(priv->wq); > - } > > dev->dev_private = NULL; > > diff --git a/drivers/gpu/drm/vmwgfx/ttm_memory.c b/drivers/gpu/drm/vmwgfx/ttm_memory.c > index edd17c30d5a5..7f7fe35fc21d 100644 > --- a/drivers/gpu/drm/vmwgfx/ttm_memory.c > +++ b/drivers/gpu/drm/vmwgfx/ttm_memory.c > @@ -468,7 +468,6 @@ void ttm_mem_global_release(struct ttm_mem_global *glob) > struct ttm_mem_zone *zone; > unsigned int i; > > - flush_workqueue(glob->swap_queue); > destroy_workqueue(glob->swap_queue); > glob->swap_queue = NULL; > for (i = 0; i < glob->num_zones; ++i) { > -- > 2.30.2 >
Am So., 10. Okt. 2021 um 16:08 Uhr schrieb Christophe JAILLET <christophe.jaillet@wanadoo.fr>: > > 'destroy_workqueue()' already drains the queue before destroying it, so > there is no need to flush it explicitly. > > Remove the redundant 'flush_workqueue()' calls. > > This was generated with coccinelle: > > @@ > expression E; > @@ > - flush_workqueue(E); > destroy_workqueue(E); > > Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr> For drm/etnaviv: Reviewed-by: Christian Gmeiner <christian.gmeiner@gmail.com>
diff --git a/drivers/gpu/drm/etnaviv/etnaviv_gpu.c b/drivers/gpu/drm/etnaviv/etnaviv_gpu.c index 789acae37f55..06bde46df451 100644 --- a/drivers/gpu/drm/etnaviv/etnaviv_gpu.c +++ b/drivers/gpu/drm/etnaviv/etnaviv_gpu.c @@ -1733,7 +1733,6 @@ static void etnaviv_gpu_unbind(struct device *dev, struct device *master, DBG("%s", dev_name(gpu->dev)); - flush_workqueue(gpu->wq); destroy_workqueue(gpu->wq); etnaviv_sched_fini(gpu); diff --git a/drivers/gpu/drm/msm/dsi/dsi_host.c b/drivers/gpu/drm/msm/dsi/dsi_host.c index c86b5090fae6..462ea65ebf89 100644 --- a/drivers/gpu/drm/msm/dsi/dsi_host.c +++ b/drivers/gpu/drm/msm/dsi/dsi_host.c @@ -1925,7 +1925,6 @@ void msm_dsi_host_destroy(struct mipi_dsi_host *host) DBG(""); dsi_tx_buf_free(msm_host); if (msm_host->workqueue) { - flush_workqueue(msm_host->workqueue); destroy_workqueue(msm_host->workqueue); msm_host->workqueue = NULL; } diff --git a/drivers/gpu/drm/msm/edp/edp_ctrl.c b/drivers/gpu/drm/msm/edp/edp_ctrl.c index fe1366b4c49f..07129a6e5dbb 100644 --- a/drivers/gpu/drm/msm/edp/edp_ctrl.c +++ b/drivers/gpu/drm/msm/edp/edp_ctrl.c @@ -1190,7 +1190,6 @@ void msm_edp_ctrl_destroy(struct edp_ctrl *ctrl) return; if (ctrl->workqueue) { - flush_workqueue(ctrl->workqueue); destroy_workqueue(ctrl->workqueue); ctrl->workqueue = NULL; } diff --git a/drivers/gpu/drm/msm/hdmi/hdmi.c b/drivers/gpu/drm/msm/hdmi/hdmi.c index 737453b6e596..5ba7c8f28419 100644 --- a/drivers/gpu/drm/msm/hdmi/hdmi.c +++ b/drivers/gpu/drm/msm/hdmi/hdmi.c @@ -61,10 +61,8 @@ static void msm_hdmi_destroy(struct hdmi *hdmi) * at this point, hpd has been disabled, * after flush workq, it's safe to deinit hdcp */ - if (hdmi->workq) { - flush_workqueue(hdmi->workq); + if (hdmi->workq) destroy_workqueue(hdmi->workq); - } msm_hdmi_hdcp_destroy(hdmi); if (hdmi->phy_dev) { diff --git a/drivers/gpu/drm/tilcdc/tilcdc_drv.c b/drivers/gpu/drm/tilcdc/tilcdc_drv.c index 6b03f89a98d4..3ddb7c710a3d 100644 --- a/drivers/gpu/drm/tilcdc/tilcdc_drv.c +++ b/drivers/gpu/drm/tilcdc/tilcdc_drv.c @@ -186,10 +186,8 @@ static void tilcdc_fini(struct drm_device *dev) if (priv->mmio) iounmap(priv->mmio); - if (priv->wq) { - flush_workqueue(priv->wq); + if (priv->wq) destroy_workqueue(priv->wq); - } dev->dev_private = NULL; diff --git a/drivers/gpu/drm/vmwgfx/ttm_memory.c b/drivers/gpu/drm/vmwgfx/ttm_memory.c index edd17c30d5a5..7f7fe35fc21d 100644 --- a/drivers/gpu/drm/vmwgfx/ttm_memory.c +++ b/drivers/gpu/drm/vmwgfx/ttm_memory.c @@ -468,7 +468,6 @@ void ttm_mem_global_release(struct ttm_mem_global *glob) struct ttm_mem_zone *zone; unsigned int i; - flush_workqueue(glob->swap_queue); destroy_workqueue(glob->swap_queue); glob->swap_queue = NULL; for (i = 0; i < glob->num_zones; ++i) {
'destroy_workqueue()' already drains the queue before destroying it, so there is no need to flush it explicitly. Remove the redundant 'flush_workqueue()' calls. This was generated with coccinelle: @@ expression E; @@ - flush_workqueue(E); destroy_workqueue(E); Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr> --- drivers/gpu/drm/etnaviv/etnaviv_gpu.c | 1 - drivers/gpu/drm/msm/dsi/dsi_host.c | 1 - drivers/gpu/drm/msm/edp/edp_ctrl.c | 1 - drivers/gpu/drm/msm/hdmi/hdmi.c | 4 +--- drivers/gpu/drm/tilcdc/tilcdc_drv.c | 4 +--- drivers/gpu/drm/vmwgfx/ttm_memory.c | 1 - 6 files changed, 2 insertions(+), 10 deletions(-)