From nobody Thu Dec 18 05:37:46 2025 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 03A07C5AD4C for ; Thu, 23 Nov 2023 14:47:16 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345888AbjKWOrH (ORCPT ); Thu, 23 Nov 2023 09:47:07 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44162 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1345870AbjKWOrE (ORCPT ); Thu, 23 Nov 2023 09:47:04 -0500 Received: from mx0b-00230701.pphosted.com (mx0b-00230701.pphosted.com [148.163.158.9]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 90234D44; Thu, 23 Nov 2023 06:47:07 -0800 (PST) Received: from pps.filterd (m0297265.ppops.net [127.0.0.1]) by mx0a-00230701.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 3ANEFS5b030696; Thu, 23 Nov 2023 06:46:27 -0800 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=synopsys.com; h=from : to : cc : subject : date : message-id : references : in-reply-to : content-type : content-transfer-encoding : mime-version; s=pfptdkimsnps; bh=KFujF5yvuQN8AJIyumcpHQn4HYbgphkYGFlu/62/Ok0=; b=q9Ne8Bcs8SDCi6KGPaaG7v6UDcyB+eb0nnigMYHbaRbwJxvposl+lVYSeZhgX6Kbq87R eDyCfMlK53jAGO2w1td3oXrieQHQoT+6obTo8G+VT4H3rSfHjh/pVJEHhe/kAwI1GztE aNsNSPdSt0nSSwo2zJ+yqluiOx98MrRlNj/q4B6EtheLDk772hRyD53sn3WQlnSOgrf7 6D4CSk7x8E0G9yJRi8LrUVqoa5hBeTXrWPvwWsXinPS+exYssmi82pg4ym1wpCmbYeQg TqqUNQq8K9mlU/f3qm923H69x0EM2tygUXmPI3zHLxPayyiSyfQl00uNC77PIn0jgWzT 6w== Received: from smtprelay-out1.synopsys.com (smtprelay-out1.synopsys.com [149.117.87.133]) by mx0a-00230701.pphosted.com (PPS) with ESMTPS id 3ugs1smhc1-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 23 Nov 2023 06:46:26 -0800 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=synopsys.com; s=mail; t=1700750784; bh=KFujF5yvuQN8AJIyumcpHQn4HYbgphkYGFlu/62/Ok0=; h=From:To:CC:Subject:Date:References:In-Reply-To:From; b=BxtbBCSHYfhhueG+pBq8g8b+NcZ1+WOlobWdIkq8w/8a2re04nqhIZIafgHHI1S2M j9237O2UoIg1hJfWVJWFveuL+T1vpb2SXcjy3vp+CJuMR43tYEKdDNiyn01OYBd2mS ZHH4zvQY1G+vRzwIO+eQecJm4BYWomvs5VtQhAR/s+sloaXx1q7Csb6w7if4o2ASq6 y3tljJOSPMVK6yErlK355l7E2r7xEfdOwsuTi/ZEwKczL2+VD6KicjyeFh+Qivp2tY DTvm/jxo7vGybOLYJFeFJP2I/OYG13he82/7BGQ9JefQbtQPN1zgDWdt3qMZRyilMP fOrG5icUvOl/Q== Received: from mailhost.synopsys.com (us03-mailhost1.synopsys.com [10.4.17.17]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) client-signature RSA-PSS (2048 bits)) (Client CN "mailhost.synopsys.com", Issuer "SNPSica2" (verified OK)) by smtprelay-out1.synopsys.com (Postfix) with ESMTPS id C626B40138; Thu, 23 Nov 2023 14:46:22 +0000 (UTC) Received: from o365relay-in.synopsys.com (us03-o365relay1.synopsys.com [10.4.161.137]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (Client CN "o365relay-in.synopsys.com", Issuer "Entrust Certification Authority - L1K" (verified OK)) by mailhost.synopsys.com (Postfix) with ESMTPS id 525D5A0262; Thu, 23 Nov 2023 14:46:21 +0000 (UTC) Authentication-Results: o365relay-in.synopsys.com; dmarc=pass (p=reject dis=none) header.from=synopsys.com Authentication-Results: o365relay-in.synopsys.com; spf=pass smtp.mailfrom=synopsys.com Authentication-Results: o365relay-in.synopsys.com; dkim=pass (1024-bit key; unprotected) header.d=synopsys.com header.i=@synopsys.com header.a=rsa-sha256 header.s=selector1 header.b=Cl1/mbIT; dkim-atps=neutral Received: from NAM11-BN8-obe.outbound.protection.outlook.com (mail-bn8nam11lp2169.outbound.protection.outlook.com [104.47.58.169]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mail.protection.outlook.com", Issuer "DigiCert Cloud Services CA-1" (verified OK)) by o365relay-in.synopsys.com (Postfix) with ESMTPS id D3A6140132; Thu, 23 Nov 2023 14:46:17 +0000 (UTC) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=J9CgjwUkt4G26Tq12pokhZw0WmJyosuO+q/rX7kTNZs2bym6JEvZQmzcRzc95ZFj/IsEuHvsr9acCt+d99N10nyyyk14L3+9eS9ue4Mp0nlw4BKQnLYhHPCNs6UZXdnFNvC1TEEvpOu9o99fumNABLbmn2+8iriH5EgRomCoYLPnWLnpDJn97Mk/kn6dJHFeB/Qbx9z9390iKQKfVXZ/iMdm2CV62PynUoh3xthp6walv0ZKgBOQxRaA4In3gpmAWZj4h1ZC3TlSXXef9NbuQdG4AG1LJDzIHqXsix/XlDeaelF24DsqW8rPwLbaekgtK7QkKLw1jc63MPgVk3zjCg== 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=KFujF5yvuQN8AJIyumcpHQn4HYbgphkYGFlu/62/Ok0=; b=A6XUkKv5lCkjouzZ5RfwyhnFYwckx3xXnBy9YAxv+ftLzCGrHX+sY1WapM+LB+JUqG19DJW+JwP2nWnEEekAOseMbs3wVtpm1PJvqlShpJY/YtkHjtcvfX1E0AfhWvLlsAq8O+r/2Nso2GfcM9kegFsuq4mYG6Iqn2eZxd+74EpWpyCGjV3jDw6aowsSPVXlWnZaFSvCJjoSUFOGTak8FCguM7Tc1W2wpgFxPNSvCBC80EzH2v9HxbCO/akz0RkB1d9+QYCp7Of5PKRmvjn4WqiW1wmGvyUD93IuR51TFbYzuzZxQSC6T3IHgkVFYspyQyD4jH0f9xgVaUf5e8ewPg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=synopsys.com; dmarc=pass action=none header.from=synopsys.com; dkim=pass header.d=synopsys.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=synopsys.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=KFujF5yvuQN8AJIyumcpHQn4HYbgphkYGFlu/62/Ok0=; b=Cl1/mbITITWxLpAHSpPxlAEvdFWztPEzSWEgIIkvhocv3MubUCaK7BpWd/nhlmWE11zvX4lWtJN5VkFfjhO7/xzYty/IZk4zcXpPIwRq8ShCxhMzN99n9qvJFzhJ4pyGTxfFhwgm5qd+uqBWPvxYo4FU7/cuUPuCRDzkg5/khs8= Received: from CY5PR12MB6372.namprd12.prod.outlook.com (2603:10b6:930:e::5) by CY5PR12MB6298.namprd12.prod.outlook.com (2603:10b6:930:21::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7025.19; Thu, 23 Nov 2023 14:46:11 +0000 Received: from CY5PR12MB6372.namprd12.prod.outlook.com ([fe80::dd25:e93d:e181:929a]) by CY5PR12MB6372.namprd12.prod.outlook.com ([fe80::dd25:e93d:e181:929a%3]) with mapi id 15.20.7025.020; Thu, 23 Nov 2023 14:46:11 +0000 X-SNPS-Relay: synopsys.com From: Jianheng Zhang To: Serge Semin CC: Russell King , Alexandre Torgue , Jose Abreu , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Maxime Coquelin , Tan Tee Min , Ong Boon Leong , Voon Weifeng , Mohammad Athari Bin Ismail , "netdev@vger.kernel.org" , "linux-stm32@st-md-mailman.stormreply.com" , "linux-arm-kernel@lists.infradead.org" , "linux-kernel@vger.kernel.org" , James Li , Martin McKenny Subject: RE: [PATCH] net: stmmac: fix FPE events losing Thread-Topic: [PATCH] net: stmmac: fix FPE events losing Thread-Index: AdoW3Xfb3QHiuCaqTA2ROZ4444S4MgAFJ5GAADdg94AAAqmPIAEgkfEQAAW/RAAAKGjdgAAQG94AACbGoFAAAtG/AAAHxz4g Date: Thu, 23 Nov 2023 14:46:11 +0000 Message-ID: References: In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ms-publictraffictype: Email x-ms-traffictypediagnostic: CY5PR12MB6372:EE_|CY5PR12MB6298:EE_ x-ms-office365-filtering-correlation-id: 0644ab61-8e64-4943-893a-08dbec32ef84 x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: L31GC8/YK9xkIxFjZgo8WLWv33xpWtrpf+cbkJtpFPOtk1SVfTdlfaY5UH59+n7X14zq2/i4wG4j0ij5Orzq4YVwpjaGd5JI6u1vClJ8iZZuMG9jXKDahPxlEfvOyMx3fszp4PENqkmkPpcjw60AUtev7Yksun5d7swXS6JneOn3B58imS79PLTH2HAh66H/w7A/r9UoGIu9rkPvhzV7RAaN4v+kVdHW5nxKfBsdJtHZf7iYO9whscddANrC4XcQwg2vO/OmCXM6uW+mibq44aNzoI3muGDaqAaGwDDVkuqY522X03/lH7z17T062LLrI8bet96HsocZ3tFC36MpJen60y1YfSLgVi8pmYzgNnPC8zaW8hdy/NPJTJTsKmo6zx5SJDTyRhJvVZzmBzClI/3sJFkES19D//LKz0D/ur6W+X7Q8n0NjZcij1MtcDX9w9reUM1+X0tyf2R0SaXlZGwVl0S+VHLZlyrA413Gi8y8QN/4/M7l32XUcy2e/Xu7WmZUuzq/hD/7cO/8gFU0kpe1huBlaKjdKiqv43t7EG2KFM3CSHfwuGX2mZ7yCoiIOnm5C6HQBZjv/KzFgxgQ/r41uxkAa4XiZeIttIM5VIc= x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:CY5PR12MB6372.namprd12.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230031)(366004)(39860400002)(396003)(346002)(136003)(376002)(230922051799003)(451199024)(64100799003)(1800799012)(186009)(83380400001)(7696005)(6506007)(966005)(9686003)(53546011)(107886003)(4326008)(8936002)(52536014)(71200400001)(5660300002)(8676002)(41300700001)(7416002)(30864003)(2906002)(478600001)(316002)(26005)(6916009)(54906003)(64756008)(66446008)(66476007)(76116006)(66556008)(66946007)(86362001)(33656002)(38100700002)(122000001)(55016003)(38070700009)(559001)(579004);DIR:OUT;SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?utf-8?B?QlN6RU5SYiszaDY1aE1KbUVJUG1LclBQYmZpMHN0R3VVMXBxbHladlVpVm9o?= =?utf-8?B?U1g5L1BvTUNtdXAwN2VEMkNHeG50QlNYeVg0dG1Gek8rNUJXWW93bU9oUndG?= =?utf-8?B?cGJTTFo5NERwUE9GbThkY0NUOGZMV2VjWnFUeGJmVHJCZWN3UHlqak42Nk5T?= =?utf-8?B?b3l3VjhYVWZrbTkvcG1RekpGNWU3Zk1pdU5IckpheENhMkF2SEpNNDd1OHdj?= =?utf-8?B?QTFMVWtnUFFTWG1DYTRPaHlkUFBzMmtCa3BleklSaDlTR2lEVlR3d2ZydXRG?= =?utf-8?B?TFBxU1lkR1N2RU5FYkRPN1dFSnZ6YUhxdnJOdndESXp2UzlydWV3VFE1Yit3?= =?utf-8?B?Z1NialJaZEs5bWZmL05YOHpRaDZnTnVGR3ErVk5mbUhtSzQ1c0NuZ2lxUTVr?= =?utf-8?B?ek5melo0eGFCK0taOWFEekVubmJjREtnd2dpRi9obnZYVzlMc0JFeXg3V1po?= =?utf-8?B?bEZwSHZObnM2S01MbndGS3RMSTlQWkRZSm95MVBER1hFUHBUNC9MSUwzQnJ0?= =?utf-8?B?eWtJUkhENXFob3E1MHg1MmxLNjlEMktwK2hDckMxcmZnNC9GNGxodWhLdmhz?= =?utf-8?B?U3FMZi85N2ttQThqcXJwa0J3TmZyeGxpVWJ3VEkza0hXSWtwWWZiTXYxckl6?= =?utf-8?B?ZVNlZUljSXRrS2YrdDg5d0lZV09uYWxuV003bUd4NWtpZlk3MlQzSmtVckl3?= =?utf-8?B?UWl0T3lBUzdRclRZVFgvTU4rV2pKNWYrSUlDRE5NdzBGUEFBT0xpUzNTblRB?= =?utf-8?B?VWlUOTFFRWQ1dG9XTmxzWXRobGg5UHZ0ZWpGZHh5YlRIZDRmSXJnbHYvOFNy?= =?utf-8?B?V2U4MlIrdkVRb0hETGxmd0UvMUtOSmNtTjI5ZEpTRXd6a2lId2VFU016YVBO?= =?utf-8?B?a3hMZkM2RDk3Rk9PQnF5RkR1eERXSVBMMVNpVFhhcmpkQmg5SmpFNTdBZ1pu?= =?utf-8?B?ODlQQnhQVDE1dFRTU2ZRWE5kTHdCalJRZzE1OTh6ck1pc1FBNk1abU5hRHoz?= =?utf-8?B?clJzaVIrekVmc1dDU1V6b0hGL1BDNFNIRTlVUGxsa0tiaTBtTEthMzBiU3hj?= =?utf-8?B?T0k3U1R1ZTlkR2gyUTFpbVJjaTdXb0djckEram9EQ2hGNFpZSGVYT1VMWmdr?= =?utf-8?B?RTRjMnhPY0dudFlDbTdCVWFQL29FcVdjdjIyUWtJQUg2QnlEeGcvNnl3d2xD?= =?utf-8?B?b3hlVENZWUcrWUkvZ1NoQkNXNTI4S1VRL1pLbC9VcUgybUtvOFZHaGlONTVk?= =?utf-8?B?MDIzakwzMmwzTk02Wjl1ZnFRTTdKYzlYVUFwb3JmZzdWQ3JpOEk1aGVhTEZG?= =?utf-8?B?NkoveDFSaDJxd0NybFdDQTRSRWphcVVDT1FBQmVGdEg2RzY2c0E0RkVQemZO?= =?utf-8?B?TlpsU2JPSkpDSnBwQjkrQU11KzZBN0thdDBGWWxOMEhkL2VPeUhlVGtzekZv?= =?utf-8?B?QlU5Y0NmRVMvMTV6UzY3bktsZHBUM3VseFAwL09iV05lalp6UlIwV3pVczVi?= =?utf-8?B?UEI5V3BlK0IzcVVCNXFnN01ZTEJkYmtqa1lLdHpySXpiRjV4eWRBbDJBL1g2?= =?utf-8?B?TitGbmxtd25Gb29XNmFzS3lIbk9TcW5zSEtjeGxiRkRSS0FIM3AxbGJZem9M?= =?utf-8?B?NVZxWDZpbHlubjI3RjhUUVpFRFdZSjU5UmZkamx3aFR4R25xckhRLzNxSDJL?= =?utf-8?B?ZVB0UzR6am1mdWZZbWdLa0dVT1l0UWdkaXoxSnVUaDVZcFF4UkFERHZZVGt1?= =?utf-8?B?dTBLbllJZGg4U0dUYzdYakFjU0tnQkVEQmZOZGkvRlJDNk4rUXAyQjBLV09K?= =?utf-8?B?Sko1UGxMajdHeUlCMVFZSk9xdStvbHVpTG5sbGtMdTBhS1ZsM2ZBeExCdk1r?= =?utf-8?B?eHBlOXAreHBaRk83bGpoMzJhZFVWSSs2bEplRkxLb0tRRXpKYitEUmR4dUM3?= =?utf-8?B?b0U1aEE0WG5mNkZZUUxQcVVYUW5zZC9IdDd6TTRMa0FxenVZUTBVTVR2Tkl1?= =?utf-8?B?K2gwTWlmVVFVUFl4Y29LcnB5UHgzdXJLYVg5ZWFPZzE4eVljMStXLy9nUW14?= =?utf-8?B?ZWJYYVNWczZFVnBNZk5nZS85NFRBaGlRL2N2QUROcm5VYVdKLzQwTTVqTEVk?= =?utf-8?Q?3JbjtgH3zlpCL/XNy5ftVuRrd?= Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-MS-Exchange-AntiSpam-ExternalHop-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-ExternalHop-MessageData-0: =?utf-8?B?WmN3OWJKQUtQY1UzcjNhRzFUZFFKM1BjYndCWjQwbHpDdmNEWWVTVGtIYzJj?= =?utf-8?B?V2N2VENlazRRNlphRThuTmZMejVhTDQyUFdxd1RoUWd1SndBRkVUNFZPVDNk?= =?utf-8?B?MnBrSEdVZllqZmE2TC9KUU1VbHNzN0JXaFREZi8wQUF5K3N5eXBXbS9lVy9G?= =?utf-8?B?WTIvUlljd1hSRytMSkl6KzkyQ01CM21Eb05yb3hxTGVaTGF4TmcxV3hoUGRa?= =?utf-8?B?NTNtZ2piSFhyOUZCK0V1ZVNoVkZwdDNKSktrN2tNTndETjlEeXBFVlpucnA2?= =?utf-8?B?ZWR2VHVQWFNZaGF1QUVXMGtDVE5pWXh0aFNzTCtyOStYL1V5SDQxNWczZktF?= =?utf-8?B?UUE0SVZlRWUxcXJzZllVQVZyalBJcDVub2pFT3RNUVptbXRDdlJxSmNySmJO?= =?utf-8?B?TFEzbnlPUXhzOFI4ZUJ6Ym1sV2ZqblpDeVlPajdTdUk1SkF5QTVBVW90SlRj?= =?utf-8?B?cmpGL2M4aHJIY3p1ckdQckJVNFpzNEJsY0lORmFEYnJlTUJWVFduMExpQjVG?= =?utf-8?B?QVB4WW9Ndmp4ZklMUkQ3bE1jL1lLMHlMRWNFZmVQUkxLZUw5dWU2Wm1wNitL?= =?utf-8?B?WE56NHpUU2MvTTh2aVZoWHg4U05IcHNQWlBQMzAvUVVLYnNjeFV1elFSZEhu?= =?utf-8?B?UXl0WGhoMUt0eUlQQzBLQ3hDVklaU1JwOUZLanVod2sycGNQZm5EeGFKRnkw?= =?utf-8?B?ZWlNN0FETlhVTHlpWnVJS2ZHdUZCeWJ1ZEhSdFU3V3Z6cVo2eDd4c0p1d1pJ?= =?utf-8?B?RHBZQ3diVGI1cGExWk9WbW1pMkNtYWVWSEc3VHdpNEdnSXNCc0dTa0lqMjNR?= =?utf-8?B?VktVU3dBeVYwaTRPWWZodElBVGs2N3FYeW9Kd0lHUFR2MHZIZXpFU3BwdHF1?= =?utf-8?B?alRWTHZMbTBxN2o0TFpPZmNrczF0LzYzdWR6dnhTc3NtSUt6OXFtd2dXTVB0?= =?utf-8?B?NTUwWEFpYmNJeThPNGplQjNUODBBdThWVUhCeWRRekZQQXB6SzExMktGaXZ0?= =?utf-8?B?MnJPRktJbUpLRWZiTzk4V0lSQ2ExcENER0lncTgydUZRRkxqZS80YUNIQy9u?= =?utf-8?B?b09GNjdlQk4xYm5EQS9tT1lCYm41a0FNcStmTG5LWkNWWkhDV05oeldycFdt?= =?utf-8?B?bE8xWUYrbDRWWWtOcEJhdW1GOVhLUG1hTFhRcWp6dSt5QVNyV2RSckIrVFhM?= =?utf-8?B?NmExVUVIK1pQdG0rWnVkajhxWno2T0Z0ZlE0dnR2RS9laGVwRG1XSHNIdGEz?= =?utf-8?B?UDU4bVVpd0QvNExveStDZFlSOXlpeXRxZWNkUHMvRWJ5SnRKS3BKQXVJenln?= =?utf-8?B?YnkvbTlFeWdGblNzcGlyY3ZMamUzUlhrOVAzZituMjFDUmJEd1NkUXZEZXZU?= =?utf-8?B?WEdlTWUranpWWjV1UkhrRm1UTytqekhpdGFGSEUzbDN1N1BMSmhqNlJQZGV3?= =?utf-8?B?Zmord3hzNDRvQU9lYUpTY0FWN21xQ2M4enJKNHg5RmY1ZUlKWW9DNnpQc2ph?= =?utf-8?B?bzlQWlBwdG14Zk1DS2lrQ1JDdnpkcG9QWEVQMnA4VGZwK3l2U21iSGNnZWV5?= =?utf-8?Q?ZMM2n+MkdrWFiKZO3cebdF8tHAjC8FF19ykxjUXFYYwdIl?= X-OriginatorOrg: synopsys.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: CY5PR12MB6372.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 0644ab61-8e64-4943-893a-08dbec32ef84 X-MS-Exchange-CrossTenant-originalarrivaltime: 23 Nov 2023 14:46:11.3907 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: c33c9f88-1eb7-4099-9700-16013fd9e8aa X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: Z7AgqoUn9SdycMcC8LyGjITssbUU887AxPFva4MiG8YDaGUc06fXzsZeaSpTthltqKFhjPAPQibfwHWtzYCPZw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY5PR12MB6298 X-Proofpoint-ORIG-GUID: SbqTl4u8NFKNu7wrp0FxYyx-XkR7gCfc X-Proofpoint-GUID: SbqTl4u8NFKNu7wrp0FxYyx-XkR7gCfc X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.272,Aquarius:18.0.987,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2023-11-23_12,2023-11-22_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_active_cloned_notspam policy=outbound_active_cloned score=0 mlxlogscore=999 adultscore=0 clxscore=1015 lowpriorityscore=0 suspectscore=0 spamscore=0 malwarescore=0 impostorscore=0 priorityscore=1501 mlxscore=0 bulkscore=0 phishscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2311060000 definitions=main-2311230106 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > From: Serge Semin > Sent: Thursday, November 23, 2023 6:58 PM > To: Jianheng Zhang > Cc: Russell King ; Alexandre Torgue ; Jose > Abreu ; David S. Miller ; Eric= Dumazet > ; Jakub Kicinski ; Paolo Abeni ; > Maxime Coquelin ; Tan Tee Min ; Ong Boon > Leong ; Voon Weifeng ; = Mohammad Athari Bin > Ismail ; netdev@vger.kernel.org; > linux-stm32@st-md-mailman.stormreply.com; linux-arm-kernel@lists.infradea= d.org; > linux-kernel@vger.kernel.org; James Li ; Martin McK= enny > > Subject: Re: [PATCH] net: stmmac: fix FPE events losing >=20 > On Thu, Nov 23, 2023 at 09:44:07AM +0000, Jianheng Zhang wrote: > > > From: Serge Semin > > > Sent: Wednesday, November 22, 2023 11:07 PM > > > To: Jianheng Zhang > > > Cc: Russell King ; Alexandre Torgue ; Jose > > > Abreu ; David S. Miller ; = Eric Dumazet > > > ; Jakub Kicinski ; Paolo Abeni = ; > > > Maxime Coquelin ; Tan Tee Min ; Ong > Boon > > > Leong ; Voon Weifeng ; Mohammad Athari > Bin > > > Ismail ; netdev@vger.kernel.org; > > > linux-stm32@st-md-mailman.stormreply.com; linux-arm-kernel@lists.infr= adead.org; > > > linux-kernel@vger.kernel.org; James Li ; Martin= McKenny > > > > > > Subject: Re: [PATCH] net: stmmac: fix FPE events losing > > > > > > On Wed, Nov 22, 2023 at 07:37:51AM +0000, Jianheng Zhang wrote: > > > > > From: Serge Semin > > > > > Sent: Tuesday, November 21, 2023 8:09 PM > > > > > To: Jianheng Zhang > > > > > Cc: Russell King ; Alexandre Torgue ; > Jose > > > > > Abreu ; David S. Miller ; Eric Dumazet > > > > > ; Jakub Kicinski ; Paolo Ab= eni > ; > > > > > Maxime Coquelin ; Tan Tee Min ; Ong > > > Boon > > > > > Leong ; Voon Weifeng ; Mohammad > Athari > > > Bin > > > > > Ismail ; netdev@vger.kernel.org; > > > > > linux-stm32@st-md-mailman.stormreply.com; linux-arm-kernel@lists.= infradead.org; > > > > > linux-kernel@vger.kernel.org; James Li > > > > > Subject: Re: [PATCH] net: stmmac: fix FPE events losing > > > > > > > > > > On Tue, Nov 21, 2023 at 09:31:31AM +0000, Jianheng Zhang wrote: > > > > > > > From: Jianheng Zhang > > > > > > > Sent: Thursday, November 16, 2023 12:01 AM > > > > > > > To: Russell King ; Serge Semin > > > > > > > Cc: Alexandre Torgue ; Jose Abr= eu > ; > > > David > > > > > S. > > > > > > > Miller ; Eric Dumazet ; Jakub Kicinski > > > > > > > ; Paolo Abeni ; Maxime Co= quelin > > > > > > > ; Tan Tee Min ; Ong Boon Leong > > > > > > > ; Voon Weifeng ; Mohammad Athari > Bin > > > > > Ismail > > > > > > > ; netdev@vger.kernel.org; > > > > > > > linux-stm32@st-md-mailman.stormreply.com; linux-arm-kernel@li= sts.infradead.org; > > > > > > > linux-kernel@vger.kernel.org > > > > > > > Subject: RE: [PATCH] net: stmmac: fix FPE events losing > > > > > > > > > > > > > > > > > > > > > > -----Original Message----- > > > > > > > > From: Russell King > > > > > > > > Sent: Wednesday, November 15, 2023 10:26 PM > > > > > > > > To: Serge Semin > > > > > > > > Cc: Jianheng Zhang ; Alexandre Torgue > > > > > ; > > > > > > > Jose > > > > > > > > Abreu ; David S. Miller ; Eric Dumazet > > > > > > > > ; Jakub Kicinski ; Pa= olo Abeni > > > ; > > > > > > > > Maxime Coquelin ; Tan Tee Min ; > Ong > > > > > Boon > > > > > > > > Leong ; Voon Weifeng ; > Mohammad > > > > > Athari > > > > > > > Bin > > > > > > > > Ismail ; netdev@vger.kern= el.org; > > > > > > > > linux-stm32@st-md-mailman.stormreply.com; linux-arm-kernel@= lists.infradead.org; > > > > > > > > linux-kernel@vger.kernel.org > > > > > > > > Subject: Re: [PATCH] net: stmmac: fix FPE events losing > > > > > > > > > > > > > > > > On Tue, Nov 14, 2023 at 02:59:57PM +0300, Serge Semin wrote: > > > > > > > > > On Tue, Nov 14, 2023 at 11:07:34AM +0000, Jianheng Zhang = wrote: > > > > > > > > > > The 32-bit access of register MAC_FPE_CTRL_STS may clea= r the FPE status > > > > > > > > > > bits unexpectedly. Use 8-bit access for MAC_FPE_CTRL_ST= S control bits to > > > > > > > > > > avoid unexpected access of MAC_FPE_CTRL_STS status bits= that can reduce > > > > > > > > > > the FPE handshake retries. > > > > > > > > > > > > > > > > > > > > The bit[19:17] of register MAC_FPE_CTRL_STS are status = register bits. > > > > > > > > > > Those bits are clear on read (or write of 1 when RCWE b= it in > > > > > > > > > > MAC_CSR_SW_Ctrl register is set). Using 32-bit access f= or > > > > > > > > > > MAC_FPE_CTRL_STS control bits makes side effects that c= lear the status > > > > > > > > > > bits. Then the stmmac interrupt handler missing FPE eve= nt status and > > > > > > > > > > leads to FPE handshake failure and retries. > > > > > > > > > > > > > > > > > > > > The bit[7:0] of register MAC_FPE_CTRL_STS are control b= its or reserved > > > > > > > > > > that have no access side effects, so can use 8-bit acce= ss for > > > > > > > > > > MAC_FPE_CTRL_STS control bits. > > > > > > > > > > > > > > > > > > > > Fixes: 5a5586112b92 ("net: stmmac: support FPE link par= tner hand-shaking procedure") > > > > > > > > > > Signed-off-by: jianheng > > > > > > > > > > --- > > > > > > > > > > drivers/net/ethernet/stmicro/stmmac/dwmac5.c | 12 ++++= ++------ > > > > > > > > > > 1 file changed, 6 insertions(+), 6 deletions(-) > > > > > > > > > > > > > > > > > > > > diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac5= .c > > > > > > > > b/drivers/net/ethernet/stmicro/stmmac/dwmac5.c > > > > > > > > > > index e95d35f..7333995 100644 > > > > > > > > > > --- a/drivers/net/ethernet/stmicro/stmmac/dwmac5.c > > > > > > > > > > +++ b/drivers/net/ethernet/stmicro/stmmac/dwmac5.c > > > > > > > > > > @@ -716,11 +716,11 @@ void dwmac5_fpe_configure(void __= iomem *ioaddr, u32 > > > num_txq, > > > > > u32 > > > > > > > > num_rxq, > > > > > > > > > > u32 value; > > > > > > > > > > > > > > > > > > > > if (!enable) { > > > > > > > > > > > > > > > > > > > - value =3D readl(ioaddr + MAC_FPE_CTRL_STS); > > > > > > > > > > + value =3D readb(ioaddr + MAC_FPE_CTRL_STS); > > > > > > > > > > > > > > > > > > Note this may break the platforms which don't support non= -32 MMIOs for > > > > > > > > > some devices. None of the currently supported glue-driver= s explicitly > > > > > > > > > state they have such peculiarity, but at the same time th= e STMMAC-core > > > > > > > > > driver at the present state uses the dword IO ops only. F= or instance > > > > > > > > > the PCIe subsystem has the special accessors for such cas= es: > > > > > > > > > pci_generic_config_read32() > > > > > > > > > pci_generic_config_write32() > > > > > > > > > which at the very least are utilized on the Tegra and Loo= ngson > > > > > > > > > platforms to access the host CSR spaces. These platforms = are also > > > > > > > > > equipped with the DW MACs. The problem might be irrelevan= t for all the > > > > > > > > > currently supported DW MAC controllers implementations th= ough, but > > > > > > > > > still it worth to draw an attention to the problem possib= ility and in > > > > > > > > > order to prevent it before ahead it would be better to ju= st avoid > > > > > > > > > using the byte-/word- IOs if it's possible. > > > > > > > > > > > > > > > > Yes, this exists for configuration accesses, and is damn an= noying > > > > > > > > because the read-modify-write of these can end up clearing = PCI > > > > > > > > status register bits that are W1C. > > > > > > > > > > > > > > > > I've never heard of that problem with MMIO though. > > > > > > > > > > > > > > > > -- > > > > > > > > RMK's Patch system: > > > > > > > > > > > > > > > > > > > > > > > > https://urldefense.com/v3/__https://www.armlinux.org.uk/developer/patches= /__;!!A4F2R9G_pg!ZnsQc > > > > > > > > > > > > > > > > > > > > > > > > 7LKbdCiIj_nLBkt44MRSL8W8YD4WvMmPNkHFlDMrjrVqEVOVA1-P-9BVE3Oa5bC1ymKXLNV5C= 9mJ_rfFtLW > > > > > > > > Fg$ > > > > > > > > FTTP is here! 80Mbps down 10Mbps up. Decent connectivity at= last! > > > > > > > Thanks for all your mention about the potential risks of usin= g readb and suggestions, I'll > consider a > > > > > new > > > > > > > solution and update the patch. > > > > > > > > > > > > > > Best Regards, > > > > > > > Jianheng > > > > > > > > > > > > Thanks for Andrew's suggestion. I consider the solution of set > > > > > > MAC_CSR_SW_Ctrl.RCWE carefully and found that the MAC_CSR_SW_Ct= rl.RCWE > > > > > > is efficient for many other interrupt status registers, and som= e are used > > > > > > in current stmmac driver (LPI PMT MMC etc). Those registers wor= k fine in > > > > > > clear on read mode with current code. So, I think there is no n= eed to > > > > > > set MAC_CSR_SW_Ctrl.RCWE that will make a large impact to curre= nt > > > > > > interrupt handler. > > > > > > > > > > > > I try adding a new member variable(staged_fpe_state) to stmmac_= fpe_cfg > > > > > > that is used to stage the MAC_FPE_CTRL_STS value read in > > > > > > dwmac5_fpe_send_mpacket(). And in dwmac5_fpe_irq_status(), use = this staged > > > > > > value and current value of MAC_FPE_CTRL_STS to check FPE status= . The > > > > > > draft patch is below. > > > > > > > > > > Are the status flags in the MAC_FPE_CTRL_STS register cleared on > > > > > _writes_? (I am asking because for some reason my DW QoS Eth v5.1= 0a HW > > > > > manual has the status MAC_FPE_CTRL_STS flags marked as R/W, which= is > > > > > weird access mode for the status flags.) If they turn to be _not_ > > > > > changeable on writes, then what about just converting the > > > > > dwmac5_fpe_configure() and dwmac5_fpe_send_mpacket() methods to a= lways > > > > > writing to the MAC_FPE_CTRL_STS register, and if required preserv= e the > > > > > shadow control MAC_FPE_CTRL_STS flags in the stmmac_fpe_cfg struc= ture? > > > > > AFAICS the only flag which needs to be preserved is EFPE - "enable > > > > > FPE" flag. > > > > > > > > > > Such implementation (if it's possible) shall be free from the _st= atus_ > > > > > flags race condition and won't require additional serializations.= On > > > > > the contrary your suggestion AFAICS causes unresolved race condit= ion > > > > > in here > > > > > > > > > > > + value =3D readl(ioaddr + MAC_FPE_CTRL_STS) | fpe_cfg->staged_= fpe_state; > > > > > > + fpe_cfg->staged_fpe_state =3D 0x0; > > > > > > > > > > and here > > > > > > > > > > > value =3D readl(ioaddr + MAC_FPE_CTRL_STS); > > > > > > + cfg->staged_fpe_state =3D value; > > > > > > > > > > Depending on the IRQ handling and the task scheduling timing you = may > > > > > end up with loosing the status flags anyway. > > > > > > > > > > * Note I am not concerning here the MAC_FPE_CTRL_STS control flags > > > > > * race condition which AFAICS already exist in the current frame > > > > > * preemption code. See the configs performed in the open/close/su= spend > > > > > * methods, in the link state change callbacks, in the worker task= and > > > > > * in the FPE status IRQ handler. Control flag accesses don't look > > > > > * coherent there. > > > > > > > > > > -Serge(y) > > > > > > > > > > > > > > > > > Best Regards, > > > > > > Jianheng > > > > > > > > > > > > [PATCH v2] net: stmmac: fix FPE events losing > > > > > > > > > > > > --- > > > > > > drivers/net/ethernet/stmicro/stmmac/dwmac5.c | 9 +++++++-- > > > > > > drivers/net/ethernet/stmicro/stmmac/dwmac5.h | 1 + > > > > > > drivers/net/ethernet/stmicro/stmmac/hwif.h | 1 + > > > > > > drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 6 +++++- > > > > > > include/linux/stmmac.h | 1 + > > > > > > 5 files changed, 15 insertions(+), 3 deletions(-) > > > > > > > > > > > > diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac5.c > > > > > b/drivers/net/ethernet/stmicro/stmmac/dwmac5.c > > > > > > index e95d35f..8917fd0 100644 > > > > > > --- a/drivers/net/ethernet/stmicro/stmmac/dwmac5.c > > > > > > +++ b/drivers/net/ethernet/stmicro/stmmac/dwmac5.c > > > > > > @@ -736,12 +736,15 @@ void dwmac5_fpe_configure(void __iomem *i= oaddr, u32 num_txq, > u32 > > > > > num_rxq, > > > > > > > > > > > > int dwmac5_fpe_irq_status(void __iomem *ioaddr, struct net_dev= ice *dev) > > > > > > { > > > > > > + struct stmmac_priv *priv =3D netdev_priv(dev); > > > > > > + struct stmmac_fpe_cfg *fpe_cfg =3D priv->plat->fpe_cfg; > > > > > > u32 value; > > > > > > int status; > > > > > > > > > > > > status =3D FPE_EVENT_UNKNOWN; > > > > > > > > > > > > - value =3D readl(ioaddr + MAC_FPE_CTRL_STS); > > > > > > + value =3D readl(ioaddr + MAC_FPE_CTRL_STS) | fpe_cfg->staged_= fpe_state; > > > > > > + fpe_cfg->staged_fpe_state =3D 0x0; > > > > > > > > > > > > if (value & TRSP) { > > > > > > status |=3D FPE_EVENT_TRSP; > > > > > > @@ -766,11 +769,13 @@ int dwmac5_fpe_irq_status(void __iomem *i= oaddr, struct net_device > > > *dev) > > > > > > return status; > > > > > > } > > > > > > > > > > > > -void dwmac5_fpe_send_mpacket(void __iomem *ioaddr, enum stmmac= _mpacket_type type) > > > > > > +void dwmac5_fpe_send_mpacket(void __iomem *ioaddr, struct stmm= ac_fpe_cfg *cfg, > > > > > > + enum stmmac_mpacket_type type) > > > > > > { > > > > > > u32 value; > > > > > > > > > > > > value =3D readl(ioaddr + MAC_FPE_CTRL_STS); > > > > > > + cfg->staged_fpe_state =3D value; > > > > > > > > > > > > if (type =3D=3D MPACKET_VERIFY) { > > > > > > value &=3D ~SRSP; > > > > > > diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac5.h > > > > > b/drivers/net/ethernet/stmicro/stmmac/dwmac5.h > > > > > > index 53c138d..022c1a2 100644 > > > > > > --- a/drivers/net/ethernet/stmicro/stmmac/dwmac5.h > > > > > > +++ b/drivers/net/ethernet/stmicro/stmmac/dwmac5.h > > > > > > @@ -156,6 +156,7 @@ void dwmac5_est_irq_status(void __iomem *io= addr, struct net_device > > > *dev, > > > > > > void dwmac5_fpe_configure(void __iomem *ioaddr, u32 num_txq, u= 32 num_rxq, > > > > > > bool enable); > > > > > > void dwmac5_fpe_send_mpacket(void __iomem *ioaddr, > > > > > > + struct stmmac_fpe_cfg *cfg, > > > > > > enum stmmac_mpacket_type type); > > > > > > int dwmac5_fpe_irq_status(void __iomem *ioaddr, struct net_dev= ice *dev); > > > > > > > > > > > > diff --git a/drivers/net/ethernet/stmicro/stmmac/hwif.h > > > > > b/drivers/net/ethernet/stmicro/stmmac/hwif.h > > > > > > index b95d3e1..5496781 100644 > > > > > > --- a/drivers/net/ethernet/stmicro/stmmac/hwif.h > > > > > > +++ b/drivers/net/ethernet/stmicro/stmmac/hwif.h > > > > > > @@ -415,6 +415,7 @@ struct stmmac_ops { > > > > > > void (*fpe_configure)(void __iomem *ioaddr, u32 num_txq, u32 = num_rxq, > > > > > > bool enable); > > > > > > void (*fpe_send_mpacket)(void __iomem *ioaddr, > > > > > > + struct stmmac_fpe_cfg *cfg, > > > > > > enum stmmac_mpacket_type type); > > > > > > int (*fpe_irq_status)(void __iomem *ioaddr, struct net_device= *dev); > > > > > > }; > > > > > > diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c > > > > > b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c > > > > > > index 3e50fd5..6a29f55 100644 > > > > > > --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c > > > > > > +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c > > > > > > @@ -964,7 +964,8 @@ static void stmmac_fpe_link_state_handle(st= ruct stmmac_priv *priv, > bool > > > > > is_up) > > > > > > bool *hs_enable =3D &fpe_cfg->hs_enable; > > > > > > > > > > > > if (is_up && *hs_enable) { > > > > > > - stmmac_fpe_send_mpacket(priv, priv->ioaddr, MPACKET_VERIFY); > > > > > > + stmmac_fpe_send_mpacket(priv, priv->ioaddr, fpe_cfg, > > > > > > + MPACKET_VERIFY); > > > > > > } else { > > > > > > *lo_state =3D FPE_STATE_OFF; > > > > > > *lp_state =3D FPE_STATE_OFF; > > > > > > @@ -5838,6 +5839,7 @@ static void stmmac_fpe_event_status(struc= t stmmac_priv *priv, int > > > status) > > > > > > /* If user has requested FPE enable, quickly response */ > > > > > > if (*hs_enable) > > > > > > stmmac_fpe_send_mpacket(priv, priv->ioaddr, > > > > > > + fpe_cfg, > > > > > > MPACKET_RESPONSE); > > > > > > } > > > > > > > > > > > > @@ -7280,6 +7282,7 @@ static void stmmac_fpe_lp_task(struct wor= k_struct *work) > > > > > > netdev_info(priv->dev, SEND_VERIFY_MPAKCET_FMT, > > > > > > *lo_state, *lp_state); > > > > > > stmmac_fpe_send_mpacket(priv, priv->ioaddr, > > > > > > + fpe_cfg, > > > > > > MPACKET_VERIFY); > > > > > > } > > > > > > /* Sleep then retry */ > > > > > > @@ -7294,6 +7297,7 @@ void stmmac_fpe_handshake(struct stmmac_p= riv *priv, bool enable) > > > > > > if (priv->plat->fpe_cfg->hs_enable !=3D enable) { > > > > > > if (enable) { > > > > > > stmmac_fpe_send_mpacket(priv, priv->ioaddr, > > > > > > + priv->plat->fpe_cfg, > > > > > > MPACKET_VERIFY); > > > > > > } else { > > > > > > priv->plat->fpe_cfg->lo_fpe_state =3D FPE_STATE_OFF; > > > > > > diff --git a/include/linux/stmmac.h b/include/linux/stmmac.h > > > > > > index 0b4658a..1322c78 100644 > > > > > > --- a/include/linux/stmmac.h > > > > > > +++ b/include/linux/stmmac.h > > > > > > @@ -175,6 +175,7 @@ struct stmmac_fpe_cfg { > > > > > > bool hs_enable; /* FPE handshake enable */ > > > > > > enum stmmac_fpe_state lp_fpe_state; /* Link Partner FPE state= */ > > > > > > enum stmmac_fpe_state lo_fpe_state; /* Local station FPE stat= e */ > > > > > > + u32 staged_fpe_state; /* Staged FPE state when read MAC_FPE_C= TRL_STS */ > > > > > > }; > > > > > > > > > > > > struct stmmac_safety_feature_cfg { > > > > > > -- > > > > > > 1.8.3.1 > > > > > > > > > > > > > > Hi Serge, > > > > > > > > Thanks for your suggestion. > > > > > > > > > Are the status flags in the MAC_FPE_CTRL_STS register cleared on > > > > > _writes_? > > > > > > > A write of 0 has no impact irrespective of the value programmed in = RCWE bit. > > > > This is safe option when writing the MAC_FPE_CTRL_STS register, whi= ch will > > > > ensure that bits[19:16] are not modified unintentionally. > > > > When RCWE bit is 0 and status bits[19:16] are read, those will be c= leared, a write > > > > of 0 or 1 do not have any impact in this mode. > > > > > > Great! Than always writing shall do the trick. > > > > > > > > > > > > then what about just converting the > > > > > dwmac5_fpe_configure() and dwmac5_fpe_send_mpacket() methods to a= lways > > > > > writing to the MAC_FPE_CTRL_STS register, and if required preserv= e the > > > > > shadow control MAC_FPE_CTRL_STS flags in the stmmac_fpe_cfg struc= ture? > > > > > AFAICS the only flag which needs to be preserved is EFPE - "enable > > > > > FPE" flag. > > > > > > > I think this is a good solution, pls check my draft patch below. > > > > > > Some comments are below. > > > > > > > > > > > -Jianheng > > > > > > > > [PATCH v2] net: stmmac: fix FPE events losing > > > > > > > > --- > > > > drivers/net/ethernet/stmicro/stmmac/dwmac5.c | 26 +++++++++-= ------------ > > > > drivers/net/ethernet/stmicro/stmmac/dwmac5.h | 4 +++- > > > > .../net/ethernet/stmicro/stmmac/dwxgmac2_core.c | 3 ++- > > > > drivers/net/ethernet/stmicro/stmmac/hwif.h | 4 +++- > > > > drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 8 ++++++- > > > > drivers/net/ethernet/stmicro/stmmac/stmmac_tc.c | 1 + > > > > include/linux/stmmac.h | 1 + > > > > 7 files changed, 28 insertions(+), 19 deletions(-) > > > > > > > > diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac5.c > > > b/drivers/net/ethernet/stmicro/stmmac/dwmac5.c > > > > index e95d35f..9575e84 100644 > > > > --- a/drivers/net/ethernet/stmicro/stmmac/dwmac5.c > > > > +++ b/drivers/net/ethernet/stmicro/stmmac/dwmac5.c > > > > @@ -710,17 +710,15 @@ void dwmac5_est_irq_status(void __iomem *ioad= dr, struct net_device > *dev, > > > > } > > > > } > > > > > > > > -void dwmac5_fpe_configure(void __iomem *ioaddr, u32 num_txq, u32 n= um_rxq, > > > > +void dwmac5_fpe_configure(void __iomem *ioaddr, struct stmmac_fpe_= cfg *cfg, > > > > + u32 num_txq, u32 num_rxq, > > > > bool enable) > > > > { > > > > > > > u32 value; > > > > > > > > if (!enable) { > > > > - value =3D readl(ioaddr + MAC_FPE_CTRL_STS); > > > > - > > > > - value &=3D ~EFPE; > > > > - > > > > - writel(value, ioaddr + MAC_FPE_CTRL_STS); > > > > + writel(0x0, ioaddr + MAC_FPE_CTRL_STS); > > > > + cfg->fpe_ctrl_sts_shadow =3D 0x0; > > > > return; > > > > } > > > > > > > > @@ -729,9 +727,9 @@ void dwmac5_fpe_configure(void __iomem *ioaddr,= u32 num_txq, u32 > > > num_rxq, > > > > value |=3D (num_rxq - 1) << GMAC_RXQCTRL_FPRQ_SHIFT; > > > > writel(value, ioaddr + GMAC_RXQ_CTRL1); > > > > > > > > - value =3D readl(ioaddr + MAC_FPE_CTRL_STS); > > > > - value |=3D EFPE; > > > > > > > + value =3D EFPE; > > > > writel(value, ioaddr + MAC_FPE_CTRL_STS); > > > > + cfg->fpe_ctrl_sts_shadow =3D EFPE; > > > > > > What about just: > > > if (enable) > > > cfg->fpe_csr =3D EFPE; > > > else > > > cfg->fpe_csr =3D 0; > > > > > > writel(cfg->fpe_csr, ioaddr + MAC_FPE_CTRL_STS); > > > > > > then ... > > > > > > > } > > > > > > > > int dwmac5_fpe_irq_status(void __iomem *ioaddr, struct net_device = *dev) > > > > @@ -766,19 +764,17 @@ int dwmac5_fpe_irq_status(void __iomem *ioadd= r, struct net_device > *dev) > > > > return status; > > > > } > > > > > > > > -void dwmac5_fpe_send_mpacket(void __iomem *ioaddr, enum stmmac_mpa= cket_type type) > > > > +void dwmac5_fpe_send_mpacket(void __iomem *ioaddr, struct stmmac_f= pe_cfg *cfg, > > > > + enum stmmac_mpacket_type type) > > > > { > > > > > > > u32 value; > > > > > > > > - value =3D readl(ioaddr + MAC_FPE_CTRL_STS); > > > > + value =3D cfg->fpe_ctrl_sts_shadow; > > > > > > > > - if (type =3D=3D MPACKET_VERIFY) { > > > > - value &=3D ~SRSP; > > > > + if (type =3D=3D MPACKET_VERIFY) > > > > value |=3D SVER; > > > > - } else { > > > > - value &=3D ~SVER; > > > > + else > > > > value |=3D SRSP; > > > > - } > > > > > > > > writel(value, ioaddr + MAC_FPE_CTRL_STS); > > > > > > this can be replaced with > > > > > > u32 value =3D cfg->fpe_csr; > > > > > > if (type =3D=3D MPACKET_VERIFY) > > > value |=3D SVER; > > > else if (type =3D=3D MPACKET_RESPONSE) > > > value |=3D SRSP; > > > > > > writel(value, ioaddr + MAC_FPE_CTRL_STS); > > > > > > > } > > > > diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac5.h > > > b/drivers/net/ethernet/stmicro/stmmac/dwmac5.h > > > > index 53c138d..aca846d 100644 > > > > --- a/drivers/net/ethernet/stmicro/stmmac/dwmac5.h > > > > +++ b/drivers/net/ethernet/stmicro/stmmac/dwmac5.h > > > > @@ -153,9 +153,11 @@ int dwmac5_est_configure(void __iomem *ioaddr,= struct stmmac_est > *cfg, > > > > unsigned int ptp_rate); > > > > void dwmac5_est_irq_status(void __iomem *ioaddr, struct net_device= *dev, > > > > struct stmmac_extra_stats *x, u32 txqcnt); > > > > -void dwmac5_fpe_configure(void __iomem *ioaddr, u32 num_txq, u32 n= um_rxq, > > > > +void dwmac5_fpe_configure(void __iomem *ioaddr, struct stmmac_fpe_= cfg *cfg, > > > > + u32 num_txq, u32 num_rxq, > > > > bool enable); > > > > void dwmac5_fpe_send_mpacket(void __iomem *ioaddr, > > > > + struct stmmac_fpe_cfg *cfg, > > > > enum stmmac_mpacket_type type); > > > > int dwmac5_fpe_irq_status(void __iomem *ioaddr, struct net_device = *dev); > > > > > > > > diff --git a/drivers/net/ethernet/stmicro/stmmac/dwxgmac2_core.c > > > b/drivers/net/ethernet/stmicro/stmmac/dwxgmac2_core.c > > > > index 453e88b..a74e71d 100644 > > > > --- a/drivers/net/ethernet/stmicro/stmmac/dwxgmac2_core.c > > > > +++ b/drivers/net/ethernet/stmicro/stmmac/dwxgmac2_core.c > > > > @@ -1484,7 +1484,8 @@ static int dwxgmac3_est_configure(void __iome= m *ioaddr, struct > > > stmmac_est *cfg, > > > > return 0; > > > > } > > > > > > > > -static void dwxgmac3_fpe_configure(void __iomem *ioaddr, u32 num_t= xq, > > > > +static void dwxgmac3_fpe_configure(void __iomem *ioaddr, struct st= mmac_fpe_cfg *cfg, > > > > + u32 num_txq, > > > > u32 num_rxq, bool enable) > > > > { > > > > u32 value; > > > > diff --git a/drivers/net/ethernet/stmicro/stmmac/hwif.h > > > b/drivers/net/ethernet/stmicro/stmmac/hwif.h > > > > index b95d3e1..68aa2d5 100644 > > > > --- a/drivers/net/ethernet/stmicro/stmmac/hwif.h > > > > +++ b/drivers/net/ethernet/stmicro/stmmac/hwif.h > > > > @@ -412,9 +412,11 @@ struct stmmac_ops { > > > > unsigned int ptp_rate); > > > > void (*est_irq_status)(void __iomem *ioaddr, struct net_device *d= ev, > > > > struct stmmac_extra_stats *x, u32 txqcnt); > > > > - void (*fpe_configure)(void __iomem *ioaddr, u32 num_txq, u32 num_= rxq, > > > > + void (*fpe_configure)(void __iomem *ioaddr, struct stmmac_fpe_cfg= *cfg, > > > > + u32 num_txq, u32 num_rxq, > > > > bool enable); > > > > void (*fpe_send_mpacket)(void __iomem *ioaddr, > > > > + struct stmmac_fpe_cfg *cfg, > > > > enum stmmac_mpacket_type type); > > > > int (*fpe_irq_status)(void __iomem *ioaddr, struct net_device *de= v); > > > > }; > > > > diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c > > > b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c > > > > index 3e50fd5..7791e9b 100644 > > > > --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c > > > > +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c > > > > @@ -964,7 +964,8 @@ static void stmmac_fpe_link_state_handle(struct= stmmac_priv *priv, bool > > > is_up) > > > > bool *hs_enable =3D &fpe_cfg->hs_enable; > > > > > > > > if (is_up && *hs_enable) { > > > > - stmmac_fpe_send_mpacket(priv, priv->ioaddr, MPACKET_VERIFY); > > > > + stmmac_fpe_send_mpacket(priv, priv->ioaddr, fpe_cfg, > > > > + MPACKET_VERIFY); > > > > } else { > > > > *lo_state =3D FPE_STATE_OFF; > > > > *lp_state =3D FPE_STATE_OFF; > > > > @@ -5838,6 +5839,7 @@ static void stmmac_fpe_event_status(struct st= mmac_priv *priv, int > status) > > > > /* If user has requested FPE enable, quickly response */ > > > > if (*hs_enable) > > > > stmmac_fpe_send_mpacket(priv, priv->ioaddr, > > > > + fpe_cfg, > > > > MPACKET_RESPONSE); > > > > } > > > > > > > > @@ -7262,6 +7264,7 @@ static void stmmac_fpe_lp_task(struct work_st= ruct *work) > > > > if (*lo_state =3D=3D FPE_STATE_ENTERING_ON && > > > > *lp_state =3D=3D FPE_STATE_ENTERING_ON) { > > > > stmmac_fpe_configure(priv, priv->ioaddr, > > > > + fpe_cfg, > > > > priv->plat->tx_queues_to_use, > > > > priv->plat->rx_queues_to_use, > > > > *enable); > > > > @@ -7280,6 +7283,7 @@ static void stmmac_fpe_lp_task(struct work_st= ruct *work) > > > > netdev_info(priv->dev, SEND_VERIFY_MPAKCET_FMT, > > > > *lo_state, *lp_state); > > > > stmmac_fpe_send_mpacket(priv, priv->ioaddr, > > > > + fpe_cfg, > > > > MPACKET_VERIFY); > > > > } > > > > /* Sleep then retry */ > > > > @@ -7294,6 +7298,7 @@ void stmmac_fpe_handshake(struct stmmac_priv = *priv, bool enable) > > > > if (priv->plat->fpe_cfg->hs_enable !=3D enable) { > > > > if (enable) { > > > > stmmac_fpe_send_mpacket(priv, priv->ioaddr, > > > > + priv->plat->fpe_cfg, > > > > MPACKET_VERIFY); > > > > } else { > > > > priv->plat->fpe_cfg->lo_fpe_state =3D FPE_STATE_OFF; > > > > @@ -7754,6 +7759,7 @@ int stmmac_suspend(struct device *dev) > > > > if (priv->dma_cap.fpesel) { > > > > /* Disable FPE */ > > > > stmmac_fpe_configure(priv, priv->ioaddr, > > > > + priv->plat->fpe_cfg, > > > > priv->plat->tx_queues_to_use, > > > > priv->plat->rx_queues_to_use, false); > > > > > > > > diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_tc.c > > > b/drivers/net/ethernet/stmicro/stmmac/stmmac_tc.c > > > > index ac41ef4..6ad3e0a 100644 > > > > --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_tc.c > > > > +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_tc.c > > > > @@ -1079,6 +1079,7 @@ static int tc_setup_taprio(struct stmmac_priv= *priv, > > > > > > > > priv->plat->fpe_cfg->enable =3D false; > > > > stmmac_fpe_configure(priv, priv->ioaddr, > > > > + priv->plat->fpe_cfg, > > > > priv->plat->tx_queues_to_use, > > > > priv->plat->rx_queues_to_use, > > > > false); > > > > diff --git a/include/linux/stmmac.h b/include/linux/stmmac.h > > > > index 0b4658a..48385c7 100644 > > > > --- a/include/linux/stmmac.h > > > > +++ b/include/linux/stmmac.h > > > > @@ -175,6 +175,7 @@ struct stmmac_fpe_cfg { > > > > bool hs_enable; /* FPE handshake enable */ > > > > enum stmmac_fpe_state lp_fpe_state; /* Link Partner FPE state */ > > > > enum stmmac_fpe_state lo_fpe_state; /* Local station FPE state */ > > > > > > > + u32 fpe_ctrl_sts_shadow; /* shadow of MAC_FPE_CTRL_STS */ > > > > > > + u32 fpe_csr; /* MAC_FPE_CTRL_STS reg cache */ > > > > > > I would have had it named as "fpe_csr" - short and well readable > > > especially seeing CSR is a well known abbreviation for Control and > > > Status register, which the MAC_FPE_CTRL_STS register actually is. > > > > > > * Note one more time: current FPE handshaking implementation is vastly > > > clumsy, needlessly overcomplicated and prone to races. I would have > > > seriously considered having it refactored. > > > > > > -Serge(y) > > > > > > > }; > > > > > > > > struct stmmac_safety_feature_cfg { > > > > -- > > > > 1.8.3.1 > > > > > > > > Hi Serge=EF=BC=8C > > >=20 > > Thanks for your comments and for pointing out the defects of the curren= t FPE > > handshaking implementation. I know that my patch cannot solve all the > > defects of the current FPE handshaking. So, I want to know if it is nec= essary > > that I continue submitting this patch if you want to refactor the FPE > > handshaking further. >=20 > Your patch solves one of the issues the FPE code has. So please feel > free to submit it. >=20 > Regarding the FPE handshaking refactoring. I would have been glad to > do that if I had an FPE-capable device (alas my DW XGMAC device is of > v2.10a revision and couldn't have been even possibly equipped with > FPE), otherwise providing a not properly debugged/tested patch(es) we > may end up with just not working feature. In anyway it's not a reason > for you to stop fixing some other issues in the implementation. I just > noted that the current code has some other ones, which may bite the > users very hard in very unexpected points. >=20 > > Moreover, I want to add FPE handshaking support for DW > > XGMAC (add fpe_send_mpacket() & fpe_irq_status() to dwxlgmac2_core.c) a= fter > > fixing this MAC_FPE_CTRL_STS register read issue. >=20 > Why not. Got ahead please. We'll have it reviewed. >=20 > -Serge(y) >=20 > > > > -Jianheng Hi Serge, That is great, pls help to check my patch update below. Thanks, -Jianheng [PATCH v2] net: stmmac: fix FPE events losing The status bits of register MAC_FPE_CTRL_STS are clear on read. Using 32-bit read for MAC_FPE_CTRL_STS in dwmac5_fpe_configure() and dwmac5_fpe_send_mpacket() clear the status bits. Then the stmmac interrupt handler missing FPE event status and leads to FPE handshaking failure and retries. To avoid clear status bits of MAC_FPE_CTRL_STS in dwmac5_fpe_configure() and dwmac5_fpe_send_mpacket(), add fpe_csr to stmmac_fpe_cfg structure to cache the control bits of MAC_FPE_CTRL_STS and to avoid reading MAC_FPE_CTRL_STS in those methods. Fixes: 5a5586112b92 ("net: stmmac: support FPE link partner hand-shaking pr= ocedure") Signed-off-by: jianheng --- drivers/net/ethernet/stmicro/stmmac/dwmac5.c | 42 +++++++++---------= ---- drivers/net/ethernet/stmicro/stmmac/dwmac5.h | 4 ++- .../net/ethernet/stmicro/stmmac/dwxgmac2_core.c | 3 +- drivers/net/ethernet/stmicro/stmmac/hwif.h | 4 ++- drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 8 ++++- drivers/net/ethernet/stmicro/stmmac/stmmac_tc.c | 1 + include/linux/stmmac.h | 1 + 7 files changed, 33 insertions(+), 30 deletions(-) diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac5.c b/drivers/net/eth= ernet/stmicro/stmmac/dwmac5.c index e95d35f..53909dc 100644 --- a/drivers/net/ethernet/stmicro/stmmac/dwmac5.c +++ b/drivers/net/ethernet/stmicro/stmmac/dwmac5.c @@ -710,28 +710,22 @@ void dwmac5_est_irq_status(void __iomem *ioaddr, stru= ct net_device *dev, } } =20 -void dwmac5_fpe_configure(void __iomem *ioaddr, u32 num_txq, u32 num_rxq, +void dwmac5_fpe_configure(void __iomem *ioaddr, struct stmmac_fpe_cfg *cfg, + u32 num_txq, u32 num_rxq, bool enable) { u32 value; =20 - if (!enable) { - value =3D readl(ioaddr + MAC_FPE_CTRL_STS); - - value &=3D ~EFPE; - - writel(value, ioaddr + MAC_FPE_CTRL_STS); - return; + if (enable) { + cfg->fpe_csr =3D EFPE; + value =3D readl(ioaddr + GMAC_RXQ_CTRL1); + value &=3D ~GMAC_RXQCTRL_FPRQ; + value |=3D (num_rxq - 1) << GMAC_RXQCTRL_FPRQ_SHIFT; + writel(value, ioaddr + GMAC_RXQ_CTRL1); + } else { + cfg->fpe_csr =3D 0; } - - value =3D readl(ioaddr + GMAC_RXQ_CTRL1); - value &=3D ~GMAC_RXQCTRL_FPRQ; - value |=3D (num_rxq - 1) << GMAC_RXQCTRL_FPRQ_SHIFT; - writel(value, ioaddr + GMAC_RXQ_CTRL1); - - value =3D readl(ioaddr + MAC_FPE_CTRL_STS); - value |=3D EFPE; - writel(value, ioaddr + MAC_FPE_CTRL_STS); + writel(cfg->fpe_csr, ioaddr + MAC_FPE_CTRL_STS); } =20 int dwmac5_fpe_irq_status(void __iomem *ioaddr, struct net_device *dev) @@ -766,19 +760,15 @@ int dwmac5_fpe_irq_status(void __iomem *ioaddr, struc= t net_device *dev) return status; } =20 -void dwmac5_fpe_send_mpacket(void __iomem *ioaddr, enum stmmac_mpacket_typ= e type) +void dwmac5_fpe_send_mpacket(void __iomem *ioaddr, struct stmmac_fpe_cfg *= cfg, + enum stmmac_mpacket_type type) { - u32 value; + u32 value =3D cfg->fpe_csr; =20 - value =3D readl(ioaddr + MAC_FPE_CTRL_STS); - - if (type =3D=3D MPACKET_VERIFY) { - value &=3D ~SRSP; + if (type =3D=3D MPACKET_VERIFY) value |=3D SVER; - } else { - value &=3D ~SVER; + else if (type =3D=3D MPACKET_RESPONSE) value |=3D SRSP; - } =20 writel(value, ioaddr + MAC_FPE_CTRL_STS); } diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac5.h b/drivers/net/eth= ernet/stmicro/stmmac/dwmac5.h index 53c138d..34e6207 100644 --- a/drivers/net/ethernet/stmicro/stmmac/dwmac5.h +++ b/drivers/net/ethernet/stmicro/stmmac/dwmac5.h @@ -153,9 +153,11 @@ int dwmac5_est_configure(void __iomem *ioaddr, struct = stmmac_est *cfg, unsigned int ptp_rate); void dwmac5_est_irq_status(void __iomem *ioaddr, struct net_device *dev, struct stmmac_extra_stats *x, u32 txqcnt); -void dwmac5_fpe_configure(void __iomem *ioaddr, u32 num_txq, u32 num_rxq, +void dwmac5_fpe_configure(void __iomem *ioaddr, struct stmmac_fpe_cfg *cfg, + u32 num_txq, u32 num_rxq, bool enable); void dwmac5_fpe_send_mpacket(void __iomem *ioaddr, + struct stmmac_fpe_cfg *cfg, enum stmmac_mpacket_type type); int dwmac5_fpe_irq_status(void __iomem *ioaddr, struct net_device *dev); =20 diff --git a/drivers/net/ethernet/stmicro/stmmac/dwxgmac2_core.c b/drivers/= net/ethernet/stmicro/stmmac/dwxgmac2_core.c index 453e88b..a74e71d 100644 --- a/drivers/net/ethernet/stmicro/stmmac/dwxgmac2_core.c +++ b/drivers/net/ethernet/stmicro/stmmac/dwxgmac2_core.c @@ -1484,7 +1484,8 @@ static int dwxgmac3_est_configure(void __iomem *ioadd= r, struct stmmac_est *cfg, return 0; } =20 -static void dwxgmac3_fpe_configure(void __iomem *ioaddr, u32 num_txq, +static void dwxgmac3_fpe_configure(void __iomem *ioaddr, struct stmmac_fpe= _cfg *cfg, + u32 num_txq, u32 num_rxq, bool enable) { u32 value; diff --git a/drivers/net/ethernet/stmicro/stmmac/hwif.h b/drivers/net/ether= net/stmicro/stmmac/hwif.h index b95d3e1..68aa2d5 100644 --- a/drivers/net/ethernet/stmicro/stmmac/hwif.h +++ b/drivers/net/ethernet/stmicro/stmmac/hwif.h @@ -412,9 +412,11 @@ struct stmmac_ops { unsigned int ptp_rate); void (*est_irq_status)(void __iomem *ioaddr, struct net_device *dev, struct stmmac_extra_stats *x, u32 txqcnt); - void (*fpe_configure)(void __iomem *ioaddr, u32 num_txq, u32 num_rxq, + void (*fpe_configure)(void __iomem *ioaddr, struct stmmac_fpe_cfg *cfg, + u32 num_txq, u32 num_rxq, bool enable); void (*fpe_send_mpacket)(void __iomem *ioaddr, + struct stmmac_fpe_cfg *cfg, enum stmmac_mpacket_type type); int (*fpe_irq_status)(void __iomem *ioaddr, struct net_device *dev); }; diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/ne= t/ethernet/stmicro/stmmac/stmmac_main.c index 3e50fd5..7791e9b 100644 --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c @@ -964,7 +964,8 @@ static void stmmac_fpe_link_state_handle(struct stmmac_= priv *priv, bool is_up) bool *hs_enable =3D &fpe_cfg->hs_enable; =20 if (is_up && *hs_enable) { - stmmac_fpe_send_mpacket(priv, priv->ioaddr, MPACKET_VERIFY); + stmmac_fpe_send_mpacket(priv, priv->ioaddr, fpe_cfg, + MPACKET_VERIFY); } else { *lo_state =3D FPE_STATE_OFF; *lp_state =3D FPE_STATE_OFF; @@ -5838,6 +5839,7 @@ static void stmmac_fpe_event_status(struct stmmac_pri= v *priv, int status) /* If user has requested FPE enable, quickly response */ if (*hs_enable) stmmac_fpe_send_mpacket(priv, priv->ioaddr, + fpe_cfg, MPACKET_RESPONSE); } =20 @@ -7262,6 +7264,7 @@ static void stmmac_fpe_lp_task(struct work_struct *wo= rk) if (*lo_state =3D=3D FPE_STATE_ENTERING_ON && *lp_state =3D=3D FPE_STATE_ENTERING_ON) { stmmac_fpe_configure(priv, priv->ioaddr, + fpe_cfg, priv->plat->tx_queues_to_use, priv->plat->rx_queues_to_use, *enable); @@ -7280,6 +7283,7 @@ static void stmmac_fpe_lp_task(struct work_struct *wo= rk) netdev_info(priv->dev, SEND_VERIFY_MPAKCET_FMT, *lo_state, *lp_state); stmmac_fpe_send_mpacket(priv, priv->ioaddr, + fpe_cfg, MPACKET_VERIFY); } /* Sleep then retry */ @@ -7294,6 +7298,7 @@ void stmmac_fpe_handshake(struct stmmac_priv *priv, b= ool enable) if (priv->plat->fpe_cfg->hs_enable !=3D enable) { if (enable) { stmmac_fpe_send_mpacket(priv, priv->ioaddr, + priv->plat->fpe_cfg, MPACKET_VERIFY); } else { priv->plat->fpe_cfg->lo_fpe_state =3D FPE_STATE_OFF; @@ -7754,6 +7759,7 @@ int stmmac_suspend(struct device *dev) if (priv->dma_cap.fpesel) { /* Disable FPE */ stmmac_fpe_configure(priv, priv->ioaddr, + priv->plat->fpe_cfg, priv->plat->tx_queues_to_use, priv->plat->rx_queues_to_use, false); =20 diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_tc.c b/drivers/net/= ethernet/stmicro/stmmac/stmmac_tc.c index ac41ef4..6ad3e0a 100644 --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_tc.c +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_tc.c @@ -1079,6 +1079,7 @@ static int tc_setup_taprio(struct stmmac_priv *priv, =20 priv->plat->fpe_cfg->enable =3D false; stmmac_fpe_configure(priv, priv->ioaddr, + priv->plat->fpe_cfg, priv->plat->tx_queues_to_use, priv->plat->rx_queues_to_use, false); diff --git a/include/linux/stmmac.h b/include/linux/stmmac.h index 0b4658a..dee5ad6 100644 --- a/include/linux/stmmac.h +++ b/include/linux/stmmac.h @@ -175,6 +175,7 @@ struct stmmac_fpe_cfg { bool hs_enable; /* FPE handshake enable */ enum stmmac_fpe_state lp_fpe_state; /* Link Partner FPE state */ enum stmmac_fpe_state lo_fpe_state; /* Local station FPE state */ + u32 fpe_csr; /* MAC_FPE_CTRL_STS reg cache */ }; =20 struct stmmac_safety_feature_cfg { --=20 1.8.3.1