From mboxrd@z Thu Jan 1 00:00:00 1970 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=-16.4 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS 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 46003C4320A for ; Thu, 5 Aug 2021 19:35:39 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 001CD61050 for ; Thu, 5 Aug 2021 19:35:38 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 001CD61050 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linuxfoundation.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 74B636EB36; Thu, 5 Aug 2021 19:35:38 +0000 (UTC) Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by gabe.freedesktop.org (Postfix) with ESMTPS id CFE586EB33 for ; Thu, 5 Aug 2021 19:35:36 +0000 (UTC) Received: by mail.kernel.org (Postfix) with ESMTPSA id 2EEF061004; Thu, 5 Aug 2021 19:35:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1628192136; bh=fZaYRnFhRWpXfUOCk6WjCAYwWtpuoJlgYzfD8ZrCnjQ=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=mIKE4ygEKSSiNr0AbWk07YOCkEiqzHO1N1Rz+Sy4eZG1xbkLxRp43n9HOYpft1pBj rl0lz6rtlQ9JDtI/4BAK1+Oub2YZt7UYNCnUL4o/e7gJzZklBmrxZiGWtFRF4VTClU VjoCZRHWRdeNA2rcV9cK96d6iERe5q8iAMrTVwps= Date: Thu, 5 Aug 2021 21:35:34 +0200 From: Greg Kroah-Hartman To: Paul Cercueil Cc: Rob Herring , "Rafael J . Wysocki" , David Airlie , Daniel Vetter , Sam Ravnborg , list@opendingux.net, linux-kernel@vger.kernel.org, linux-mips@vger.kernel.org, dri-devel@lists.freedesktop.org Subject: Re: [PATCH 2/2] gpu/drm: ingenic: Add workaround for disabled drivers Message-ID: References: <20210805192110.90302-1-paul@crapouillou.net> <20210805192110.90302-3-paul@crapouillou.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210805192110.90302-3-paul@crapouillou.net> X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" On Thu, Aug 05, 2021 at 09:21:09PM +0200, Paul Cercueil wrote: > 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; > + } So you are mucking around with devices on other busses within this driver? What could go wrong? :( Please use the existing driver core functionality for this type of thing, it is not unique, no need for this function to be called. thanks, greg k-h