Received: by 2002:a05:6358:c692:b0:131:369:b2a3 with SMTP id fe18csp983117rwb; Wed, 26 Jul 2023 06:04:32 -0700 (PDT) X-Google-Smtp-Source: APBJJlFhhQdlE2GSjv48foJyDI6i9OsmQU8RJRQLuQLgT9aDKViI2By3nNZMnG3Tui4bK/ImGfg8 X-Received: by 2002:a19:4f0a:0:b0:4f4:d071:be48 with SMTP id d10-20020a194f0a000000b004f4d071be48mr1603189lfb.14.1690376672290; Wed, 26 Jul 2023 06:04:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1690376672; cv=none; d=google.com; s=arc-20160816; b=Eiv3mam1Mo8fvRY9wZvBRyF12rOmYh6Nmus+j8YvCxbDZ2rTn/lyuINxMIg/Q0brHO csf7l5fH5DwBLs6W2v+2gxmK4RbfjmBbxy2Gp382GRAv60brC1BoGbHKxQfZZ16wiy1q ExiECvzypNTxVFVXd1jUEtZPbBj7l8/QsoBy4NA/Z3ShYS0JneSgdk7rslQT8DU/cG7M 2fz+W+mkpmVAir6q+quj5jBlGiGJaNzbO+UuRche+5k3+5Zp0SBLQmr68s/0MowhZ68e Y2TbzwFvhj61PcDlenXuu1qf9aoqf019EKri14iczvBghLz2mmjK3fkERYq0u8W55xEO YdEg== 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=bALS92dZEp6Bog/IDgTHSkowfaf9shZJRJWKE/3Rzp4=; fh=FZqRUCw1MEnHSk8xERMgu3inhKgJxvshda9/vXF5ysE=; b=Xy84FAlMoq065G+AkgoD3hgIsRBBvtAeUh2OrPJ+bk2Wck3tIEmDAtInVE24/DGrCF eYqVSyRnyVTrZdzLvf2PLv1arwm63On7WAaA0eC1YgOktxQoS/OIKYLffXiznb9eKKAI O32/KDKWNGZyp+05/mr+odL53J8M3Aw4eBi4BZP2vbnA7dzEdt8h7yBHrSiq5Q/R0vul oGDE3GtLxVKUin8PSaD5wQ4Zicxw4IyhZb1oC/T1k7c/tmSR8WVvPQoT+dQP42Lr+Nqt P0kjaErHPnvOS2Tb9YDOHWQUHcz6i4iVP0abBRnfZDgFKCK1lWoGyxzWi+GhtIUzeeZ2 osBA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=K522A7YU; 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 ga10-20020a170906b84a00b0099bca0c5445si591889ejb.363.2023.07.26.06.03.53; Wed, 26 Jul 2023 06:04:32 -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=K522A7YU; 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 S233860AbjGZMmC (ORCPT + 99 others); Wed, 26 Jul 2023 08:42:02 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46232 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230296AbjGZMl6 (ORCPT ); Wed, 26 Jul 2023 08:41:58 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D381E2129; Wed, 26 Jul 2023 05:41:55 -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 6B45C61AE9; Wed, 26 Jul 2023 12:41:55 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 4D1F1C433C7; Wed, 26 Jul 2023 12:41:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1690375314; bh=bALS92dZEp6Bog/IDgTHSkowfaf9shZJRJWKE/3Rzp4=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=K522A7YUIGm7SR5p/ijItVCD+05Na78v0dHvP6RrW5JDm7ocD8s+++3FsBW8zCpCN YCYw7f0JDV6tPpmtPpErRRqlfR0RwAge3HzBCoQ9Af/F9h9z2E+58+4Vw9X1x+LsPx brSuyzhawBS3vJEvDQEKEvjEsX6xEqCE9wZ3lfxucpuzxeF5ix9CWN+KJDMsX/tTnM /A5ClEgYaWPfeez2AMkgkIfesVaiHKxxmElImvFZjrGbW3Qw/ViVkE3UL+kGB0BrLN Qeaq5YJIvU0QGCNBQi0eUSoz59sADEaMRgyFu6TARgzDEhRkthXLxa7Sp8dRmYo0M7 zUas4sryFDWNA== Date: Wed, 26 Jul 2023 14:41:51 +0200 From: Maxime Ripard To: Douglas 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="fea6cqcwqp7wzipv" Content-Disposition: inline In-Reply-To: <20230725133443.v3.2.I59b417d4c29151cc2eff053369ec4822b606f375@changeid> 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 --fea6cqcwqp7wzipv Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Hi, 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. Maxime --fea6cqcwqp7wzipv Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iHUEABYKAB0WIQRcEzekXsqa64kGDp7j7w1vZxhRxQUCZMEUjwAKCRDj7w1vZxhR xanPAP4voVmceTn00DRIp62vuGdOHci+svLi/7f8l6Z6NuyYrQD9Ewfs//FjcPgH B/1NNtCNPIdGky8NtXB4QU3dP2Nq4AA= =15yF -----END PGP SIGNATURE----- --fea6cqcwqp7wzipv--