Received: by 2002:a25:e74b:0:0:0:0:0 with SMTP id e72csp413514ybh; Sat, 18 Jul 2020 07:55:08 -0700 (PDT) X-Google-Smtp-Source: ABdhPJycU4xn6C4uP694yQY1V1ITkBNAPGECM3GlamRz04OMHIJdO98Wn82oH3h+LFXs/cnf53db X-Received: by 2002:a05:6402:1507:: with SMTP id f7mr14572235edw.37.1595084108385; Sat, 18 Jul 2020 07:55:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1595084108; cv=none; d=google.com; s=arc-20160816; b=a2bi3T7vqb7Fidnnx9QZL3M4pCghO14kMJvuHvG8bII04aRZcs9VDMhNODxMtxUtfj CpF31v91ibZ/gTcqzoCAPfKMDGcKzcA1/OfzaowbBs0P8gRYMofm4Lv5zQOcn0C/GDQR PnYTPTVC6I4a6X1lGTtIj45psfehFPW1yrIqNeCPiWeqg9D8FXlO6A1HwKiPfRyEfYth +szbpoT2r9BDpzJ+Oo+dIZxbY6b8EqKS7kq65qhLCkYlHnqSbdqby12cT5Js58nuH0wQ +ySxTfxfX59EJx4UhOYFo3qBJmAqZCURrPyEtp/Dk1a2v7rTW8CDXm6fc3ZFLkkWcE81 mTkw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=czQn0HwQTHuU+8VDDFhyjzIQBT95BxQ0LG8/RPvs3lo=; b=d69LuKacX00vZxAa4XentIzqqm+6MlIcQoG3u+1KlfJD3sBVkaAPyd3SknR0iVXF5Y KA+SXfk+WawyutW0WVe4Zy59ZO1978QuzG6DfddlqLFok34iuUJew9yMfuhckKiH0wrw rTLVFtoENrs5SozWuGgsnMiDQKmrHnh8K26OkKITooFBwfVPbUX7K2cEPm1hwlAFlgYK FVZoeKxjk3fpaZAVIRGsD/uHEs0fV3eBb6TtdmuN/FR2anaheXHSrBMywx/JSvgkcdMe kUYV3JUTANyMZ69LRnWhdJlODD8FrxQ3n4v/Aa2ifCEvXoljqbmfq5wcCeVYv6DoYwnE qz4A== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id z7si7101375eju.478.2020.07.18.07.54.45; Sat, 18 Jul 2020 07:55:08 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726973AbgGROyl (ORCPT + 99 others); Sat, 18 Jul 2020 10:54:41 -0400 Received: from vps0.lunn.ch ([185.16.172.187]:42670 "EHLO vps0.lunn.ch" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726574AbgGROyk (ORCPT ); Sat, 18 Jul 2020 10:54:40 -0400 Received: from andrew by vps0.lunn.ch with local (Exim 4.94) (envelope-from ) id 1jwoEW-005m00-3M; Sat, 18 Jul 2020 16:54:36 +0200 Date: Sat, 18 Jul 2020 16:54:36 +0200 From: Andrew Lunn To: Mark Einon Cc: davem@davemloft.net, netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] net: ethernet: et131x: Remove redundant register read Message-ID: <20200718145436.GB1375379@lunn.ch> References: <20200717132135.361267-1-mark.einon@gmail.com> <20200717134008.GB1336433@lunn.ch> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Jul 17, 2020 at 04:21:51PM +0100, Mark Einon wrote: > On Fri, 2020-07-17 at 15:40 +0200, Andrew Lunn wrote: > > On Fri, Jul 17, 2020 at 02:21:35PM +0100, Mark Einon wrote: > > > Following the removal of an unused variable assignment (remove > > > unused variable 'pm_csr') the associated register read can also go, > > > as the read also occurs in the subsequent > > > call. > > > > Hi Mark > > > > Do you have any hardware documentation which indicates these read are > > not required? Have you looked back through the git history to see if > > there are any comments about these read? > > > > Hardware reads which appear pointless are sometimes very important to > > actually make the hardware work. > > > > Andrew > > Hi Andrew, > > Yes - I'm aware of such effects. In the original vendor driver ( > https://gitlab.com/einonm/Legacy-et131x) the read of this register ( > pm_phy_sw_coma) is not wrapped in a function call and is always called > once when needed. > > Also in the current kernel driver et1310_in_phy_coma() is called a few > other times without the removed read being made. > > The datasheet I have for a similar device (et1011) doesn't say anything > other than the register should be read/write. > > So I think this is a safe thing to do. Hi Mark It is good to include this sort of information in the commit message. It makes it clear you have considered this, and it stops people like me asking... Andrew