]> git.baikalelectronics.ru Git - kernel.git/commit
net: dsa: bcm_sf2: properly propagate carrier down state for MoCA
authorFlorian Fainelli <f.fainelli@gmail.com>
Fri, 15 May 2015 19:38:01 +0000 (12:38 -0700)
committerDavid S. Miller <davem@davemloft.net>
Mon, 18 May 2015 03:40:24 +0000 (23:40 -0400)
commit778d4f4caf88eeb08ce24bf137ee629032ba2c0c
tree93e3c834d10338c3386a18a438f68853f7dc5bad
parent92d0f5ffe0237ceaac2c0679243fa81f5b2fe990
net: dsa: bcm_sf2: properly propagate carrier down state for MoCA

MoCA interfaces require the use of an user-space daemon (mocad) which
will typically use cmd->autoneg to force the link. This is causing other
network manager applications not to get proper carrier down
notifications because of the following sequence of events:

- link down interrupt is received, link is set to 0 by the interrupt
  handler
- fixed_link update callback runs and updates the BMSR register
  accordingly
- PHY library polls the PHY for link status, sees the link is down,
  proceeds with reporting that
- mocad gets notified of the link state and call phy_ethtool_sset()
  with cmd->autoneg set to the link status (0)
- phy_start_aneg() is called at the end of phy_ethtool_sset() and sets
  the PHY state to PHY_FORCING

Just make sure we notify the interface carrier appropriately when we
detect that the link is down in our fixed_link update callback. This is
made local to the bcm_sf2 driver as the PHY library does the right thing
in any case. This is similar to the GENET change introduced in
697fb1ed92db1993443f78942e3028fdd00fb1cc ("net: bcmgenet: enable MoCA
link state change detection").

Fixes: a308ff9e14d2 ("net: dsa: add Broadcom SF2 switch driver")
Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/dsa/bcm_sf2.c