Received: by 10.192.165.156 with SMTP id m28csp419044imm; Thu, 19 Apr 2018 01:04:41 -0700 (PDT) X-Google-Smtp-Source: AIpwx4/0tNnz8Ob9NwfaDgvciuOy0Uql1820tN6YNkZN+36zxCXGmCXlKge5O+wZYl+bUgcO+j6Y X-Received: by 10.99.2.199 with SMTP id 190mr4422928pgc.11.1524125081370; Thu, 19 Apr 2018 01:04:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524125081; cv=none; d=google.com; s=arc-20160816; b=PKU9rHbbZImAo2PJi9G4zWSBmHIfMvH3NXACLyC22X+7S3J1uaUuJ80lXxQjtC3zco xenbyHBF+BEv+kpPulXwDJeuatsldR+zSNwaLR/TrchB29hcqH08xaqTgkMeUtYjXulA b7ra3jWvKS/qLVEVl1gvlsD3wpbchYNL/iroDaaU9LnlnnODgwtruMhlixLUek/0uihH Ob9VtI8PnIfmPviugfpO6Mi+cCu30AteLST3rI95yk9lVh2ZKHlRv7dL05IQq8+zpXz/ t4UsvL6yIutyGK3NgliQHGWI/B65MDlG4XbCMouBpFt6r5zs4iqGoKn4Lvgm+q29AJT9 6RSQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:spamdiagnosticmetadata :spamdiagnosticoutput:content-transfer-encoding:mime-version :message-id:subject:cc:to:from:date:dkim-signature :arc-authentication-results; bh=ViOzsdAttLme3Jtk/66v1BbXpn/gfJdSaIvQ48fx0gY=; b=Fx0uxfLlmphjDsHnRtf6CP4zKQ8jd/8IZbPDwzhHTJAfnOfQJbDMtU4y999lbOjitf aiC2FybCB6ayJxTLmycSs6NewRbDvEFldt7XxMh2SumOa3tuhEzRRuNdVEaAQ4f2OoLg 8yoQsdIOI0aZAq+sM1QIgOt9ZFDvtVp10bI2XyIx9pO04I945d7GLCFXimEw6Kz2kz57 svlBqonLDIC9nYIEwZUrJIGjzOCcCi4qmRWv3UaVXkiypoMeEnoHjdVg3glEvaCreVRh 0NvK3GrkLKmCsyao7NH4lLTorS88yBEHIFZP/KJUjc6B1+WxNesPtEhkC0Te3++wSU8B oPRw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@Synaptics.onmicrosoft.com header.s=selector1-synaptics-com header.b=gjN4bfs2; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 85si2844429pfh.176.2018.04.19.01.04.26; Thu, 19 Apr 2018 01:04:41 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@Synaptics.onmicrosoft.com header.s=selector1-synaptics-com header.b=gjN4bfs2; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752628AbeDSIDA (ORCPT + 99 others); Thu, 19 Apr 2018 04:03:00 -0400 Received: from mail-by2nam03on0087.outbound.protection.outlook.com ([104.47.42.87]:2785 "EHLO NAM03-BY2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1750913AbeDSICy (ORCPT ); Thu, 19 Apr 2018 04:02:54 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Synaptics.onmicrosoft.com; s=selector1-synaptics-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=ViOzsdAttLme3Jtk/66v1BbXpn/gfJdSaIvQ48fx0gY=; b=gjN4bfs2iGZUNjBgOttTSw+DGfdfTiY0q2u3cJATjLmnIqEOozF++mRIJugYP6npN5gCjeu2YgKpnsnyRmZgM0hYYE6zRmY1RdMvlfaoOiBsW+dquRDhQdWLux5chggbYjRR6+9IG9INjV3jhKj5g/CEnJVcTPTBlvia6WN9d/0= Authentication-Results: lunn.ch; dkim=none (message not signed) header.d=none;lunn.ch; dmarc=none action=none header.from=synaptics.com; Received: from xhacker.debian (124.74.246.114) by BN6PR03MB2626.namprd03.prod.outlook.com (2603:10b6:404:59::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.696.12; Thu, 19 Apr 2018 08:02:50 +0000 Date: Thu, 19 Apr 2018 16:02:32 +0800 From: Jisheng Zhang To: Andrew Lunn , Florian Fainelli , "David S. Miller" Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Jingju Hou Subject: [PATCH] net: phy: marvell: clear wol event before setting it Message-ID: <20180419160232.519d15be@xhacker.debian> X-Mailer: Claws Mail 3.16.0 (GTK+ 2.24.32; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Originating-IP: [124.74.246.114] X-ClientProxiedBy: TY1PR01CA0152.jpnprd01.prod.outlook.com (2603:1096:402:1::28) To BN6PR03MB2626.namprd03.prod.outlook.com (2603:10b6:404:59::9) X-MS-PublicTrafficType: Email X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:(7020095)(4652020)(5600026)(4534165)(4627221)(201703031133081)(201702281549075)(2017052603328)(7153060)(7193020);SRVR:BN6PR03MB2626; X-Microsoft-Exchange-Diagnostics: 1;BN6PR03MB2626;3:y8UzKdlHT4qnxTfJX5RZaSTSmHmZPFJlIi5WGrJl2yuq6Wadxc/ZdsaRKcro6SZ7GVZq94Tu2jLglTw9AyWrTsyB/JGNo8z6xM1BeSXa6NevXgTLrkEHh2LGroyGfgghLqtjvgdS4jkUCOpiRV3RZvdTokj/5+nTdT63oPNr+ggz/d4XP3gFx66b3WLZg1cYWcw9CAEm9SOPj9MGJakIH/M1P3Zobz3aPZui91x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TfFvAJ9dFfsUUzFE8XadeYAvpPi0y4LXVD7uvJ4b/TQVep1DUCArauN10QgJNT6s5B0wzdcqCb34ZV8HYvnKeLGcw8uoyKbX+xLGc1pif5hU+OCvW2deQ5hWPN7ESQrCgww;4:ynQuZVCnOfjtPXnkLionXeS5gcrr1Z4+b6wrxgKPoaYi6ExA1+pG3Fjy9LTMnNKLSNprwenPyEEubWkwPARDqAN/Er722SpTC36EIZn1EzTbW7zzROUOz+UJr5FCwhoHSwTbFpySR36zVwnV4xaoL5oJ5oltEIqLTAzGZ106mLaYml2pgTGK5zcMRABlX52DivfhOviEKbbJsx47CRBDNoky8DhPgoUWBGoJ/4rZDmMZM0+rSGU0ouiqw4K74tPpG48EHw6BUEuS9bY2zpmVlw== X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(6040522)(2401047)(8121501046)(5005006)(3002001)(10201501046)(93006095)(93001095)(3231232)(944501327)(52105095)(6041310)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123558120)(20161123564045)(20161123562045)(20161123560045)(6072148)(201708071742011);SRVR:BN6PR03MB2626;BCL:0;PCL:0;RULEID:;SRVR:BN6PR03MB2626; X-Forefront-PRVS: 0647963F84 X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10009020)(39380400002)(376002)(366004)(396003)(39860400002)(346002)(25786009)(4326008)(86362001)(8936002)(6506007)(52116002)(5660300001)(26005)(1857600001)(7696005)(6666003)(81166006)(50226002)(386003)(316002)(33896004)(50466002)(110136005)(47776003)(53936002)(55016002)(16526019)(478600001)(186003)(6116002)(39060400002)(305945005)(230700001)(8676002)(66066001)(9686003)(1076002)(476003)(2906002)(72206003)(7736002)(107886003)(3846002)(23726003)(956004)(39210200001);DIR:OUT;SFP:1101;SCL:1;SRVR:BN6PR03MB2626;H:xhacker.debian;FPR:;SPF:None;LANG:en;MLV:ovrnspm;PTR:InfoNoRecords; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1;BN6PR03MB2626;23:VKVK/Vj4lCxxv7uvvEI9CmqidCwobRGIIPseySWWe?= =?us-ascii?Q?Nz+pbetRyWmfunxiIs2uc0o4nU91aE2yyf2Z30RvTAqz9U6WbCe7R09I6k5X?= =?us-ascii?Q?b7vmq8SQI8f0TRWhIZwahPfoU3H1K6u46fuXFpgnro+VqD+YElP1f53ub/SH?= =?us-ascii?Q?JtQiIbYmzufvT3u7kpmAecLdqRAjwxhHdRwXnTRuxN9+DgErZQBgSSoYarJq?= =?us-ascii?Q?gEMhYP9B1PC7WbJS/1Oks+BcXd0F7v5Z2K3nJStMjTkp7VLw7dwIoPEzRh1h?= =?us-ascii?Q?wgiBCTLHY8mMuMGoEsllDMu7tCsRRMCc1C37WizUeo4CIxmogzESPuHw3yoX?= =?us-ascii?Q?DbDiXdDTtjJSK8oar741ovS9OODmMigfbVnie6Q9OHVT5CPf4FC1Fa4WtnKR?= =?us-ascii?Q?AoTRjozAKy6co4naLTLb/BolyUX9Cn01PjZYWlea4liGhaqqp99DeHC7qZ1Q?= =?us-ascii?Q?nCx5zvJuAaT/NcV0yQTWdjuBEJ4YXUu87FGIaa/HpWgW8sptaModm7X2tzed?= =?us-ascii?Q?sFK8c8GiCvx/Hbi9qxA1w4yE/xcGAnchYaAm46InETl6WjvvxrZxUGxxp5ZD?= =?us-ascii?Q?mkjLkW8+oIG2vDniLOBXMw9eba6eUI5K3xH+wMydk3t2heS1Giaw+WLAbYec?= =?us-ascii?Q?xjk2ZEWXSuQIgDPV913lPmOHgzmYfl1ziLohiNXj2Mbq2S4Rog1U6Hahx+7r?= =?us-ascii?Q?fCgi4awljmfkPMeQFVunlvfnlSc+kQ/Wa8x7dkMzd78Ev2LlUtYpoOP5i5gg?= =?us-ascii?Q?6g3JcHD5JfLtc6XHjPuVdu9HS7ryA0qaxVOVONqsIHeGHj8Vqt3PXWcMCIwc?= =?us-ascii?Q?iEnAnAPnDU/tv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57FIrG8MCHRyncLqPnDBnctf2JEkR0Duy77CW9oMcu5rS2GPCbY91nDxAD3t2JzLma8P2Mg9Qxa8GI13ermgZSzC0DUEkG2liQYxGWyuP80QbD1lHTOiUJ2zjkaspwQkG7K3BNCdTk4p6Z30a1iuFngdy4KLSnwRXNkO4=;24:jy9Av7RN9P4pa48JLChRPoiExEINx0db73JNUpmyHte6rqUI7Qjye2r2BFZAYueVNyXjUsfVM1CoOnCwc/fvmZ3KodlscLFK0zTQVtL00mQ= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1;BN6PR03MB2626;7:M0ibSDuA6r6+q4wqNQ6F7rN9s3S2+OCmWvW1opbuA0NUtXPAiHLf2jgK2PpGP/twGVR+ZpWVjKu+xQ6+87LX/W8J37OwMvXkI9IlwxovXMLVw8/DAz74izpbP3qt+tGBXE8oCK+582W78m8SOmsg2HjMGEIJWXLH9dVQiXLmeBms7r0wAyeWYiFOBSXWpNFcnh/UKhdnOKnMVS+q2bntWl7p+ItZvkOUa2OxYABXDBgjjlcmhDvvjoIG8OR/dAeV X-MS-Office365-Filtering-Correlation-Id: a1aecaa5-45ce-463d-3fe8-08d5a5cbf3a6 X-OriginatorOrg: synaptics.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Apr 2018 08:02:50.9090 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: a1aecaa5-45ce-463d-3fe8-08d5a5cbf3a6 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 335d1fbc-2124-4173-9863-17e7051a2a0e X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN6PR03MB2626 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Jingju Hou If WOL event happened once, the LED[2] interrupt pin will not be cleared unless reading the CSISR register. So clear the WOL event before enabling it. Signed-off-by: Jingju Hou Signed-off-by: Jisheng Zhang --- drivers/net/phy/marvell.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/drivers/net/phy/marvell.c b/drivers/net/phy/marvell.c index c22e8e383247..b6abe1cbc84b 100644 --- a/drivers/net/phy/marvell.c +++ b/drivers/net/phy/marvell.c @@ -115,6 +115,9 @@ /* WOL Event Interrupt Enable */ #define MII_88E1318S_PHY_CSIER_WOL_EIE BIT(7) +/* Copper Specific Interrupt Status Register */ +#define MII_88E1318S_PHY_CSISR 0x13 + /* LED Timer Control Register */ #define MII_88E1318S_PHY_LED_TCR 0x12 #define MII_88E1318S_PHY_LED_TCR_FORCE_INT BIT(15) @@ -1393,6 +1396,12 @@ static int m88e1318_set_wol(struct phy_device *phydev, if (err < 0) goto error; + /* If WOL event happened once, the LED[2] interrupt pin + * will not be cleared unless reading the CSISR register. + * So clear the WOL event first before enabling it. + */ + phy_read(phydev, MII_88E1318S_PHY_CSISR); + /* Enable the WOL interrupt */ err = __phy_modify(phydev, MII_88E1318S_PHY_CSIER, 0, MII_88E1318S_PHY_CSIER_WOL_EIE); -- 2.17.0