Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp367458ybt; Wed, 24 Jun 2020 01:00:25 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx5rsz0HlMo0FE9JtQHdovh//D7mBAto05n9jgHLswstI9xkrxhnOU+QioW28CVKhtZlFS6 X-Received: by 2002:a17:906:404e:: with SMTP id y14mr9954623ejj.260.1592985625563; Wed, 24 Jun 2020 01:00:25 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1592985625; cv=pass; d=google.com; s=arc-20160816; b=fnG0DQaDL9Fove3DV7ETzE3YPimXeqHac5Wn8gHteO2tp61BmlE5/YjKZOODoSb9d5 Rij06w4XDj89rcX00ed1tPS3ZyjF2KxvORNvYF81Z/LA2Ey875FA946YzRiM9lbLwaPc jAfnCZWWaxl8VsTtF1fRq0rvwmsgndTdm5GifjmXjnEiBrV9bfk69ajXD+v9U+bRC4T1 hmY4aeRCUgrlZHVilhQoLKDGdLHHjWenf3JperZH/QlUJkDVQMpPS+2UNGtSR1AzZetw MKaSYPTezr08fedJF7f6u7IAk2VH1q8tNr+2aP6W0hYEFnHuIf8ExmM6BrNw+GmCckcK hv/Q== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:content-transfer-encoding :references:in-reply-to:message-id:subject:cc:to:from:date :dkim-signature; bh=esmGpd06+XbH8PEb5lccTyTxqWbNOmlM7DnYQwXJAHw=; b=QVeAe05oTM0d9Kn/Rq/i+AYUCIKY1d97daYqCF6VCg/wZo1+bTesS+SZleBhFYPyzY 6fn+5DRTWLJVEzSOZ6OHb3+gIm6KIhe1e91+wkrD89pNNJyKUvfZu2DdS5jPJtKtag7+ J6qRHn2BdNQXoDxkLn6H9O66FIOUYjQHldVJlYp41CIoKmfPEPpfxoYfJRBwxmR3csE+ KMoKD4A4vLalFIqy8GxeaIGWB793rvwlfK8puRfP6vFL6fKjVqQnKbchuc5NvpyIbjIG JOI+8vd5Qy7x/Ww2eI5Yzt9slo8SwMk/2ob1w/ekOuZgcC++16MBuo7ewW83gnFMAW20 3Ysg== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@Synaptics.onmicrosoft.com header.s=selector2-Synaptics-onmicrosoft-com header.b=DfbNRKOp; arc=pass (i=1 spf=pass spfdomain=synaptics.com dkim=pass dkdomain=synaptics.com dmarc=pass fromdomain=synaptics.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id o6si451217ejn.680.2020.06.24.01.00.01; Wed, 24 Jun 2020 01:00:25 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@Synaptics.onmicrosoft.com header.s=selector2-Synaptics-onmicrosoft-com header.b=DfbNRKOp; arc=pass (i=1 spf=pass spfdomain=synaptics.com dkim=pass dkdomain=synaptics.com dmarc=pass fromdomain=synaptics.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2390223AbgFXH7u (ORCPT + 99 others); Wed, 24 Jun 2020 03:59:50 -0400 Received: from mail-co1nam11on2080.outbound.protection.outlook.com ([40.107.220.80]:18896 "EHLO NAM11-CO1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S2390208AbgFXH7s (ORCPT ); Wed, 24 Jun 2020 03:59:48 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=PZd5WC9kbD5oWekYISiKw/fL/0DUrihCGGmq3n5qTBak9frlNv7TlKlbsBGdCp9D04933uYdWBqWgeocFAMrOPKEoBhbSypWdyJn+WXFdF2OQ3rnlzPIuYQCMHu0n2tuv3ozrcrnRSD89jzOK4k5XCxJubiHP/H+0XOIo1PDY0agqJypOEbpFefdL+LlA8jIX+nAv3lEkfTnaDfp0I9rO5uYoIF1sPJLKaMepfexJW8gqYYdnLnVt7VKiGX3WCRO0qrtxWNSYGCQhQsxkiDFk+Xm/lAIbtA8k0MgJGerLgmHFYqr+tf7/veTOxEGaxU5WYQAMQU4vWRRISV3bQZ/NQ== 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=esmGpd06+XbH8PEb5lccTyTxqWbNOmlM7DnYQwXJAHw=; b=m7EaDwfsDtGfIVyMDQ1ReYExEbN8Z+7x+VRsVR2Py+apEzy4uLX8dSbcrfUC4U4XCZBdl9PxZ+zzU/hfri6NBJlS81GIF/rwVRdy45+XkBWHueOhEnBSbXFVlT1rMFilwbdi/QMpAaClRq2guRoOOSeiOZ5dy38hGEtmclMApAatc6jkNqLWAlHRC0DgPIBniprvwGpnH/HZArR2VtsZhfRv1bRBtYP4XT0wfXnRpOolzlRNpBHPo7EHAgpdAJWt3zHVdmbwin6vwh5HU/HL8YTDRKE38kY+hJCDVfWAdQ670WV3u1Uzl17G1QgCjOW8xyxHp9bSU+vZzF4ztWi2aQ== 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=esmGpd06+XbH8PEb5lccTyTxqWbNOmlM7DnYQwXJAHw=; b=DfbNRKOpdDCt0nWuEg38GViXzyMYT/38uv7ZyaH52L+GoTFh7Fw+cpSAJQZxsVBxrpPZ9UZkldIGF/EW7TiX+9faoC8Ri+5qqlrw6arkwzzfNIugwkz02Y99Xbg/NfIHhoJTuJieyw6TRCeDYO1Ngr0sb+QvApGCknSOX+0or3U= 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 BY5PR03MB5361.namprd03.prod.outlook.com (2603:10b6:a03:21a::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3131.20; Wed, 24 Jun 2020 07:59:46 +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; Wed, 24 Jun 2020 07:59:46 +0000 Date: Wed, 24 Jun 2020 15:58:24 +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 v4 1/2] net: phy: make phy_disable_interrupts() non-static Message-ID: <20200624155824.4afc1a8e@xhacker.debian> In-Reply-To: <20200624155757.6b2e82cb@xhacker.debian> References: <20200624155757.6b2e82cb@xhacker.debian> X-Mailer: Claws Mail 3.17.5 (GTK+ 2.24.32; x86_64-pc-linux-gnu) Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-ClientProxiedBy: TY1PR01CA0190.jpnprd01.prod.outlook.com (2603:1096:403::20) 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 TY1PR01CA0190.jpnprd01.prod.outlook.com (2603:1096:403::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3131.21 via Frontend Transport; Wed, 24 Jun 2020 07:59:44 +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: 8fa41d64-4cd9-492b-17b2-08d818148fe8 X-MS-TrafficTypeDiagnostic: BY5PR03MB5361: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:9508; X-Forefront-PRVS: 0444EB1997 X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: Sl/2udKB+E2qYxrHG2RkJTNtOttEynxsUxQqw9uzB4aa0nNSCFJ0vpNTzKSvJ7AZyAGFyqmTzYKGs4q5hQaGOA0zg43pSa9MvRy7yzFR4Sl9qoVd7c7+tWO6OToTaQzV/4QRZEvhpCpsgqTfqON2oqfNhRdjiCroq9KM9xc0pPrEHGe9dAyCvHSrf8sPxWA6DMznJWw84ZuEdrJnzJn2Q9Ee3r+xwYN/Rpe5jgV/Jd4bM6yE4rfM7SiCRJJMmQslGlyXWxBxVBjCz6g9oBglNt2WuqanIYzFZt+9WkrKQYAOQMt1kuN2L/89ad6ioArq 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)(366004)(396003)(39860400002)(346002)(136003)(6506007)(52116002)(26005)(186003)(16526019)(7696005)(8676002)(66556008)(66476007)(110136005)(6666004)(8936002)(66946007)(9686003)(55016002)(1076003)(316002)(4326008)(478600001)(956004)(2906002)(83380400001)(5660300002)(86362001);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData: 5WJHrr8ytDXhAXwoPjuPvi1veNhs92OJa8uBMT4nZDkhv/lGp4G461EWUdR9XA8HbLxxDznQFQ+DvkABNJ4K6HEFKaD8AuOuNHHKdeatxaMNIK6jAnTxGcd8lnHxgRJzKNpHINd69bQtdbjkdNKKRuRsKcOqctrkCMNIVR9ajPNZdpGmoyn2z88X5F1fhUxMwn4pxzEjh0wnG75EGqU5KGrIWDHqznXsk1g7iiuEHKhOj9s3pwueiSKk76hMT/Z/iB0ctd/rLZbRbXGB64NJDk897tvkY8TH9ZXkPpgKUEkqv+/2Yv5K8dhfBnKISmCe6qUjzteq9zKHsFeu9T2Kt3OFqYkRrOR57YZwYL2uxYH8hzG2HV1FS9j6hYD2Ik6rp1pLY6jw2siNp/qqYfr0GIxWqK5jvDrrbXqEIGem8gX4k53HY1OjLpLiRdhtqGixeCDMkfkNEGlR2Ngx1HrH+unO++u5kBZD3BlZb73ZzE/l2RQJ3YEjoPV+PQupqG7J X-OriginatorOrg: synaptics.com X-MS-Exchange-CrossTenant-Network-Message-Id: 8fa41d64-4cd9-492b-17b2-08d818148fe8 X-MS-Exchange-CrossTenant-AuthSource: BYAPR03MB3573.namprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 24 Jun 2020 07:59:46.8248 (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: /G/BScYBBjEKNBETTq872aXzaggdTSmg5V/MP+uYgl1LABHScFj9NKPLl7B/w0bBnhx9pw7YORPrxk2ewnWiBw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY5PR03MB5361 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@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." Make phy_disable_interrupts() non-static 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 | 2 +- include/linux/phy.h | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/net/phy/phy.c b/drivers/net/phy/phy.c index 1de3938628f4..56cfae950472 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; 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); -- 2.27.0