From patchwork Mon Jun 22 10:29:27 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jisheng Zhang X-Patchwork-Id: 217406 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.5 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, MSGID_FROM_MTA_HEADER, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, USER_AGENT_SANE_2 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1F885C433DF for ; Mon, 22 Jun 2020 10:31:11 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id E5C9020578 for ; Mon, 22 Jun 2020 10:31:10 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=Synaptics.onmicrosoft.com header.i=@Synaptics.onmicrosoft.com header.b="GU61v2ZL" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727908AbgFVKbI (ORCPT ); Mon, 22 Jun 2020 06:31:08 -0400 Received: from mail-bn8nam12on2049.outbound.protection.outlook.com ([40.107.237.49]:17472 "EHLO NAM12-BN8-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727876AbgFVKbE (ORCPT ); Mon, 22 Jun 2020 06:31:04 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=hv/YnjkCQBxFMjwj06n9YEGUr0jQ3mB9QA/OG/SDTzxInn3hoxfm7mxkVcOwI/+H8TxTsUDHbfM6zXKDJZcadjkeyUzqHR3E88mkbbORqQe9SPpxRYRI9BzRAlmb3O80RzBlS8lDPJvy2LPZeCHBfOoCFgrXoBgG0inHiSIZE1ZNOjSsbsEoB7B0NNoVujXr4K2f+yP7GYCQIMNfafjy1rqroy9xCq8me4CUyjiz53AwMQj7fVsIP31xINU9tiFGD/EGBDM8Bk7rctHB1NcWMK9q8I3rufdYjBwaGCOLEeZomDFAD+on1wZa6UVOLmXz8XjXj571oa51tYkbrcXglA== 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-SenderADCheck; bh=aLqXYD5+M1qr6969+54SQO/N2iaUDB9aJQm0E0oXLNo=; b=GY3GCjnq1KFlxHiE47Hurv3p1dcBqs+lmhaiSacbA7wiuisRa/U+2ulAqQGAyaDx6j44LLk+sUh7rOEs5IGzsrAZgS2Ifz9H6n76L9MB0SISB/ZZT/6CxH8Hfl/+WKcfj3g71/LrS9d00IZnD8oRVli6oAcRLBWWn86iSkZ+LF3OtqJiVXYOhRoDzKU7Dm88VvVJwjByYpdbz9B4OMIuyjvSlfANWiAFUjJj4/VNr2lSZfW2x0RGCralcBvMeSSbk5dRJHSjClt112I2OIKUHqzwr9IAQBcFmvNqgyN3f2GnpF/D4lSkoOQT5jx6CwdKWJ1BztfixiaTRzY9RquCcQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=synaptics.com; dmarc=pass action=none header.from=synaptics.com; dkim=pass header.d=synaptics.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Synaptics.onmicrosoft.com; s=selector2-Synaptics-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=aLqXYD5+M1qr6969+54SQO/N2iaUDB9aJQm0E0oXLNo=; b=GU61v2ZLCDwzZ5qZB1LPuLv7/cLwZHOoizjRn2kQzGsa4kFPPk2UnB3KsxPWcZSVwnVECyPmCYZ0tqxLjhw+2wP+0gJzkoioJzqd6fkKAEZajp0RwONYGBDuVexpdz/z9klVRdWOJrEdCc5IunTxfB7vPvwYDJxQ+tBpux8f8u0= Authentication-Results: lunn.ch; dkim=none (message not signed) header.d=none; lunn.ch; dmarc=none action=none header.from=synaptics.com; Received: from BYAPR03MB3573.namprd03.prod.outlook.com (2603:10b6:a02:ae::15) by BYAPR03MB4134.namprd03.prod.outlook.com (2603:10b6:a03:18::28) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3109.23; Mon, 22 Jun 2020 10:31:01 +0000 Received: from BYAPR03MB3573.namprd03.prod.outlook.com ([fe80::d1ae:8ea7:ea:8998]) by BYAPR03MB3573.namprd03.prod.outlook.com ([fe80::d1ae:8ea7:ea:8998%7]) with mapi id 15.20.3109.027; Mon, 22 Jun 2020 10:31:01 +0000 Date: Mon, 22 Jun 2020 18:29:27 +0800 From: Jisheng Zhang To: Andrew Lunn , Florian Fainelli , Heiner Kallweit , Russell King , "David S. Miller" , Jakub Kicinski Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 1/2] net: phy: export phy_disable_interrupts() Message-ID: <20200622182927.7679958e@xhacker.debian> In-Reply-To: <20200622182857.3130b555@xhacker.debian> References: <20200622182857.3130b555@xhacker.debian> X-Mailer: Claws Mail 3.17.5 (GTK+ 2.24.32; x86_64-pc-linux-gnu) X-ClientProxiedBy: TYBP286CA0043.JPNP286.PROD.OUTLOOK.COM (2603:1096:404:10a::31) To BYAPR03MB3573.namprd03.prod.outlook.com (2603:10b6:a02:ae::15) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from xhacker.debian (124.74.246.114) by TYBP286CA0043.JPNP286.PROD.OUTLOOK.COM (2603:1096:404:10a::31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3109.22 via Frontend Transport; Mon, 22 Jun 2020 10:30:59 +0000 X-Mailer: Claws Mail 3.17.5 (GTK+ 2.24.32; x86_64-pc-linux-gnu) X-Originating-IP: [124.74.246.114] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 6dd8137b-601a-4659-8418-08d816975c3b X-MS-TrafficTypeDiagnostic: BYAPR03MB4134: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:9508; X-Forefront-PRVS: 0442E569BC X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: vl7G1RWmpuQ/0PGIoTdv1p5CECCQ5hlxI53S0xh8X2AHzh33omHWxiY+ay+7XtEg+ubO08iFg7npWho0Pz6QJJBeYu3CL99oUXeNcBgTSZaa1dQpsGhsz1r117VE+NduFcqSi9tpCkgQB2pmdUuRX+ps48Ax9LgMyAr8Pondw4yzlxiKijc2mNAiZ2cXiIGPWkuPMcFLM1S3jxUNcw4ZtHSmkkwrfJPX+l/mrmkjJ/6RbUjBaUTO0CWsi+pzU6n8D7wuNptYKzObKoXkju50zWG5eYUyFI2eiDfJF9nEPEe3oH2l/6XBBCBxVnxmcgHM X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:BYAPR03MB3573.namprd03.prod.outlook.com; PTR:; CAT:NONE; SFTY:; SFS:(376002)(136003)(346002)(39860400002)(366004)(396003)(83380400001)(7696005)(66946007)(16526019)(186003)(52116002)(26005)(8676002)(956004)(8936002)(6506007)(4326008)(6666004)(86362001)(9686003)(1076003)(5660300002)(55016002)(110136005)(66556008)(66476007)(478600001)(316002)(2906002); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData: SjJFpd2Fu3kp3jnbwvPnZBtQR1Qs3Aec4GV3hnQR7sCqUJFGYpaUfPVwzrTLa1X16hldel8qOCT7OPEH5Js0lwQxeto7utbbGSb39RH2AaywVRsaLUYiTExFxIzrQn+x9o1Ce/3y20fyEJOBFttKp8qGUkazNizLAXrnmjgl5G14+Wll0o0nQKEGtstOH+AX85HJv8zRKpdvYr+y5h8w2qEAaYGf4RW7ExDYMtOvBYO+oyW/ltDfP5ephfa8583agmGhdg6eAOyq1emw4OMpZKkwMDgYd2q30Ikzpi5JtA0p0XAjjury0FXtI9oGAd4XORwm/0YPpvjOIpPXxLice3N8na+evL7p/KpbYc3RJMm0OnmNDD+NWLrO7yhWOp+RzsfdRoKKhuqGND16yowhYRZDR4xNOP1xuRzBXxVIQCFRS5eNEVbtDXFkz9I7+VHQvEpiYE5NhVPNuRpMvbmOQ1oZ4n8wMkh489l0jdGzxdj6NkccEDgS4cReg0f0O2Mk X-OriginatorOrg: synaptics.com X-MS-Exchange-CrossTenant-Network-Message-Id: 6dd8137b-601a-4659-8418-08d816975c3b X-MS-Exchange-CrossTenant-OriginalArrivalTime: 22 Jun 2020 10:31:01.7391 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 335d1fbc-2124-4173-9863-17e7051a2a0e X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: UdqjdRJdPol3sz/ZOVEyFE9KjeNXrnRWHg+96f9jw+OMZs7xy0aMFtOHqydwxVvMqSEm+jqd6BEQjlS/QKXuyg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: BYAPR03MB4134 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org We face an issue with rtl8211f, a pin is shared between INTB and PMEB, and the PHY Register Accessible Interrupt is enabled by default, so the INTB/PMEB pin is always active in polling mode case. As Heiner pointed out "I was thinking about calling phy_disable_interrupts() in phy_init_hw(), to have a defined init state as we don't know in which state the PHY is if the PHY driver is loaded. We shouldn't assume that it's the chip power-on defaults, BIOS or boot loader could have changed this. Or in case of dual-boot systems the other OS could leave the PHY in whatever state." Export phy_disable_interrupts() so that it could be used in phy_init_hw() to have a defined init state. Suggested-by: Heiner Kallweit Signed-off-by: Jisheng Zhang --- drivers/net/phy/phy.c | 3 ++- include/linux/phy.h | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/net/phy/phy.c b/drivers/net/phy/phy.c index 1de3938628f4..a3d92a15da71 100644 --- a/drivers/net/phy/phy.c +++ b/drivers/net/phy/phy.c @@ -840,7 +840,7 @@ static void phy_error(struct phy_device *phydev) * phy_disable_interrupts - Disable the PHY interrupts from the PHY side * @phydev: target phy_device struct */ -static int phy_disable_interrupts(struct phy_device *phydev) +int phy_disable_interrupts(struct phy_device *phydev) { int err; @@ -852,6 +852,7 @@ static int phy_disable_interrupts(struct phy_device *phydev) /* Clear the interrupt */ return phy_clear_interrupt(phydev); } +EXPORT_SYMBOL_GPL(phy_request_interrupt); /** * phy_interrupt - PHY interrupt handler diff --git a/include/linux/phy.h b/include/linux/phy.h index 8c05d0fb5c00..b693b609b2f5 100644 --- a/include/linux/phy.h +++ b/include/linux/phy.h @@ -1416,6 +1416,7 @@ int phy_ethtool_ksettings_set(struct phy_device *phydev, int phy_mii_ioctl(struct phy_device *phydev, struct ifreq *ifr, int cmd); int phy_do_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd); int phy_do_ioctl_running(struct net_device *dev, struct ifreq *ifr, int cmd); +int phy_disable_interrupts(struct phy_device *phydev); void phy_request_interrupt(struct phy_device *phydev); void phy_free_interrupt(struct phy_device *phydev); void phy_print_status(struct phy_device *phydev); From patchwork Mon Jun 22 10:29:53 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jisheng Zhang X-Patchwork-Id: 217407 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.5 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, MSGID_FROM_MTA_HEADER, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, USER_AGENT_SANE_2 autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id C159AC433E0 for ; Mon, 22 Jun 2020 10:30:55 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id A07B12076A for ; Mon, 22 Jun 2020 10:30:55 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=Synaptics.onmicrosoft.com header.i=@Synaptics.onmicrosoft.com header.b="ahWmozKK" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727838AbgFVKax (ORCPT ); Mon, 22 Jun 2020 06:30:53 -0400 Received: from mail-bn8nam12on2057.outbound.protection.outlook.com ([40.107.237.57]:43947 "EHLO NAM12-BN8-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726905AbgFVKax (ORCPT ); Mon, 22 Jun 2020 06:30:53 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=TQVGVL51SZG1/YDQIi1GS85xb7xyOhc1ULuGR1NuuMzmudpwGQOuygQmfeHytqthNQKNe+a11cYY3Y/YKJUtp/nO1+rLNEtPG1rukHsJEPErOAQSr251gBuGz5T6c+nBt63SA3S1bZ4OY58XgWSgpch/hhmqrvLuhLu6HwonE0B9s1lDUcqS4cvbirRW9gXQfZ15mIK9MnhJM2vltKw/e53m6T4ePHU7iJzeq0pfIh4nudIiW5Io4yiLqMuN6HLUHjVSR2Xb4h0YY9uoZ/cqJvcQzrfP5FI656mcbu9gofQ0eY2vzuj91bHYiUnizIHzFyJcp7pBIOpvnyQJTOGSdQ== 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-SenderADCheck; bh=TAARXCDWVw/k6mgBlRNGXmLSZOUoss4oi3ce53G+E4w=; b=GTaKXKfOTQ7z8ojcLdGhVJ4IVeIGpsjXsLA442MzMF1uCPpBnOsNjZfNoabajlATWleynT3CGxRAyw2QzUsPwH9niuQ+iNNsaVdmJEGvc3gScSmvihnB8b30DI+pKsqIpJO3wk/lW6m8AzEJISwJaRV+nloK/DlR5snEcY/PfU4EbQNkI76mg5jnatYwJtoLEhq/QEUIMRWvwi0uq9XNALgBXMZs9hsrtNqaQ3D8mgVBDR6DsLroaJbnlR4uAky7+jR8ghYPZCxfu4TbfM+7C+j+lYVbDZ37X8UkJMwDNBXuePrU6Mbx7GgGN4raXCxsBoCB5JSTJq6PU8mhlZgLnQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=synaptics.com; dmarc=pass action=none header.from=synaptics.com; dkim=pass header.d=synaptics.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Synaptics.onmicrosoft.com; s=selector2-Synaptics-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=TAARXCDWVw/k6mgBlRNGXmLSZOUoss4oi3ce53G+E4w=; b=ahWmozKKd0cnNaAmJWOB/3nRaNtuYTSiGCizEjNnSZrIWEpx21QPCfq1m/iHFJVFzkMpAqh6QXV1CTiGdLHwkQ4yxPmKz1fTTwIOmaSXFGk6gFp8Nbm2ciIhoa2f18Nh5eRVaEpU47EpU3k8PM82xy95dV568bMGuYbdiOHJWGA= Authentication-Results: lunn.ch; dkim=none (message not signed) header.d=none; lunn.ch; dmarc=none action=none header.from=synaptics.com; Received: from BYAPR03MB3573.namprd03.prod.outlook.com (2603:10b6:a02:ae::15) by BYAPR03MB4134.namprd03.prod.outlook.com (2603:10b6:a03:18::28) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3109.23; Mon, 22 Jun 2020 10:30:49 +0000 Received: from BYAPR03MB3573.namprd03.prod.outlook.com ([fe80::d1ae:8ea7:ea:8998]) by BYAPR03MB3573.namprd03.prod.outlook.com ([fe80::d1ae:8ea7:ea:8998%7]) with mapi id 15.20.3109.027; Mon, 22 Jun 2020 10:30:49 +0000 Date: Mon, 22 Jun 2020 18:29:53 +0800 From: Jisheng Zhang To: Andrew Lunn , Florian Fainelli , Heiner Kallweit , Russell King , "David S. Miller" , Jakub Kicinski Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 2/2] net: phy: call phy_disable_interrupts() in phy_init_hw() Message-ID: <20200622182953.4d642e15@xhacker.debian> In-Reply-To: <20200622182857.3130b555@xhacker.debian> References: <20200622182857.3130b555@xhacker.debian> X-Mailer: Claws Mail 3.17.5 (GTK+ 2.24.32; x86_64-pc-linux-gnu) X-ClientProxiedBy: TYBP286CA0043.JPNP286.PROD.OUTLOOK.COM (2603:1096:404:10a::31) To BYAPR03MB3573.namprd03.prod.outlook.com (2603:10b6:a02:ae::15) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from xhacker.debian (124.74.246.114) by TYBP286CA0043.JPNP286.PROD.OUTLOOK.COM (2603:1096:404:10a::31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3109.22 via Frontend Transport; Mon, 22 Jun 2020 10:30:47 +0000 X-Mailer: Claws Mail 3.17.5 (GTK+ 2.24.32; x86_64-pc-linux-gnu) X-Originating-IP: [124.74.246.114] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: a580005b-b185-4e41-5eb9-08d8169754a4 X-MS-TrafficTypeDiagnostic: BYAPR03MB4134: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:8273; X-Forefront-PRVS: 0442E569BC X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: ny7L9cxdlSvvPgRJrUU/51nN6JNeRlI9HPQwQnAxtLZJ8owffKiQzcUBbETMUjVjJ0cPWTqXjEgDvI+cd1Z7inuzDqn2nlCIPu1ePBUiUViQKDWfw88BeY1JEKumrbDnvOn7vWLNfR7UmCNIN9AJNGbXd4E12gBEQT9YMFp3ROWCkkxmCp+wNg9zdadCuOT6qKvKmTzXo6v6Mv0V807xsxhqSoNvbQZ/1mPioNK+/EIMA/YE17zGy3dHbP4eYSwFij/uELXe+QgFsACMvofK2lCldJRr75vRBAvGFFS4gvH2iuCGWx7Qsz0CWLtKwr69 X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:BYAPR03MB3573.namprd03.prod.outlook.com; PTR:; CAT:NONE; SFTY:; SFS:(376002)(136003)(346002)(39860400002)(366004)(396003)(83380400001)(7696005)(66946007)(16526019)(186003)(52116002)(26005)(8676002)(956004)(8936002)(6506007)(4326008)(6666004)(86362001)(9686003)(1076003)(5660300002)(55016002)(110136005)(66556008)(66476007)(478600001)(316002)(2906002); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData: Sp7I8JNIjMLAHsy0+7dQL5fg1B9yMeLOZ2O9UjcHSzrGNSujgMJcEM7mk/IQMi8aCqWuDxefp5lLdcrtDeY0LABrNWxDp9d8WbM1vxZy0QPfDeJXYQOc08c5EYOuPVzT5EPzS07bF+fS7YpLMuzzRfeB62e0Wrd54ugYW1KwnCq5gyd8XjJBgCWyuI7ZAfLmVmfRY7iWdM84lTdEblJ9QAbiYT+YSFHTKMd9Cs3DAgxYs4tVLZOUpoE+6B4ZbmCWfoRIZumtkcwdYMXA5A5OYSkkrzQdEWaPOoKkhT1VSUFvXj/OjJKjmfm0FIcCJbfe0lBqe+GNLcaTnqZB2xTOTFZvCFsjvHcKC4tWt4XmGXGNXrZf20nTXmZorQiR0OZEo+INSI8ZAXR6WmqO1umfXZchthTRbhYq9TOKamcxhVrxtNkXXdBHkv+3EqoYkhfmnX+cJIji8ZI+ZfjCjC2bqjI0sTzGhAiNuj8DccI7L2LvVYk/sqBwSnmglzj2hBup X-OriginatorOrg: synaptics.com X-MS-Exchange-CrossTenant-Network-Message-Id: a580005b-b185-4e41-5eb9-08d8169754a4 X-MS-Exchange-CrossTenant-OriginalArrivalTime: 22 Jun 2020 10:30:49.1874 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 335d1fbc-2124-4173-9863-17e7051a2a0e X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: uu1+8LYMuYccyNlbxT6L/QU+HL9rZj+2WIXueLS2WcHHjhVIro8rScFBAj/KjSgSqvxMhqmUGmcTP/lk3prbIQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: BYAPR03MB4134 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org Call phy_disable_interrupts() in phy_init_hw() to "have a defined init state as we don't know in which state the PHY is if the PHY driver is loaded. We shouldn't assume that it's the chip power-on defaults, BIOS or boot loader could have changed this. Or in case of dual-boot systems the other OS could leave the PHY in whatever state." as Pointed out by Heiner. Suggested-by: Heiner Kallweit Signed-off-by: Jisheng Zhang --- drivers/net/phy/phy_device.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/drivers/net/phy/phy_device.c b/drivers/net/phy/phy_device.c index 04946de74fa0..f17d397ba689 100644 --- a/drivers/net/phy/phy_device.c +++ b/drivers/net/phy/phy_device.c @@ -1090,10 +1090,13 @@ int phy_init_hw(struct phy_device *phydev) if (ret < 0) return ret; - if (phydev->drv->config_init) + if (phydev->drv->config_init) { ret = phydev->drv->config_init(phydev); + if (ret < 0) + return ret; + } - return ret; + return phy_disable_interrupts(phydev); } EXPORT_SYMBOL(phy_init_hw);