Received: by 10.192.165.156 with SMTP id m28csp446788imm; Thu, 19 Apr 2018 01:40:22 -0700 (PDT) X-Google-Smtp-Source: AIpwx4/X9fUgrMwLrEEPzIl/u1ggX8Q9mtPFJPOZxjTkXltHmEsmhiMQTmoAOoTwj7PrATzXY3Fm X-Received: by 10.101.97.130 with SMTP id c2mr4512141pgv.219.1524127221940; Thu, 19 Apr 2018 01:40:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524127221; cv=none; d=google.com; s=arc-20160816; b=uV3TJ0o6kkguDmuRak+T40FwXa32+ICakxrKhA1R7F2thLzcPFxdQb4Zv2RQ2QBNIY AzMrL3dv/Y1gXzecNr+NZwzQO+Vnylekszgtf2v5TSy77bjenBZz23QWgXTSay+6XCg6 a2hlxmXzLqoinHm8bX5DENaeiEMAJijdST4Af1Ycqo4EvEfVgZJMVUDgyFkQXdkSrmzJ 0QZgwlkKc+peUa0L46hsrWdvKfkEJ2neJUmH3dOEQFPtd08nfm3lwHCAy61Tfb7SqVqb boyJDeS1+ElqwjdSEysRhQKQhIdi8rwYfh10tFpHDVLwiRIZy0AoPi7mV5Y0gUBi4NTr xNZA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:mime-version:accept-language:in-reply-to :references:message-id:date:thread-index:thread-topic:subject:cc:to :from:arc-authentication-results; bh=r97fPaGcQ0f8FHKyzwCm3IVPo4DqfhM0g1NZw9LH0IY=; b=vWTludxsKncuRY58ig/59hCVlu/D4AW2HMjR0XvCZIfJhuEoFgf/nlu4AsSSp9RIys RvaRkAlT/kkxyf9bMyy0P63i/ZI3HlvbvJmh/+pcSxinuC8xTWfFFB2azTr5c2lT126q ewBwR0rhOV017HeTaLxls8S3o4SHGJUvX8Th9UZB0ItPq8+Y+qeKtfAWDx5/CiCRSR4Y 8n8cJj72PB9f34SEJ0hgGHcIf8byjcIvgEUqKLRYMQy0koGyarlTMSY4iqNUHvfmQ88T 8FB++CGIIeKb/ZMBphDAF6PJlB+rb6U8fT3ii6yAiRT8341PFEK3/SZVTeYSsEpKCC3V bGdg== ARC-Authentication-Results: i=1; mx.google.com; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nvidia.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d17si2425220pgo.183.2018.04.19.01.40.07; Thu, 19 Apr 2018 01:40:21 -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; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nvidia.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752143AbeDSIix convert rfc822-to-8bit (ORCPT + 99 others); Thu, 19 Apr 2018 04:38:53 -0400 Received: from hqemgate15.nvidia.com ([216.228.121.64]:19965 "EHLO hqemgate15.nvidia.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750972AbeDSIiv (ORCPT ); Thu, 19 Apr 2018 04:38:51 -0400 Received: from hqpgpgate102.nvidia.com (Not Verified[216.228.121.13]) by hqemgate15.nvidia.com id ; Thu, 19 Apr 2018 01:39:03 -0700 Received: from HQMAIL105.nvidia.com ([172.20.161.6]) by hqpgpgate102.nvidia.com (PGP Universal service); Thu, 19 Apr 2018 01:38:50 -0700 X-PGP-Universal: processed; by hqpgpgate102.nvidia.com on Thu, 19 Apr 2018 01:38:50 -0700 Received: from BGMAIL104.nvidia.com (10.25.59.13) by HQMAIL105.nvidia.com (172.20.187.12) with Microsoft SMTP Server (TLS) id 15.0.1347.2; Thu, 19 Apr 2018 08:38:49 +0000 Received: from BGMAIL102.nvidia.com (10.25.59.11) by bgmail104.nvidia.com (10.25.59.13) with Microsoft SMTP Server (TLS) id 15.0.1347.2; Thu, 19 Apr 2018 08:38:45 +0000 Received: from BGMAIL102.nvidia.com ([::1]) by bgmail102.nvidia.com ([fe80::250a:5992:4657:28e%20]) with mapi id 15.00.1347.000; Thu, 19 Apr 2018 08:38:45 +0000 From: Bhadram Varka To: Jisheng Zhang , Andrew Lunn , Florian Fainelli , "David S. Miller" CC: "netdev@vger.kernel.org" , "linux-kernel@vger.kernel.org" , Jingju Hou Subject: RE: [PATCH] net: phy: marvell: clear wol event before setting it Thread-Topic: [PATCH] net: phy: marvell: clear wol event before setting it Thread-Index: AQHT17Tmskie4f0tkky4KxMjyNmTQKQHwlIA Date: Thu, 19 Apr 2018 08:38:45 +0000 Message-ID: <96e77eac86794bef9a5b772147527c67@bgmail102.nvidia.com> References: <20180419160232.519d15be@xhacker.debian> In-Reply-To: <20180419160232.519d15be@xhacker.debian> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ms-exchange-transport-fromentityheader: Hosted x-originating-ip: [10.24.193.52] MIME-Version: 1.0 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 8BIT Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, > -----Original Message----- > From: netdev-owner@vger.kernel.org On > Behalf Of Jisheng Zhang > Sent: Thursday, April 19, 2018 1:33 PM > 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 > > 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 > + There is already macro to represent this register - MII_M1011_IEVENT. Do we need this macro ? > /* 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); This part of the operation already taken care by ack_interrupt and did_interrupt [....] .ack_interrupt = &marvell_ack_interrupt, .did_interrupt = &m88e1121_did_interrupt, [...] If at all WOL event occurred marvell_ack_interrupt will take care of clearing the interrupt status register. Am I missing anything here ? > /* Enable the WOL interrupt */ > err = __phy_modify(phydev, MII_88E1318S_PHY_CSIER, 0, > MII_88E1318S_PHY_CSIER_WOL_EIE); > -- > 2.17.0