Received: by 2002:a05:7412:31a9:b0:e2:908c:2ebd with SMTP id et41csp5936629rdb; Sun, 17 Sep 2023 20:49:31 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGv+w56eDcBt64+Lpmblq7qUZinL7Ljc4mH6fiFc5pO30udyn6FVm7S7DZgSGBaV2rFzBm9 X-Received: by 2002:a05:6870:d784:b0:1d6:5e41:a8a1 with SMTP id bd4-20020a056870d78400b001d65e41a8a1mr9773904oab.27.1695008971013; Sun, 17 Sep 2023 20:49:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695008970; cv=none; d=google.com; s=arc-20160816; b=OgeMx8PZzxamkWwHYEfcNPlvIPfefNrwsw/cZ6EHmkJZZ6kWnPjXam25lXj3blq9ie ap/E1lEKWnjsYXJ1avhD+XZSyv6zsGLZqYpH09EqaKjgdDUI7pQYHtQbky/QS1E/pGWE yPKqtC+Udp7Qh+Zd3kTo8aIfHZVm9+ELrtdNhPbt7yB5j6Z/hcZdLW/d9pxLdPe0y+55 mhZO5uwFZIoXB8UpURyazNG1IVRj6cgKS8a1jp2UnKqC7qPRm6824rcJbkVKxD7U+jz7 3n7aFu5dNync+h3d4Me4dWdwp8ex8asmmjATNvmicorCG0vz9c4DpFymgeoe/Tskvgyh cnNg== 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=HcyXtbuSybwZfPrv3j+piUk/lE/DKEayxg62s5DPc7U=; fh=CqgTXqMQgiI6ZZ9FarY/qubWo/kTOBdY+ZOoCy6bGc8=; b=U7LwMPomwNqxUiBMsWraD+sgx1/2Xg2yzZTMWi0b1+bwWyvh19wMFpQOzzKKbrodVV ylwiY3e+ZyTeM0lTVNnJ1a0xWVGQmEGxAXdHmt6G5u7EiMlsoIkg/Fzhl6PmJ2ff73TO RXBgGHycx4oBGECpvu/gu5yCf5KdflEbBvlW8KgahpxOSVVJVOXXGX00LZ509HFLeWQV S3+fUPs++iSXJdqEcwIpXZYUIMkzAWGJ+544dMgopGAUMfbepFGy6xsC+lDB6yjezu8z fferNI09G8XxwieF0Aa3ctaOS9Ay3B8AwAiGSbj3hguAmCZN49Te/ibSfx4eNLA3aABV Z91A== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from morse.vger.email (morse.vger.email. [23.128.96.31]) by mx.google.com with ESMTPS id b19-20020a630c13000000b00569561773a6si7415855pgl.549.2023.09.17.20.49.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 17 Sep 2023 20:49:30 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 as permitted sender) client-ip=23.128.96.31; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 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 morse.vger.email (Postfix) with ESMTP id 4889F80212C8; Sun, 17 Sep 2023 20:49:27 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at morse.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231277AbjIRDst (ORCPT + 99 others); Sun, 17 Sep 2023 23:48:49 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57574 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230360AbjIRDs2 (ORCPT ); Sun, 17 Sep 2023 23:48:28 -0400 Received: from muru.com (muru.com [72.249.23.125]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id CAA5F10E; Sun, 17 Sep 2023 20:48:21 -0700 (PDT) Received: from localhost (localhost [127.0.0.1]) by muru.com (Postfix) with ESMTPS id C00A080BF; Mon, 18 Sep 2023 03:48:20 +0000 (UTC) Date: Mon, 18 Sep 2023 06:48:19 +0300 From: Tony Lindgren To: "H. Nikolaus Schaller" Cc: Tomi Valkeinen , Laurent Pinchart , Sebastian Reichel , dri-devel@lists.freedesktop.org, linux-omap@vger.kernel.org, linux-kernel@vger.kernel.org, Daniel Vetter , David Airlie Subject: Re: [PATCH] drm/omap: dsi: Fix deferred probe warnings Message-ID: <20230918034819.GO5285@atomide.com> References: <20230412073954.20601-1-tony@atomide.com> <9daacd2f-0dbf-dddc-9403-b802447896a2@ideasonboard.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-0.8 required=5.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on morse.vger.email 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 (morse.vger.email [0.0.0.0]); Sun, 17 Sep 2023 20:49:27 -0700 (PDT) * H. Nikolaus Schaller [230916 12:50]: > Hi Tomi and Tony, > > > Am 13.09.2023 um 13:59 schrieb Tomi Valkeinen : > > > > On 12/04/2023 10:39, 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. > >> 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); > > > > Shouldn't this rather be > > > > if (!dsi->dsidev) > > return 0; > > > > before the if (WARN_ON(dsi->dsidev != client)) line? > > Yes you are right. We have a different variant in our Pyra kernel: > > What we currently have in our Pyra tree is: https://git.goldelico.com/?p=letux-kernel.git;a=commitdiff;h=5bf7bd64eec1eb924e794e8d6600919f0dae8c5a;hp=27a0cd6263194d1465e9c53293d35f8c8c988f9d > > struct dsi_data *dsi = host_to_omap(host); > > - if (WARN_ON(dsi->dsidev != client)) > +printk("%s\n", __func__); > + > + if (!dsi->dsidev || WARN_ON(dsi->dsidev != client)) > return -EINVAL; > > cancel_delayed_work_sync(&dsi->dsi_disable_work); > > > > > If dsi->dsidev is NULL, then attach hasn't been called, and we shouldn't do anything in the detach callback either. > > > > With your change we'll end up doing all the work in the detach callback, without ever doing their counterpart in the attach side. > > If useful, I can post above mentioned patch (without printk). Sounds good to me. Thanks, Tony