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 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 smtp.lore.kernel.org (Postfix) with ESMTPS id 249FAEDEC43 for ; Wed, 13 Sep 2023 12:02:35 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 5BDC810E09E; Wed, 13 Sep 2023 12:02:34 +0000 (UTC) Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by gabe.freedesktop.org (Postfix) with ESMTPS id 6757B10E09E for ; Wed, 13 Sep 2023 12:02:32 +0000 (UTC) Received: from [192.168.88.20] (91-154-35-171.elisa-laajakaista.fi [91.154.35.171]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id D9911BEB; Wed, 13 Sep 2023 14:00:58 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1694606459; bh=cswXhRm1e1DcA5shIZXc+UdI9/fAUQAb3D1e4uW/sS4=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=D0s47RcRZq5Dle5bWezeRXWqB2YlSXsj8GyHlBQcINOj2NEqKt+qy9MtXPPLdYfCU ai3SewP2FH7mo25fxHBCodpG24BOq+Qlx/i+JkWxHFr4eh5R7lym5JxOMuDTi+We1M XRu5RxyQGEQNR34PN/tV6PMMDW1ADtKFFGkC0PkQ= Message-ID: <0cd10461-aff1-9302-3d36-dd2ba609195a@ideasonboard.com> Date: Wed, 13 Sep 2023 15:02:28 +0300 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.15.0 Subject: Re: [PATCH] drm/omap: dsi: Fix deferred probe warnings Content-Language: en-US To: Tony Lindgren , Laurent Pinchart References: <20230412073954.20601-1-tony@atomide.com> <20230412085044.GP11253@pendragon.ideasonboard.com> <2bf56c04-733b-24a5-a344-166a94cd51f7@ideasonboard.com> <20230412085926.GR11253@pendragon.ideasonboard.com> <20230913073755.GE5285@atomide.com> From: Tomi Valkeinen In-Reply-To: <20230913073755.GE5285@atomide.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit 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: , Cc: Sebastian Reichel , dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, linux-omap@vger.kernel.org Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" On 13/09/2023 10:37, Tony Lindgren wrote: > * 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? I sent a comment to the patch. As Laurent said, I think this really should be fixed in the framework side. Calling detach in drivers without attach feels just plain wrong. However, I don't see any harm in the patch (but perhaps some changes needed as per my comments), and it will fix the issue for omapdrm, until someone has the time and energy to look at a real fix. Tomi