]> git.baikalelectronics.ru Git - kernel.git/commit
net: sfp: track upstream's attachment state in state machine
authorRussell King <rmk+kernel@armlinux.org.uk>
Sun, 10 Nov 2019 14:07:14 +0000 (14:07 +0000)
committerDavid S. Miller <davem@davemloft.net>
Tue, 12 Nov 2019 00:17:01 +0000 (16:17 -0800)
commit55f9f0cfbfb515a1f7e50e044e1b46b10c2718e0
tree5ac4169ce85dc0faac0b5c2c650b1938fea9258d
parent09815c2032ff3c466494072113931d91221c27c0
net: sfp: track upstream's attachment state in state machine

Track the upstream's attachment state in the state machine rather than
maintaining a boolean, which ensures that we have a strict order of
ATTACH followed by an UP event - we can never believe that a newly
attached upstream will be anything but down.

Rearrange the order of state machines so we run the module state
machine after the upstream device's state machine, so the module state
machine can check the current state of the device and take action to
e.g. reset back to empty state when the upstream is detached.

This is to allow the module detection to run independently of the
network device becoming available.

Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/phy/sfp.c