Re: [PATCH RFC 05/26] phy: improve safety of fixed-phy MII register reading
From: Florian Fainelli <f.fainelli@gmail.com>
Date: 2016-01-07 19:51:10
From: Florian Fainelli <f.fainelli@gmail.com>
Date: 2016-01-07 19:51:10
On 07/12/15 09:37, Russell King wrote:
There is no prevention of a concurrent call to both fixed_mdio_read() and fixed_phy_update_state(), which can result in the state being modified while it's being inspected. Fix this by using a seqcount to detect modifications, and memcpy()ing the state. We remain slightly naughty here, calling link_update() and updating the link status within the read-side loop - which would need rework of the design to change. Signed-off-by: Russell King <redacted>
Reviewed-by: Florian Fainelli <f.fainelli@gmail.com> -- Florian