Received: by 10.192.165.148 with SMTP id m20csp1721614imm; Thu, 26 Apr 2018 00:59:35 -0700 (PDT) X-Google-Smtp-Source: AIpwx49dFbs/Kh+mvPqJU8kTjAcvRWdvp0yIo3JDcPv/CecfJ5Ehc7uFKcAQ6pay5xicjf7Qt51+ X-Received: by 10.98.245.139 with SMTP id b11mr31009045pfm.113.1524729575573; Thu, 26 Apr 2018 00:59:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524729575; cv=none; d=google.com; s=arc-20160816; b=G1MdlVb7E/TFSYH1gwp/flrmYEqrDXNWz90Q/GuimCIaZbIBQob1dRpXPy+PTdZjaF 66jf/poKITh4mDBb/9X5iRCTRc/G0j1EdK93Hxh57GbNaLaUQLxyAsmOs3TDroJt6gfq HK9DZEn1WWUM1EZ/+dVzQiNo1amAywQDHAr4Oi3KyUbjgpNFNjWlErG33hSxUDa3rpPv CMey8f3Um3+60/OKD/e0YSxGHkBhDhH+xOi10jtB0S/51c1YD0gTnqrPdynV5WxW8PQe D/RcZ9WPq4z5JWqV/T1QE7WhcZix2IotFTw9D5U3XtoL9F29eNh8+2kf3nhy37005bb7 /soQ== 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=yakz92nrK4ZhPAEGmWLF2N5dpb1YKbXLv5klPeYEx3I=; b=SYlapIC9fm4P+7Z53XgAWLlynPT+wD0dI/lCyYQd6pmLovCNuLX/oyG2ykQ4fJQrqG LreOo4jM8OYVUHcl63HqTyYESzOGViIgkQ+vH8HO8LsovHRi/i0LlLmp5wwalNoa05lJ FEhGF3n7/LL5pSnV9bEUn6EHcw05d3I0W0tC+QK7jRBnveUNY6raw+XOa1dF/wCbrftP qytyrHy1NiyaXcX4kAu0MpuUfrZqUkCnfeC52pU37EHH9YisrM26J9L6YMPdDzpSlfrU YqGANb3n4lnPEa4+lPVX+ML2QRqB3jKHpl9eK30klCbU/37y8vFPXvpwVNlG9B3cYBLw bVKg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@Synaptics.onmicrosoft.com header.s=selector1-synaptics-com header.b=YR6C4+vl; 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 89-v6si18240204plc.444.2018.04.26.00.59.21; Thu, 26 Apr 2018 00:59:35 -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=YR6C4+vl; 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 S1754376AbeDZH4v (ORCPT + 99 others); Thu, 26 Apr 2018 03:56:51 -0400 Received: from mail-dm3nam03on0054.outbound.protection.outlook.com ([104.47.41.54]:7392 "EHLO NAM03-DM3-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1754281AbeDZH4r (ORCPT ); Thu, 26 Apr 2018 03:56:47 -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=yakz92nrK4ZhPAEGmWLF2N5dpb1YKbXLv5klPeYEx3I=; b=YR6C4+vloCTRO4gXAH3OJ9v2rgSeOV393JyUL0I4eqD4e11Kai90IwUSZaJ3h9YZXepu1eaxjK784/d7A+XhdROlYEU7YbEQAwLWCb8OcRxttTWom63FFDq1VZpsEibHyIGPTdPHuDc3pBAACn1bBL93i6NxJzos5brKcOyuumM= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Jisheng.Zhang@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.696.14; Thu, 26 Apr 2018 07:56:42 +0000 Date: Thu, 26 Apr 2018 15:56:19 +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: <20180426155619.2c5d87d1@xhacker.debian> In-Reply-To: References: <20180419160232.519d15be@xhacker.debian> <20180419121801.GC17888@lunn.ch> <4273f766-a017-b336-7d14-a28901d274b9@nvidia.com> <20180426141508.6660a633@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: TYAPR01CA0016.jpnprd01.prod.outlook.com (2603:1096:404::28) 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:OCtFo9gm+3CtazODWfNKfNxNgdA39+TBsPRk/ItIJlu2q+Inm+KcTxO5/dSSx6ZE+iqQFXIwJlXQ+iols0tb7PVMoU6X1gbG8gS+y5mwz/ndxzeZjSewcNuTdjjPJcd+5UB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KQg66zEJKdzrUo3RjF4rHr5507yhEBNErS/IwEPhlStO//uk3A7hc8XVApSDfbNLCb/abM/msarBM0Gy7nVeYP+ONIMewh6ubb07HJBx9Z8+lDqSOkQ2mNMxIf7FQWDakGA+3GHReMPD0m1t2RDzELbbzNV9g+ImoJ4+FcymEXa9YweM8inMeLISJwAD7npXJPVZj6fL;4:xxi+Xuv0oMf03nBUCUe674jgB2vovIxRY/X5Y65Qh0eBG10RNKyG70FBBemzwfBtmxMfX4bjY40SZcCge//O9jgGU890jttVq2frnl+ldbupH5GAyHleElQ7/urBrAHA+WNa8bVhSPiD/9t22vSeEc54w12ZIG0T+sTwJlPh5ORmSZ52HCPmKbayVVo6sbUClD6qXP7HDZAD+BeSbYZ/G1ei7zVk2Buvr3hzU3LHWbAMZ0ORzLnDVuC1H0YjFaEaqGNax8bGJ0hqW+Mia4vLzA== 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)(93006095)(93001095)(10201501046)(3231232)(944501410)(52105095)(6041310)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123560045)(20161123562045)(20161123564045)(20161123558120)(6072148)(201708071742011);SRVR:CY4PR03MB2632;BCL:0;PCL:0;RULEID:;SRVR:CY4PR03MB2632; X-Forefront-PRVS: 0654257CF5 X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10009020)(39380400002)(346002)(396003)(376002)(366004)(39860400002)(189003)(199004)(9686003)(8936002)(66066001)(4326008)(2906002)(47776003)(53936002)(76176011)(72206003)(305945005)(50226002)(107886003)(39060400002)(93886005)(81156014)(478600001)(316002)(6916009)(81166006)(55016002)(6246003)(54906003)(105586002)(106356001)(186003)(8676002)(230700001)(25786009)(97736004)(50466002)(6666003)(53546011)(6506007)(26005)(68736007)(5660300001)(33896004)(476003)(52116002)(7696005)(486006)(3846002)(386003)(1076002)(229853002)(7736002)(23726003)(6116002)(11346002)(446003)(956004)(16526019)(86362001)(39210200001);DIR:OUT;SFP:1101;SCL:1;SRVR:CY4PR03MB2632;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;CY4PR03MB2632;23:zvtYi38N5GrX0LsvtYsHE+jlQ2W9N5FzULO3JSD2H?= =?us-ascii?Q?p+H85stK1Kd+ATnLcgJgqkWt//R+KwzywOXCeoIAK/VtkDFZImIwzG+ZZJvh?= =?us-ascii?Q?FiJo8r8mB4c+eVWn1YaCN0dOJ7O9lSPFRmPu+BWw3EAH8DFfSbgUgG2Tp/Hc?= =?us-ascii?Q?KSxsfsEhEPd45NIjvMfcXl8QcyE/U2hK717AtWevq3zH3ESg6yH9nR4rFOoe?= =?us-ascii?Q?dFMes2AieYRhcDoOLg+QTyhCumtmlK2kU11FCT8aF9+krHYvXr9MkS8xO09c?= =?us-ascii?Q?F62oquNOw6FxkWVcAQ8kgZ8rTa/oBSQr+KyG5s+A+I3x0uPZh5HoYKn1zQBu?= =?us-ascii?Q?g6rmPp1JQqCsW5DtN1ck0kItvp4IRUJpwFeA0BJBar9T/TShB9ENoXCOoQg+?= =?us-ascii?Q?yP5lyM6MB0fZs8MndZN4KkXU04OqDkanoZ08V+Na93LBjoAeNTWrH/hTaMss?= =?us-ascii?Q?fJwjHxrPrVB+EKOWHSm74W0enFDxeE3dGE0iteyNJeARIDa2T8NxqvG+GLME?= =?us-ascii?Q?dQcU0typxiY6lALnqM5Ysd3V/BQX2ywAoWdkY3KXSw6JFAi2+KDF9RPSiVKX?= =?us-ascii?Q?l4XbybmlPJCq1y9qfxVA+415E1SC3VdzvXZ1/I0nhLaE9fVmMMFV0doUwkvs?= =?us-ascii?Q?M1547VuZ9J/r4pvvUnW76UgCS5MXDcy9xe6CwIqCXbc7csczboXaSBxVtP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oft-Exchange-Diagnostics: 1;CY4PR03MB2632;6:NcA0jiciLMXFR0fERBXEyMHPlBvlLSodYlMcqFCE0DQUnnWsiTXt3RR/vZVm3j3QzgsA2Ku9CUJ7pYYNjmgDB/Ri/3O2ZpgYcGAzRn4AJD9DXxGvoK3oQ1rjXNUuRIYBuYb4gLLoh8EcsurQ50Vbm5JtnvegMSnI5l3CQanWtSz/KqujGcvxfrLZrBQKogtMGRTAL10K+Nmid/sIqo0RnOZgoDePilRMu9Mcdu41hxUYuYfwwogUG/P/R5IQt5cBpq3fAC4dsny/UuUNyxM1+uBYiC2f72slCyXRwrhnGUGbLec5+ihecPLXli4loEr26ZJbK6kysuLf318XNnd7MHk8SGGifmj+8A9M+vQY4me50wr4OHX/kna81lSS0YWC0bK9sO/lz9KST863qrtw+dP/zW/e47EJBiQ+wGwHTn6gtyp7uCbnK8uvqwYtW4sk26vuLUgygU2QSjLoeUgFdw==;5:oHegjMdCdBPoIaN3DNwjH7GBmU3wa5+gver5ErggysnUL/FPj1jVKAuZyRIvz3jmS40csjqBcm/WkbBuQQpwGPm3DyxyXNpew4T/GLmeRmaoyTBSJ3DAzczgscTengwSKRvgc+wh14izilU5baAPoewVk7PF2XHOSUD2dbkcJ+c=;24:hfU6kSR5ElO4vs0IXndHWW64XDSxeCvkeR2viBKnqp9r8cfWWYzaUjtwJpHBBXlCqfciBdlo+vT4WM2n2UbfG+2rRTd3jjtcvAmR2ww1aI4= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1;CY4PR03MB2632;7:ej41VS7RpTzgPeVMbYJxw69WHI+ftruQYLcmfRLvSCL2Itkjq9FUFSm5KtsWFPbnztDbNjNHxVxA4SK+p1XSW8ugTPj7hvM/nP8xnhl4eFtFfX8ec9aojGY49SNB9CjwcCjoZmr3Sgund8Lq1Q1DXH3tnAvu0vyzVuNmD1J2UNp78Dn7DDu40n7VZJsw4OyRl1mZFCY5o8U3uSJa33HNMZta3dPtkGIcUQ7wMFIGIQiviHkRR3T1g7eRudulO46t X-MS-Office365-Filtering-Correlation-Id: 36f6e0c7-12f8-4a7c-ae71-08d5ab4b4111 X-OriginatorOrg: synaptics.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 26 Apr 2018 07:56:42.6930 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 36f6e0c7-12f8-4a7c-ae71-08d5ab4b4111 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 On Thu, 26 Apr 2018 11:56:33 +0530 Bhadram Varka wrote: > Hi, > On 4/26/2018 11:45 AM, Jisheng Zhang wrote: > > 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: > >>>> 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() > This part of the code executes only when we enable WOL through ethtool > (ethtool -s eth0 wol g) > > Lets say once WOL enabled through magic packet - HW generates WOL > interrupt once magic packet received. > The problem that I see here is that for the next immediate magic packet > I don't see WOL interrupt generated by the HW. hmm, so you want a "stick" WOL feature, I dunno whether Linux kernel requires WOL should be "stick".