[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-Id: <20190208.220924.1009748238168528290.davem@davemloft.net>
Date: Fri, 08 Feb 2019 22:09:24 -0800 (PST)
From: David Miller <davem@...emloft.net>
To: hkallweit1@...il.com
Cc: andrew@...n.ch, f.fainelli@...il.com, netdev@...r.kernel.org,
linux@...linux.org.uk
Subject: Re: [PATCH net-next] net: phy: consider latched link-down status
in polling mode
From: Heiner Kallweit <hkallweit1@...il.com>
Date: Wed, 6 Feb 2019 19:39:52 +0100
> The link status value latches link-down events. To get the current
> status we read the register twice in genphy_update_link(). There's
> a potential risk that we miss a link-down event in polling mode.
> This may cause issues if the user e.g. connects his machine to a
> different network.
>
> On the other hand reading the latched value may cause issues in
> interrupt mode. Following scenario:
>
> - After boot link goes up
> - phy_start() is called triggering an aneg restart, hence link goes
> down and link-down info is latched.
> - After aneg has finished link goes up and triggers an interrupt.
> Interrupt handler reads link status, means it reads the latched
> "link is down" info. But there won't be another interrupt as long
> as link stays up, therefore phylib will never recognize that link
> is up.
>
> Deal with both scenarios by reading the register twice in interrupt
> mode only.
>
> Signed-off-by: Heiner Kallweit <hkallweit1@...il.com>
Applied, thanks.
Powered by blists - more mailing lists