From patchwork Thu Aug 18 03:00:53 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wei Fang X-Patchwork-Id: 12946637 X-Patchwork-Delegate: kuba@kernel.org 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 CF195C25B08 for ; Thu, 18 Aug 2022 03:01:17 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S242946AbiHRDBM (ORCPT ); Wed, 17 Aug 2022 23:01:12 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59054 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S242930AbiHRDA5 (ORCPT ); Wed, 17 Aug 2022 23:00:57 -0400 Received: from EUR05-VI1-obe.outbound.protection.outlook.com (mail-vi1eur05on2054.outbound.protection.outlook.com [40.107.21.54]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B5363A74CB; Wed, 17 Aug 2022 20:00:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=km+PJ95VkyenNivIETBtRLjx7xXNKlk5iY1YSPuUcoHz6P4kw+HwK6sO3hB4mcZCbxY0OKA0wBJ1oY2CKRFBlM0WJdUZM/OJEHGAyNcM0NSJEF+0dYbCv/QrPiinKRl6ZqlLLYdh1rFxGJHdgrbbr/suWmNrN9xu5AU59gz0W9EjC4ZR86YvF9xEeHz3mlSqVlS5OASl0CyMOqFjHipSXOQTbcGUFpFus6l5JFWvtMUK8GGTHRtGPNZOHo8L784psoxKWBfO7af1HIBPxIqqKC1I0gJK97EoNLB85/I6amW4OIOJxiLXQnO7l/08k1Xbo1L6bkqRUZfcEdDEIAjp/w== 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=wsiiVW89XoQLMq5HgXUMki4nZjRqP/+iSXzWB+zkUHc=; b=OhxU8L05t+mSL1fwp+8Ipdw2P+3gVpOIE733nptY8WDCEgUnrpe8LVIOv9UPH+1HmqaevI1LrCTOdXmAthir/Lb1kW1kpPiEIxpdz1byVgtt+MB10HR1BoebuNQLabcuFvRxZEZnX4YNC9qzGq7vUS2QHtX+GgLP0snPdcPsbPrYazqqMhknU6scgp6k+Ony+4D5Ysh7YeWF/0f6vqLYvEOWwP1c2B2l8BrPZA9o42PMFmXsjLzpo33XsdmIW0peaTV9kf839X36Yw+tLkA2tnBRUIXuTKkfnnL20cYNYuKe4Cq/SjxOTarbJDzDMDi/AH7qzoVzmpBha3DHOmycVw== 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=wsiiVW89XoQLMq5HgXUMki4nZjRqP/+iSXzWB+zkUHc=; b=l0sPm6nIlsj/DnyvdtWbFoHK6gQlQ37eQ5oaI5+R/FCSMlHrwi9XxxeBvSL9tSfyQTJ5VE3pPkHOfHA96yfV0QBVBlpFnYBGb9u/rMgkukehKZ2Jwsm5e2jhCrvuOmDjyp5LxAkkLVvrWNaS5uARx5EA7laYPuhWPbuxc748AE4= 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 VI1PR04MB4637.eurprd04.prod.outlook.com (2603:10a6:803:70::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5546.16; Thu, 18 Aug 2022 03:00:54 +0000 Received: from DB9PR04MB8106.eurprd04.prod.outlook.com ([fe80::5598:eebf:2288:f279]) by DB9PR04MB8106.eurprd04.prod.outlook.com ([fe80::5598:eebf:2288:f279%9]) with mapi id 15.20.5525.010; Thu, 18 Aug 2022 03:00:54 +0000 From: wei.fang@nxp.com To: andrew@lunn.ch, hkallweit1@gmail.com, linux@armlinux.org.uk, davem@davemloft.net, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com, robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org, f.fainelli@gmail.com, netdev@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH V3 net 1/2] dt-bindings: net: ar803x: add disable-hibernation-mode propetry Date: Thu, 18 Aug 2022 11:00:53 +0800 Message-Id: <20220818030054.1010660-2-wei.fang@nxp.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220818030054.1010660-1-wei.fang@nxp.com> References: <20220818030054.1010660-1-wei.fang@nxp.com> X-ClientProxiedBy: SI2PR01CA0038.apcprd01.prod.exchangelabs.com (2603:1096:4:193::20) To DB9PR04MB8106.eurprd04.prod.outlook.com (2603:10a6:10:24b::13) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 642a98ae-74e0-419a-114e-08da80c5dd9a X-MS-TrafficTypeDiagnostic: VI1PR04MB4637:EE_ X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: pcpCXmZDz2g7e83dGGBZ3aY2aZcECwjSQdoWB5J2e2vBW4kF3+B5Z2jApNMLb7aZ/YdEDW3QD9449pF59sv24ZSCP7g92Ry8TEgTvDO96G0w2HeviIo2eYBj6MXoRkAGW5ISqqLKbDL8NJakFXxfD3uM9GI/ekD5AyLIWxNQvH6y4JgtIrhu3i7OcixpHrb9tmmp2GP9fUgqtl1VZ1y4iTV2UQbISTm0PblbFidJs3KLu0OE7CQgRQOu8tj+FIGgK+1J5gkrnR9+7yP7AOZa5S/1z6F+uTWolB5mEMy5L1Zty9ufsbKiwKDxsGKXKBiC49mzfamza/wDU2iG8350TSdRDKv0SHbCAwU3Y+2ftJJj1wZmcgHDQzgMCQ5o/4znSb+yp5inz0H6arvnDAlp3oiVHatLSwiaeFyfeyNU92SoN0l8c/7A982AtkJdNM/A9SoATdtWuujFn9dMTLs+AkVczlebxBoVXFj6DZbcbW02IPZhEcLgnnvTMbdJTDjtq95zuE47gR1BUvihpnAC0Gn5PLt9Slqoi6McPZXC7VanGm+Ske8ndSuHFIGrxEbT/mMawL0xA10UPYtbrWPYIeOn9OJsIQtywnxDpU0oWdPlOa1a6A+kpomyyPcWPS9gm+S9y3kHKaUoamwVv3hvmC5rGByZmeDTIyVS9FsS7ZvFldZRH36IEH5A3Ri4Ys8fYh98VBcKZzYgkwk5ZgvCVpAEBjX7F24vBe2yUbPyEswhKhe260O/P4gxwYjOWfs/d7eR1jBVcjthKKVhXp1VaA6eCgVps8jsS8qajxXTvQ0= 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:(13230016)(4636009)(376002)(346002)(366004)(39860400002)(136003)(396003)(83380400001)(52116002)(6512007)(6506007)(26005)(2616005)(1076003)(9686003)(186003)(38350700002)(38100700002)(66556008)(7416002)(8936002)(5660300002)(8676002)(66946007)(66476007)(2906002)(478600001)(6486002)(41300700001)(316002)(921005)(86362001)(36756003);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: 6ntjZP6mE+d4wLo45p/OryiI9d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gOijJ9BGkYPu41cDqw4B+8stXDXIlby5o5UDmLiFtA+hLht6oM8BLet3mrhfAWrIPduqZRNTvq/wPwG3U/ada/pH+M1VSUFbf5uDwyywHFzeruPdawv3VtE16k/4Q2fs/uEzrJOjgED9nEm/CN/HZ79KIntE6HVwCTradmUPVWoWafh9EXzlnPYitApEYxfwULuLRnTvCIF1kpWYMh42VdJiQXvc4cositlAo5EUxukyDIFyunGmbIpLYEwnXBSNqt8bvfkLhL3nuRKqYZ4cjSHewWgTPQDRoRSfdS5awcu1qsZ1V+5r0Q7VqPtcyvaEDkZiRo7X/YEce2PHUM2/epD8M+oAkL3GLBHiRyF5nbG5ccV8jxujMibN92S7gkDY05VAdxXEJn5cYTq6e7NEmU+IyCAiYZqWsi7C4fyzbE7ghiPoop89KdzrR3w4Qjh7xF1AQg6Nt/zZoR6SGTdTtGoBqFX8rQtgHsDJ+5DI5PB3Y4xTXkd4 X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 642a98ae-74e0-419a-114e-08da80c5dd9a X-MS-Exchange-CrossTenant-AuthSource: DB9PR04MB8106.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 Aug 2022 03:00:54.2526 (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: a3WCQ6OgfnfEz+3a6rhToc4xq+Ahe4zCpIoIvfUnMG+V0Ky6kqFYgpRnXPSKrDy/k3y4wNGK5/lIR5Q5jE74Og== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR04MB4637 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org From: Wei Fang The hibernation mode of Atheros AR803x PHYs defaults to be enabled after hardware reset. When the cable is unplugged, the PHY will enter hibernation mode after about 10 seconds and the PHY clocks will be stopped to save power. However, some MACs need the phy output clock for proper functioning of their logic. For instance, stmmac needs the RX_CLK of PHY for software reset to complete. Therefore, add a DT property to configure the PHY to disable this hardware hibernation mode. Signed-off-by: Wei Fang Reviewed-by: Rob Herring --- V2 change: 1. Add subject prefix. 2. Modify the property name and description to make them clear. V3 change: According to Andrew's suggestion, remodify the description to make it clear. --- Documentation/devicetree/bindings/net/qca,ar803x.yaml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/Documentation/devicetree/bindings/net/qca,ar803x.yaml b/Documentation/devicetree/bindings/net/qca,ar803x.yaml index b3d4013b7ca6..161d28919316 100644 --- a/Documentation/devicetree/bindings/net/qca,ar803x.yaml +++ b/Documentation/devicetree/bindings/net/qca,ar803x.yaml @@ -40,6 +40,14 @@ properties: Only supported on the AR8031. type: boolean + qca,disable-hibernation-mode: + description: | + Disable Atheros AR803X PHYs hibernation mode. If present, indicates + that the hardware of PHY will not enter power saving mode when the + cable is disconnected. And the RX_CLK always keeps outputting a + valid clock. + type: boolean + qca,smarteee-tw-us-100m: description: EEE Tw parameter for 100M links. $ref: /schemas/types.yaml#/definitions/uint32 From patchwork Thu Aug 18 03:00:54 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wei Fang X-Patchwork-Id: 12946638 X-Patchwork-Delegate: kuba@kernel.org 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 531FAC3F6B0 for ; Thu, 18 Aug 2022 03:01:41 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S242951AbiHRDBi (ORCPT ); Wed, 17 Aug 2022 23:01:38 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59362 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S242938AbiHRDBL (ORCPT ); Wed, 17 Aug 2022 23:01:11 -0400 Received: from EUR05-VI1-obe.outbound.protection.outlook.com (mail-vi1eur05on2047.outbound.protection.outlook.com [40.107.21.47]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 07715A7A8A; Wed, 17 Aug 2022 20:01:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Az1OP6I+U9e9yg1RJJzslRnf8FnXHvK4cNl5NI8tnn12/C5YeUu2WgpIiC8/gcqsA3g27p1AMhoPwLYC2vFkCoinrTbmIfXchrXdaYljPUnRvnMoQnxdIoF7R1gpVpnYomOk9pILOihTX2LFcoemiHhg2dWq1Y+HH5ckOPJHxQTWRnquq9pwL71fIANejQ2DCbDCb3AEDeZ24b5M4SoXT2yLjQd6/LK47M55XdqOs2Eg5nN7oI8ZcFqPLr9YXQ7VXeAq83Q3zKScATM7EkOcOxE/0/LzFrPljMJB38WBbROse4W4jfGfK+1Sn2TlS/4PhdAPdKBgQhro5kNyvZgNLA== 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=zVpWDT/kQ6DaYd8fFWFppvRa9MNAhIH2N4AhUaFN1lE=; b=R0qzhBfkMdmf624BJK5ffowgQfAyzY5tb//MURzTyJvff0HRAYr/CYQSR36axco1TF+Ubs/qixab35EkagdeXW7G0xyfreVfzynor7nX2MrjunSFplKzvRdlpmWd3l0rgHGn0PjtxgMbBs5GxmznuDfPUbqLyARHZvqf3Fp73D0tev2e4IIKs2ihSqGSOp6f1EvvhlOSSUo0+R6i16xaqzrBDcTNha9roskaaoZdVJtFCCyDyTfDTHixULod28iYzI379quabPlgL64VyBXt9lZbMW7xEsS5EoOYkgLRzeEyXiFFXu8F3M3OQ0+g05jPxWFFtoFRIJsF2sWMQrqKdw== 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=zVpWDT/kQ6DaYd8fFWFppvRa9MNAhIH2N4AhUaFN1lE=; b=oWcrgWbBotQyU3o8ZzILMYMOdYHDtiTtozaBziN0quWKKepvNOhPhzCStiRkTMuylZMDZxWHqad02CkY9qzrdlD42mVVdi3do9wkmZotYRQfDcBgtL1mb+ELNwR5MXxdq1LfWHIf0Da1fhLpiwjN6doBLYWWDi7vx7kDzIv+TGs= 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 VI1PR04MB4637.eurprd04.prod.outlook.com (2603:10a6:803:70::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5546.16; Thu, 18 Aug 2022 03:01:00 +0000 Received: from DB9PR04MB8106.eurprd04.prod.outlook.com ([fe80::5598:eebf:2288:f279]) by DB9PR04MB8106.eurprd04.prod.outlook.com ([fe80::5598:eebf:2288:f279%9]) with mapi id 15.20.5525.010; Thu, 18 Aug 2022 03:01:00 +0000 From: wei.fang@nxp.com To: andrew@lunn.ch, hkallweit1@gmail.com, linux@armlinux.org.uk, davem@davemloft.net, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com, robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org, f.fainelli@gmail.com, netdev@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH V3 net 2/2] net: phy: at803x: add disable hibernation mode support Date: Thu, 18 Aug 2022 11:00:54 +0800 Message-Id: <20220818030054.1010660-3-wei.fang@nxp.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220818030054.1010660-1-wei.fang@nxp.com> References: <20220818030054.1010660-1-wei.fang@nxp.com> X-ClientProxiedBy: SI2PR01CA0038.apcprd01.prod.exchangelabs.com (2603:1096:4:193::20) To DB9PR04MB8106.eurprd04.prod.outlook.com (2603:10a6:10:24b::13) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 52607a28-3295-4507-5a2c-08da80c5e15d X-MS-TrafficTypeDiagnostic: VI1PR04MB4637:EE_ X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: GofHPRwQn0qJdWlzFSZdw1/51x0/s0Taz0UhL4dHqu8GTmnYRrs1XCQK1iKDbY6SiIXmr5zvgnM8wmeXuFTRx7XVlTbkfV37ZXaJ4VAOP3ruKs+XwKl/sPL2vpgvpADT/gjwwJrqUZkXMox36omJEsbcHTLDudTWIaW0octT8gl+MzwjLi63JpEvFDSBHZOKZJPQeJGKP0xLl69VBbbxg5f3WMDrAF/xQx5yLZR16N305wUSMOQsmEb/vJVU1nAmq0edF7gACNkNmIkl7AgQ/FX0GMCHZqMoopfvnlnteDHIQDMGH6Z329XjUBOl4m1DzSSuGBh1Bwq+OFXpoQLWtE10lWkNFX4n73XRJkrwL44gke0t2n6TTrdI+JDhzorFVuWddbjtGZD7//iB5qJwL4BWfDnhn4GfDeF/60PXwWvsKEYBa96VYXGi1DTSdhurp+tgfCPxOvJoxyEMnNjvft2hbwpW52Wd2qmAqJTdkXNdlShBnNg78naloGOj1GPN5mRR3e+3R7ofJ5gyVIzGzYi5fs+QJKoQpivTXZj8pTZN08X9PwC+APgcLsx9CCUxuHou+ZDDld43PyeIACGFFpjc3vtdtFkRNLHDvykP2lcCMlUvMhvPOShfIh6lJNVR+YkKrb1o7o3u2qYJfK5At0L0x79fULuC3knf0DP6sslqZ/ZEUTEDwb+K/68WRoXESpWeWIczwlKwX7urEYJ7O8VYfQttOfNu+mnt6i3vdEzIn5Ct8pp1BKGvxApwN8OLu7k34cHQRCSZQ4rc6zUZ4AGp1IzCEdSI70Sb9BtWW+A= 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:(13230016)(4636009)(376002)(346002)(366004)(39860400002)(136003)(396003)(83380400001)(52116002)(6512007)(6506007)(26005)(2616005)(1076003)(9686003)(186003)(38350700002)(38100700002)(66556008)(7416002)(8936002)(5660300002)(8676002)(66946007)(66476007)(2906002)(6666004)(478600001)(6486002)(41300700001)(316002)(921005)(86362001)(36756003);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: tLxcUfBZazrpjPttVOWGq1bAZpVNJO+dtRv8DA5Qq5e41WZDNqc/eO0vdaez6EhuFQqRkfnWwOcbvc31H6kGr3PSuoZiaXiPzoIUDimqhjY2L4YCiAOjj3gChpKn0BxPKLHMU9UuzIGP2x9TqlZs+HieNDB8V/YfAo6cZUQ7WE2XsRHRgPj+R8pXwOs9ZssbTMghKPtg/A4LnT5q6RfeAStiWvXqk+ZPokyT/B4VZi+FittDPGYIYq48hVQcO0O/glpC0UbvTh1+26zVNF382ae2NhrF9RIgUvoXYeVRScGp6kf0JXpxGi/bKL6C5xkBJwgcfLKTXspytgyab5hi3rsz69IqJUKXmVvu/BYDuKW90Z4d0nhSDAh/dTDVBwAEDHR6n711T9VsSTEU3t6NnZIrd7EbamSVRyAcDz+Y1PrZTdKjmtGx/Cp7e4RYLY9t1IBCbApi7BqwRKHMY4yLGB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xbmZMaP4QEK9BexCepC7sMRqvMu6cccpM57KedYdy7MNpXI80R1kF X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 52607a28-3295-4507-5a2c-08da80c5e15d X-MS-Exchange-CrossTenant-AuthSource: DB9PR04MB8106.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 Aug 2022 03:01:00.5813 (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: 6DXD0Jvyoy5cLCRk7HKtjT0xdMPGRko1JvhfsDmRMVOqODzrhFNkNXep9rP6U1miihudu+KrYnSApiLLvWqHNw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR04MB4637 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org From: Wei Fang When the cable is unplugged, the Atheros AR803x PHYs will enter hibernation mode after about 10 seconds if the hibernation mode is enabled and will not provide any clock to the MAC. But for some MACs, this feature might cause unexpected issues due to the logic of MACs. Taking SYNP MAC (stmmac) as an example, if the cable is unplugged and the "eth0" interface is down, the AR803x PHY will enter hibernation mode. Then perform the "ifconfig eth0 up" operation, the stmmac can't be able to complete the software reset operation and fail to init it's own DMA. Therefore, the "eth0" interface is failed to ifconfig up. Why does it cause this issue? The truth is that the software reset operation of the stmmac is designed to depend on the RX_CLK of PHY. So, this patch offers an option for the user to determine whether to disable the hibernation mode of AR803x PHYs. Signed-off-by: Wei Fang Reviewed-by: Andrew Lunn --- V2 change: Modify the property name and the function name to make them more clear. V3 change: No change. --- drivers/net/phy/at803x.c | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/drivers/net/phy/at803x.c b/drivers/net/phy/at803x.c index 59fe356942b5..11ebd59bf2eb 100644 --- a/drivers/net/phy/at803x.c +++ b/drivers/net/phy/at803x.c @@ -115,6 +115,7 @@ #define AT803X_DEBUG_REG_HIB_CTRL 0x0b #define AT803X_DEBUG_HIB_CTRL_SEL_RST_80U BIT(10) #define AT803X_DEBUG_HIB_CTRL_EN_ANY_CHANGE BIT(13) +#define AT803X_DEBUG_HIB_CTRL_PS_HIB_EN BIT(15) #define AT803X_DEBUG_REG_3C 0x3C @@ -192,6 +193,9 @@ #define AT803X_KEEP_PLL_ENABLED BIT(0) #define AT803X_DISABLE_SMARTEEE BIT(1) +/* disable hibernation mode */ +#define AT803X_DISABLE_HIBERNATION_MODE BIT(2) + /* ADC threshold */ #define QCA808X_PHY_DEBUG_ADC_THRESHOLD 0x2c80 #define QCA808X_ADC_THRESHOLD_MASK GENMASK(7, 0) @@ -730,6 +734,9 @@ static int at803x_parse_dt(struct phy_device *phydev) if (of_property_read_bool(node, "qca,disable-smarteee")) priv->flags |= AT803X_DISABLE_SMARTEEE; + if (of_property_read_bool(node, "qca,disable-hibernation-mode")) + priv->flags |= AT803X_DISABLE_HIBERNATION_MODE; + if (!of_property_read_u32(node, "qca,smarteee-tw-us-1g", &tw)) { if (!tw || tw > 255) { phydev_err(phydev, "invalid qca,smarteee-tw-us-1g\n"); @@ -999,6 +1006,20 @@ static int at8031_pll_config(struct phy_device *phydev) AT803X_DEBUG_PLL_ON, 0); } +static int at803x_hibernation_mode_config(struct phy_device *phydev) +{ + struct at803x_priv *priv = phydev->priv; + + /* The default after hardware reset is hibernation mode enabled. After + * software reset, the value is retained. + */ + if (!(priv->flags & AT803X_DISABLE_HIBERNATION_MODE)) + return 0; + + return at803x_debug_reg_mask(phydev, AT803X_DEBUG_REG_HIB_CTRL, + AT803X_DEBUG_HIB_CTRL_PS_HIB_EN, 0); +} + static int at803x_config_init(struct phy_device *phydev) { struct at803x_priv *priv = phydev->priv; @@ -1051,6 +1072,10 @@ static int at803x_config_init(struct phy_device *phydev) if (ret < 0) return ret; + ret = at803x_hibernation_mode_config(phydev); + if (ret < 0) + return ret; + /* Ar803x extended next page bit is enabled by default. Cisco * multigig switches read this bit and attempt to negotiate 10Gbps * rates even if the next page bit is disabled. This is incorrect