linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 00/10] drm/msm: fix bind error handling
@ 2023-03-06 10:07 Johan Hovold
  2023-03-06 10:07 ` [PATCH 01/10] Revert "drm/msm: Add missing check and destroy for alloc_ordered_workqueue" Johan Hovold
                   ` (11 more replies)
  0 siblings, 12 replies; 30+ messages in thread
From: Johan Hovold @ 2023-03-06 10:07 UTC (permalink / raw)
  To: Rob Clark, Abhinav Kumar, Dmitry Baryshkov
  Cc: Sean Paul, David Airlie, Daniel Vetter, linux-arm-msm, dri-devel,
	freedreno, linux-kernel, Johan Hovold

I had reasons to look closer at the MSM DRM driver error handling and
realised that it had suffered from a fair amount of bit rot over the
years.

Unfortunately, I started fixing this in my 6.2 branch and failed to
notice two partial and, as it turned out, broken attempts to address
this that are now in 6.3-rc1.

Instead of trying to salvage this incrementally, I'm reverting the two
broken commits so that clean and backportable fixes can be added in
their place.

Included are also two related cleanups.

Johan


Johan Hovold (10):
  Revert "drm/msm: Add missing check and destroy for
    alloc_ordered_workqueue"
  Revert "drm/msm: Fix failure paths in msm_drm_init()"
  drm/msm: fix NULL-deref on snapshot tear down
  drm/msm: fix NULL-deref on irq uninstall
  drm/msm: fix drm device leak on bind errors
  drm/msm: fix vram leak on bind errors
  drm/msm: fix missing wq allocation error handling
  drm/msm: fix workqueue leak on bind errors
  drm/msm: use drmm_mode_config_init()
  drm/msm: move include directive

 drivers/gpu/drm/msm/disp/msm_disp_snapshot.c |  3 -
 drivers/gpu/drm/msm/msm_drv.c                | 67 +++++++++++++-------
 2 files changed, 44 insertions(+), 26 deletions(-)

-- 
2.39.2


^ permalink raw reply	[flat|nested] 30+ messages in thread
* Re: [PATCH 01/10] Revert "drm/msm: Add missing check and destroy for alloc_ordered_workqueue"
@ 2023-03-08  2:10 Jiasheng Jiang
  2023-03-08  7:41 ` Johan Hovold
  0 siblings, 1 reply; 30+ messages in thread
From: Jiasheng Jiang @ 2023-03-08  2:10 UTC (permalink / raw)
  To: johan+linaro
  Cc: robdclark, quic_abhinavk, dmitry.baryshkov, sean, airlied,
	daniel, linux-arm-msm, dri-devel, freedreno, linux-kernel,
	Jiasheng Jiang

On Mon, 06 Mar 2023 18:07:13 +0800, Johan Hovold wrote:
> This reverts commit 643b7d0869cc7f1f7a5ac7ca6bd25d88f54e31d0.

The commit not only adds the allocation sanity check, but also adds the
destroy_workqueue to release the allocated priv->wq.
Therefore, revert the commit will cause memory leak.

> A recent patch that tried to fix up the msm_drm_init() paths with
> respect to the workqueue but only ended up making things worse:
> 
> First, the newly added calls to msm_drm_uninit() on early errors would
> trigger NULL-pointer dereferences, for example, as the kms pointer would
> not have been initialised. (Note that these paths were also modified by
> a second broken error handling patch which in effect cancelled out this
> part when merged.)

There is a check for the kms pointer to avoid NULL-pointer dereference in
the msm_drm_uninit().

> Second, the newly added allocation sanity check would still leak the
> previously allocated drm device.

The ddev is allocated by drm_dev_alloc which support automatic cleanup.

Thanks,
Jiang


^ permalink raw reply	[flat|nested] 30+ messages in thread

end of thread, other threads:[~2023-03-28 22:38 UTC | newest]

Thread overview: 30+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-03-06 10:07 [PATCH 00/10] drm/msm: fix bind error handling Johan Hovold
2023-03-06 10:07 ` [PATCH 01/10] Revert "drm/msm: Add missing check and destroy for alloc_ordered_workqueue" Johan Hovold
2023-03-28 12:49   ` Dmitry Baryshkov
2023-03-06 10:07 ` [PATCH 02/10] Revert "drm/msm: Fix failure paths in msm_drm_init()" Johan Hovold
2023-03-28 12:49   ` Dmitry Baryshkov
2023-03-06 10:07 ` [PATCH 03/10] drm/msm: fix NULL-deref on snapshot tear down Johan Hovold
2023-03-21 15:06   ` Dmitry Baryshkov
2023-03-06 10:07 ` [PATCH 04/10] drm/msm: fix NULL-deref on irq uninstall Johan Hovold
2023-03-21 15:17   ` Dmitry Baryshkov
2023-03-06 10:07 ` [PATCH 05/10] drm/msm: fix drm device leak on bind errors Johan Hovold
2023-03-21 14:54   ` Dmitry Baryshkov
2023-03-22  7:47     ` Johan Hovold
2023-03-24 22:04       ` Dmitry Baryshkov
2023-03-06 10:07 ` [PATCH 06/10] drm/msm: fix vram " Johan Hovold
2023-03-24 22:06   ` Dmitry Baryshkov
2023-03-06 10:07 ` [PATCH 07/10] drm/msm: fix missing wq allocation error handling Johan Hovold
2023-03-28 12:50   ` Dmitry Baryshkov
2023-03-06 10:07 ` [PATCH 08/10] drm/msm: fix workqueue leak on bind errors Johan Hovold
2023-03-28 12:50   ` Dmitry Baryshkov
2023-03-06 10:07 ` [PATCH 09/10] drm/msm: use drmm_mode_config_init() Johan Hovold
2023-03-06 12:38   ` Dmitry Baryshkov
2023-03-06 13:31     ` Johan Hovold
2023-03-06 10:07 ` [PATCH 10/10] drm/msm: move include directive Johan Hovold
2023-03-21 14:43   ` Dmitry Baryshkov
2023-03-21 13:02 ` [PATCH 00/10] drm/msm: fix bind error handling Johan Hovold
2023-03-21 15:21   ` Dmitry Baryshkov
2023-03-22  7:54     ` Johan Hovold
2023-03-28 22:37 ` Dmitry Baryshkov
2023-03-08  2:10 [PATCH 01/10] Revert "drm/msm: Add missing check and destroy for alloc_ordered_workqueue" Jiasheng Jiang
2023-03-08  7:41 ` Johan Hovold

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).