]> git.baikalelectronics.ru Git - kernel.git/commit
net/ncsi: Reset channel state in ncsi_start_dev()
authorSamuel Mendoza-Jonas <sam@mendozajonas.com>
Fri, 16 Nov 2018 04:51:58 +0000 (15:51 +1100)
committerDavid S. Miller <davem@davemloft.net>
Sun, 18 Nov 2018 05:09:49 +0000 (21:09 -0800)
commit057f630ae5dbbbbd56cc534b8ea47d321123edff
treebd3fa6082c4195610fecb1ef657cae4e16c42aa5
parent2d5c04f0dea4f13929f5b6000588d6b206700f57
net/ncsi: Reset channel state in ncsi_start_dev()

When the NCSI driver is stopped with ncsi_stop_dev() the channel
monitors are stopped and the state set to "inactive". However the
channels are still configured and active from the perspective of the
network controller. We should suspend each active channel but in the
context of ncsi_stop_dev() the transmit queue has been or is about to be
stopped so we won't have time to do so.

Instead when ncsi_start_dev() is called if the NCSI topology has already
been probed then call ncsi_reset_dev() to suspend any channels that were
previously active. This resets the network controller to a known state,
provides an up to date view of channel link state, and makes sure that
mode flags such as NCSI_MODE_TX_ENABLE are properly reset.

In addition to ncsi_start_dev() use ncsi_reset_dev() in ncsi-netlink.c
to update the channel configuration more cleanly.

Signed-off-by: Samuel Mendoza-Jonas <sam@mendozajonas.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/ncsi/internal.h
net/ncsi/ncsi-manage.c
net/ncsi/ncsi-netlink.c