Received: by 2002:a05:6358:c692:b0:131:369:b2a3 with SMTP id fe18csp2008127rwb; Thu, 27 Jul 2023 00:05:15 -0700 (PDT) X-Google-Smtp-Source: APBJJlFvM4S94frCvIpekQyIo8FNMGJd5IRhcbqYr7nm6bsv/5UE5VUXAZYWA/Nyh9ZSbjDEp5mg X-Received: by 2002:a17:907:162a:b0:96f:9cea:a34d with SMTP id hb42-20020a170907162a00b0096f9ceaa34dmr1546445ejc.21.1690441515063; Thu, 27 Jul 2023 00:05:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1690441515; cv=none; d=google.com; s=arc-20160816; b=upr+5yYVVVNhzH3LOJ0rf3VGprbDr1+MSbvxmGsDk8wtDAOOm+FdzQtt4a2EW9TmGH cMysfYxEdcCeI9eNaar7lJ4ulZQh3WlfFKj4xmzrRcs+6EBiw+B3ZYO/zN/n9kSb3Ppe hFqAduDuEiBPvGrdl8zWZePMrGLscyOwDGt89qSdJXDCqTTvgCbFzxtrS+zhBIXToFXq prD4bS/mPPxPrfVzoTDV8YZXwhB4obUNx+V4vXEDD5UimyUNr2//xBrjbCRO071dQIp5 0LJ2sXzay7UDjg1IuE8Csyk4UDRokterSvMOqemV4uRkK0kIwpe5L8SpXgnSo4//DlxB 5uig== 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=FRjnZpBXyoICml35qRO4Ubw0mh4eZitG61lIBtAT9ZE=; fh=0Vw7S/hhwk2rbmzgzwsNpTz4OWECMf9M5MoCjjPXtLk=; b=sNLuYmI+ZqutglaFU0pE5ofOuqbeu007Tgsw1nLSmO+mT70pKOeaY06Gf4OXBVJLEH /GdLRiKqrHLq0KXUncTtx/34AaR9NohEzm3O9cEOeWgLRRt6blWf8WM7oMjR8Sf8XJ6f BJpnJu5/tzfxE+QGbYa61HfsY8yLTKiXCWjbyMdY5ysGQnjm4blMq99PCsDbre3r+Fk/ pYinRWj0P+WViQ3UWGCDKW7uF6orv89PYr5CuCkxCXJxNesjWSXV7u3v+PPcFi90BlIr fVhQ1LQCSRp7WEEvIG5rhCdJ5sT3fYVtvwMRgaTssfIiM/IR3bj4sPJTOoKZugLbtxWr yEjA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=fYZL11pK; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id ot1-20020a170906ccc100b0098d2261cddfsi539134ejb.1049.2023.07.27.00.04.50; Thu, 27 Jul 2023 00:05:15 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=fYZL11pK; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231449AbjG0GiK (ORCPT + 99 others); Thu, 27 Jul 2023 02:38:10 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35058 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231808AbjG0GiC (ORCPT ); Thu, 27 Jul 2023 02:38:02 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D201E189; Wed, 26 Jul 2023 23:38:00 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 6F3F261D4B; Thu, 27 Jul 2023 06:38:00 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 53265C433C8; Thu, 27 Jul 2023 06:37:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1690439879; bh=FRjnZpBXyoICml35qRO4Ubw0mh4eZitG61lIBtAT9ZE=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=fYZL11pKqnmkNulOQe7GL0kffosuY1A0wodOf9CauFTecIaODJGJPhXFxc7GYCnLi BER1cf+68K8Sz2Jhsnl4nq4fGGxli2s2LmnmWkmf9kSG75WPIDHdxsThaZ4Nb4s5p7 pUWoIaAaMZSgVHhutZGd/KWaom/Sli98Q8tiw2zU34EzcqASaA5SNusxS1pyJc4Ua7 9AyNvj3j3dUOJimVrImfyr0ZfSgr/zzasFPckHAj9q/VU/kQpXeLodMZmz5RJrVV8l c8qxGhe0+v6AvJtH3eCtG/XNvGqjEyYEGHVCQEqYj7/T25emB02p4i6V3iaDfN8UCm 99iL9y1DWV5Aw== Date: Thu, 27 Jul 2023 08:37:56 +0200 From: Maxime Ripard To: Doug Anderson Cc: Jiri Kosina , Benjamin Tissoires , Bjorn Andersson , Konrad Dybcio , Rob Herring , Frank Rowand , Krzysztof Kozlowski , Conor Dooley , Neil Armstrong , Sam Ravnborg , Maarten Lankhorst , Thomas Zimmermann , cros-qcom-dts-watchers@chromium.org, Chris Morgan , linux-input@vger.kernel.org, hsinyi@google.com, linux-arm-msm@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, Dmitry Torokhov , devicetree@vger.kernel.org, Daniel Vetter , yangcong5@huaqin.corp-partner.google.com Subject: Re: [PATCH v3 02/10] drm/panel: Check for already prepared/enabled in drm_panel Message-ID: References: <20230725203545.2260506-1-dianders@chromium.org> <20230725133443.v3.2.I59b417d4c29151cc2eff053369ec4822b606f375@changeid> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="qmidvgjg6qmglwns" Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --qmidvgjg6qmglwns Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hi, On Wed, Jul 26, 2023 at 08:10:33AM -0700, Doug Anderson wrote: > On Wed, Jul 26, 2023 at 5:41=E2=80=AFAM Maxime Ripard wrote: > > On Tue, Jul 25, 2023 at 01:34:37PM -0700, Douglas Anderson wrote: > > > NOTE: arguably, the right thing to do here is actually to skip this > > > patch and simply remove all the extra checks from the individual > > > drivers. Perhaps the checks were needed at some point in time in the > > > past but maybe they no longer are? Certainly as we continue > > > transitioning over to "panel_bridge" then we expect there to be much > > > less variety in how these calls are made. When we're called as part of > > > the bridge chain, things should be pretty simple. In fact, there was > > > some discussion in the past about these checks [1], including a > > > discussion about whether the checks were needed and whether the calls > > > ought to be refcounted. At the time, I decided not to mess with it > > > because it felt too risky. > > > > Yeah, I'd agree here too. I've never found evidence that it was actually > > needed and it really looks like cargo cult to me. > > > > And if it was needed, then I'm not sure we need refcounting either. We > > don't have refcounting for atomic_enable / disable, we have a sound API > > design that makes sure we don't fall into that trap :) > > > > > Looking closer at it now, I'm fairly certain that nothing in the > > > existing codebase is expecting these calls to be refcounted. The only > > > real question is whether someone is already doing something to ensure > > > prepare()/unprepare() match and enabled()/disable() match. I would say > > > that, even if there is something else ensuring that things match, > > > there's enough complexity that adding an extra bool and an extra > > > double-check here is a good idea. Let's add a drm_warn() to let people > > > know that it's considered a minor error to take advantage of > > > drm_panel's double-checking but we'll still make things work fine. > > > > I'm ok with this, if we follow-up in a couple of releases and remove it > > and all the calls. > > > > Could you add a TODO item so that we can keep a track of it? A follow-up > > is fine if you don't send a new version of that series. >=20 > By this, I think you mean to add a "TODO" comment inline in the code? No, sorry, I meant an entry in our TODO list: Documentation/gpu/todo.rst > Also: I was thinking that we'd keep the check in "drm_panel.c" with > the warning message indefinitely. You think it should be eventually > removed? If we are truly thinking of removing it eventually, this > feels like it should be a more serious warning message like a WARN(1, > ...) to make it really obvious to people that they're relying on > behavior that will eventually go away. Yeah, it really feels like this is cargo-cult to me. Your approach seems like a good short-term thing to do to warn everyone but eventually we'll want it to go away. So promoting it to a WARN could be a good thing, or let's say we do a drm_warn for now, WARN next release, and gone in two? Maxime --qmidvgjg6qmglwns Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iHUEABYKAB0WIQRcEzekXsqa64kGDp7j7w1vZxhRxQUCZMIQxAAKCRDj7w1vZxhR xS9GAP9BIm0s8ZsLC+bhjElbosmrjvC+nJKq8JPUsWqiC6LCgAEA7zDgSlWYWW1y wy47ZmFD7kfSibH3ZXnpNrOTtnnmpQ4= =4IGd -----END PGP SIGNATURE----- --qmidvgjg6qmglwns--