Linux MIPS Architecture development
 help / color / mirror / Atom feed
From: Yige Jiang <yigejiang86@gmail.com>
To: Paul Cercueil <paul@crapouillou.net>,
	Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Cc: Yige Jiang <yigejiang86@gmail.com>,
	Maxime Ripard <mripard@kernel.org>,
	Thomas Zimmermann <tzimmermann@suse.de>,
	David Airlie <airlied@gmail.com>, Simona Vetter <simona@ffwll.ch>,
	Sam Ravnborg <sam@ravnborg.org>,
	linux-mips@vger.kernel.org, dri-devel@lists.freedesktop.org,
	linux-kernel@vger.kernel.org, stable@vger.kernel.org
Subject: [PATCH] drm/ingenic: Unbind directly when the IPU port is missing
Date: Thu,  3 Dec 2026 03:15:55 +0800	[thread overview]
Message-ID: <20261202233911.cc464592b027.ingenic-drm@gmail.com> (raw)

With CONFIG_DRM_INGENIC_IPU enabled but no IPU at port 8,
ingenic_drm_probe() calls ingenic_drm_bind() directly. The remove
callback chooses its cleanup using only the Kconfig symbol and calls
component_master_del(). No aggregate device was registered, so this
does not call ingenic_drm_unbind().

The clock notifier and DRM device remain registered while devres
releases the register mapping, clocks and DRM device reference. The
notifier can subsequently refer to freed driver data.

Tear down any aggregate device first. Its unbind callback clears the
driver data, as do failed bind attempts. If driver data remains after
component_master_del(), this was a successful direct bind and needs
to be unbound explicitly. This also handles an aggregate device whose
components have not bound or have already been removed.

Fixes: 3b5b005ef7d9 ("drm/ingenic: Fix driver not probing when IPU port is missing")
Cc: stable@vger.kernel.org
Signed-off-by: Yige Jiang <yigejiang86@gmail.com>
---
Based on drm-misc-fixes-2026-11-27.
Compile-tested on next-20261104: arm64, GCC 14.2.0, W=1;
baseline and patched objects built without warnings.
Both CONFIG_DRM_INGENIC_IPU=y and =n were checked.
The code changes are the same as in that build.
No hardware or runtime test was performed.

 drivers/gpu/drm/ingenic/ingenic-drm-drv.c | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/drivers/gpu/drm/ingenic/ingenic-drm-drv.c b/drivers/gpu/drm/ingenic/ingenic-drm-drv.c
index 625ec76cf04d8798d1946249bb3d1305817ff29e..cf7b0f914fc37bf7648d4d35c856911ab3c2e30c 100644
--- a/drivers/gpu/drm/ingenic/ingenic-drm-drv.c
+++ b/drivers/gpu/drm/ingenic/ingenic-drm-drv.c
@@ -1480,10 +1480,12 @@ static void ingenic_drm_remove(struct platform_device *pdev)
 {
 	struct device *dev = &pdev->dev;
 
-	if (!IS_ENABLED(CONFIG_DRM_INGENIC_IPU))
-		ingenic_drm_unbind(dev);
-	else
+	if (IS_ENABLED(CONFIG_DRM_INGENIC_IPU))
 		component_master_del(dev, &ingenic_master_ops);
+
+	/* A direct bind is not torn down by the component framework. */
+	if (dev_get_drvdata(dev))
+		ingenic_drm_unbind(dev);
 }
 
 static void ingenic_drm_shutdown(struct platform_device *pdev)

base-commit: bf57105b00e32d37b666c029c8c6b8708391da20

                 reply	other threads:[~2026-12-02 19:16 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20261202233911.cc464592b027.ingenic-drm@gmail.com \
    --to=yigejiang86@gmail.com \
    --cc=airlied@gmail.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mips@vger.kernel.org \
    --cc=maarten.lankhorst@linux.intel.com \
    --cc=mripard@kernel.org \
    --cc=paul@crapouillou.net \
    --cc=sam@ravnborg.org \
    --cc=simona@ffwll.ch \
    --cc=stable@vger.kernel.org \
    --cc=tzimmermann@suse.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox