Received: by 2002:a05:6a10:c604:0:0:0:0 with SMTP id y4csp67677pxt; Thu, 5 Aug 2021 18:12:14 -0700 (PDT) X-Google-Smtp-Source: ABdhPJytq5S5etiTIULHUaB6QqvB6O4a4k4cdywT8IcVJVhb10AXFa5x8nXYxqhYe2ZQxSlkBG5j X-Received: by 2002:a17:906:22db:: with SMTP id q27mr7717705eja.185.1628212334361; Thu, 05 Aug 2021 18:12:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1628212334; cv=none; d=google.com; s=arc-20160816; b=pcF+r1j9Z8T79BFDhmHmnNjuEbCBWC69YS+YKnmxsPl/HvWyUZCp+Gt4w3WvE+JxWX sYZbrMNBbLcrFfx9bOvNCAHvK5vhETrP5ox6jQs7LS8dsiL4jfRSyWCFXeguz69/a8KF Z1mZk3KAjyp6fN3x2JxiyWtH/KtxJ4Gv4PeOZUA8YlfPIt4Lu8bwjakS/KgigvxtNO8p ACcYZG8klS7HYMDH0hDwzOW31kAtQA2SDpiFbCmM2E1Xw62eUTn+y9crGcANeRzush6X DIkjkCcOyFyHlX+FsXsvlssTNTbMqocdThcnJSFvQ/wXK+7ygA1R+QcI051oviUU/WTh v0Jw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=5kDdfq/Ns63YzdUuXf5mVpaN8rwQTKnydqqKvkNP1ZI=; b=ydk1uoMe64QCUJKYS5OgMMVXisOdZBI+WA6gNbIvLwgavk5B9/4+xUvSTPo1+7Bkm3 bUW2Br8GViPnoN/Epin1aSjwIbYkPi3/rUZDD3angK2hvYeTxRj8n+w7iBOWm/Z0Hw5O noHSm5jvf7dsZjXRj4bvvqAVO+DsCCFor8ZnQrmBEhwXa60duuhXoqjFWPSvwSwToepR zvsdgTQo7uEhm6sSgUirdnpQvTZ7Klsxj+wnM2R1FggCz3/EfqKXNE2mhMS2glF9uvzk SEeFleaAoBqAyXGhis44Du4VtLsWr/imeB6aIrkYs8Xm4NIWNOtZGnxj2feXuYsyHNt8 aSLA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=mIKE4ygE; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id e2si6665435eds.340.2021.08.05.18.11.51; Thu, 05 Aug 2021 18:12:14 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=mIKE4ygE; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229503AbhHETfw (ORCPT + 99 others); Thu, 5 Aug 2021 15:35:52 -0400 Received: from mail.kernel.org ([198.145.29.99]:56662 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230471AbhHETfv (ORCPT ); Thu, 5 Aug 2021 15:35:51 -0400 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> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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