All of lore.kernel.org
 help / color / mirror / Atom feed
From: Florian Fainelli <f.fainelli@gmail.com>
To: Vladimir Oltean <olteanv@gmail.com>, Andrew Lunn <andrew@lunn.ch>
Cc: Matthew Wilcox <willy@infradead.org>,
	yu kuai <yukuai3@huawei.com>,
	klassert@kernel.org, "David S. Miller" <davem@davemloft.net>,
	Heiner Kallweit <hkallweit1@gmail.com>,
	Jakub Kicinski <jakub.kicinski@netronome.com>,
	hslester96@gmail.com, mst@redhat.com, yang.wei9@zte.com.cn,
	netdev <netdev@vger.kernel.org>,
	lkml <linux-kernel@vger.kernel.org>,
	yi.zhang@huawei.com, zhengbin13@huawei.com
Subject: Re: [PATCH] net: 3com: 3c59x: remove set but not used variable 'mii_reg1'
Date: Fri, 3 Jan 2020 11:17:12 -0800	[thread overview]
Message-ID: <b4697457-51d2-c987-4138-b4b2b92e391d@gmail.com> (raw)
In-Reply-To: <CA+h21hqcz=QF8bq285JjdOn+gsOGvGSnDiWzDOS5-XGAGGGr9w@mail.gmail.com>

On 1/3/20 11:13 AM, Vladimir Oltean wrote:
> Hi Andrew,
> 
> On Fri, 3 Jan 2020 at 19:54, Andrew Lunn <andrew@lunn.ch> 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.

And since more reviewers are on the same boat, the fix should probably
look to eliminate the warning by doing something like:

(void)mdio_read(dev, vp->phys[0], MII_BMSR);
-- 
Florian

  reply	other threads:[~2020-01-03 19:17 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-01-03 12:19 [PATCH] net: 3com: 3c59x: remove set but not used variable 'mii_reg1' yu kuai
2020-01-03 14:46 ` Matthew Wilcox
2020-01-03 14:59   ` Michal Kubecek
2020-01-03 17:53   ` Andrew Lunn
2020-01-03 18:17     ` Michal Kubecek
2020-01-03 19:13     ` Vladimir Oltean
2020-01-03 19:17       ` Florian Fainelli [this message]
2020-01-03 19:37         ` Andrew Lunn
     [not found]           ` <CAP8WD_a6QJNz2mUpz_eCaNReoZKVAdL0TpoF-m+gA4VPWRrrMg@mail.gmail.com>
2020-01-03 20:03             ` tedheadster
2020-01-06 12:48           ` yukuai (C)

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=b4697457-51d2-c987-4138-b4b2b92e391d@gmail.com \
    --to=f.fainelli@gmail.com \
    --cc=andrew@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=hkallweit1@gmail.com \
    --cc=hslester96@gmail.com \
    --cc=jakub.kicinski@netronome.com \
    --cc=klassert@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mst@redhat.com \
    --cc=netdev@vger.kernel.org \
    --cc=olteanv@gmail.com \
    --cc=willy@infradead.org \
    --cc=yang.wei9@zte.com.cn \
    --cc=yi.zhang@huawei.com \
    --cc=yukuai3@huawei.com \
    --cc=zhengbin13@huawei.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.