Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp878701rwd; Tue, 13 Jun 2023 01:23:43 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5/QJSjWSs/SjX//MOR35tZ3CNz5PM5J1LOhKAk1OpTA7dgDWFgSmA+PvGag/z9ArOI1aAg X-Received: by 2002:a05:6808:144c:b0:39c:7240:b4e4 with SMTP id x12-20020a056808144c00b0039c7240b4e4mr7693531oiv.26.1686644623507; Tue, 13 Jun 2023 01:23:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686644623; cv=none; d=google.com; s=arc-20160816; b=PYOsAjbGCCFBq7zSTAgcVEkPL9OzHjmGWat2xGUG9mJguv5RrgPGi+uVfqaZ/OQKsr q9iM5FiX5tLEBDv4eK99Wq/adCfJcsobwft+gV0fmj3Sicj/xgsEmceOVIq1LSvru/sy 56U7MffsL+01toqlnWOtg/d//b6iBE/pGccoxv0PWxMzczX/zhfw5OuookX8GbiFJcCb rvzB5CX+ZsBgo9J+x7DLw3fC9wCReXHpt8uoZr0yfl7k5S/Qz/hA1rxHyBM5vN5QGXZP UJj0yeAFw0T16taADJnlXeBRLbE4OyAbydN7yTW8gpbFp3lId2gZOXOjb5yYgq5hpvow 8wRQ== 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=UsJLNzamcvflvt39bJ653iKfbKKP5ytmbnffadMCPyM=; b=IeH6kKm4XjjCCEDFyN+zhAB6dBtOWtDLVo/yFztkgqT2N9ak57E1fDIc1H1ly7rrOo dwADR5OzmMaMBwFc13lczKQzDlTSzDvwrhihgzveoJH0KBICpYH5zgeRadA3P3IA7XSh MNpfvrdcwh2ZhO2US3tWek75tCECUA/cUOZP9E6E9Y4/PBD5UEukQm/FnP2GD1vX1rsV YoU3gg0Qjumhi4s851VtoKilyLnotQNp0osCZUj/LhDIEjU2+29vHz2/Rb06WCgI0Vo/ V3RLBfPKppx3sQHQB+SsM/Ml6LikdCrGMXc/R9XVZSdADeR5AWQKZZzVdKviOgRVOM7G mGhw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bgdev-pl.20221208.gappssmtp.com header.s=20221208 header.b=NzCmxWBn; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id y7-20020aa79427000000b00662c06a0a75si5683719pfo.15.2023.06.13.01.23.31; Tue, 13 Jun 2023 01:23:43 -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=@bgdev-pl.20221208.gappssmtp.com header.s=20221208 header.b=NzCmxWBn; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233271AbjFMIAW (ORCPT + 99 others); Tue, 13 Jun 2023 04:00:22 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51158 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241173AbjFMH76 (ORCPT ); Tue, 13 Jun 2023 03:59:58 -0400 Received: from mail-vs1-xe34.google.com (mail-vs1-xe34.google.com [IPv6:2607:f8b0:4864:20::e34]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3D7363C39 for ; Tue, 13 Jun 2023 00:58:57 -0700 (PDT) Received: by mail-vs1-xe34.google.com with SMTP id ada2fe7eead31-43b4b5378ecso300642137.1 for ; Tue, 13 Jun 2023 00:58:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bgdev-pl.20221208.gappssmtp.com; s=20221208; t=1686643135; x=1689235135; 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=UsJLNzamcvflvt39bJ653iKfbKKP5ytmbnffadMCPyM=; b=NzCmxWBnfmLYJE9eX8SGkh9EhG7MM+9AO4XxEFNdYE36a5jCujth0fxlxzD/WRlvI8 wwHufGE06Z+3m94N+4rDADqMOC4ANpUJorLdPwiUD00X2QXZznGT46ZEvMM0nF5r7Hri 9GXJltOAClw2tO8tc9BIcNcAmC/T/tpq50YHo40fVChd+g0FeBMUbytkvo7nId5TBP0R 1L0PMHqcFc6yCQ9/WNDJ5GubKrmAIjPco7+TvVkVgtJNRwxw658g7/AUVJ8UH0JCOH2P tjKwFbEn3WJEakotGAE6Gq3ferV6U8Sae8+CLPLCZsmps1TPLgesfq6pbt4z12KWyPjJ ekjQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1686643135; x=1689235135; 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=UsJLNzamcvflvt39bJ653iKfbKKP5ytmbnffadMCPyM=; b=FonJDbJP+6GBuCzX/oWzCzDXZVE2mMjz7NlGqvgyePD7D3poGdmIhMNDOYXDtkNiFD 5YiLtPc0xHlHJn6qFhOD6RsLQdm9X+rICMufJDIYEOun4LYo6jK3M2gZCniSEOf6l8/1 GsP4vTtGoM6ihAxhb/TrmK+UH/CsnF9hSraDAyVwnUcjXeseB3SJo4FAwaRBG7s2voBQ +d+QpGnHN6nGFHiSxySUzgIHjGSxGpQa2QBkdwfYwkdBt4LK4N9h4nJz/SZzkqJgIoS8 PKAKer7xrqUiVczNfE2xIToVWBT9M6XAn20cn7TeNFBf5wOWLom0F8Y19ORruufd5lqU sw0Q== X-Gm-Message-State: AC+VfDxjgiIvNa7sUQeLZg8UXIWYx31/SNylZXXpfwCMEZdQMdlDE1kt X0bscYgQEuDGP2mr97ORCuqQTX3Zv4BIRmD51PObwQ== X-Received: by 2002:a67:f610:0:b0:43b:398c:b251 with SMTP id k16-20020a67f610000000b0043b398cb251mr6161345vso.5.1686643135653; Tue, 13 Jun 2023 00:58:55 -0700 (PDT) MIME-Version: 1.0 References: <20230612092355.87937-1-brgl@bgdev.pl> <20230612092355.87937-14-brgl@bgdev.pl> <20230612204042.litbbv23zdb3u5k7@halaney-x13s> In-Reply-To: <20230612204042.litbbv23zdb3u5k7@halaney-x13s> From: Bartosz Golaszewski Date: Tue, 13 Jun 2023 09:58:44 +0200 Message-ID: Subject: Re: [PATCH 13/26] net: stmmac: dwmac-qcom-ethqos: make the rgmii clock optional To: Andrew Halaney Cc: Vinod Koul , Bhupesh Sharma , Andy Gross , Bjorn Andersson , Konrad Dybcio , "David S . Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Kishon Vijay Abraham I , Giuseppe Cavallaro , Alexandre Torgue , Jose Abreu , netdev@vger.kernel.org, linux-arm-msm@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-phy@lists.infradead.org, linux-arm-kernel@lists.infradead.org, linux-stm32@st-md-mailman.stormreply.com, Bartosz Golaszewski 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,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_NONE, 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 Mon, Jun 12, 2023 at 10:40=E2=80=AFPM Andrew Halaney wrote: > > On Mon, Jun 12, 2023 at 11:23:42AM +0200, Bartosz Golaszewski wrote: > > From: Bartosz Golaszewski > > > > On sa8775p there's no RGMII clock so make it optional in the driver. > > > > Signed-off-by: Bartosz Golaszewski > > --- > > drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c | 2 +- > > 1 file changed, 1 insertion(+), 1 deletion(-) > > > > diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c b/= drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c > > index 3438b6229351..252dca400071 100644 > > --- a/drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c > > +++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c > > @@ -663,7 +663,7 @@ static int qcom_ethqos_probe(struct platform_device= *pdev) > > ethqos->rgmii_config_loopback_en =3D data->rgmii_config_loopback_= en; > > ethqos->has_emac3 =3D data->has_emac3; > > > > - ethqos->rgmii_clk =3D devm_clk_get(dev, "rgmii"); > > + ethqos->rgmii_clk =3D devm_clk_get_optional(dev, "rgmii"); > > This makes it optional for older platforms too, but as far as I know on > those platforms it is mandatory. > > This can be enforced in dt-binding checks, but should we also enforce > that in the driver still? Honestly I feel like yes, but there's probably > some precedent maintainers follow on this front that I don't know of. > While my gut feeling is that enforcing the clock list on the DT binding lever is enough, we can also do a different thing: rename the clock from rgmii_clk to link_clk or something similar and just determine the name based on the HW variant ("rgmii" or "phyaux"). Or even get the clock by its index? this way we could fold the next patch in the series into this one and simplify the code. Bart > > > if (IS_ERR(ethqos->rgmii_clk)) { > > ret =3D PTR_ERR(ethqos->rgmii_clk); > > goto out_config_dt; > > -- > > 2.39.2 > > >