From patchwork Fri Dec 16 01:14:34 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wei Fang X-Patchwork-Id: 13074726 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 11ED3C4332F for ; Fri, 16 Dec 2022 01:19:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version: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:In-Reply-To:References: List-Owner; bh=z9n2sQeqxiFy042/6IBT5+bDoIgvPRq8W5JmzDjYoXo=; b=lMctdUmFz4IxGn XnRdtcomTunNSN3tN3hdbgmdk7tnh7+dKf0LZNZBfD+nY7WkmoTT4qZZcPIGU8FBrYvyAETQkRrfg JeTPK62bQwMGZ6I89TYUEP4qBe6Phii/NjFPAWfd6AiOyxbODbSJ0SKnUys+Ql4qVr8kPEZcwbRYJ Odk+pAW/rK7RGTzf49YlLgowqxBMmSa+DlB1dzKHNC6Tf2PLMzYdt0lZqK8quCFId1Y3JwXS8asGb 6udY/SEVKkO7rgLtjM+to7rSnwi4TKwElbF+j11Qy8m1ezTshBIBAasv8i/oaSHEyjfD3es2FSvpm FqiPFrS8/bUi6Rv42wgA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1p5zMu-00CD0p-St; Fri, 16 Dec 2022 01:18:33 +0000 Received: from mail-am0eur02on2047.outbound.protection.outlook.com ([40.107.247.47] helo=EUR02-AM0-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1p5zMr-00CD09-R2 for linux-arm-kernel@lists.infradead.org; Fri, 16 Dec 2022 01:18:31 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=b/hovpWoIXzzHUT35xqloKxZNZBlExdzYH94US5+qZ9jRAGYcQRBLR7zMmfWANwtk+iJUgzXUtf/rygDfbuGo8+1wKhz0dboXTWIAe/ZNXc+a4f++yZn6UqXZAaOf2RvmvAVdMyWdj57WaqjTgOVKTr1LLtLRedxBH6LvRsH30v5Pi6Mr3SKzuazHcYZ9D/gsT8M7lr2LG2KyucLUBKO0FJGOhHKMH414jc49A1RwEbpoGK9knleK1IXlzYAFJo2jRuBsqn9ujlIPtDuGRG7TfzUkdZZm+Knw0dPO0DTX096/2MdGjONuLu6yaVub4iaHdkBU56B4DoJBI+WG5Q7hQ== 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=bRZXQ4lErLBNs6bb/vxQN9nM5NgdquVgw+tnFQI0O/0=; b=e29sDPVVz/qRhs6a9JLREAJgwxCZDKyODSCaFPwAkSHkDPJONUalUDHpxJzP0KIFAXWIp2tI4+H3qaMYq3K4PlsWpithUtPP0exDnwdRgXpG2BEbr7e/QYBXHw24GsHzvmlykcloBDDFfljlePJpXCqzmJXHWVgdj4jeNb5bIbfKTEtF0ZJARgC0OSmIXpGtDGgixTn8T58Dea4yI1OH1yDsNy5IfsXzI711pikyO2h+zo4vg1AugHPlgwmfp2naBeu/fg4a4pKzo0Ck0RC0JY+SZG2kcOzzbh2YoEeszsHMgEEpaKrJzWEhlzRyUErq+eWvaaEY30v5LfoTfoJ8bA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nxp.com; dmarc=pass action=none header.from=nxp.com; dkim=pass header.d=nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=bRZXQ4lErLBNs6bb/vxQN9nM5NgdquVgw+tnFQI0O/0=; b=SQewPG5ry2CPdpc4Uu0ZrbhKnPtcehIWQc1UlF9If9suz6mnGo3Ye4tSn4Pk7tQ+r1GBYfDte9C4MPubVSKtBq2A05+yfQ+wE0kj1OyOsLY8k5LumCR7u4HmvmHK1OFh3nOBlcv2H781TFH6TFjtoxLMbT7FkHdpSYfaJrWxVwM= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nxp.com; Received: from DB9PR04MB8106.eurprd04.prod.outlook.com (2603:10a6:10:24b::13) by AS1PR04MB9358.eurprd04.prod.outlook.com (2603:10a6:20b:4dc::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5924.11; Fri, 16 Dec 2022 01:18:26 +0000 Received: from DB9PR04MB8106.eurprd04.prod.outlook.com ([fe80::e9c1:3e78:4fc8:9b24]) by DB9PR04MB8106.eurprd04.prod.outlook.com ([fe80::e9c1:3e78:4fc8:9b24%9]) with mapi id 15.20.5880.019; Fri, 16 Dec 2022 01:18:26 +0000 From: wei.fang@nxp.com To: robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org, shawnguo@kernel.org, s.hauer@pengutronix.de, kernel@pengutronix.de, festevam@gmail.com, linux-imx@nxp.com, Frank.Li@nxp.com, shenwei.wang@nxp.com, xiaoning.wang@nxp.com Cc: devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH v2] arm64: dts: imx8dxl: Disable hibernation mode of AR8031 for EQOS Date: Fri, 16 Dec 2022 09:14:34 +0800 Message-Id: <20221216011434.967813-1-wei.fang@nxp.com> X-Mailer: git-send-email 2.25.1 X-ClientProxiedBy: SI2PR02CA0021.apcprd02.prod.outlook.com (2603:1096:4:195::10) To DB9PR04MB8106.eurprd04.prod.outlook.com (2603:10a6:10:24b::13) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DB9PR04MB8106:EE_|AS1PR04MB9358:EE_ X-MS-Office365-Filtering-Correlation-Id: 42f7bf23-1da6-451d-5a66-08dadf035ad8 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: HoCW5XylVxxeAAQ6axBPbL/7FxnmsNY/M2rnYrAR2/V3ot98DAQbSz6lh99KeX1hkIZATQJj2O2A5Ls8nGNt0HqNf/Jyh9BvE+SJYVIg+Fjyo+fbhauDCaMZEU+efhir1tsobdSsTJA9b9gNo+jhkeCWka3xUI7kWK9EFEeH86wegMN6TBqj3PpYmGvrLgqOTBarwthcphq4QxGvNed2+Q8Q6uC3MKF64+2qIY2FGrQ5xHWAcDXA9Xvffg7zsZQOz/x5gWBThXdAcw4mpG1xi2ZOlgUprJr/PaCNls8TGNpGoIqkWZ6a1I7n3cK7O3sp1WJNfEXiLkuGW5vB1ENu/3Kgog6Kzwp4B+bU0Zz5A1x6NN3uITBrZxzm9PJrsIywWcAgX5ccPGJyOcIv5G/jhlzuditm61+JWihJptt4B9x5ZCELIKJLWUkssho9reTAZsw4/2rUVbhOBbvnhwPQxF3QSmiJCzFJmT6IcuPRMooiBsIHzhZuz9uklaTi/wdzXVpPfi1BOyvO7k2ze8NA1//xGuKB+8oGHcTLVKVfiKnzgOlWPfDUgSon5mj5ELfhgPW9bT7By0pfEHX3mIausqD6zLkHsLiK6veBjh7i9LOrrzGb8r881QiSWRP1buvl/8QjDw1yoK8DVMkrCGkhgA1jN2o+PAV9kewytGWZNTikEPQftVnot2/+e3q14w/lm7UEbWYgMIQVhMbYTA2XJ0JAShtpYeWMxFhGWLK8hREOR4er/rZiw4ELzPqUOC3HMNMRvKsbLWNHmejcfQ5gSQ== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DB9PR04MB8106.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230022)(4636009)(376002)(396003)(136003)(366004)(39860400002)(346002)(451199015)(6506007)(52116002)(6512007)(9686003)(26005)(2906002)(478600001)(186003)(6666004)(6486002)(966005)(316002)(38100700002)(66476007)(8676002)(4326008)(2616005)(66556008)(66946007)(38350700002)(8936002)(1076003)(41300700001)(36756003)(921005)(86362001)(5660300002)(83380400001)(32563001);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: +cnUSIOpYTja33tk96c24Wt2IHdF+J1ANiHP5+vmrzwv+v4DfJI/EFpdGC2qitkAwwDfdufwFuU/FLU6q6+dzbSYTKFzTeRp7c02fOWry7j23fRjo0RIcTJ030/7PBC/+wza+ZJsv+To3+gIMgkyyl1q3cj5YQqpMPGUgkIJHO661psr+C4KkXs9Lw39r3mwJF2/DlkGi3lHAH8G8ED8LkANlyXiJ+iZhkNzK00UAN3II0r0tQJEaiVnCIsRcX0pR24tPHfURauAEbQI3ZbI5O/eQ37PR1jvB22x8qYc0+bdfsARpFoQdQuJkK9M/ANVjxME0NC9Cj0B852EnePLiOcQOW/8SJyg8hfY7jZNehbwN2qQVz8ErKFE92gECrS+xvs4ZwOokz8l89YhjjzRLNsGdj+eLjMQW77TZnu+MunnZfkxHLe/D+guu2m8o6lu9z0lsUOkj0mXxZjEQbnUnozrxRMNJZm/hJ57oEHORhRbNo7yXo7uYV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7Ybg8s7qNZtXoMRgedr X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 42f7bf23-1da6-451d-5a66-08dadf035ad8 X-MS-Exchange-CrossTenant-AuthSource: DB9PR04MB8106.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 16 Dec 2022 01:18:26.0487 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: VBljxpuhhCT9rfxQS1MSdLEfzzQtMgwp3du+oavVAadpd7zZECn/esdkNNMZMkS6eOsUDP4x50CGGP1vyiCvLw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS1PR04MB9358 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20221215_171829_905962_FC8FD957 X-CRM114-Status: GOOD ( 13.45 ) 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 From: Wei Fang The hibernation mode of AR8031 PHY defaults to be enabled after hardware reset. When the cable is unplugged, the PHY will enter hibernation mode after about 10 senconds and the PHY clocks will be stopped to save power. However, due to the design of EQOS, the mac needs the RX_CLK of PHY for software reset to complete. Otherwise the software reset of EQOS will be failed and do not work correctly. The only way is to disable hibernation mode of AR8031 PHY for EQOS, the "qca,disable-hibernation-mode" property is used for this purpose and has already been submitted to the upstream, for more details please refer to the below link: https://lore.kernel.org/netdev/20220818030054.1010660-2-wei.fang@nxp.com/ This issue is easy to reproduce, just unplug the cable and "ifconfig eth0 down", after about 10 senconds, then "ifconfig eth0 up", you will see failure log on the serial port. The log is shown as following: root@imx8dxlevk:~# [34.941970] imx-dwmac 5b050000.ethernet eth0: Link is Down root@imx8dxlevk:~# ifconfig eth0 down [35.437814] imx-dwmac 5b050000.ethernet eth0: FPE workqueue stop [35.507913] imx-dwmac 5b050000.ethernet eth0: PHY [stmmac-1:00] driver [Qualcomm Atheros AR8031/AR8033] (irq=POLL) [35.518613] imx-dwmac 5b050000.ethernet eth0: configuring for phy/rgmii-id link mode root@imx8dxlevk:~# ifconfig eth0 up [71.143044] imx-dwmac 5b050000.ethernet eth0: Register MEM_TYPE_PAGE_POOL RxQ-0 [71.215855] imx-dwmac 5b050000.ethernet eth0: PHY [stmmac-1:00] driver [Qualcomm Atheros AR8031/AR8033] (irq=POLL) [72.230417] imx-dwmac 5b050000.ethernet: Failed to reset the dma [72.236512] imx-dwmac 5b050000.ethernet eth0: stmmac_hw_setup: DMA engine initialization failed [72.245258] imx-dwmac 5b050000.ethernet eth0: __stmmac_open: Hw setup failed SIOCSIFFLAGS: Connection timed out After applying this patch, the software reset of EQOS will be successful. And the log is shown as below. root@imx8dxlevk:~# ifconfig eth0 up [96.114344] imx-dwmac 5b050000.ethernet eth0: Register MEM_TYPE_PAGE_POOL RxQ-0 [96.171466] imx-dwmac 5b050000.ethernet eth0: PHY [stmmac-1:00] driver [Qualcomm Atheros AR8031/AR8033] (irq=POLL) [96.188883] imx-dwmac 5b050000.ethernet eth0: No Safety Features support found [96.196221] imx-dwmac 5b050000.ethernet eth0: IEEE 1588-2008 Advanced Timestamp supported [96.204846] imx-dwmac 5b050000.ethernet eth0: registered PTP clock [96.225558] imx-dwmac 5b050000.ethernet eth0: FPE workqueue start [96.236858] imx-dwmac 5b050000.ethernet eth0: configuring for phy/rgmii-id link mode [96.249358] 8021q: adding VLAN 0 to HW filter on device eth0 Signed-off-by: Wei Fang Reviewed-by: Clark Wang --- V2 change: Remove "net" from the subject. --- arch/arm64/boot/dts/freescale/imx8dxl-evk.dts | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/arm64/boot/dts/freescale/imx8dxl-evk.dts b/arch/arm64/boot/dts/freescale/imx8dxl-evk.dts index 280a9c9d8bd9..1bcf228a22b8 100644 --- a/arch/arm64/boot/dts/freescale/imx8dxl-evk.dts +++ b/arch/arm64/boot/dts/freescale/imx8dxl-evk.dts @@ -135,6 +135,7 @@ ethphy0: ethernet-phy@0 { reg = <0>; eee-broken-1000t; qca,disable-smarteee; + qca,disable-hibernation-mode; vddio-supply = <&vddio0>; vddio0: vddio-regulator {