Received: by 10.192.165.156 with SMTP id m28csp458216imm; Thu, 19 Apr 2018 01:55:33 -0700 (PDT) X-Google-Smtp-Source: AIpwx49N8oZidai9+cfkpTiskUEejzgJJZ12O77eZxYsvzNVxV2rPDBUd8OmRjccQyuwRmxUEfrK X-Received: by 10.98.15.195 with SMTP id 64mr5007125pfp.63.1524128133849; Thu, 19 Apr 2018 01:55:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524128133; cv=none; d=google.com; s=arc-20160816; b=Vj3IuKuwXcQnmiMk8QPE3assIVsfLWwoyXw8/f40kmbya/AK35TENW/P1lGaXh/ZI5 OK65i3KujEcK5ec1wuqMlMy3jC/NzrQldlCWecc9K0cj6N8ZNwaGv/lNTo8OhwUG12LC e3p9xHyIhbV6bHcKJqZqOMRTa6xUKRtNZ93OQ7RwKxrpf2sBvSntIchVAv2tvnnkUt30 BJRc8rsKVsMHE5dpOtFky8O4CxaMcYsWTmKaE/4OQ0Tapf8Upks/hJfpNvaJDf5+sD62 xkVmxoh0iv/sRBeb4/wdvI0WCXObq78POk/7GewkRl++PqqGP8/0Fp65A8Gu2H2k1Oer b4iQ== 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 :references:in-reply-to:message-id:subject:cc:to:from:date :dkim-signature:arc-authentication-results; bh=hgX8Ydl0yCcYng02lE/Pa8YrMAQEsR5yoVG15dIJIUE=; b=ZA8sd4w9dplh8Vw1w9Fdqw/FZ1H5u9wGCH415CsF5Aahn7m7oXvEn/iTVJRxDvYrqn iXx8sEvv4Sdv4fzmANz2OXBSyVLUmtd4m3rUX91dd+bEK69Ork2gziprigHMmYxzi896 mwau8IdvWIzLOYIaHz/RKhrJyledoYSLhkxMgP6e8f36uLituNH9oWOF/+FilmA833h9 UVEnKNe0OCZ57YpEYKUFCFUk1gLgdoSlx60wY6d8RJzkWIMtPSLk9ZN3SMpqBf+PP6rC BnEfL3H2V7+Ah0YV7eJSRryHG0xcOtMoVOz//KrNMRX0CiDSQ1e7PBibrjZfH/pckJH/ id1g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@Synaptics.onmicrosoft.com header.s=selector1-synaptics-com header.b=LBcMNiz7; 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 d17si2425220pgo.183.2018.04.19.01.55.19; Thu, 19 Apr 2018 01:55:33 -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=LBcMNiz7; 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 S1751182AbeDSIyO (ORCPT + 99 others); Thu, 19 Apr 2018 04:54:14 -0400 Received: from mail-by2nam01on0047.outbound.protection.outlook.com ([104.47.34.47]:36341 "EHLO NAM01-BY2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1750913AbeDSIyK (ORCPT ); Thu, 19 Apr 2018 04:54:10 -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=hgX8Ydl0yCcYng02lE/Pa8YrMAQEsR5yoVG15dIJIUE=; b=LBcMNiz7MBgcMlrhetslxSX80M/SnF4KopfsWMx5sPLeQynpBy6PUB41bZrVFf1/kcrBw2psjkFAexmdhtkEoYaqDpkQYAO0/CSCdp5W5Y79SAH53nvlgzVRZoarB+AIGJM79lf07oP12/cUe2MIv+Y5e4nlWEEWDYRXW3pVi0Y= Authentication-Results: nvidia.com; dkim=none (message not signed) header.d=none;nvidia.com; dmarc=none action=none header.from=synaptics.com; Received: from xhacker.debian (124.74.246.114) by CY4PR03MB2632.namprd03.prod.outlook.com (2603:10b6:903:75::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.675.14; Thu, 19 Apr 2018 08:54:05 +0000 Date: Thu, 19 Apr 2018 16:53:51 +0800 From: Jisheng Zhang To: Bhadram Varka Cc: Andrew Lunn , Florian Fainelli , "David S. Miller" , "netdev@vger.kernel.org" , "linux-kernel@vger.kernel.org" , Jingju Hou Subject: Re: [PATCH] net: phy: marvell: clear wol event before setting it Message-ID: <20180419165351.5388021e@xhacker.debian> In-Reply-To: <96e77eac86794bef9a5b772147527c67@bgmail102.nvidia.com> References: <20180419160232.519d15be@xhacker.debian> <96e77eac86794bef9a5b772147527c67@bgmail102.nvidia.com> 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: KAWPR01CA0064.jpnprd01.prod.outlook.com (2603:1096:402:b::24) To CY4PR03MB2632.namprd03.prod.outlook.com (2603:10b6:903:75::11) X-MS-PublicTrafficType: Email X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:(7020095)(4652020)(5600026)(4534165)(4627221)(201703031133081)(201702281549075)(2017052603328)(7153060)(7193020);SRVR:CY4PR03MB2632; X-Microsoft-Exchange-Diagnostics: 1;CY4PR03MB2632;3:nTKTosVyZ/RlwQ3d3LugLfGvjnEPI6ClIuWDg/xumP9W9MXUaxrGvXCR0VwqfUrucMGMmvyFTVg8jDq0ZXj9v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KUCA9+COjtWQi7VPmQqVjrQPypk3oxofXWC2iwfxAq0PQ4tsAqW9732uBpdBWtcea+ncEx3OdYEcEm2wWZWmZVVlv7DLKvxAWBTijJATc+9qlkMSxgufPpy+IWK/GS8W5j4qj/xlPAiwMeQtSh5JM9GJLBrtLD31zPuhFyllu9HhGsEUiQ621iYQ8XFk7YvO/QtJ1bB6BF/qPNXpjktXfaTI7BbzRTiD79sYFROOZOShpI1OmoviOf5saXZcPyWIQ+NEYvT;4:ag0QXpe4kJtPukiLW47DiCJ6ZzRfVTGho7WSXOEW2i3ZrTU6LFRgBLWt83yBh70bT83Iawh1MzrWh0AnsHsirQZCeDRjuwP+HBrn3hX1xmSSnUrqz5niv05MZxSUOOAZoaGdTuTGf0G0rf3xdXi8geriMPqb6uUm+UpTF0ewvwY8oLQ8PcAjtd6IJAvDN2DThRDqck6mXaoolILMHl2f1l7GW/22QVTIyJsourjTg07VVkfeimcs7Ui6E2SpqXo4vODRHMZf78T1SF8wm1v2IGCSweQf/kRRe8J+ZeW6RAop8XJHsKXinlPHiwH0JWQLbhdIm3J7y0Tjp9yghpZYeRffireP5ciJNGFXznF52dM= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(9452136761055)(85827821059158); X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(6040522)(2401047)(8121501046)(5005006)(3002001)(3231232)(944501382)(52105095)(93006095)(93001095)(10201501046)(6041310)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123562045)(20161123564045)(20161123560045)(20161123558120)(6072148)(201708071742011);SRVR:CY4PR03MB2632;BCL:0;PCL:0;RULEID:;SRVR:CY4PR03MB2632; X-Forefront-PRVS: 0647963F84 X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10009020)(396003)(366004)(376002)(39380400002)(346002)(39860400002)(13464003)(57704003)(43544003)(53936002)(26005)(7736002)(66066001)(50226002)(25786009)(47776003)(50466002)(4326008)(5660300001)(6666003)(6506007)(53546011)(8936002)(386003)(8676002)(6916009)(86362001)(229853002)(81166006)(11346002)(478600001)(72206003)(23726003)(16526019)(476003)(1076002)(3846002)(107886003)(6116002)(230700001)(76176011)(52116002)(7696005)(33896004)(446003)(956004)(2906002)(55016002)(305945005)(54906003)(316002)(9686003)(39060400002)(186003)(6246003)(39210200001);DIR:OUT;SFP:1101;SCL:1;SRVR:CY4PR03MB2632;H:xhacker.debian;FPR:;SPF:None;LANG:en;MLV:ovrnspm;PTR:InfoNoRecords; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1;CY4PR03MB2632;23:EcM+QmQOQNHPQ1dCt6fUY8nttj3pr0BuY2uOZ1/PW?= =?us-ascii?Q?5dBc8i+Kk0JKbpc4ykqX6sLA59fyz7aD0Vy74UPwsxm6/lkZS343W9qqE8DO?= =?us-ascii?Q?Eu1hYZN783pVZUJDBfmGDeoQP+7QWHe9S2ixTjLYFqHrqPvkDQVcEGuMkTHp?= =?us-ascii?Q?p0Rs0htgTXQKPeC2fasYRQ6Ry5SnJGiBWs2JAXz5JW9vA+mUUpZ4iIto1DjI?= =?us-ascii?Q?0oGWKLiwDoW+inAFsmSxziMvhmCYNvB+Ms46K0jU33oqCQjwcGAgSmxGvTnr?= =?us-ascii?Q?X+y8WRqKMri+DdN5owzr/fvIH+FSdKb7NxL+w5MsQawy0ksaNKb+p0STtIVv?= =?us-ascii?Q?uOTN3nQL1qX0fxt5nAgWouZp4ipFHenXnOV2fAqfdaJ8CB5Ac9xld4gN6UcW?= =?us-ascii?Q?FCXQCuqNTz96zC4U/whLWP4qgzHNOLZx1WAnMyyX/CiwXC2B+2spPIfA/UHW?= =?us-ascii?Q?ix8Oexss1I+hiRX7EiDrwnYH8xnJqdkBhBNhoBWQuVxNV6lAlX/i96O76Yma?= =?us-ascii?Q?i9lDr/+RJoGeX+hl6YeLL3agxzRtOb5s3FKMFrgPC1EyqMxH60atVyCvMEOG?= =?us-ascii?Q?AgQVXUskqUg9C9yu5Jcbavo3au+1EjAxFTePiYS/NdbP6v5fNbLQ7B21KEI1?= =?us-ascii?Q?x+SOvuNC8/by1HVMqpWbRUP1fHROM92g6sQMP9eVQtHezQuvJfbT99tJIC8M?= =?us-ascii?Q?8FZAD1/YK1PvMSH+Z88+NeLg56I8DeZ7ZLxP6BDAvIPVDVg3Oqqs5D/o2Oz/?= =?us-ascii?Q?h6NOQsKF7+HY+lVJelgdeXQ3Cerc8GCdvVUHwfSfyofYPp/A6wMYfcCsoIKy?= =?us-ascii?Q?KIKiV3BS/UOG0tOErnoSq82gTqEanpVIG/teo90BHyfggAcl7bJyEcL4fOfv?= =?us-ascii?Q?whOrI9Z8sHIb2CwTwswZwRdHNxIAdVVISvFyppTgOH9pA4Z2EEFXUwpeqI6j?= =?us-ascii?Q?fEKTJkmW0557+SO/PIfFKq1O2rhGRxsTkw/eaqPQhITE5lPrApE3JxMabEPh?= =?us-ascii?Q?/mUYPtqOITiGUexJHHq51HQ7AyAWVuW37p1/1+MxMuWsVckh1cRpW4J4iF/z?= =?us-ascii?Q?tqseVtYBc/RcTJa7hBWu+PUg3TUlEG2t5WVK1/oA4cvoow7pyGZugLxUCWDW?= =?us-ascii?Q?ry9B6wfWt3IL0HnNQAEVuQiekJcK+Q7ykJTBxJa4MAWNH5xZY3UOVBJ4NL/S?= =?us-ascii?Q?tIMo62vJB7i14ld3PXgrcx099iNG3KdtZXl7lX/g8uMX04zHehOkHiKs1Fj1?= =?us-ascii?Q?g4A6Ja65KvslvuZr/SRGEbT75udJNp5bRkdI7p7?= X-Microsoft-Antispam-Message-Info: Li1t04d5gsvzCj1JFXnuoGlyfXtrV10DmE0hHtp8XmOFzDV7/0YU0JyEkNchYMhEl4n80O20sNXnQq2BFcGhG83fWLTylghzlZY+sRTOma28UcpAdWrEWzIUk2y29HIGC9vPv6mY8YnX4UdUFm0RWMVANooga1N1Ift+t775SkyybkP6twxnlgoSFD//WRyy X-Microsoft-Exchange-Diagnostics: 1;CY4PR03MB2632;6:hGZmB3F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MS-Office365-Filtering-Correlation-Id: d799be03-f614-426e-d060-08d5a5d31c32 X-OriginatorOrg: synaptics.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Apr 2018 08:54:05.3973 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: d799be03-f614-426e-d060-08d5a5d31c32 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 335d1fbc-2124-4173-9863-17e7051a2a0e X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY4PR03MB2632 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, On Thu, 19 Apr 2018 08:38:45 +0000 Bhadram Varka wrote: > 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 ? Good point. Will use MII_M1011_IEVENT instead in v2. > > > /* 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 ? If there's no valid irq for phy, the ack_interrupt/did_interrupt won't be called. Thanks