From patchwork Thu Aug 5 19:21:08 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paul Cercueil X-Patchwork-Id: 12422003 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-13.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 227DCC432BE for ; Thu, 5 Aug 2021 19:21:23 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 052E061158 for ; Thu, 5 Aug 2021 19:21:22 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231384AbhHETVg (ORCPT ); Thu, 5 Aug 2021 15:21:36 -0400 Received: from aposti.net ([89.234.176.197]:54872 "EHLO aposti.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S242531AbhHETVg (ORCPT ); Thu, 5 Aug 2021 15:21:36 -0400 From: Paul Cercueil To: Greg Kroah-Hartman , Rob Herring , "Rafael J . Wysocki" , David Airlie , Daniel Vetter , Sam Ravnborg Cc: list@opendingux.net, linux-kernel@vger.kernel.org, linux-mips@vger.kernel.org, dri-devel@lists.freedesktop.org, Paul Cercueil Subject: [PATCH 1/2] drivers core: Export driver_deferred_probe_check_state() Date: Thu, 5 Aug 2021 21:21:08 +0200 Message-Id: <20210805192110.90302-2-paul@crapouillou.net> In-Reply-To: <20210805192110.90302-1-paul@crapouillou.net> References: <20210805192110.90302-1-paul@crapouillou.net> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-mips@vger.kernel.org Export this function as a GPL symbol, so that it can be used from modules. Signed-off-by: Paul Cercueil --- drivers/base/dd.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/base/dd.c b/drivers/base/dd.c index daeb9b5763ae..658f1527a58b 100644 --- a/drivers/base/dd.c +++ b/drivers/base/dd.c @@ -296,6 +296,7 @@ int driver_deferred_probe_check_state(struct device *dev) return -EPROBE_DEFER; } +EXPORT_SYMBOL_GPL(driver_deferred_probe_check_state); static void deferred_probe_timeout_work_func(struct work_struct *work) { From patchwork Thu Aug 5 19:21:09 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paul Cercueil X-Patchwork-Id: 12422005 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-13.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9FA21C4338F for ; Thu, 5 Aug 2021 19:21:33 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 882BB61050 for ; Thu, 5 Aug 2021 19:21:33 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S242509AbhHETVr (ORCPT ); Thu, 5 Aug 2021 15:21:47 -0400 Received: from aposti.net ([89.234.176.197]:54888 "EHLO aposti.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S242592AbhHETVm (ORCPT ); Thu, 5 Aug 2021 15:21:42 -0400 From: Paul Cercueil To: Greg Kroah-Hartman , Rob Herring , "Rafael J . Wysocki" , David Airlie , Daniel Vetter , Sam Ravnborg Cc: list@opendingux.net, linux-kernel@vger.kernel.org, linux-mips@vger.kernel.org, dri-devel@lists.freedesktop.org, Paul Cercueil Subject: [PATCH 2/2] gpu/drm: ingenic: Add workaround for disabled drivers Date: Thu, 5 Aug 2021 21:21:09 +0200 Message-Id: <20210805192110.90302-3-paul@crapouillou.net> In-Reply-To: <20210805192110.90302-1-paul@crapouillou.net> References: <20210805192110.90302-1-paul@crapouillou.net> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-mips@vger.kernel.org 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 --- 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)