Received: by 2002:a05:7412:31a9:b0:e2:908c:2ebd with SMTP id et41csp3077048rdb; Wed, 13 Sep 2023 00:52:34 -0700 (PDT) X-Google-Smtp-Source: AGHT+IENuUQ+tZk7CWzl67EMHpCf2KEy1mg3RkHHclioQ8oeqdyztEYrfithbqr4YY5m7hAXXEbE X-Received: by 2002:a17:902:cec7:b0:1c2:82e:32de with SMTP id d7-20020a170902cec700b001c2082e32demr2697135plg.0.1694591554256; Wed, 13 Sep 2023 00:52:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1694591554; cv=none; d=google.com; s=arc-20160816; b=OUbYZFa9wJabZLiMtCLmDIV9dAAODknfWy3cKx8dn7FFK5BQgdUJZW9klRxZx3oaEm sd4wsUv3RJThsm9cOKorNJJg/gm47OZw8JheM7uJg2uCWojrTvtNXGV2bKXq7LxYDdY5 OSHOaNwHmxsyM02xJCihfDJAW7679ohHwR4QCKwQDtr/BIE/RJcyRFS34yNy110/paB3 4Hv3L75N0d4/a6TngPbl9yItmxvqUJwh5F3Xof2aOeHaCLgQAKQtS4b1tEgq8o1IMgZa wVdp4e8MtP46cJWA73qV+fYSDIxoiSysDPdRcA1vPK5ueZdeYGsz411B9HS0FboXpEO9 smnw== 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; bh=tvHV49AoGmLJCha8FmIOLBDsD123wEVuF7bd13815y0=; fh=E75FqJCVL3gC0i+cD4JQGIm1ElVGANwvbrA+sG4UwOc=; b=S9uTLDNGA/WC+hMwW/OPQdJ9ozBSxtEMYYk4G2LVKUvWZgq/WhoflVmQbqIMLzeh4q ucD0KvEHqRCcIctRIGRXXj0qF2hY45Mz75RmqUY9OED3naxlwHFN9D4ps2+wSL71T5nE GJvHY1XmqRdQOpdvREMdCsb3S09aEW2wl8I0VaYfSX2l7bVd2na9eGCYAZ0966VvLyZL XhhTWBq65C+2heu2HPLfoak5ehiEscrmBhHM9VFb1eREvT2JE9ypvjFqxmi0cOe6xIYq AjAsICuBy1UtEB2796dD+ms7lNcxobydN9XHDBxUJElbBB5VnFzvVOA2xDDECryHxmKK V/4A== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from howler.vger.email (howler.vger.email. [23.128.96.34]) by mx.google.com with ESMTPS id t14-20020a170902e84e00b001bee6def27esi10001648plg.260.2023.09.13.00.52.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 13 Sep 2023 00:52:34 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) client-ip=23.128.96.34; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by howler.vger.email (Postfix) with ESMTP id 065AE82CBA48; Wed, 13 Sep 2023 00:38:03 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at howler.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238599AbjIMHiC (ORCPT + 99 others); Wed, 13 Sep 2023 03:38:02 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54682 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238597AbjIMHiB (ORCPT ); Wed, 13 Sep 2023 03:38:01 -0400 Received: from muru.com (muru.com [72.249.23.125]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id A34681727; Wed, 13 Sep 2023 00:37:57 -0700 (PDT) Received: from localhost (localhost [127.0.0.1]) by muru.com (Postfix) with ESMTPS id E3D438088; Wed, 13 Sep 2023 07:37:56 +0000 (UTC) Date: Wed, 13 Sep 2023 10:37:55 +0300 From: Tony Lindgren To: Laurent Pinchart Cc: Tomi Valkeinen , David Airlie , Daniel Vetter , Sebastian Reichel , dri-devel@lists.freedesktop.org, linux-omap@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] drm/omap: dsi: Fix deferred probe warnings Message-ID: <20230913073755.GE5285@atomide.com> References: <20230412073954.20601-1-tony@atomide.com> <20230412085044.GP11253@pendragon.ideasonboard.com> <2bf56c04-733b-24a5-a344-166a94cd51f7@ideasonboard.com> <20230412085926.GR11253@pendragon.ideasonboard.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230412085926.GR11253@pendragon.ideasonboard.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (howler.vger.email [0.0.0.0]); Wed, 13 Sep 2023 00:38:03 -0700 (PDT) * Laurent Pinchart [230412 11:59]: > On Wed, Apr 12, 2023 at 11:55:34AM +0300, Tomi Valkeinen wrote: > > On 12/04/2023 11:50, Laurent Pinchart wrote: > > > Hi Tony, > > > > > > Thank you for the patch. > > > > > > On Wed, Apr 12, 2023 at 10:39:53AM +0300, Tony Lindgren wrote: > > >> We may not have dsi->dsidev initialized during probe, and that can > > >> lead into various dsi related warnings as omap_dsi_host_detach() gets > > >> called with dsi->dsidev set to NULL. > > >> > > >> The warnings can be "Fixed dependency cycle(s)" followed by a > > >> WARNING: CPU: 0 PID: 787 at drivers/gpu/drm/omapdrm/dss/dsi.c:4414. > > > > > > How can this happen ? I assume .detach() can't be called without a > > > priori successful call to .attach(), that that sets dsi->dsidev. > > > > I had a quick look, and the driver calls mipi_dsi_host_register() in > > probe, and mipi_dsi_host_unregister() in remove. > > > > mipi_dsi_host_unregister() always calls mipi_dsi_detach(), but I don't > > think mipi_dsi_host_register() always calls attach, which happens later > > when the peripheral probes. > > Is this something that should be addressed in the DRM MIPI DSI helpers, > to only detach after an attach ? Tomi, any comments on detach after attach? Regards, Tony > > >> Let's fix the warnings by checking for a valid dsi->dsidev. > > >> > > >> Signed-off-by: Tony Lindgren > > >> --- > > >> drivers/gpu/drm/omapdrm/dss/dsi.c | 2 +- > > >> 1 file changed, 1 insertion(+), 1 deletion(-) > > >> > > >> diff --git a/drivers/gpu/drm/omapdrm/dss/dsi.c b/drivers/gpu/drm/omapdrm/dss/dsi.c > > >> --- a/drivers/gpu/drm/omapdrm/dss/dsi.c > > >> +++ b/drivers/gpu/drm/omapdrm/dss/dsi.c > > >> @@ -4411,7 +4411,7 @@ static int omap_dsi_host_detach(struct mipi_dsi_host *host, > > >> { > > >> struct dsi_data *dsi = host_to_omap(host); > > >> > > >> - if (WARN_ON(dsi->dsidev != client)) > > >> + if (dsi->dsidev && WARN_ON(dsi->dsidev != client)) > > >> return -EINVAL; > > >> > > >> cancel_delayed_work_sync(&dsi->dsi_disable_work); > > -- > Regards, > > Laurent Pinchart >