]> git.baikalelectronics.ru Git - kernel.git/commit
net: bcmgenet: reapply manual settings to the PHY
authorDoug Berger <opendmb@gmail.com>
Tue, 5 Nov 2019 19:07:26 +0000 (11:07 -0800)
committerDavid S. Miller <davem@davemloft.net>
Wed, 6 Nov 2019 18:46:22 +0000 (10:46 -0800)
commit1f48ac61365f04e3af4c46da2ef22303bb6f10e4
treeb4ced329bbfcdbd29852a52d6ddb1072c9cd42ac
parenta40c03c3b3367e1ddb7fee6e1c6e37b76a0548a9
net: bcmgenet: reapply manual settings to the PHY

The phy_init_hw() function may reset the PHY to a configuration
that does not match manual network settings stored in the phydev
structure. If the phy state machine is polled rather than event
driven this can create a timing hazard where the phy state machine
might alter the settings stored in the phydev structure from the
value read from the BMCR.

This commit follows invocations of phy_init_hw() by the bcmgenet
driver with invocations of the genphy_config_aneg() function to
ensure that the BMCR is written to match the settings held in the
phydev structure. This prevents the risk of manual settings being
accidentally altered.

Fixes: 390dff99da87 ("net: bcmgenet: add main driver file")
Signed-off-by: Doug Berger <opendmb@gmail.com>
Acked-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/broadcom/genet/bcmgenet.c