LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
From: Paul Cercueil <paul@crapouillou.net>
To: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Rob Herring <robh@kernel.org>,
	"Rafael J . Wysocki" <rafael@kernel.org>,
	David Airlie <airlied@linux.ie>, Daniel Vetter <daniel@ffwll.ch>,
	Sam Ravnborg <sam@ravnborg.org>
Cc: list@opendingux.net, linux-kernel@vger.kernel.org,
	linux-mips@vger.kernel.org, dri-devel@lists.freedesktop.org,
	Paul Cercueil <paul@crapouillou.net>
Subject: [PATCH 2/2] gpu/drm: ingenic: Add workaround for disabled drivers
Date: Thu,  5 Aug 2021 21:21:09 +0200	[thread overview]
Message-ID: <20210805192110.90302-3-paul@crapouillou.net> (raw)
In-Reply-To: <20210805192110.90302-1-paul@crapouillou.net>

When the drivers of remote devices (e.g. HDMI chip) are disabled in the
config, we want the ingenic-drm driver to be able to probe nonetheless
with the other devices (e.g. internal LCD panel) that are enabled.

Signed-off-by: Paul Cercueil <paul@crapouillou.net>
---
 drivers/gpu/drm/ingenic/ingenic-drm-drv.c | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/drivers/gpu/drm/ingenic/ingenic-drm-drv.c b/drivers/gpu/drm/ingenic/ingenic-drm-drv.c
index d261f7a03b18..5e1fdbb0ba6b 100644
--- a/drivers/gpu/drm/ingenic/ingenic-drm-drv.c
+++ b/drivers/gpu/drm/ingenic/ingenic-drm-drv.c
@@ -1058,6 +1058,18 @@ static int ingenic_drm_bind(struct device *dev, bool has_components)
 	for (i = 0; ; i++) {
 		ret = drm_of_find_panel_or_bridge(dev->of_node, 0, i, &panel, &bridge);
 		if (ret) {
+			/*
+			 * Workaround for the case where the drivers for the
+			 * remote devices are not enabled. When that happens,
+			 * drm_of_find_panel_or_bridge() returns -EPROBE_DEFER
+			 * endlessly, which prevents the ingenic-drm driver from
+			 * working at all.
+			 */
+			if (ret == -EPROBE_DEFER) {
+				ret = driver_deferred_probe_check_state(dev);
+				if (ret == -ENODEV || ret == -ETIMEDOUT)
+					continue;
+			}
 			if (ret == -ENODEV)
 				break; /* we're done */
 			if (ret != -EPROBE_DEFER)
-- 
2.30.2


  parent reply	other threads:[~2021-08-05 19:21 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-05 19:21 [PATCH 0/2] gpu/drm: ingenic: Handle " Paul Cercueil
2021-08-05 19:21 ` [PATCH 1/2] drivers core: Export driver_deferred_probe_check_state() Paul Cercueil
2021-08-05 19:34   ` Greg Kroah-Hartman
2021-08-05 19:21 ` Paul Cercueil [this message]
2021-08-05 19:35   ` [PATCH 2/2] gpu/drm: ingenic: Add workaround for disabled drivers Greg Kroah-Hartman
2021-08-05 20:05     ` Paul Cercueil
2021-08-06 10:17       ` Greg Kroah-Hartman
2021-08-06 11:01         ` Paul Cercueil
2021-08-10  9:35           ` Daniel Vetter
2021-08-10 10:33             ` Paul Cercueil
2021-08-10 10:59               ` Daniel Vetter
2021-08-10 11:58                 ` Paul Cercueil
2021-08-10  9:47           ` Greg Kroah-Hartman
2021-08-10 10:40             ` Paul Cercueil
2021-08-10 10:52               ` Daniel Vetter

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=20210805192110.90302-3-paul@crapouillou.net \
    --to=paul@crapouillou.net \
    --cc=airlied@linux.ie \
    --cc=daniel@ffwll.ch \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mips@vger.kernel.org \
    --cc=list@opendingux.net \
    --cc=rafael@kernel.org \
    --cc=robh@kernel.org \
    --cc=sam@ravnborg.org \
    --subject='Re: [PATCH 2/2] gpu/drm: ingenic: Add workaround for disabled drivers' \
    /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

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).