Received: by 10.192.165.148 with SMTP id m20csp1636002imm; Wed, 25 Apr 2018 23:16:58 -0700 (PDT) X-Google-Smtp-Source: AIpwx4/2X2+DKoukpjBvAs/4D52QXbfqb+5+JLMkbVY5lRXkGSbZYlbvGLoOykj25fi6Ves415pE X-Received: by 2002:a17:902:aa90:: with SMTP id d16-v6mr32246494plr.189.1524723418909; Wed, 25 Apr 2018 23:16:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524723418; cv=none; d=google.com; s=arc-20160816; b=q6awyYrjYOoF2AueKi/29kMR28T+Bedvu3jNmt5XtF6d4GugJ3rZcXC9dNi0lhfgRh h3ZsDLKwVN6ki5i07JQ6LgG88GSc5qjKE+SkGTdeKww+b2qAgqVI61/ucDMcsQDOsUns LvVugL3LtYt29OBDbyzyGE4s6q7c3IYf4kKjCtD9QRM8p6QAJrJyEhwoZlENXCPJniwP KMj60nTbX9npNAq/fBCk1xgpvUzVnSmbtX0gBwMaIDdbly6lO1VpmpUTLC4x/hCQShsq nHYFR+e4G6/1gcxENAzsvFYeCtN5ZbX5FxyVISJYTP7L68NRo+Rq46lxgtLPUUkavQVU NxWA== 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=6/uN8Q/PmuXVih72ACvwNByAzrNdTUrTtqNniDUMu/Q=; b=NOdqWwkTg33D0B7VFCOf1Nb+Se7eI8e7QNpB+5t4AWcx/VkuOvCjHfCtrXZpvBQqQp IjUNJdMjYjmv4D5FCvS2NFSjH/DtiESmT0ZRqOzrbLf0zht4npkEF3bmOoxovcxWfwMW lBQttj7BHfi3sBQr/oYpudZXVDbfLO3nBPjZURKLMlbOqcj/tx8FaB0fTSXVP475rX0X mLO9a6agbE1nWfnVG7mo8YkOBBzceqUInhe8OWWmHoLy+13PBqCd9OVqlPc/7TShpocy ZlhPSHK6bIvkjAld1cYKV1WZ6V0IlP+y20mVQqq07sCO++biFe/BWb1JxXMaiidcwKYJ Qcbw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@Synaptics.onmicrosoft.com header.s=selector1-synaptics-com header.b=csmXXtin; 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 3-v6si18437601plt.98.2018.04.25.23.16.44; Wed, 25 Apr 2018 23:16:58 -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=csmXXtin; 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 S1753054AbeDZGPi (ORCPT + 99 others); Thu, 26 Apr 2018 02:15:38 -0400 Received: from mail-co1nam03on0053.outbound.protection.outlook.com ([104.47.40.53]:30752 "EHLO NAM03-CO1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751465AbeDZGPe (ORCPT ); Thu, 26 Apr 2018 02:15:34 -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=6/uN8Q/PmuXVih72ACvwNByAzrNdTUrTtqNniDUMu/Q=; b=csmXXtin5AOZsAPcbuNW8KrIwvaCLou/Df+S93F+mtTsbV/GZDLHP9rCF+O5C3JbRZfGT/LXkVfz/8NMy4FOYgyvuwMwEMc49wPzX7OWu8eq6VJ+cHa44S3xiXjqBCRyh0ogCs74LWQ42NMXKIR+6YEybe4vc37fr2Crq1qPaKE= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Jisheng.Zhang@synaptics.com; Received: from xhacker.debian (124.74.246.114) by MWHPR03MB2639.namprd03.prod.outlook.com (2603:10b6:300:46::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.696.13; Thu, 26 Apr 2018 06:15:31 +0000 Date: Thu, 26 Apr 2018 14:15:08 +0800 From: Jisheng Zhang To: Bhadram Varka Cc: Andrew Lunn , Florian Fainelli , "David S. Miller" , , , Jingju Hou Subject: Re: [PATCH] net: phy: marvell: clear wol event before setting it Message-ID: <20180426141508.6660a633@xhacker.debian> In-Reply-To: <4273f766-a017-b336-7d14-a28901d274b9@nvidia.com> References: <20180419160232.519d15be@xhacker.debian> <20180419121801.GC17888@lunn.ch> <4273f766-a017-b336-7d14-a28901d274b9@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: KAWPR01CA0066.jpnprd01.prod.outlook.com (2603:1096:402:b::26) To MWHPR03MB2639.namprd03.prod.outlook.com (2603:10b6:300:46::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:MWHPR03MB2639; X-Microsoft-Exchange-Diagnostics: 1;MWHPR03MB2639;3:/eMzxoWuCRLcFiRWudnQvyalkXzszXyCky0rQtOhnj6b/KT42uCpaExH520TOupPqaGpEcnBVlQBkOOEbr9u3LtJ3wv1JFN7FIQRKm4MlaAfXnFHO3aTljD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CwrxY3cdxR3o1peI8m+cYUVolDcvDGHNlarzUxYuuHbjHIbld1CbZUFbN9bbeVaYxw0QcKJSBBnJkx/qQOokUfW5SXmxeTG1fCJPbc/tYX+Mdyy75uvcmHWqLfJETfEICNOSphc/tBdSaYm/urh0DFPFn1gf2ttk1BuuHo46yVtrbtb/5K+VeRC4/JmvWK7SLPS5wKW/d+aWflG5VkVDQlMzinXgcEUCrquzDfkTluL;4:c/i5mcJCfcIPXqXKXoRrcV7wF55Yq7Hv+aexa+2zkwoUDa7/RtMS1hqBzgNAQdMO7VJ4WCO0tb8JzYoJ6CMax77l2Dqp2dUAZakm5ql3MFT+Yg2dBqLxkmXjVUwejI13PHzaT4pREOHx07lVzXaPGk4jgb9QDHQruDpxRQF67GbTm9+wXVtzTGByZxOkbynDnuFMs1PLTm7n8TscmYdmd1Sf4a8g7vOkYU3ntcqGlj+buSzruqugVKDknCpHeN5mD9aoh+Th11QdpeKQv5lx+w== X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(6040522)(2401047)(5005006)(8121501046)(10201501046)(3231232)(944501410)(52105095)(93006095)(93001095)(3002001)(6041310)(20161123558120)(20161123560045)(20161123564045)(20161123562045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(6072148)(201708071742011);SRVR:MWHPR03MB2639;BCL:0;PCL:0;RULEID:;SRVR:MWHPR03MB2639; X-Forefront-PRVS: 0654257CF5 X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10009020)(366004)(39860400002)(376002)(39380400002)(396003)(346002)(189003)(199004)(956004)(66066001)(476003)(53936002)(11346002)(8936002)(6116002)(23726003)(3846002)(50466002)(50226002)(68736007)(486006)(4326008)(2906002)(478600001)(106356001)(5660300001)(72206003)(81166006)(39060400002)(186003)(16526019)(107886003)(316002)(446003)(81156014)(8676002)(7736002)(1076002)(105586002)(305945005)(6246003)(229853002)(54906003)(86362001)(7696005)(52116002)(47776003)(230700001)(25786009)(53546011)(386003)(6506007)(26005)(76176011)(33896004)(9686003)(97736004)(55016002)(6916009)(6666003)(39210200001);DIR:OUT;SFP:1101;SCL:1;SRVR:MWHPR03MB2639;H:xhacker.debian;FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;MX:1;A:1; Received-SPF: None (protection.outlook.com: synaptics.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1;MWHPR03MB2639;23:PXhIEMxvndlyGCb88ny9K9w8AKu8gjskO+6v4/38u?= =?us-ascii?Q?rXuHWBqM4bFnCknv2+bmq3U3O1ImXTeLc79IdIUVKh2Doby7wuZIxuAOJhgV?= =?us-ascii?Q?B70VeiFq6U3ywyb2qWSAvR+GZ3XC6DcQsUCdpCls9wi82Nm44VJYL3SiWXEC?= =?us-ascii?Q?AhvRXJnwD3Lwc0C2RgqyZyLt5b+Q5Pf3zn9hqpQt7y55md8C8nLIzs8TwU7d?= =?us-ascii?Q?wTPTbSafSsP6SBB17+CAv2q8DLVDjmwsBkdicJHSUqjtiCxVAmPI+1WvFJT4?= =?us-ascii?Q?6okNDYHkQ0i2bXdzLnzN5m1K2JriBVlPayGGZm9xqPvWerkN24kJ70o52yUp?= =?us-ascii?Q?wmuW7chgGSGSEnoy0mdYb0VYaIsk+SZhbszr/QZDVeRp/yX7lB7z3N5eeiJv?= =?us-ascii?Q?ky4vc+qKZBu8NruOIE/n8HqLfGtixgzYIPDVTThSQit1tgB0INSkJXi7IGRB?= =?us-ascii?Q?FHOIBFIwDQqzY6u8PhsfVU+id+8YIBzQ2BXv0eNEQQg4ln063T18V8QTkiD+?= =?us-ascii?Q?hf3Zu1LZ49WHKavQkPfqtXBtBNXuv8kDKzx21bs4f2cHBwfrl5LxVwX7Z4NC?= =?us-ascii?Q?RV8mo56BldgEoc3a4lqeMWBxL4o1fTRK16sD/Xz2WY8VZES8v2/dQvjLXOqc?= =?us-ascii?Q?MpvOdytpRWqHGVnUV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VYwTBt7IP8of677eSkIXj6UbwFUj0tz3BQ6D/ox8KoL/bIs665v5bzEFum+7w8TvMrWNOkRR6bRekfRRt X-MS-Office365-Filtering-Correlation-Id: 02e2f4b1-98d0-49f5-0b09-08d5ab3d1e21 X-OriginatorOrg: synaptics.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 26 Apr 2018 06:15:31.3067 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 02e2f4b1-98d0-49f5-0b09-08d5ab3d1e21 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 335d1fbc-2124-4173-9863-17e7051a2a0e X-MS-Exchange-Transport-CrossTenantHeadersStamped: MWHPR03MB2639 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, On Thu, 26 Apr 2018 11:10:21 +0530 Bhadram Varka wrote: > Hi, > > On 4/19/2018 5:48 PM, Andrew Lunn wrote: > > On Thu, Apr 19, 2018 at 04:02:32PM +0800, Jisheng Zhang wrote: > >> 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); > >> + > > Hi Jisheng > > > > The problem with this is, you could be clearing a real interrupt, link > > down/up etc. If interrupts are in use, i think the normal interrupt > > handling will clear the WOL interrupt? So can you make this read > > conditional on !phy_interrupt_is_valid()? > So this will clear WoL interrupt bit from Copper Interrupt status register. > > How about clearing WoL status (Page 17, register 17) for every WOL event ? > This is already properly done by setting MII_88E1318S_PHY_WOL_CTRL_CLEAR_WOL_STATUS in m88e1318_set_wol() Thanks