Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp18898349ybl; Fri, 3 Jan 2020 11:15:31 -0800 (PST) X-Google-Smtp-Source: APXvYqzBtA6dv+02BcMgaXZpgPz0BNbTiVOYlSTS/kNVj7dteGeSpZ6IND9Bcx58TIeSIWmc0bhp X-Received: by 2002:a9d:66ca:: with SMTP id t10mr99372764otm.352.1578078930860; Fri, 03 Jan 2020 11:15:30 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1578078930; cv=none; d=google.com; s=arc-20160816; b=Yq6lARowFwVWURS2eiRRHvXg8iiFCxJCaiK1LPk5VWyb60lop0XDqWs/b8BG3cwYIq kmotPzaJPZ1x1swUdtedLL/2xHd/j01SxDnvoFH1cNSvvKiAcsuTphBsE3MD6+LNLrbH Cn7a1/hlSYwPAlhTkntB77CYuUz2J+ZRJwFxabWNG/yIefWBuuWing9gHbaCThVLx4oZ yV8zfCrcCdcDWWjoA1tF6qPon72geYiv/WONPYJlf/YgIJ+4p4wagcecNct4zlObk504 tkiFjK7HChHmrF8s9xApiHQvZxpxkEIVkl/vRrjGjnm4Y641CAoc5ccdkd3OQVQz3c4p 9w5g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=mJgZ6foC5X2L3PU1OYn3aOckELw2Hq9GWYF/0Ih/oEA=; b=ouNFtE7sQ2xbnE5zpdZjibQ24uFi6xjwmsAt2teWENXHz94zdJLmVb5/FRDu/S3Y5e H9yCqD2e5zBTrV+tDn539EefIyefXJVqtmZejsF9E2NApJT6EiG33m6Uprnw31f6UtDS PYJr0sqocF3DMih3oJG+QVtK7obQauP5VBpvfRPkmFMI3ud/GFJ62rON6sooKE0/sJmb Z+0duV4U+bRTw7MDbthgADvvemq06FXt+zkbbp98bnXuw9J6pOZNhaqnCLvvqGsEgxrA TzrFctqmK+Qp2aYVyqzm4g1+8dwpapzWkO0PQC97uMJy72MU+Dp5VATvbEHYo5M/1d3L vdUw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=KLoelPZ3; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id h2si31638790otn.100.2020.01.03.11.15.17; Fri, 03 Jan 2020 11:15:30 -0800 (PST) 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=@gmail.com header.s=20161025 header.b=KLoelPZ3; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728495AbgACTNU (ORCPT + 99 others); Fri, 3 Jan 2020 14:13:20 -0500 Received: from mail-ed1-f43.google.com ([209.85.208.43]:32778 "EHLO mail-ed1-f43.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728373AbgACTNU (ORCPT ); Fri, 3 Jan 2020 14:13:20 -0500 Received: by mail-ed1-f43.google.com with SMTP id r21so42398549edq.0; Fri, 03 Jan 2020 11:13:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=mJgZ6foC5X2L3PU1OYn3aOckELw2Hq9GWYF/0Ih/oEA=; b=KLoelPZ3P4+qC9Qv/UPorq+aZdYVDP4Pk4HjgFD6T4/V/1mlZjvdN+jZeDbn1H/sU0 KXSq3AwEWxoePWhFULGURiZnud5VzyugNavbvhRFDS5ihJk9aKUR55gRKp8Z4HbGubH8 0smQ9z7qQ8q7SaGbpr7tbnPH9r5KQnyWDaDVC3S7oUcMk2iHmXru1y+ZmRpCXodepOHz N+UamyOGwzLMY6WZ+jcy444ea8d1DFa4JhH/nntYecLuJux5Yuvt/ayiPu7h/I6o32C2 Lp1Qg0+XpDcp96X8FhbXteCHFZoecPBDuN2RmcRz4NZosGpC/zbOzm/YkHK6TdSetR76 Lfsg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=mJgZ6foC5X2L3PU1OYn3aOckELw2Hq9GWYF/0Ih/oEA=; b=tknkzfuTTmcA8af0j85iF9uymAHT+jS2GgO/lhX+xlO8R00VMz7Iat3CMbYcyoPYjW LTQO/+T7aA1ghyI817D0lmyt8LUg/YK3sbV2ymFi2K2I3MOnEHL/WheZ7GR0ss0n5T4M V+iafpO/7JXlprsKWKzo7d3NGgYcXr/FZUj//vdKM+LZCZgL+gjWRfLTgvY02TO6oaG0 KTjlmhaBg12KVFAVTFoR5+wxR/6Dst7ymZlkTZUc3KXi2Vdc3F037sjjqQ5ELoUFINMU xJcS1V8nJqT2p4Ojmw1FbglRCxV4059IYItKrRFwewIpfuMknYcwKVqMxMLPoII8jFfL C60Q== X-Gm-Message-State: APjAAAXVMXoLNohT4gNIF4olknGIcy87LulN0GTtBmmvTz4Qx+7BFbrT qyIxH8WELFfWp/MRokVEzhJHreBGAE742xhTATM= X-Received: by 2002:a17:906:c35a:: with SMTP id ci26mr96583374ejb.133.1578078798402; Fri, 03 Jan 2020 11:13:18 -0800 (PST) MIME-Version: 1.0 References: <20200103121907.5769-1-yukuai3@huawei.com> <20200103144623.GI6788@bombadil.infradead.org> <20200103175318.GN1397@lunn.ch> In-Reply-To: <20200103175318.GN1397@lunn.ch> From: Vladimir Oltean Date: Fri, 3 Jan 2020 21:13:07 +0200 Message-ID: Subject: Re: [PATCH] net: 3com: 3c59x: remove set but not used variable 'mii_reg1' To: Andrew Lunn Cc: Matthew Wilcox , yu kuai , klassert@kernel.org, "David S. Miller" , Heiner Kallweit , Jakub Kicinski , hslester96@gmail.com, mst@redhat.com, yang.wei9@zte.com.cn, netdev , lkml , yi.zhang@huawei.com, zhengbin13@huawei.com Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Andrew, On Fri, 3 Jan 2020 at 19:54, Andrew Lunn wrote: > > I fully agree about the general case. However, reading the MII_BMSR > should not have any side affects. It would be an odd Ethernet PHY if > it did. This is not really correct. As far as I know the clause 22 spec requires the link status bit in BMSR to be latching low, so that momentary losses of link can be caught post-facto. In fact, even genphy_update_link treats this case: /* The link state is latched low so that momentary link * drops can be detected. Do not double-read the status * in polling mode to detect such short link drops. */ if (!phy_polling_mode(phydev)) { status = phy_read(phydev, MII_BMSR); if (status < 0) return status; else if (status & BMSR_LSTATUS) goto done; } So no, reading BMSR generally is not without side effects, and that does not make the PHY odd. Whether clearing the latching-low status bits is of any relevance to the 3com 3c59x driver bookkeeping, that I have not clue. > > Andrew Regards, -Vladimir