From patchwork Thu Jun 27 08:49:16 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christophe Roullier X-Patchwork-Id: 13714170 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (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 34B81C2BD09 for ; Thu, 27 Jun 2024 10:42:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Type: Content-Transfer-Encoding:MIME-Version:References:In-Reply-To:Message-ID:Date :Subject:CC:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=kfYZ2gkK9VCqIVUh4OLEdbTiAXaU0YJT9q5BaZZNaJY=; b=Qa/yJ6+l+qX3IUJh6hbeMdUiFg oP9ujYoZ+8R+Scdzb70/t+4k7W7sUuyROGBZ7XLLBOdJkiyIHIC6A0qboDE/IXJi0IG4zOUwCqpY2 YgGYs+6YrOWSkM4ePTuuuTMPJkoDJ4H6akzl5ZVAs4RhXAgGthY/8VzKejuchFxaQZXTK3GST3vSp LaipkQ6Kv6kHuiUCrATg2FifaDoDkfvdEQHOZFGNVfI08updTJ+MlIdOBVWJgrpNw493b6TNKoPjH Kt2UfEP5gswYSfCrgJCvEUISbkuBWaaahGf5kSNVn/CevV8QS2hilLCoqDSvrhQ1w2Ipmk9GqeDNL Gy2+js8w==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sMmaC-0000000A15R-0Ecm; Thu, 27 Jun 2024 10:42:28 +0000 Received: from desiato.infradead.org ([2001:8b0:10b:1:d65d:64ff:fe57:4e05]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sMmZo-0000000A11F-2Hsv for linux-arm-kernel@bombadil.infradead.org; Thu, 27 Jun 2024 10:42:07 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=desiato.20200630; h=Content-Type:Content-Transfer-Encoding :MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:CC:To:From: Sender:Reply-To:Content-ID:Content-Description; bh=kfYZ2gkK9VCqIVUh4OLEdbTiAXaU0YJT9q5BaZZNaJY=; b=EcYgRGtKFvei6dT8hN5MeYEPo0 IgcEMHJGVJMAKcNB4bwbR43d/ahUg2B+yOZY2puugOAOUP4MpwBzS6Jv/BDEXxEo1cS3wcMvbG0qi xiTxkKlUZIN4pH0PK2vWKWeH9FkVMRduRk0PqDehUA8PWcnS43dcOXggn6ceeetdv6d8Mzdbef5Bp b3TC1K80hV2h5THu8IU6KZoI1Xlk8wMSfHSSA1fZUOoEMN8LRa7hgTlJfRn1Kw5hEEtYDkAKsrVtv S5w0fyHQTJRvvmZ+3CcEFcnbcTSfG2wEPbIEI1/VOVVB76QLw3JilNw8QUHXKjHmUbVxvhcZ5Ph3S 8RnOqhZA==; Received: from mx08-00178001.pphosted.com ([91.207.212.93]) by desiato.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sMkrL-00000008lLg-3O94 for linux-arm-kernel@lists.infradead.org; Thu, 27 Jun 2024 08:52:28 +0000 Received: from pps.filterd (m0369457.ppops.net [127.0.0.1]) by mx07-00178001.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 45R7ohBg009985; Thu, 27 Jun 2024 10:50:55 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=foss.st.com; h= cc:content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s=selector1; bh= kfYZ2gkK9VCqIVUh4OLEdbTiAXaU0YJT9q5BaZZNaJY=; b=onYVcOHekXslD15N +o4fkLSStepfc0dMbHrF5dgYaWpEN4nXMxRzBMrMK7Nbt8jkg5YffCbD0TzYuQk+ Sl65HboCSrVL9BE9LrEDZ74Bfk3KYiZf8ZLUaAs9SNHAylLaBwNQGhJnLG0Fy1fA Z1OKmAI9ZxtECTT/2IDjH61q8NE5vlMKXi6gfgdMa5F2cmy9E8vSShLssd0e30sE RudZ9xnzxzPuT5U022sKuWGwk2OeH+Z/2B2ZuuSzH0SOpoKFNg5w22tc2eQEHKsT L/h3w82QzypTIJO97SqQ2w/1wpNk0cSxjbkmUN0yV+SxVjniLlwMItAh7G2vpikg LCUuFw== Received: from beta.dmz-ap.st.com (beta.dmz-ap.st.com [138.198.100.35]) by mx07-00178001.pphosted.com (PPS) with ESMTPS id 3yx9jjhynh-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 27 Jun 2024 10:50:55 +0200 (MEST) Received: from euls16034.sgp.st.com (euls16034.sgp.st.com [10.75.44.20]) by beta.dmz-ap.st.com (STMicroelectronics) with ESMTP id 0FE9540055; Thu, 27 Jun 2024 10:50:41 +0200 (CEST) Received: from Webmail-eu.st.com (shfdag1node2.st.com [10.75.129.70]) by euls16034.sgp.st.com (STMicroelectronics) with ESMTP id 30E022138EF; Thu, 27 Jun 2024 10:49:27 +0200 (CEST) Received: from localhost (10.48.86.164) by SHFDAG1NODE2.st.com (10.75.129.70) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.35; Thu, 27 Jun 2024 10:49:26 +0200 From: Christophe Roullier To: "David S . Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Maxime Coquelin , Alexandre Torgue , Richard Cochran , Jose Abreu , Liam Girdwood , Mark Brown , Christophe Roullier , Marek Vasut CC: , , , , Subject: [net-next,PATCH 1/2] net: stmmac: dwmac-stm32: Add test to verify if ETHCK is used before checking clk rate Date: Thu, 27 Jun 2024 10:49:16 +0200 Message-ID: <20240627084917.327592-2-christophe.roullier@foss.st.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20240627084917.327592-1-christophe.roullier@foss.st.com> References: <20240627084917.327592-1-christophe.roullier@foss.st.com> MIME-Version: 1.0 X-Originating-IP: [10.48.86.164] X-ClientProxiedBy: EQNCAS1NODE3.st.com (10.75.129.80) To SHFDAG1NODE2.st.com (10.75.129.70) X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1039,Hydra:6.0.680,FMLib:17.12.28.16 definitions=2024-06-27_04,2024-06-25_01,2024-05-17_01 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240627_095211_487248_CF98597A X-CRM114-Status: GOOD ( 12.63 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org When we want to use clock from RCC to clock Ethernet PHY (with ETHCK) we need to check if value of clock rate is authorized but we must add test before to check if ETHCK is used. Fixes: 582ac134963e ("net: stmmac: dwmac-stm32: Separate out external clock rate validation") Signed-off-by: Christophe Roullier Reviewed-by: Marek Vasut --- drivers/net/ethernet/stmicro/stmmac/dwmac-stm32.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-stm32.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-stm32.c index b2db0e26c4e4..8b85265ca6cf 100644 --- a/drivers/net/ethernet/stmicro/stmmac/dwmac-stm32.c +++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-stm32.c @@ -195,6 +195,9 @@ static int stm32mp1_validate_ethck_rate(struct plat_stmmacenet_data *plat_dat) struct stm32_dwmac *dwmac = plat_dat->bsp_priv; const u32 clk_rate = clk_get_rate(dwmac->clk_eth_ck); + if (!dwmac->enable_eth_ck) + return 0; + switch (plat_dat->mac_interface) { case PHY_INTERFACE_MODE_MII: case PHY_INTERFACE_MODE_GMII: From patchwork Thu Jun 27 08:49:17 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christophe Roullier X-Patchwork-Id: 13714149 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (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 86EBCC2BD09 for ; Thu, 27 Jun 2024 10:35:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Type: Content-Transfer-Encoding:MIME-Version:References:In-Reply-To:Message-ID:Date :Subject:CC:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=lTOpN87EXBOPrm4lUPfEQRrOiTJrMQBvfm4Jw+7hbeo=; b=FEpBHjuBD9KNxEfla0lkyJ0tMW IC17tv5PAJ+aIPZeqp2DHBoCLyOe2fCRPBFlXgtGjj0D15XPLEJr5f2hFbuV59Gr0i7IKXMpGzsNC BHveCKIJNadtipBcQ4LmZx6zp7Shttb7nv7DqS0QPcveDXrHOVIVSwtRwMY64VZ6QJFEvC+I55NJg rU+5u/zPRy4k9ss33kUvDGEQJTZdRrNBBr5DqzYO44k1+/gcQQ0rXtrRykEU1OAefQqmmFkt1RC6b snhzhD6Elo6iz+xb1wovuGMa62gw1kT3f9QK44stDW9H9HlFFl7MaXVnlA3LF3oIuDq5BErcKUkTD 5c00BOKg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sMmTM-00000009yO4-2oqy; Thu, 27 Jun 2024 10:35:24 +0000 Received: from desiato.infradead.org ([2001:8b0:10b:1:d65d:64ff:fe57:4e05]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sMmRt-00000009xiU-1Fd3 for linux-arm-kernel@bombadil.infradead.org; Thu, 27 Jun 2024 10:33:53 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=desiato.20200630; h=Content-Type:Content-Transfer-Encoding :MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:CC:To:From: Sender:Reply-To:Content-ID:Content-Description; bh=lTOpN87EXBOPrm4lUPfEQRrOiTJrMQBvfm4Jw+7hbeo=; b=K+vgy/Wv9io2yCVK+gwKp5QrDE 8Io4qYlf6jwYla2o6KgcJXUZfXmWkJpahCApVTQTYdjfVlmDyKNFcBoqZVWoOM5+3IrKKtatcylGr 86W4SEGV4ZnRZxAEUjwo9tV9NMbvsXmZ6IapKsh9J/z+KxobuGyGPr8QZCSVwJg5Tl+oImgomLbhD oPalCceuTB22nncaLZQ7X+ZcP59DjFx39vuSGsjp+k44gPKGGJCNeRZHYpU2xybCenDTMlTL6YnoB 9XGODZoKwoTCWvy9F24aL1LhTeNg6TrmFtmIhHmPRHeBnL4/28mGFH1J7LwNbIouFjbk0kylf6c/N d+KajoYg==; Received: from mx07-00178001.pphosted.com ([185.132.182.106]) by desiato.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sMkqn-00000008lLC-48LK for linux-arm-kernel@lists.infradead.org; Thu, 27 Jun 2024 08:52:03 +0000 Received: from pps.filterd (m0369458.ppops.net [127.0.0.1]) by mx07-00178001.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 45R7QdSC008977; Thu, 27 Jun 2024 10:50:50 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=foss.st.com; h= cc:content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s=selector1; bh= lTOpN87EXBOPrm4lUPfEQRrOiTJrMQBvfm4Jw+7hbeo=; b=H8sDeZYlIV9GVw28 BfhA7y+fFFNdyaVxphpgNYFj7XXTgKJ4be86ZtGaFfbveV9pD5TglLkMsHL7Sno3 EZ6Kr4wJvUXTFWu2VxHHj3Q3bxJwHFs6B4RP4uKgLQI5+8QfQECnCuXMniecdTD+ DM7EC44FwTeFj+1jRUcWcOS48knpXElOwVkuxvs1AR3sqv0pvft0atemMdynwy+z FSF0dwSMmIhMhWmXt92/7APQfSXnj9feBIfrXKfBpRdvzCG1yoySpyj0T8GczT2b DSxCOjQ5HNmaRVjOazJsMeJsGtgmfl02vzgD0yq+XpyuzLR96J/9eiCyHmADHMPL Ufi2FA== Received: from beta.dmz-ap.st.com (beta.dmz-ap.st.com [138.198.100.35]) by mx07-00178001.pphosted.com (PPS) with ESMTPS id 3yx860tbfk-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 27 Jun 2024 10:50:50 +0200 (MEST) Received: from euls16034.sgp.st.com (euls16034.sgp.st.com [10.75.44.20]) by beta.dmz-ap.st.com (STMicroelectronics) with ESMTP id AE75740053; Thu, 27 Jun 2024 10:50:40 +0200 (CEST) Received: from Webmail-eu.st.com (shfdag1node2.st.com [10.75.129.70]) by euls16034.sgp.st.com (STMicroelectronics) with ESMTP id 56D702138F1; Thu, 27 Jun 2024 10:49:27 +0200 (CEST) Received: from localhost (10.48.86.164) by SHFDAG1NODE2.st.com (10.75.129.70) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.35; Thu, 27 Jun 2024 10:49:27 +0200 From: Christophe Roullier To: "David S . Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Maxime Coquelin , Alexandre Torgue , Richard Cochran , Jose Abreu , Liam Girdwood , Mark Brown , Christophe Roullier , Marek Vasut CC: , , , , Subject: [net-next,PATCH 2/2] net: stmmac: dwmac-stm32: update err status in case different of stm32mp13 Date: Thu, 27 Jun 2024 10:49:17 +0200 Message-ID: <20240627084917.327592-3-christophe.roullier@foss.st.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20240627084917.327592-1-christophe.roullier@foss.st.com> References: <20240627084917.327592-1-christophe.roullier@foss.st.com> MIME-Version: 1.0 X-Originating-IP: [10.48.86.164] X-ClientProxiedBy: EQNCAS1NODE3.st.com (10.75.129.80) To SHFDAG1NODE2.st.com (10.75.129.70) X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1039,Hydra:6.0.680,FMLib:17.12.28.16 definitions=2024-06-27_05,2024-06-25_01,2024-05-17_01 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240627_095139_671538_9E97750F X-CRM114-Status: GOOD ( 13.04 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Second parameter of syscfg property (mask) is mandatory for MP13 but optional for all other cases so need to re init err to 0 for this case to avoid parse issue. Fixes: 50bbc0393114 ("net: stmmac: dwmac-stm32: add management of stm32mp13 for stm32") Signed-off-by: Christophe Roullier Reviewed-by: Marek Vasut --- drivers/net/ethernet/stmicro/stmmac/dwmac-stm32.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-stm32.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-stm32.c index 8b85265ca6cf..d060d1d8bfc6 100644 --- a/drivers/net/ethernet/stmicro/stmmac/dwmac-stm32.c +++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-stm32.c @@ -371,10 +371,12 @@ static int stm32_dwmac_parse_data(struct stm32_dwmac *dwmac, dwmac->mode_mask = SYSCFG_MP1_ETH_MASK; err = of_property_read_u32_index(np, "st,syscon", 2, &dwmac->mode_mask); if (err) { - if (dwmac->ops->is_mp13) + if (dwmac->ops->is_mp13) { dev_err(dev, "Sysconfig register mask must be set (%d)\n", err); - else + } else { dev_dbg(dev, "Warning sysconfig register mask not set\n"); + err = 0; + } } return err;