Received: by 2002:a05:6a10:f3d0:0:0:0:0 with SMTP id a16csp284764pxv; Wed, 30 Jun 2021 05:44:43 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxz/I39MFXY5pjINDxtWNld7cQsOg5Thybq98xGA+IuzDtT2pQOSeD+9Qg6A7n7LIPkN/FS X-Received: by 2002:a6b:d009:: with SMTP id x9mr7744282ioa.199.1625057082892; Wed, 30 Jun 2021 05:44:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1625057082; cv=none; d=google.com; s=arc-20160816; b=Dmc5qSA58XVzgUvfoGDqYiD2p6AQAqdtaokjehzfS0G6lB6wQnrwnXfFU43h4b53Ib VY7WPt5loB8mjPTFP17lc03Ws2/gSZHxmVPdipfLfJ0Uy+GU6X4g17tJuAbhZdH1+Tlp cPKXUl+gWqhpgkJQ5dfnnHl4ruBnEyvI1fjB6greJwDIGwPOIF5T1C+LALAE9eDe5ADI ChLRHVYa2y7XZauODRWrr3nyxGEwAa4arSXEc062myxjfzWmBNOVfceZ+XfCE0rn1BNu DEQQjpjW6w3HxnWu8n6rmszD/ofeTS/ughyjFo7yA6VUoV9lz3KKxSY0spzX301qRJOl mKyg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date :dkim-signature; bh=s6koXmz5XowlSlfDZce2IHXMcI+NRSY/LpyWpk2emGg=; b=THyvtzOjqFciirul/cl0p67qEL0cxL70cf7QlKjJgTbrbaSz8lgh8y95oaA49d8Oe3 Eavn17geJoLCeTM6SDAyl3RUsvDGxb2v8qLPDG44t8Hyv3fSiXxquch7fhTohVqf9o8o Its5Cyr1YtUhkNIkhCMllYlfiTQo0cLplk9p2Dao+TLpGEIy6uAYvn+6xDlarG7aK3xb Fbf1vL4Xhl3P6KEo/W9Jk31Hw2GD7U6A94gm0wJcUDJU99Q5P4b95LQY3ASgtezZQS2S lzHC1lj7M/KJHVjeYKFyr1iFZrPRVC+3rVvClBmANqRZHnRIVfR/t6wjpVIcWng2o92P 8mxw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="FeTNFP/0"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id k9si10966164jav.118.2021.06.30.05.44.31; Wed, 30 Jun 2021 05:44:42 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="FeTNFP/0"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234767AbhF3Mpv (ORCPT + 99 others); Wed, 30 Jun 2021 08:45:51 -0400 Received: from mail.kernel.org ([198.145.29.99]:49098 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234713AbhF3Mpv (ORCPT ); Wed, 30 Jun 2021 08:45:51 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id A67EA61607; Wed, 30 Jun 2021 12:43:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1625057002; bh=6OF4N7JUtnNgaXGoSID4OhvWKE5ES8/5xECcYMjn9GM=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=FeTNFP/0ZM6PCu6uCPphHKqYIH1H53Fn0P0lBSgSiPaSnDxaiEDoTfwPnscep264G VD1qn9Du9w5RFbMpaoP9kVqAoS1qW6MWuYMYAky4JPkgi0Q3CzwopOlXhVIH6adUP0 LX1s2/SHr3RkVVE6SCBGo+8/iMPT1lg3xWSop3EqsrAMhyACheA9CZw9gt5d0C/TWG v+y1BgP9nZaz+HPITZG95rI25JNIzHguGMlKNmxdf7ZhPIaaFZlCkas7kJTmAEPvz1 1/TccvltwJ8Iv3+zLrLmFdNM0jThM1U0Vy58BJB+KCztbGEkOiPPqRlps3x4HvXybC f8ALCQLH4m1Jg== Date: Wed, 30 Jun 2021 14:43:18 +0200 From: Marek =?UTF-8?B?QmVow7pu?= To: Ling Pei Lee Cc: Russell King , Andrew Lunn , Heiner Kallweit , davem@davemloft.net, Jakub Kicinski , netdev@vger.kernel.org, linux-kernel@vger.kernel.org, weifeng.voon@intel.com, vee.khee.wong@linux.intel.com, vee.khee.wong@intel.com Subject: Re: [PATCH net-next V2] net: phy: marvell10g: enable WoL for mv2110 Message-ID: <20210630144318.42786e1b@dellmb> In-Reply-To: <20210629105554.1443676-1-pei.lee.ling@intel.com> References: <20210629105554.1443676-1-pei.lee.ling@intel.com> X-Mailer: Claws Mail 3.17.8 (GTK+ 2.24.33; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Ling, some more things, please look at these. First, the subject line should be net: phy: marvell10g: enable WoL for 88X3310 and 88E2110 since you are also implementing it for 3310. > From: Voon Weifeng > > Basically it is just to enable to WoL interrupt and enable WoL > detection. Then, configure the MAC address into address detection > register. "Implement Wake-on-LAN feature for 88X3310 and 88E2110. This is done by enabling WoL interrupt and WoL detection and configuring MAC address into WoL magic packet registers." > Change Log: > V2: > (1) Reviewer Marek request to rorganize code to readable way. > (2) Reviewer Rusell request to put phy_clear_bits_mmd() outside of > if(){}else{} and modify return ret to return phy_clear_bits_mmd(). > (3) Reviewer Rusell request to add return on phy_read_mmd() in > set_wol(). (4) Reorganize register layout to be put before > MV_V2_TEMP_CTRL. (5) Add the .{get|set}_wol for 88E3110 too as per > feedback from Russell. We do not put changelogs into the commit message normally. Mostly we put it into cover letters or after the "--" line so that it is not included in the commit message in git history (merge commits are one of the exceptions). As Russell wrote, you have only partially reorganized register constants. The constants should be defined in this order + MV_V2_PORT_INTR_STS = 0xf040, + MV_V2_PORT_INTR_MASK = 0xf043, + MV_V2_WOL_INTR_EN = BIT(8), + MV_V2_MAGIC_PKT_WORD0 = 0xf06b, + MV_V2_MAGIC_PKT_WORD1 = 0xf06c, + MV_V2_MAGIC_PKT_WORD2 = 0xf06d, + /* Wake on LAN registers */ + MV_V2_WOL_CTRL = 0xf06e, + MV_V2_WOL_CLEAR_STS = BIT(15), + MV_V2_WOL_MAGIC_PKT_EN = BIT(0), + MV_V2_WOL_STS = 0xf06f, Also: - MV_V2_WOL_STS is not used, you should read the register before cleaning or don't define the constant at all. (IMO you should read it). - register value constants should be prefixed with whole register names, so: MV_V2_WOL_INTR_EN rename to MV_V2_PORT_INTR_STS_WOL_EN MV_V2_WOL_CLEAR_STS rename to MV_V2_WOL_CTRL_CLEAR_STS MV_V2_WOL_MAGIC_PKT_EN rename to MV_V2_WOL_CTRL_MAGIC_PKT_EN + /* Reset the clear WOL status bit as it does not self-clear */ + return phy_clear_bits_mmd(phydev, MDIO_MMD_VEND2, + MV_V2_WOL_CTRL, + MV_V2_WOL_CLEAR_STS); This has wrong indentation, the arguments in new lines should start at the position of first argument. Marek