Received: by 2002:a05:6358:9144:b0:117:f937:c515 with SMTP id r4csp78693rwr; Wed, 19 Apr 2023 03:47:17 -0700 (PDT) X-Google-Smtp-Source: AKy350YgQnZSWkvxfKrPlx02F5WhaAfFdDenCndy6KjMPakovpfnL5wnQWMzLnqkUy0Szv0pBU2a X-Received: by 2002:a05:6a20:258f:b0:f0:dedb:83b7 with SMTP id k15-20020a056a20258f00b000f0dedb83b7mr3256899pzd.60.1681901237260; Wed, 19 Apr 2023 03:47:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1681901237; cv=none; d=google.com; s=arc-20160816; b=s7ftDIWZVDLDSKGXK5SXxWjYpXPiAUkjL4w4bpk6YDj+TGwqNFkVXWXVu2mUxtrsl2 skfCQVJf6s1Ii+IrzFqa6OO7Ng2Qatw04cuTBitvIFK2BbWaO1u2WhWmYWWDSaZ48Ow7 bE8LSI1bKMuZ89Kyg53kYqrgpm7Ir/tdcJ0JPmZxYDCDR4CMnwHTFAeEJGoAQbkspV4T ndAd/cESoK/P/IxjnKiSBvRu3+j0lofDuSAooiWOw3QoAOE1TYfNheskxdlA2kzs+qEv VKjbRCn61PzPUXHCNQyQfugqgXpwV4anxmEpnPs77D0rRzrdDCX6Yj7IuUIa3O7yrwzU LcgA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=5MdNpSS+OOI19jq0uYTZJnCcJQUPASUIXiKZhUZv1Dk=; b=kqc1cAQRuha1D5ZUgr5IZH/Qv0Oofc3dX0UkzwYKSFvKpu2+OkyxGI4qKjP2uw9aSP 77DpOupKejP0HqlecibkjfqQkfbSLNXv7miwUBGsyOsGMldRpv0UcwAdbSaQ2bLwpCiB iAgdSxo86tZiLeF76hleEt251FqBq41OUjxD/K2uWc2XgDMQVZhPE9pZZf7Snid+aeQL j1S27k2zdi9RiFR/PXaohU3rkBFOHAV9HXtNcnkjjP0UEUqDxb9X4B6YrPLCjcyNRw2J gKMjnY1zFe9oG/6npldMHIKlntcDZ7/Y55yRd08VlRC9czGVWtx+q0TTePhpRYBLEsmZ YhGg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20221208 header.b=qPRkEGyJ; 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id 69-20020a630248000000b0051f0bd1b159si4917654pgc.718.2023.04.19.03.47.05; Wed, 19 Apr 2023 03:47:17 -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=@gmail.com header.s=20221208 header.b=qPRkEGyJ; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232321AbjDSKmI (ORCPT + 99 others); Wed, 19 Apr 2023 06:42:08 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49384 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231574AbjDSKmD (ORCPT ); Wed, 19 Apr 2023 06:42:03 -0400 Received: from mail-pf1-x436.google.com (mail-pf1-x436.google.com [IPv6:2607:f8b0:4864:20::436]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 59EBC106; Wed, 19 Apr 2023 03:42:02 -0700 (PDT) Received: by mail-pf1-x436.google.com with SMTP id d2e1a72fcca58-63b5c830d5eso2511450b3a.2; Wed, 19 Apr 2023 03:42:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1681900922; x=1684492922; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=5MdNpSS+OOI19jq0uYTZJnCcJQUPASUIXiKZhUZv1Dk=; b=qPRkEGyJsDCSaZp4ogPYKDiohjMXJ0vzEVw3ywT3uU/GKNXrfLhJZ6WO/RujYYRmnF PIWdYM8XUTae0Uwqo7K/BsM/m71gYS2qAaYZAovPC1ozzLxvbFBxNBj2itCjIfsdCZJz oYXRbDEc4jvuxTsiYF9N+36SWDKzN6YFkfpmByLMKoupMARS4SESLcF10sB+s5JNHtH+ eU6mOiWuF6DAzFXziTij97EURj0NDOKUoNwtwn7c6F8otf7HQY66n+v+ABnb1PuUo9vp 1st/sxXJ8d2dMZe0h1UZDcj5KiM9BY58WSMtHv03DVWR0PY6UdrnmgJzZ4HyJLaQfrvf 4SnQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1681900922; x=1684492922; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=5MdNpSS+OOI19jq0uYTZJnCcJQUPASUIXiKZhUZv1Dk=; b=a9+oF9oZ90DwII8B5NcDhmPWznPe+EAnOYGEN5NxZq1aRtt+y9Zm3iMaofA26qofK5 uF/rgXTVpSvBRvjSWRByYG9Yxgv4k/UvcAIzvEyQSGIVAkcvmkqkpR+vbqOgsIKN3HX/ ge8VYf5SDjRxEw91qBslF73oLKOQId8K1N6VHD+UyzPKpXuc2WTtJhly+JWjnpPhNrvM ZAo01O86ro+xdnH2/H3M9kRc1ACgijIJkvNTNjeblfyh6X2iyVE2njUoB+E+D+q5vHIw nWXc5zs4hkNAQ8Wa0AN9q22yw4Y1tyF/CCZrKb9RJZGELpx17tytTwKY8b0YXSsqNe0B Mtdg== X-Gm-Message-State: AAQBX9eHIEteHoUtHJIdnBWLJVI8PBpR5rCfeWOzNXx+ae6FTyEw7+8d nm5nfvxU5GiI+HkFeMZxF5O4yYAFaqnEPlHUtGo= X-Received: by 2002:a17:90a:9802:b0:247:160d:3a8e with SMTP id z2-20020a17090a980200b00247160d3a8emr2278200pjo.22.1681900921522; Wed, 19 Apr 2023 03:42:01 -0700 (PDT) MIME-Version: 1.0 References: <20230415104104.5537-1-aford173@gmail.com> <20230415104104.5537-3-aford173@gmail.com> <7eed74e8-9f67-a410-3cec-f61a6db85238@denx.de> <56085a0f-02f7-6f45-f351-1f9ee612b748@denx.de> <426e901f14254cfcff87ba1747534f9b856ef738.camel@pengutronix.de> In-Reply-To: <426e901f14254cfcff87ba1747534f9b856ef738.camel@pengutronix.de> From: Adam Ford Date: Wed, 19 Apr 2023 05:41:49 -0500 Message-ID: Subject: Re: [PATCH 3/6] drm: bridge: samsung-dsim: Fetch pll-clock-frequency automatically To: Lucas Stach Cc: Marek Vasut , Krzysztof Kozlowski , aford@beaconembedded.com, dri-devel@lists.freedesktop.org, Laurent Pinchart , Andrzej Hajda , m.szyprowski@samsung.com, Robert Foss , Jernej Skrabec , Jagan Teki , NXP Linux Team , devicetree@vger.kernel.org, Jonas Karlman , Sascha Hauer , Rob Herring , linux-arm-kernel@lists.infradead.org, Neil Armstrong , linux-kernel@vger.kernel.org, Pengutronix Kernel Team , Shawn Guo Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_ENVFROM_END_DIGIT, FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,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 On Tue, Apr 18, 2023 at 3:47=E2=80=AFAM Lucas Stach wrote: > > Am Dienstag, dem 18.04.2023 um 10:30 +0200 schrieb Marek Vasut: > > On 4/18/23 04:29, Adam Ford wrote: > > > On Sun, Apr 16, 2023 at 5:08=E2=80=AFPM Marek Vasut w= rote: > > > > > > > > On 4/15/23 12:41, Adam Ford wrote: > > > > > Fetch the clock rate of "sclk_mipi" (or "pll_clk") instead of > > > > > having an entry in the device tree for samsung,pll-clock-frequenc= y. > > > > > > > > > > Signed-off-by: Adam Ford > > > > > --- > > > > > drivers/gpu/drm/bridge/samsung-dsim.c | 12 ++++++------ > > > > > 1 file changed, 6 insertions(+), 6 deletions(-) > > > > > > > > > > diff --git a/drivers/gpu/drm/bridge/samsung-dsim.c b/drivers/gpu/= drm/bridge/samsung-dsim.c > > > > > index 9fec32b44e05..73f0c3fbbdf5 100644 > > > > > --- a/drivers/gpu/drm/bridge/samsung-dsim.c > > > > > +++ b/drivers/gpu/drm/bridge/samsung-dsim.c > > > > > @@ -1744,11 +1744,6 @@ static int samsung_dsim_parse_dt(struct sa= msung_dsim *dsi) > > > > > struct device_node *node =3D dev->of_node; > > > > > int ret; > > > > > > > > > > - ret =3D samsung_dsim_of_read_u32(node, "samsung,pll-clock-f= requency", > > > > > - &dsi->pll_clk_rate); > > > > > - if (ret < 0) > > > > > - return ret; > > > > > - > > > > > ret =3D samsung_dsim_of_read_u32(node, "samsung,burst-cloc= k-frequency", > > > > > &dsi->burst_clk_rate); > > > > > if (ret < 0) > > > > > > > > Does this break compatibility with old samsung DTs ? > > > > > > My goal here was to declutter the device tree stuff and fetch data > > > automatically if possible. What if I changed this to make them > > > optional? If they exist, we can use them, if they don't exist, we > > > could read the clock rate. Would that be acceptable? > > > > If you do not see any potential problem with ignoring the DT property > > altogether, that would be better of course, but I think you cannot do > > that with old DTs, so you should retain backward compatibility fallback= , > > yes. What do you think ? > > I'm very much in favor of this patch, but I also think we shouldn't > risk breaking Samsung devices, where we don't now 100% that the input > clock rate provided by the clock driver is correct. > > So I think the right approach is to use "samsung,pll-clock-frequency" > when present in DT and get it from the clock provider otherwise. Then > just remove the property from the DTs where we can validate that the > input clock rate is correct, i.e. all i.MX8M*. I'll update this accordingly when I do a V2 of this series. adam > > Regards, > Lucas