From patchwork Wed Oct 16 03:18:29 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ley Foon Tan X-Patchwork-Id: 13837636 X-Patchwork-Delegate: kuba@kernel.org Received: from CHN02-SH0-obe.outbound.protection.partner.outlook.cn (mail-sh0chn02on2126.outbound.protection.partner.outlook.cn [139.219.146.126]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 8565017C9E8; Wed, 16 Oct 2024 03:18:55 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=139.219.146.126 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729048738; cv=fail; b=UXgyPyh9FQ1jKoA8JZLIE4gtMVPauMGJL/E0PtZ4PA6sak+kNtpccnL/Id5g/8ziY/hQwh2wF1e0fKVgRWftn+Vuls5CR7bv7t8Axe2Q4gUuUxN3SGdT2GqaJzU+WM5t8JfNonpc47AMQwk7CGr5u9w4eMTiOC3BcXcnL7jxK9I= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729048738; c=relaxed/simple; bh=5/eQkq1wqu2C/1CuF2zkx3pNQVk6A2SmTaf0uJ+MFsA=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: Content-Type:MIME-Version; b=uoyobKhax5wS+Splwfhw+pjfSZR7RZqAAeX50oHw0lD7A6qVhIpp3O2R2zY9VVMg8XGs+0S5p6E4d5pqXZuXcycJYKpmaNDk5oT1g2MWrMfDI6qPOBa0IrNtsdCwbNdxKivwc+jyS14uJjWgdCKqJIJ83nsdSD5w7l9bdPb1ou4= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=starfivetech.com; spf=pass smtp.mailfrom=starfivetech.com; arc=fail smtp.client-ip=139.219.146.126 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=starfivetech.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=starfivetech.com ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=DT9pOpDCjNpt8kJNmOXoV8AjuzxkyP1ysOGlQx27ieNamQQts85DDrybputzYMxA1MElQqO9XYgt/pS0icQqdr0pgkwJEpC9YKIowCDYwkL/eoNXP1o9zk8IwQddIHPnWg8LH25vdUUsP7/kSWTt8WD0F4Z71U64DKZ2sUv7hhZxsseec4h/liJVy/1vzzxwnKGZn5ZzjOrHT9wbxfSm4wEPgd/OLRsJmyFD8//DA2OA85xzI4Pfm3MDMXwA7hWQD4K8+VVEIOeOGf0XuIyMs1LY6v/vmqqfTwUGuUyRHJCmqAAJGg+ViOkhCUVgDBVJgpX437zeC10nwX5E0yIfAQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=WahXJcbGM8ulZVxAjtg3xSlDTBK4O7kf1zmBe6FFoAw=; b=nJqoAQWkAE2Oy83zCSTNnlUqJqeeRuCRocbTz0CFHS9fAkeoVtnxfqHNZt/4Zu2fHz1cvdbdxUizCyWDGnK76VQdRoZufPxlyk57YYoba9IINotk9D9T1Co6830S5zjQZHJ3WOvj0Z5Hyss4aN9+6z5QiM0t7kJyuGeJv9RC2khaPw3zj3+I40un+ZAR0lNUsxHAfty4R/RKsgA4Mqc0Gyuy4UKunPmnIu4bpL77vF3HDgvaUqwdcgcLq3qfDO2og6xpcbuqFoewpJ7kZ7cjuTZvD/Qie+vExlXJPPyir96ojyRAceg1hMMHS4GcMjb67WIRGrpK4vblobqVoJ397A== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=starfivetech.com; dmarc=pass action=none header.from=starfivetech.com; dkim=pass header.d=starfivetech.com; arc=none Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=starfivetech.com; Received: from ZQZPR01MB0979.CHNPR01.prod.partner.outlook.cn (2406:e500:c550:f::12) by ZQZPR01MB0961.CHNPR01.prod.partner.outlook.cn (2406:e500:c550:9::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8048.21; Wed, 16 Oct 2024 03:18:54 +0000 Received: from ZQZPR01MB0979.CHNPR01.prod.partner.outlook.cn ([fe80::617c:34a2:c5bf:8095]) by ZQZPR01MB0979.CHNPR01.prod.partner.outlook.cn ([fe80::617c:34a2:c5bf:8095%4]) with mapi id 15.20.8048.013; Wed, 16 Oct 2024 03:18:54 +0000 From: Ley Foon Tan To: Alexandre Torgue , Jose Abreu Cc: "David S . Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , netdev@vger.kernel.org, linux-kernel@vger.kernel.org, lftan.linux@gmai.com Subject: [PATCH net v2 1/4] net: stmmac: dwmac4: Fix MTL_OP_MODE_RTC mask and shift macros Date: Wed, 16 Oct 2024 11:18:29 +0800 Message-ID: <20241016031832.3701260-2-leyfoon.tan@starfivetech.com> X-Mailer: git-send-email 2.46.0 In-Reply-To: <20241016031832.3701260-1-leyfoon.tan@starfivetech.com> References: <20241016031832.3701260-1-leyfoon.tan@starfivetech.com> X-ClientProxiedBy: BJXPR01CA0053.CHNPR01.prod.partner.outlook.cn (2406:e500:c211:12::20) To ZQZPR01MB0979.CHNPR01.prod.partner.outlook.cn (2406:e500:c550:f::12) Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: ZQZPR01MB0979:EE_|ZQZPR01MB0961:EE_ X-MS-Office365-Filtering-Correlation-Id: 13855ebe-503f-449b-46f0-08dced9143f1 X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0;ARA:13230040|1800799024|366016|52116014|41320700013|38350700014; X-Microsoft-Antispam-Message-Info: bbAwPSCCMvkurmwJZrx1rB/epi87OWLOydommTqXVNR0fWECIJo7JAc6+KZzrDjYOs3ohjp3xizOfvD3gAJGnioZb5FrGqWhnF1n9mLFqjqxD7W+0XNFWebuMTtMlzQjECs4m++7zc+BtwzkeNIJKAYwPUuJ83w3wVQMYbWVr6NFLcCkVK1Q/q1MLwMZHRrqJsi0LAMhNaYDgvrO1uecXHGGekUz2izoXO3jNL28lVjE/PhFXGhGPfRaFvgPa0CTzcidc5B21w7N1w8F4ZrI4fIzA5T9UFqW9zSMcq9rgflVherEb6oGRAHnCCCwN5R/Ft+RAF6GK0GMKitZZ+ZTgFXd58+fvgqoXp8ycPBiQEJ7QZOrROiv7YPlK1CUGOIA1bAaEyc34DzPu3Dzt2GDHQ5TSHlUnd9JkM3wftHypx2J5sOlD0A9ErMK3UB5g6HM3gm+G7ZBdphLSF2j3lqlOCu9m0veBxP1JSdYnD5hObWyH/Eux+yPaz6M81HhV8sAGjqV06lC7c8Z61XrQOzdQu3AwOujNfgOBDsske+pRSu9ucjjDlj3dgsEPCh2lyMqWbkSXfufUI1SLlGfxhwD7aT9lcg//LZLXa7OJpu4KU3wwVjhf0BsLtfoDoNJgC5s X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:ZQZPR01MB0979.CHNPR01.prod.partner.outlook.cn;PTR:;CAT:NONE;SFS:(13230040)(1800799024)(366016)(52116014)(41320700013)(38350700014);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: qgblyZiSRFryvGOF2Swgpx6kuI9hLDtX4W9LKrzdjJgRtBAdalveX4sBLIbGBN4wEx9lvjszxHjO/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d+iFBm6VHXzpgpMVZoijIkBAuLcsBDY5mBhGVVllQvweRekvon8Zq2Fj9nAz6WsHtehfVN2hCxT/YGFRxz/VwY3Ij0ue1t52R8zBx4gpaTXyR3FGyyH43rFMRJv7HTiN6CeVeuswO6Nr9cvn+usxAaryfrQaR/HletqznqsxLkakb2XsJK8/QYjTzZyoZX2pfB93A+Ptqv+gYskxZ53vF8sfCRfK9DK5fD8nc1E6wf1T49Bc7hcxRhMZcdcHyYF3A4BbfBGYEx9AP2EUv1c4BBdG6sPhsUNuaUS2izfj1SFg1h73GlETY0O1e+le77HFbkH6qCSRL1dSqe6eP8hukywrCN5/QPeMh2rtl4a27pbIe0beENtGut5FK4W/Wkabkmlf8+GKuF4mbU+DMr+UJXVxVk1637FGBTf9kyjIXnDikhWgAzjGRJvWUgCbw+Sle6GpSFLeAXJGqu8oq0bRg== X-OriginatorOrg: starfivetech.com X-MS-Exchange-CrossTenant-Network-Message-Id: 13855ebe-503f-449b-46f0-08dced9143f1 X-MS-Exchange-CrossTenant-AuthSource: ZQZPR01MB0979.CHNPR01.prod.partner.outlook.cn X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 16 Oct 2024 03:18:54.7565 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 06fe3fa3-1221-43d3-861b-5a4ee687a85c X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: 2zXi/XzoGKBCZfIV+HnDElNrgOnOfQP/U+jhUbOqh7Rp4mRksBdOzCCkApIXhPQ/MmJ7YUOVxzcl/c6tg5GrJsGbGITSCl09HdFIORO/pU4= X-MS-Exchange-Transport-CrossTenantHeadersStamped: ZQZPR01MB0961 X-Patchwork-Delegate: kuba@kernel.org RTC fields are located in bits [1:0]. Correct the _MASK and _SHIFT macros to use the appropriate mask and shift. Fixes: 35f74c0c5dce ("stmmac: add GMAC4 DMA/CORE Header File") Signed-off-by: Ley Foon Tan --- drivers/net/ethernet/stmicro/stmmac/dwmac4.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac4.h b/drivers/net/ethernet/stmicro/stmmac/dwmac4.h index 93a78fd0737b..acbe5a027c85 100644 --- a/drivers/net/ethernet/stmicro/stmmac/dwmac4.h +++ b/drivers/net/ethernet/stmicro/stmmac/dwmac4.h @@ -389,8 +389,8 @@ static inline u32 mtl_chanx_base_addr(const struct dwmac4_addrs *addrs, #define MTL_OP_MODE_EHFC BIT(7) -#define MTL_OP_MODE_RTC_MASK 0x18 -#define MTL_OP_MODE_RTC_SHIFT 3 +#define MTL_OP_MODE_RTC_MASK GENMASK(1, 0) +#define MTL_OP_MODE_RTC_SHIFT 0 #define MTL_OP_MODE_RTC_32 (1 << MTL_OP_MODE_RTC_SHIFT) #define MTL_OP_MODE_RTC_64 0 From patchwork Wed Oct 16 03:18:30 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ley Foon Tan X-Patchwork-Id: 13837637 X-Patchwork-Delegate: kuba@kernel.org Received: from CHN02-SH0-obe.outbound.protection.partner.outlook.cn (mail-sh0chn02on2126.outbound.protection.partner.outlook.cn [139.219.146.126]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 1C7D818756A; Wed, 16 Oct 2024 03:18:59 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=139.219.146.126 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729048741; cv=fail; b=B/APHm9d3hxJ3ivRJDq7Z0Y42ltIylzqJXc+pkgN1kOs3DvMZojDByHkHrvqLRjK2slV4vjiqlDNGOQ70h+yVAYVQrT80Qm3Ilfg8X75+Bu32eE80yyd8ObM1lyQ4be6phiRmv8hT4fp8gYVmZ/5E7z7uRhQPsNt6t8Wkeyx8oo= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729048741; c=relaxed/simple; bh=HW8KSwXWeO/6JE4pbs1n16h4fsVPU8jQQFlgxBrKAI0=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: Content-Type:MIME-Version; b=IIqX+f2SKOEui5hZGDFTYmnFFgPTG1ltjQ2QO+J2h/26muQzLn4tThQserE2vcmUcqWqg7yCJTPk2CRgB8EaEta3e2s7nK0AaFZkiLCEv1iWkoPYd0lnIviRzteLuZ3/xcEZcOBPruDuTyV8+nhK7qDCWxril8QNkxejfpqLwv0= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=starfivetech.com; spf=pass smtp.mailfrom=starfivetech.com; arc=fail smtp.client-ip=139.219.146.126 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=starfivetech.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=starfivetech.com ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=U32De4qvwgVrbFAvEXm3lVD3JjO4SbLlKTbdnYh6gZ0IKsCQ/ZStb8Zqtrvw2pTTZgBstourqgon/5VeXZ7wZCf3poyaQDC7zFIgq654KT7U/8OXPy/gw1lT213LADrIw+CCCWitA4fTagAWFJsuvxc9eSVLH+DKDp7Lxei6ABqO+syhJ4Fcyrslq+Z2qod/bTHiH3PXZir4qjRX6+NNsmnUo6nzoDo9M1TDuiqRtwrhYC0eDMubDQ8cQPnyYCcC5oS8yKvMuBEHhn57Yad0ADRM+LoifMaeQC9eTFDeKnOHJsPansn24j/k2dZDs3IYWkLdvvM7236ciUd8XzrWHw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=ImfW7z7XD5azVTc+abegwuNShrnp0d2Wh4zrw+IKVkY=; b=L7CxUQ+rVV1NTLSMET62sqLnajtDTg2qjzYhtLtEwDB86RPI/2pXspo1JwbmzUyi9fIbRG5Uw4c1oJLHUanCmRxFj17ugNKF382LhztmgRPnDKCYGd7uReFgWJRGcgaHCcSKX3U8OA/L5oAKiod521ppur1SbtMNv0YRcb/coWbe0JoYxzRe9CBI8kY8Qo/FuTMoBJJgSYC/quXXV3nttaLOV9rE1BXqBjCfA2H0mYNJ2S7AzwvX4X1biuDWqJdeN9iqdRobV42xivC5OfjvyvMeSyb8pmFzsQx31O8F2+N4cZKDZw170fmUhlu/SXzofw5g4D+N5XRkub5ulKkeDA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=starfivetech.com; dmarc=pass action=none header.from=starfivetech.com; dkim=pass header.d=starfivetech.com; arc=none Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=starfivetech.com; Received: from ZQZPR01MB0979.CHNPR01.prod.partner.outlook.cn (2406:e500:c550:f::12) by ZQZPR01MB0961.CHNPR01.prod.partner.outlook.cn (2406:e500:c550:9::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8048.21; Wed, 16 Oct 2024 03:18:56 +0000 Received: from ZQZPR01MB0979.CHNPR01.prod.partner.outlook.cn ([fe80::617c:34a2:c5bf:8095]) by ZQZPR01MB0979.CHNPR01.prod.partner.outlook.cn ([fe80::617c:34a2:c5bf:8095%4]) with mapi id 15.20.8048.013; Wed, 16 Oct 2024 03:18:56 +0000 From: Ley Foon Tan To: Alexandre Torgue , Jose Abreu Cc: "David S . Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , netdev@vger.kernel.org, linux-kernel@vger.kernel.org, lftan.linux@gmai.com Subject: [PATCH net v2 2/4] net: stmmac: dwmac4: Fix the MTL_OP_MODE_*_MASK operation Date: Wed, 16 Oct 2024 11:18:30 +0800 Message-ID: <20241016031832.3701260-3-leyfoon.tan@starfivetech.com> X-Mailer: git-send-email 2.46.0 In-Reply-To: <20241016031832.3701260-1-leyfoon.tan@starfivetech.com> References: <20241016031832.3701260-1-leyfoon.tan@starfivetech.com> X-ClientProxiedBy: BJXPR01CA0053.CHNPR01.prod.partner.outlook.cn (2406:e500:c211:12::20) To ZQZPR01MB0979.CHNPR01.prod.partner.outlook.cn (2406:e500:c550:f::12) Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: ZQZPR01MB0979:EE_|ZQZPR01MB0961:EE_ X-MS-Office365-Filtering-Correlation-Id: 4d035553-893d-46a7-e82d-08dced9144f4 X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0;ARA:13230040|1800799024|366016|52116014|41320700013|38350700014; X-Microsoft-Antispam-Message-Info: 1G+3ud2Qgtavm3jbMBsCiFGbJjQ266LJXfBNJ/C0DAtM9N5/FcM2VkUg2+9omBabaAp8/Ptn3QWxcqSlM6/l3wNUsXdlLPh8YJZw24hSOYemb47AEpy9kvAqj08OhPpu603godXUdeYab4PqmEbM204cSpRqtm9C6jSxoAtIkeApZRwUWq+lWkM+Bj3JLp0Mo+r/giCnp/zRZboapwYl32XGrKLCBeg6ZCLHCyEMRg5YM9nNLGBvOR+YRypyiD2W2U4KrLfufop/YLFa/wfRgwDMkHakuOlcW9bC28AddHzsHSccYwbhL92CJDfZRFuoHDsS1jnkZwCCEQQQoTIxUG07tyNgTVY0KJBWB3L3DEQuGAUdQe1/WAycOu+KPotU3TjCT8iggOv/uIpsJ69sNmV1q+ZXCkmZ7IhGxju/vTegigyBpb0nqEFWz12tOYP3O/5vG3LbgrkfyuOuGE7mg2G+8Etwnd86HJ99LeeUWdpXm3iRnuwEWyF/VxKAOBJiYgAqzi8ArGblf7/zlu9m7Zy9umRZNDxom2naL+83lVznASmIpQDoU9Rk5c4CVYQHMhBZc/4rdaE1gIfIoSlAC9AjLEClhq8JG6Yw6dtdrCUm1O2fA67pm/fjWqj0ZK/+ X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:ZQZPR01MB0979.CHNPR01.prod.partner.outlook.cn;PTR:;CAT:NONE;SFS:(13230040)(1800799024)(366016)(52116014)(41320700013)(38350700014);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: 7prceT+XCoiOQXdq/9mdtQ0S3prAUnPeFA22ztDDTEkrzC7YBnRQNqBrEFEKNGOtGeGwzlj+ZZrQCe7hNTKvSCSe2TBLdqIEuFL1gKJtTYL+e5WtKdcqSVD07qtmETuXlTO3UDV1bglqGh2rW66b9r2T714FnQWBT7hVzuMDAZxMdwniya5K+fFtkzPa/qxSmbsR4f3LxObPG0Nc7dytg9MiQGbjHtc6W24x+LLgPEgVHYb+w5i9nyZZmugX3VsjMD9qEE3a7IAXAgvZJ5+KghTZvVML6r+ukEw7ws0B1NSFK/ucRWYzwGoeBhkH6GiihzArYGhXPCiWH4RO73MasrilsOS+ySV3SU0jb5ismvTTaZ2LnoPSksLKF84G0Q/iZyIEeMP+2ZyAo/LvQZrmSqWJy1KXfp3LYOPUx2RBzeo9vEefhQWnBFw+jmVzxU62J+E5X5eGkBOgNemAAYrUDsfGcFg9LBiP6255ARbdCPhwtENwvkszcjD4/GKI6+swed5hSTT8o+g0VAaTqEjQn2T6+K0lK+uSiLdrpgiqPKC5VURVa+PGpmfFYfN8bZJlaN/ipj1n60MIQw0u+mTUGjBba9oM5J/YCHsOzMFkZueN70WTlnE0HISZ8NeytUW9lq5N8PqYamaJYMBd9djNR2okI8MFRiGCj1RGr5fQGf08IFyXXIaFc27gBuIOUqOPq0PSxsssQ9FAMPqQ/MfF9RIGv4laQ7jQZznqHMM9nviklF1hmYqblAJmM57ZQ9Z/HZViJUwfPl79OqIPUc6Px/e90vAmWW4sanwEyapGk7udfh8YouuiVE9k3bckErh07/pT48yUaoRDSDSFWfcwI361SFGPzK6hpBO2qtAXxustJotrX2lgzhyobY2aWclhTN6qAnsFESh16jrwRYndF7KKEsZvONBRZ7ACDGSu8ZPUb9vKf488EdSiG7lJQKmlo51k5HtSbYGTqwiVMmVBVf9mgPqiGKdx1uGTsV/LCdto7aKrtgTBxOLLd9gkpVMrOGaOAnsiq2IBW+Z0k5G6zezjJpxAboum89woNrLUaS8cJ8A5vpf5/QMU1YdDgEarFS+/FZG0qTDXeeR5eJW+OT3y75Qbq7zLdPas+30zGHQgRl2x18P1ejWgR750owO1WqPM521NXysAHMztPgSL+zwLnSaaKE0A580Ymg5IvFYhYqK6LOQauzGtFQ7WXeVIZz/rkigu91IJYVE27OMxtA7mTKGpnIqwHfl+cXPMfGFeuGw70uS7U7rGXVnQ9eGVKj9WOByRKmOGak1Wt+prcJsRlJOBNQSuHDn72MwFOa8qFVHTrsWTNr83+xHeKXxhOKeP7AMzVdbyS20hMuasxRCd+Su0oAhgGXwQi5vb140uY4jn0t6XGdjyGpSUMwzNySQF9H15LvRLfOhIjYGjI6GmDEQveDgYVMnYI3kPI0HrDvnPMh4iM/EJAGZL4NOrhizzEDMu1ayKlEoYhwIdnkNR0TU+LzO47sPjlpI8vu1zVpIJ7zaLKZrc05MQIsIoIOFARhqizRTVqto7Z19IXN7Z7mk3sIaHOTSFMOeer1WmAS39ntGV421XYA9RTlaxRLPNwnW5JkbBli6xYHl71Q== X-OriginatorOrg: starfivetech.com X-MS-Exchange-CrossTenant-Network-Message-Id: 4d035553-893d-46a7-e82d-08dced9144f4 X-MS-Exchange-CrossTenant-AuthSource: ZQZPR01MB0979.CHNPR01.prod.partner.outlook.cn X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 16 Oct 2024 03:18:56.4581 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 06fe3fa3-1221-43d3-861b-5a4ee687a85c X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: lzsGHxXf/axMw70NE5NLuj/eGIn5ELChdY3GEkzpNltQzQz0qGc+XFX2V857jjvULrHkR5kpyRbNVwJQYO/YPTw+sDIwzdtO6M5Hm2rNRcI= X-MS-Exchange-Transport-CrossTenantHeadersStamped: ZQZPR01MB0961 X-Patchwork-Delegate: kuba@kernel.org In order to mask off the bits, we need to use the '~' operator to invert all the bits of _MASK and clear them. Fixes: 48863ce5940f ("stmmac: add DMA support for GMAC 4.xx") Signed-off-by: Ley Foon Tan --- drivers/net/ethernet/stmicro/stmmac/dwmac4_dma.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac4_dma.c b/drivers/net/ethernet/stmicro/stmmac/dwmac4_dma.c index e0165358c4ac..4e1b1bd98f68 100644 --- a/drivers/net/ethernet/stmicro/stmmac/dwmac4_dma.c +++ b/drivers/net/ethernet/stmicro/stmmac/dwmac4_dma.c @@ -266,7 +266,7 @@ static void dwmac4_dma_rx_chan_op_mode(struct stmmac_priv *priv, } else { pr_debug("GMAC: disable RX SF mode (threshold %d)\n", mode); mtl_rx_op &= ~MTL_OP_MODE_RSF; - mtl_rx_op &= MTL_OP_MODE_RTC_MASK; + mtl_rx_op &= ~MTL_OP_MODE_RTC_MASK; if (mode <= 32) mtl_rx_op |= MTL_OP_MODE_RTC_32; else if (mode <= 64) @@ -335,7 +335,7 @@ static void dwmac4_dma_tx_chan_op_mode(struct stmmac_priv *priv, } else { pr_debug("GMAC: disabling TX SF (threshold %d)\n", mode); mtl_tx_op &= ~MTL_OP_MODE_TSF; - mtl_tx_op &= MTL_OP_MODE_TTC_MASK; + mtl_tx_op &= ~MTL_OP_MODE_TTC_MASK; /* Set the transmit threshold */ if (mode <= 32) mtl_tx_op |= MTL_OP_MODE_TTC_32; From patchwork Wed Oct 16 03:18:31 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ley Foon Tan X-Patchwork-Id: 13837638 X-Patchwork-Delegate: kuba@kernel.org Received: from CHN02-SH0-obe.outbound.protection.partner.outlook.cn (mail-sh0chn02on2131.outbound.protection.partner.outlook.cn [139.219.146.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 7720618A6AA; Wed, 16 Oct 2024 03:19:03 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=139.219.146.131 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729048745; cv=fail; b=CaV39Ckk6gulpDYOVM9y1aXd98Ho9fbgg3v8SK9DK3TebqkGN4nHKQV3dSM0hw3/MZdo8l75eQ/pgir2B0cjiY2JyYGGeeVNMTzYanmvcR8bEjh1+g6M/OSwDfO2rshPDADlCVN1FyOjaVTbz7RE/IkwfF6Vu3uhSsuvDUnZ3gM= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729048745; c=relaxed/simple; bh=R+EeBlj86pRNtPtgXv896mqaSsSseyfHwsT8jQ5djoc=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: Content-Type:MIME-Version; b=PyE0CAeLPAKiNZvvziSuEjFNciXm6pt5lLWABmeR+b4eoBX1BX9R3P9DtqOneYUj4Cl+7Mpy32ADwsxGzOoFoh87xrSIZ5lLmz7raaNRFqG7SWNHsX2E0Ic48AcDAgozeFhzJGTxTET8qyPL3mGNvHOjihjze3fxXFwwOO45mFE= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=starfivetech.com; spf=pass smtp.mailfrom=starfivetech.com; arc=fail smtp.client-ip=139.219.146.131 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=starfivetech.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=starfivetech.com ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=BbyjTeA07B1TMFziCaQcJkhKK31rX+VxlcArzux8ocF3oVPwG9VSW6JPrnM1oZt/1vyt/PCBTqM3ZK0gLX1rY8UaDBmWecVVy65umdXjfSamRFj8uFBL4szF38N2Ogm6/82gZ50Ydu0+PxQfR4IaHVhjEcftd0FBcd8Qu+nigbHngXTUfgTEnhyprHS5NI0hB//f++Y12LALmRq3nkG43Rzw81UyNCjzDeV5qn+vZlJuOGuwbCrVX0lefzIWT8OezzLmdlogtmqDT8SvMNuoVI9ELgmM2icj9/8qfVMJCZ5P6m8tzCKXOixSTMemt2JBz0h+/UfuagalXjhIqrml4A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=/sNVfhZi9kq6WRMkg6s9bACOW5z61wVpEKgboggd3Zs=; b=JdqgtoHYGz42Xqsjkwcmms6IGeXU0qPjlN+vVqLXLNAOVQnWLOr0nfNYf7eTujhcBCVvZQ58nxmj27Fo3Jhdylry7COSmkxwllyh3NCmq+tZHBZiv64FdBqzKOdGKR0kQ9GZHYlzVztXA/2U25JqHY9n3EM7CxcgSI4WdOHI3uSO7uOt/V0dvZtfzxbdmDytoxQTO7qjIvt3x4Vh5vAM7O1npQ0MspXAulRMy5LwsabBOJ0kk/LJ4UVhfSvX4ZFouFc5lWpeM9QBpoOqaYlhyPnOk5stDcgDjyhhvd/fQmUXjb7KfVEMrTKlo+TnNjybWYNIzOpIXRgzWlflvtmOZA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=starfivetech.com; dmarc=pass action=none header.from=starfivetech.com; dkim=pass header.d=starfivetech.com; arc=none Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=starfivetech.com; Received: from ZQZPR01MB0979.CHNPR01.prod.partner.outlook.cn (2406:e500:c550:f::12) by ZQZPR01MB1060.CHNPR01.prod.partner.outlook.cn (2406:e500:c550:b::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8048.18; Wed, 16 Oct 2024 03:18:58 +0000 Received: from ZQZPR01MB0979.CHNPR01.prod.partner.outlook.cn ([fe80::617c:34a2:c5bf:8095]) by ZQZPR01MB0979.CHNPR01.prod.partner.outlook.cn ([fe80::617c:34a2:c5bf:8095%4]) with mapi id 15.20.8048.013; Wed, 16 Oct 2024 03:18:58 +0000 From: Ley Foon Tan To: Alexandre Torgue , Jose Abreu Cc: "David S . Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , netdev@vger.kernel.org, linux-kernel@vger.kernel.org, lftan.linux@gmai.com Subject: [PATCH net v2 3/4] net: stmmac: dwmac4: Receive Watchdog Timeout is not in abnormal interrupt summary Date: Wed, 16 Oct 2024 11:18:31 +0800 Message-ID: <20241016031832.3701260-4-leyfoon.tan@starfivetech.com> X-Mailer: git-send-email 2.46.0 In-Reply-To: <20241016031832.3701260-1-leyfoon.tan@starfivetech.com> References: <20241016031832.3701260-1-leyfoon.tan@starfivetech.com> X-ClientProxiedBy: BJXPR01CA0053.CHNPR01.prod.partner.outlook.cn (2406:e500:c211:12::20) To ZQZPR01MB0979.CHNPR01.prod.partner.outlook.cn (2406:e500:c550:f::12) Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: ZQZPR01MB0979:EE_|ZQZPR01MB1060:EE_ X-MS-Office365-Filtering-Correlation-Id: 0d769a77-4f75-4d71-7c49-08dced9145f6 X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0;ARA:13230040|41320700013|52116014|366016|1800799024|38350700014; X-Microsoft-Antispam-Message-Info: Vd150yzDPrWggLTrlSnR33krlsU8WH8qpS0gHtlWO4LdWVcSfo5EaKAKUH4h/T1VJOKBPvHSu2VnGskw9wRWs6ylGwOwATIZnraNvt4eiI/A0OlyNIGs66ovFCagl2NyIOiwm4bSoKHxOaZ1a46Ql+LGaxUl1Y5Xj893IUprPrpwLQ9MRgjquH2YsBwGFKpO98sY1PlhftIbOFSBUzFvw+zrZpi3Ietyx9ue+esrV/vTsLm2iRGeXsGSmYwYZLx9D9J8OSfOYrRKHtoEmgX7+iq5V0e38pAxnmfIn9O/ghMg240h16Aa/iDEbLEVeNuDuiuXDuOXgd0z5uHkyrUoZ8YZncP8SoWV3lfQD5Ase3jZSgH8y1Y/b1ygVtaa/yWB41xu4IN2wzEkdYnPhzFEZDQLvkCVqGpgc28DW9n03RSFr8PQqK0oxU+fmXHWFhSPErC1ef3KyC222GRVJAY18CGj5HtvNwXAAnGsNfVfhf+b1bQ5pl9bhF/eN7SdRazptH5E+7Xn7g+BXV7b2vmSVuv/h0ZGQJyIXRzLn/lMkpzC0Nu4Im60hB7rc0GMmtxBpbisosoZSgdb4jU/rW8pFNWdOQmIubNU9ZCVLrpA/7Sl87m3lBJz1QSsONpsVbeC X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:ZQZPR01MB0979.CHNPR01.prod.partner.outlook.cn;PTR:;CAT:NONE;SFS:(13230040)(41320700013)(52116014)(366016)(1800799024)(38350700014);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData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9rQR9JKMo6es1DrLr1csNCR8gXg2BJIA/vkXHhSZd4nKjp0UstsR3wg4Nqi1Z/ElKAv9NH5M1GJlVDws+7I36N2KlPCXHrPPKvYt80qN5pXIN0Ad+3M44A25Potfdz9nBY+so5DNult+UQ8unW7cDYX3G2ojCqWHK7pqs5j4PsdqnIu96BQWr8KhzZz/rZq7fdDiTM+kXI2mpqNjAK65ls80Adfg7Fee1vYwspsaOJObUhp427MMJQVZC0QQOnoMSCv3fODfOeAm9yAh+wFWSzGzFUqw0aH5MzfoGNPcG+A0+0T7rgwjdzl+01JW8LkzS7+ph60nUqIm9v0Sg0+emA5AzxJYL21xi0YP9hYxda2aKLJud1PKxvwoO+gnUJUWK1VhZ3nGsfojVCaNf9ClgDO5siwk+haaL84rJadQK0f16qgQ/eUSdgXnm48cQmt6+c8M6Dc1wwihKc4M/vXNUSp1p5sVaBzPcukK8j95IWowYBDTwncV/Lj+o6EscxF+S+U72CTWAjPRVq6QLTpRl9netQwkUrQi5cO3gvUkR/24KEiPbnNZD4jHWX2VBNigJ5yA== X-OriginatorOrg: starfivetech.com X-MS-Exchange-CrossTenant-Network-Message-Id: 0d769a77-4f75-4d71-7c49-08dced9145f6 X-MS-Exchange-CrossTenant-AuthSource: ZQZPR01MB0979.CHNPR01.prod.partner.outlook.cn X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 16 Oct 2024 03:18:58.1444 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 06fe3fa3-1221-43d3-861b-5a4ee687a85c X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: Muw6QpaRV5Hlpr5fYj0f/1GrpJtNh/aiAf/PZK3WzoIUjcwLj/pYWfTfb4xS8ZQ5W9bOqg3rGskXb0KYreJzrAoKgiSKS6woM/lxYPkXhHo= X-MS-Exchange-Transport-CrossTenantHeadersStamped: ZQZPR01MB1060 X-Patchwork-Delegate: kuba@kernel.org The Receive Watchdog Timeout (RWT, bit[9]) is not part of Abnormal Interrupt Summary (AIS). Move the RWT handling out of the AIS condition statement. From databook, the AIS is the logical OR of the following interrupt bits: - Bit 1: Transmit Process Stopped - Bit 7: Receive Buffer Unavailable - Bit 8: Receive Process Stopped - Bit 10: Early Transmit Interrupt - Bit 12: Fatal Bus Error - Bit 13: Context Descriptor Error Fixes: 48863ce5940f ("stmmac: add DMA support for GMAC 4.xx") Signed-off-by: Ley Foon Tan --- drivers/net/ethernet/stmicro/stmmac/dwmac4_lib.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac4_lib.c b/drivers/net/ethernet/stmicro/stmmac/dwmac4_lib.c index 0d185e54eb7e..57c03d491774 100644 --- a/drivers/net/ethernet/stmicro/stmmac/dwmac4_lib.c +++ b/drivers/net/ethernet/stmicro/stmmac/dwmac4_lib.c @@ -185,8 +185,6 @@ int dwmac4_dma_interrupt(struct stmmac_priv *priv, void __iomem *ioaddr, x->rx_buf_unav_irq++; if (unlikely(intr_status & DMA_CHAN_STATUS_RPS)) x->rx_process_stopped_irq++; - if (unlikely(intr_status & DMA_CHAN_STATUS_RWT)) - x->rx_watchdog_irq++; if (unlikely(intr_status & DMA_CHAN_STATUS_ETI)) x->tx_early_irq++; if (unlikely(intr_status & DMA_CHAN_STATUS_TPS)) { @@ -198,6 +196,10 @@ int dwmac4_dma_interrupt(struct stmmac_priv *priv, void __iomem *ioaddr, ret = tx_hard_error; } } + + if (unlikely(intr_status & DMA_CHAN_STATUS_RWT)) + x->rx_watchdog_irq++; + /* TX/RX NORMAL interrupts */ if (likely(intr_status & DMA_CHAN_STATUS_RI)) { u64_stats_update_begin(&stats->syncp); From patchwork Wed Oct 16 03:18:32 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ley Foon Tan X-Patchwork-Id: 13837639 X-Patchwork-Delegate: kuba@kernel.org Received: from CHN02-SH0-obe.outbound.protection.partner.outlook.cn (mail-sh0chn02on2131.outbound.protection.partner.outlook.cn [139.219.146.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 6EE5D18A937; Wed, 16 Oct 2024 03:19:05 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=139.219.146.131 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729048747; cv=fail; b=hvoC6hBNk7JV6EDKMp4Z8yaBrFN9VjG9jxT/n1mNzijxXDAy4kZvq5ez6lOf8IkWZhZBAuod43qRU+f9baohuBme1Fx11X1IqgX2KGhbKNb/gZrW+G+Cf9AsQOvTLHvAIAtt8DP85a9BVPbDI9rbBiNn8lSox7h8BbEvnF8tve4= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729048747; c=relaxed/simple; bh=sobNCl3ooaqbIlw9wt+4q+9FdFry1wzPHjzFTUUDqjY=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: Content-Type:MIME-Version; b=Bnr+IMI6sN/EqqZuzNXIk4F4JuBCcQVSJSRfqqm9G/VAPc83gDeS4dLF4pgETCgBb1KS1rB1XrVgLe5BHOyy34pKjGLlHrTv8UgJkB6266QA9wdPR6dLKT6VKD845mMZcRO6DCwGzXDpbshFLP3M0qRwWZ99R3fAS6yEZbwCGLc= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=starfivetech.com; spf=pass smtp.mailfrom=starfivetech.com; arc=fail smtp.client-ip=139.219.146.131 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=starfivetech.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=starfivetech.com ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=i5QQ+lJoTpn2mdGdtgip00DxDA7PahkvepOFiOFfdvq7ZnWjtoAqBKAZVycTV2JSldlJescST7D1DVsgRR5aYg8cHCEYteny2bAreCk7jxnFowRdrkdvh6LAORpWnq1jW0N/hKLtRvqibJu9gQob7mrdUW16BHEIZxyxko8pSU5n2JWMWKGat7YN1oKE1FvO60uQ1Osd/0wve/X8yDe+m6et58F8i3OL0XDW5SwZKsSg1xOdaGbxM5FuCVdGQm9L4Ki7AAv5souuLe3awrD3XjMEFbo6Ad/9eX/Y2yUnXp33MmLkYnNwzbAPlsTBVptF+4yBnNazD4nMfAGfyrhIhw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=sDeunpIW/MhESRiJ+4Hk9C9fg8saeCUltfwpDOzTJwo=; b=YkypoE08qEugloT0inGqyOnQEs0SCl55keNA6OQkDS99pEbwU6GSSughrriXQO2bPq47QC4NSRTRA6QQyG/K9W1D1kgCTdNAuoI293aGErnVu+ncVj5CUbueeRtG82LyGB4FjrklEIagZqHsU5toJZqiphSQxafZfy2YChu8i6GpUBHgNzxsxyh/2h52jfyTIvF5pQ53XwFU3V/5SBXoVvDUox8mhAsknEn0t5/8KR3Nw0+LswWn5uO5NYK3+nSX50z3iMGI3atpDVPaTv2SS1q+MA2Re/tTB2HeBQggFmXTdq7Zx01cA4/2v8H9Z+BmZ3ptXOep1u4ANpqwTvDTaA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=starfivetech.com; dmarc=pass action=none header.from=starfivetech.com; dkim=pass header.d=starfivetech.com; arc=none Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=starfivetech.com; Received: from ZQZPR01MB0979.CHNPR01.prod.partner.outlook.cn (2406:e500:c550:f::12) by ZQZPR01MB1060.CHNPR01.prod.partner.outlook.cn (2406:e500:c550:b::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8048.18; Wed, 16 Oct 2024 03:18:59 +0000 Received: from ZQZPR01MB0979.CHNPR01.prod.partner.outlook.cn ([fe80::617c:34a2:c5bf:8095]) by ZQZPR01MB0979.CHNPR01.prod.partner.outlook.cn ([fe80::617c:34a2:c5bf:8095%4]) with mapi id 15.20.8048.013; Wed, 16 Oct 2024 03:18:59 +0000 From: Ley Foon Tan To: Alexandre Torgue , Jose Abreu Cc: "David S . Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , netdev@vger.kernel.org, linux-kernel@vger.kernel.org, lftan.linux@gmai.com Subject: [PATCH net v2 4/4] net: stmmac: dwmac4: Fix high address display by updating reg_space[] from register values Date: Wed, 16 Oct 2024 11:18:32 +0800 Message-ID: <20241016031832.3701260-5-leyfoon.tan@starfivetech.com> X-Mailer: git-send-email 2.46.0 In-Reply-To: <20241016031832.3701260-1-leyfoon.tan@starfivetech.com> References: <20241016031832.3701260-1-leyfoon.tan@starfivetech.com> X-ClientProxiedBy: BJXPR01CA0053.CHNPR01.prod.partner.outlook.cn (2406:e500:c211:12::20) To ZQZPR01MB0979.CHNPR01.prod.partner.outlook.cn (2406:e500:c550:f::12) Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: ZQZPR01MB0979:EE_|ZQZPR01MB1060:EE_ X-MS-Office365-Filtering-Correlation-Id: bb053883-ddf8-4359-8250-08dced9146f7 X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0;ARA:13230040|41320700013|52116014|366016|1800799024|38350700014; X-Microsoft-Antispam-Message-Info: OUhUEbx/WaX03ORiiwxOHJtSRxy60oiKGX4iidb59dNZ5rJlVDyrUeX4fWBUOpST9t7wHdScBbr8E2JpRcT91eVaBtXgnhjcEZO1gaQa+iodJIKDq4tE2oANhx2uzOTlZ5Ufjqrxykn1enZhg5WwZePZ3rvebGrrWSlOtGh3qdidzco2k/hBebjCT/APfk4RY3t1e3i+mntYiUx6eX07T5hbUVCLMi6OiiWUERiD2p8xNAHqXga7NZaVt2//Lzbsv/1piUksSmu4XzVYYjhiRGTzeWUEn7GUqH73DdgEwdsw0evjzq6YVyEQ34T6sNPr4UbYRvtaL1hI+u79ZNeFKjr9N9DeGUjSPuuC+s3MP9Xa/7b+MYVzmY5++TsChTaMRtaSVS0u9m2KAl1F+vWoWdLoSBxCB0NMSrtnfXsW1SE9nWYU92t4xZ3rQFFbNYVt8bVKFSRdLVY0PT4ZnGEnFwwSk9Dn9WZdQTJNJ+3esNqUJT0MJR+Gkt/FQTx526T2n3UkUzfcdw2GS48hI9vrRn66nAOQdxrqzjkGL8FjRsGxToCvA9h8l78tVUXGCH+fNsFe2mt72fc32LjIxQbXu7PPeGhtFhRsbIiZCefX7ZysBVaA/fF4aSNyzo91k5RN X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:ZQZPR01MB0979.CHNPR01.prod.partner.outlook.cn;PTR:;CAT:NONE;SFS:(13230040)(41320700013)(52116014)(366016)(1800799024)(38350700014);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: lAAqmJ5NDLG0ADkTMfASY8OyCfg31OaHbp8rTV0ZihYI49kznW+a5tlGbBLgbq5xaJzB8JFIn3VRuKRowl6G7hS2QT4X3iijf0EqOCdQ/y/R3alTPAkg3JDfmgKit3M0sjiErWqmVLmIp+wIw8vmwzeFDhJ3egZ1cIF8y4m5UI2q6LHWjpHzY9UwUqN/PmAn1voXBOQllQjPJL0hOUnk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WPJdgfWvyI24zMoCLVeF0PzlM9eVW8oXCR564jdc304TJO2uyvSRWbXL4R+fAJy/iu44Gi5sQoFbXl9xl8uYiFd9c9xDFGPu4dC6SSCVMDVwklJjqM4oagbwJLhPcBYXb/4kYGQ3gy00IVvJHrmpEZiIwJ8RPFlvmJgE1nf123oxrlF34NE7ot8vpgfV6NaJpmyFq0lwtbhaT2RIJU2vP0hQH1ZlvKTWGWCFnRGgr4M2jhgh2ngDzzmKc3e02AFV/duscc6XF3DfxNRhnZkZEkcH9a+TpRwa5xFTMbNeHJ6nD69s5Gr43weBveqonFwrR50bzC47g== X-OriginatorOrg: starfivetech.com X-MS-Exchange-CrossTenant-Network-Message-Id: bb053883-ddf8-4359-8250-08dced9146f7 X-MS-Exchange-CrossTenant-AuthSource: ZQZPR01MB0979.CHNPR01.prod.partner.outlook.cn X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 16 Oct 2024 03:18:59.8414 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 06fe3fa3-1221-43d3-861b-5a4ee687a85c X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: 4xZ+rAfUh3qWc94mFFDOsmM12FgmvhN1D+obQRNSAI41GVySdAaJzJIsk4cs/q8RQ61R3XlTa8PrwrQKzij0+UOtlUy2Jrif8KVSi5DPuts= X-MS-Exchange-Transport-CrossTenantHeadersStamped: ZQZPR01MB1060 X-Patchwork-Delegate: kuba@kernel.org The high address will display as 0 if the driver does not set the reg_space[]. To fix this, read the high address registers and update the reg_space[] accordingly. Fixes: fbf68229ffe7 ("net: stmmac: unify registers dumps methods") Signed-off-by: Ley Foon Tan --- drivers/net/ethernet/stmicro/stmmac/dwmac4_dma.c | 8 ++++++++ drivers/net/ethernet/stmicro/stmmac/dwmac4_dma.h | 2 ++ 2 files changed, 10 insertions(+) diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac4_dma.c b/drivers/net/ethernet/stmicro/stmmac/dwmac4_dma.c index 4e1b1bd98f68..60cee7a06ba2 100644 --- a/drivers/net/ethernet/stmicro/stmmac/dwmac4_dma.c +++ b/drivers/net/ethernet/stmicro/stmmac/dwmac4_dma.c @@ -203,8 +203,12 @@ static void _dwmac4_dump_dma_regs(struct stmmac_priv *priv, readl(ioaddr + DMA_CHAN_TX_CONTROL(dwmac4_addrs, channel)); reg_space[DMA_CHAN_RX_CONTROL(default_addrs, channel) / 4] = readl(ioaddr + DMA_CHAN_RX_CONTROL(dwmac4_addrs, channel)); + reg_space[DMA_CHAN_TX_BASE_ADDR_HI(default_addrs, channel) / 4] = + readl(ioaddr + DMA_CHAN_TX_BASE_ADDR_HI(dwmac4_addrs, channel)); reg_space[DMA_CHAN_TX_BASE_ADDR(default_addrs, channel) / 4] = readl(ioaddr + DMA_CHAN_TX_BASE_ADDR(dwmac4_addrs, channel)); + reg_space[DMA_CHAN_RX_BASE_ADDR_HI(default_addrs, channel) / 4] = + readl(ioaddr + DMA_CHAN_RX_BASE_ADDR_HI(dwmac4_addrs, channel)); reg_space[DMA_CHAN_RX_BASE_ADDR(default_addrs, channel) / 4] = readl(ioaddr + DMA_CHAN_RX_BASE_ADDR(dwmac4_addrs, channel)); reg_space[DMA_CHAN_TX_END_ADDR(default_addrs, channel) / 4] = @@ -225,8 +229,12 @@ static void _dwmac4_dump_dma_regs(struct stmmac_priv *priv, readl(ioaddr + DMA_CHAN_CUR_TX_DESC(dwmac4_addrs, channel)); reg_space[DMA_CHAN_CUR_RX_DESC(default_addrs, channel) / 4] = readl(ioaddr + DMA_CHAN_CUR_RX_DESC(dwmac4_addrs, channel)); + reg_space[DMA_CHAN_CUR_TX_BUF_ADDR_HI(default_addrs, channel) / 4] = + readl(ioaddr + DMA_CHAN_CUR_TX_BUF_ADDR_HI(dwmac4_addrs, channel)); reg_space[DMA_CHAN_CUR_TX_BUF_ADDR(default_addrs, channel) / 4] = readl(ioaddr + DMA_CHAN_CUR_TX_BUF_ADDR(dwmac4_addrs, channel)); + reg_space[DMA_CHAN_CUR_RX_BUF_ADDR_HI(default_addrs, channel) / 4] = + readl(ioaddr + DMA_CHAN_CUR_RX_BUF_ADDR_HI(dwmac4_addrs, channel)); reg_space[DMA_CHAN_CUR_RX_BUF_ADDR(default_addrs, channel) / 4] = readl(ioaddr + DMA_CHAN_CUR_RX_BUF_ADDR(dwmac4_addrs, channel)); reg_space[DMA_CHAN_STATUS(default_addrs, channel) / 4] = diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac4_dma.h b/drivers/net/ethernet/stmicro/stmmac/dwmac4_dma.h index 17d9120db5fe..4f980dcd3958 100644 --- a/drivers/net/ethernet/stmicro/stmmac/dwmac4_dma.h +++ b/drivers/net/ethernet/stmicro/stmmac/dwmac4_dma.h @@ -127,7 +127,9 @@ static inline u32 dma_chanx_base_addr(const struct dwmac4_addrs *addrs, #define DMA_CHAN_SLOT_CTRL_STATUS(addrs, x) (dma_chanx_base_addr(addrs, x) + 0x3c) #define DMA_CHAN_CUR_TX_DESC(addrs, x) (dma_chanx_base_addr(addrs, x) + 0x44) #define DMA_CHAN_CUR_RX_DESC(addrs, x) (dma_chanx_base_addr(addrs, x) + 0x4c) +#define DMA_CHAN_CUR_TX_BUF_ADDR_HI(addrs, x) (dma_chanx_base_addr(addrs, x) + 0x50) #define DMA_CHAN_CUR_TX_BUF_ADDR(addrs, x) (dma_chanx_base_addr(addrs, x) + 0x54) +#define DMA_CHAN_CUR_RX_BUF_ADDR_HI(addrs, x) (dma_chanx_base_addr(addrs, x) + 0x58) #define DMA_CHAN_CUR_RX_BUF_ADDR(addrs, x) (dma_chanx_base_addr(addrs, x) + 0x5c) #define DMA_CHAN_STATUS(addrs, x) (dma_chanx_base_addr(addrs, x) + 0x60)