Received: by 10.192.165.148 with SMTP id m20csp400000imm; Fri, 27 Apr 2018 00:27:49 -0700 (PDT) X-Google-Smtp-Source: AB8JxZpVLIy3H3WceXa3Ku/EH3Yj7lvf4EdzYJcgPyJp8qfes+46HmvbSKvLsj313C40S2zeHD+c X-Received: by 2002:a17:902:7241:: with SMTP id c1-v6mr1265511pll.217.1524814069609; Fri, 27 Apr 2018 00:27:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524814069; cv=none; d=google.com; s=arc-20160816; b=qlKfpFlgbKDWq32he9xktOYccJtztNy59faK3MA+bfZ9owvjfk7u8ZJh+yzF5OVns+ 1sGnSdmoA8iBqLtOLedC7XZPdMkjV0k0M7F5T2tkCd8H7sE/GNyAOEEf5IDds3jxGS+8 8DfxG4CsAs6PCti8142oWe/uhsXjgPdcSgSlKJs8L5t4jsbu0TUZx0FZoCjqaPBBa5Mi 58WjPnOsxJSYxnOUmdzUgWx/oQd5iAPe2PHgiCO6TOVxLy6w+5xBR2CZIOiM9fFtZnHT fnkhfoGbRfbqKHej+9kGUK/XtaPsErZFvZpmPFcpY8xhvVFRrW0hb6idMwCh6PAZ2o6+ cnoQ== 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=OG7hL70rkT70rTfbVk5hZJuI/wOxxmx068l8x9z6yC4=; b=m26bCFjLU4GNIsBB21ChtYFsF9M7Lnzb6CwjSQNTcBvk7POKxADzw4sfnuExDrSMWC u+ihywhOGZuD5IvpgvraqCNaNC5/+p3y/Vy3Ru/jUWVf5IsdK3uAPcpWaYCJsLV+oU9K nxmszxNtJKc5eXcDwX89NimkKgDTaO2BO18SpQZ9IU8WUAufJrJqGo5CvTMDaXzBAY9h z4FNjQwY+xb1xjheD4DQCSbR9vwNlDQWWQD62T/n33kPT82cf3GMSF+s3msnj2AXSxUY 3ic4XArNoLyG6EtI22scZD6uV65XDshKldvAadmnZ4vlBgPLOl+kQDOQ+nRRGUdFSOcc 4Uzw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@Synaptics.onmicrosoft.com header.s=selector1-synaptics-com header.b=tsrS5Vh0; 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 f20-v6si214006plr.471.2018.04.27.00.27.35; Fri, 27 Apr 2018 00:27:49 -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=tsrS5Vh0; 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 S932328AbeD0H00 (ORCPT + 99 others); Fri, 27 Apr 2018 03:26:26 -0400 Received: from mail-co1nam03on0084.outbound.protection.outlook.com ([104.47.40.84]:43472 "EHLO NAM03-CO1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1757469AbeD0H0Y (ORCPT ); Fri, 27 Apr 2018 03:26:24 -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=OG7hL70rkT70rTfbVk5hZJuI/wOxxmx068l8x9z6yC4=; b=tsrS5Vh0I+Fs6A1BkztzjL6vMdOPNyESNKVd7niP205zxiQyYA27Arr5XE7vBUAs+nXvQQO60N/hYsElgDyr1eZRbsR4oXAPBJNL0RsfvpIfz5dkJ1/CnNS+NZ/JM1A9kJKfGCr/ZqbWoMy8VOzb9ispj/hhVB/N/VG8uDROOCU= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Jisheng.Zhang@synaptics.com; Received: from xhacker.debian (124.74.246.114) by DM5PR03MB2633.namprd03.prod.outlook.com (2603:10b6:3:43::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.715.18; Fri, 27 Apr 2018 07:26:20 +0000 Date: Fri, 27 Apr 2018 15:25:55 +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: <20180427152555.5e8efb9c@xhacker.debian> In-Reply-To: <73e21c83-f78a-8b22-a421-f179ef6adef1@nvidia.com> References: <20180419160232.519d15be@xhacker.debian> <20180419121801.GC17888@lunn.ch> <4273f766-a017-b336-7d14-a28901d274b9@nvidia.com> <20180426141508.6660a633@xhacker.debian> <73e21c83-f78a-8b22-a421-f179ef6adef1@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=UTF-8 Content-Transfer-Encoding: quoted-printable X-Originating-IP: [124.74.246.114] X-ClientProxiedBy: KAWPR01CA0096.jpnprd01.prod.outlook.com (2603:1096:402:c::32) To DM5PR03MB2633.namprd03.prod.outlook.com (2603:10b6:3:43::7) X-MS-PublicTrafficType: Email X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:(7020095)(4652020)(5600026)(4534165)(4627221)(201703031133081)(201702281549075)(2017052603328)(7153060)(7193020);SRVR:DM5PR03MB2633; X-Microsoft-Exchange-Diagnostics: 1;DM5PR03MB2633;3:2jJAmyx+ZUGoEyI1IveW+p2Jccqw8CWkA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F0T9Qckm0g2v0PlGV+u81u6yAqESVNTwH6u1eqOHYxAZcTluwiStkLfqqYP05I58kCr6mibuvtyGpY1yFScD36q2AYau3zdBpbIIn+8pIPlUZbDCAC4Uhi4sCPFv8i6ONtSn37WxwUxDxapxbzkMNj/tML67NK+QFeDuQs/RdyhYYWZS1fNLPLrLdS7O6zS3qeAk4R+rUkLN30tA5lwsqU+ilepACgy4fv2MRvDN8CHckEBEoLDjEthVXvDtbdmYsUHrM30d9PT1VDt6qoCzxO4qcpid9be+0ed6cmVd9OAYpTKvg+qJosP6C7WfDd;4:ICZhlul1r2NmQ3UQ0J+0+aBgNbjb28PnSWG0LtdoV71YZgp8IaHsak3xjZItvLn7GNVp8ngg7YE5i6TrLXr6kAcLZtECwwcywiIimAQOWQ1prEQSwpVt9Y/zVuz+wfv8+YvKW688mGCDMe+Sn6q6M8Sd1DK6czxH2iru/WogXxAbN23thdw46PgJ+FpRVFUjCnoEId/QsXZP61Plt4PvNNv5qpXM29dGlo3Fs1310z3p8qU5yI9eb50cbBtDj4XWPjNyJBkIfah4vl99m0+zAA== 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)(3231232)(944501410)(52105095)(93006095)(93001095)(3002001)(10201501046)(6041310)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123558120)(20161123564045)(20161123560045)(20161123562045)(6072148)(201708071742011);SRVR:DM5PR03MB2633;BCL:0;PCL:0;RULEID:;SRVR:DM5PR03MB2633; X-Forefront-PRVS: 0655F9F006 X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10009020)(39380400002)(396003)(376002)(39860400002)(346002)(366004)(199004)(189003)(3846002)(6116002)(47776003)(86362001)(93886005)(1076002)(186003)(16526019)(66066001)(68736007)(97736004)(50466002)(476003)(105586002)(39060400002)(6246003)(956004)(107886003)(11346002)(486006)(53936002)(446003)(229853002)(25786009)(305945005)(5660300001)(50226002)(4326008)(72206003)(2906002)(55016002)(9686003)(6916009)(6666003)(7736002)(76176011)(6506007)(386003)(316002)(7696005)(52116002)(33896004)(26005)(23676004)(8676002)(81166006)(81156014)(478600001)(8746002)(8936002)(54906003)(106356001)(39210200001);DIR:OUT;SFP:1101;SCL:1;SRVR:DM5PR03MB2633;H:xhacker.debian;FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;A:1;MX:1; Received-SPF: None (protection.outlook.com: synaptics.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?utf-8?B?MTtETTVQUjAzTUIyNjMzOzIzOjdTM0Z0Q1gvakpZc2RXazFaSHlsblBCcjVG?= =?utf-8?B?a2NUNjM1a0F0eFVTWGlLcUZjY0ZSZFphdmJrR1p1ZXJ2cEJjWnJmYWk4TTVq?= =?utf-8?B?cXl2K3YyL0xhN2FTRHJVMy9SY2Z6OHRpaG0wL3ZEMTJ6UnRJTjQ5Q3JvMTJL?= =?utf-8?B?d1EyY3lQdEpaeFh0TEJIME1ucitVNmp2K3FzSnBpSGVIdHlnSXlPK3YzSTJ4?= =?utf-8?B?VUZ0V0NIUVFaZjRRWldXeTIweVlLL2dMMHZXejlXUndWNmZ1cEJKVENlbmJ5?= =?utf-8?B?RjNmdWxOeUpLR1NoK1N4aFJ6QU9GbXBCdHJWS1FEZU5wdFl0RU1SVkVpNlFu?= =?utf-8?B?a0NKSzh4QzhQTUF2alRmcWl6ZFpxZDMrQzdUOVBBajBNdVNIS3dwUmU1bExK?= =?utf-8?B?VEZVdE5RN09RM1daNVJ4TkZYYjVmZGMrdHVxS2RhSHBvNU84NExlR2J6ZERY?= =?utf-8?B?NDgzRS8vMzJxVVRZRUQ4TnFxY0V1NEJTMWM2OGd6a09haTJLdFQzWWZZQUJK?= =?utf-8?B?MjBjb3NqKzdjZ3EyRkdOSFk1Y09ManBRKzhYU0YzZW9MeWluVTQ4YzM5ZlZM?= =?utf-8?B?TWY0NmZ1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3vL+QZrQGvzTcFIkYm808CUr/5l2eLOV17HKcCcF6SRjyZALtuWjhZiOAV7Rnu9wYGb9raCQ==;5:18LPqr0DXkAluWtrJQOfWsgbyWlpnzlbkglqTfBBcnQyhMSYqejPMTcy9wViHBsSEkv+aKW34NKYZfHpS1ncOjFAlNlKgUGTHjlB+i5O77Q7VBtsvwvQNFCm7FQfzAdlZXTtpxni7fYPEdvcWPHXAvvU/nax7OJpx8GpR2Etbs8=;24:WKYPlQ8IEaPRoT2ytfCjvfkuRilLUzY5ipHDont2BEJbOd5EBDfeOCpnggAiidUMu1WhgMV/k8a1QzIiBT5clq6drke+/FQ6qFNXSpoQJn4= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1;DM5PR03MB2633;7:idx3jAUNmWXSnCFTsgvO7RQOJq1q70i6ugpc6HCEyRENm3N00DAJAWvW1fE1jG+UAQ4/Msr3HYzTk5DNrMw/AsLWabcIC0rDw4uN5kz0OUjd/OcVlFTiuElawLOjDw63Y388cok9zdJep3udD88W/8Hvkai6DcGW+6WXkUsazZuv/ruaLugQ9FHUV9b/6GSt/VMON81Xrq2iDdvQZaFzFjJ1uEJPZf9wPULq0fraTJ1cyj21Ek7pdYXZN7dbyp6d X-MS-Office365-Filtering-Correlation-Id: 9554471e-032f-437a-1085-08d5ac102d7a X-OriginatorOrg: synaptics.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 27 Apr 2018 07:26:20.5534 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 9554471e-032f-437a-1085-08d5ac102d7a X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 335d1fbc-2124-4173-9863-17e7051a2a0e X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR03MB2633 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, 26 Apr 2018 12:39:59 +0530 Bhadram Varka wrote: > >>>>> > >>>>> 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 @@ > >>>>> =C2=A0=C2=A0 /* WOL Event Interrupt Enable */ > >>>>> =C2=A0=C2=A0 #define MII_88E1318S_PHY_CSIER_WOL_EIE BIT(7) > >>>>> =C2=A0=C2=A0 +/* Copper Specific Interrupt Status Register */ > >>>>> +#define MII_88E1318S_PHY_CSISR=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 0x13 > >>>>> + > >>>>> =C2=A0=C2=A0 /* LED Timer Control Register */ > >>>>> =C2=A0=C2=A0 #define MII_88E1318S_PHY_LED_TCR=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 0x12 > >>>>> =C2=A0=C2=A0 #define MII_88E1318S_PHY_LED_TCR_FORCE_INT BIT(15) > >>>>> @@ -1393,6 +1396,12 @@ static int m88e1318_set_wol(struct=20 > >>>>> phy_device *phydev, > >>>>> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 if (er= r < 0) > >>>>> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0 goto error; > >>>>> =C2=A0=C2=A0 +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 /* If WOL = event happened once, the LED[2] interrupt pin > >>>>> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 * will not be cle= ared unless reading the CSISR register. > >>>>> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 * So clear the WO= L event first before enabling it. > >>>>> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 */ > >>>>> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 phy_read(phydev, MII_88= E1318S_PHY_CSISR); > >>>>> + =20 > >>>> Hi Jisheng > >>>> > >>>> The problem with this is, you could be clearing a real interrupt, li= nk > >>>> 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()? =20 > >>> So this will clear WoL interrupt bit from Copper Interrupt status=20 > >>> register. > >>> > >>> How about clearing WoL status (Page 17, register 17) for every WOL=20 > >>> event ? > >>> =20 > >> This is already properly done by setting=20 > >> MII_88E1318S_PHY_WOL_CTRL_CLEAR_WOL_STATUS > >> in m88e1318_set_wol() =20 > > This part of the code executes only when we enable WOL through ethtool= =20 > > (ethtool -s eth0 wol g) > > > > Lets say once WOL enabled through magic packet - HW generates WOL=20 > > interrupt once magic packet received. > > The problem that I see here is that for the next immediate magic=20 > > packet I don't see WOL interrupt generated by the HW. > > I need to explicitly clear WOL status for HW to generate WOL interrupt.= =20 >=20 > With the below patch I see WOL event interrupt for every magic packet=20 > that HW receives... >=20 > diff --git a/drivers/net/phy/marvell.c b/drivers/net/phy/marvell.c > index ed8a67d..5d3d138 100644 > --- a/drivers/net/phy/marvell.c > +++ b/drivers/net/phy/marvell.c > @@ -55,6 +55,7 @@ >=20 > =C2=A0#define MII_M1011_IEVENT=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 0x13 > =C2=A0#define MII_M1011_IEVENT_CLEAR=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0 0x0000 > +#define MII_M1011_IEVENT_WOL_EVENT=C2=A0=C2=A0=C2=A0=C2=A0 BIT(7) >=20 > =C2=A0#define MII_M1011_IMASK=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0 0x12 > - #define MII_M1011_IMASK_INIT=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0 0x6400 > + #define MII_M1011_IMASK_INIT=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0 0x6480 >=20 > @@ -195,13 +196,40 @@ struct marvell_priv { > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 bool copper; > =C2=A0}; >=20 > +static int marvell_clear_wol_status(struct phy_device *phydev) > +{ > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 int err, temp, oldpage; > + > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 oldpage =3D phy_read(phydev, MII_MA= RVELL_PHY_PAGE); > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 if (oldpage < 0) > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0 return oldpage; > + > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 err =3D phy_write(phydev, MII_MARVE= LL_PHY_PAGE, > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 MII_88E1= 318S_PHY_WOL_PAGE); > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 if (err < 0) > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0 return err; > + > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 /* > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 * Clear WOL status so that fo= r next WOL event > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 * interrupt will be generated= by HW > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 */ > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 temp =3D phy_read(phydev, MII_88E13= 18S_PHY_WOL_CTRL); > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 temp |=3D MII_88E1318S_PHY_WOL_CTRL= _CLEAR_WOL_STATUS; > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 err =3D phy_write(phydev, MII_88E13= 18S_PHY_WOL_CTRL, temp); is it better to reuse __phy_write()? > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 if (err < 0) > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0 return err; > + > + > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 phy_write(phydev, MII_MARVELL_PHY_P= AGE, oldpage); > + > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 return 0; > +} > + > =C2=A0static int marvell_ack_interrupt(struct phy_device *phydev) > =C2=A0{ > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 int err; >=20 > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 /* Clear the interrupts by re= ading the reg */ > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 err =3D phy_read(phydev, MII_= M1011_IEVENT); > - > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 if (err < 0) > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0 return err; >=20 > @@ -1454,12 +1482,18 @@ static int marvell_aneg_done(struct phy_device=20 > *phydev) >=20 > =C2=A0static int m88e1121_did_interrupt(struct phy_device *phydev) > =C2=A0{ > -=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 int imask; > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 int imask, err; >=20 > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 imask =3D phy_read(phydev, MI= I_M1011_IEVENT); >=20 > -=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 if (imask & MII_M1011_IMASK_INIT) > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 if (imask & MII_M1011_IMASK_INIT) { > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0 if (imask & MII_M1011_IEVENT_WOL_EVENT) { > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 err =3D marvel= l_clear_wol_status(phydev); > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 if (err < 0) > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 return 0; > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0 } > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0 return 1; > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 } >=20 > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 return 0; > =C2=A0}