summaryrefslogtreecommitdiffstats
path: root/net/ncsi/ncsi-netlink.c
diff options
context:
space:
mode:
authorSamuel Mendoza-Jonas <sam@mendozajonas.com>2018-11-15 23:51:58 -0500
committerDavid S. Miller <davem@davemloft.net>2018-11-18 00:09:49 -0500
commit2878a2cfe57a5db21844801cf502fe535a3134b2 (patch)
treebd3fa6082c4195610fecb1ef657cae4e16c42aa5 /net/ncsi/ncsi-netlink.c
parent0b970e1b040c10d0e2a252943a2feaa6ee3cacdf (diff)
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>
Diffstat (limited to 'net/ncsi/ncsi-netlink.c')
-rw-r--r--net/ncsi/ncsi-netlink.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/net/ncsi/ncsi-netlink.c b/net/ncsi/ncsi-netlink.c
index 33314381b4f5..cde48fe43dba 100644
--- a/net/ncsi/ncsi-netlink.c
+++ b/net/ncsi/ncsi-netlink.c
@@ -330,9 +330,9 @@ static int ncsi_set_interface_nl(struct sk_buff *msg, struct genl_info *info)
330 package_id, channel_id, 330 package_id, channel_id,
331 channel_id == NCSI_RESERVED_CHANNEL ? " (any)" : ""); 331 channel_id == NCSI_RESERVED_CHANNEL ? " (any)" : "");
332 332
333 /* Bounce the NCSI channel to set changes */ 333 /* Update channel configuration */
334 ncsi_stop_dev(&ndp->ndev); 334 if (!(ndp->flags & NCSI_DEV_RESET))
335 ncsi_start_dev(&ndp->ndev); 335 ncsi_reset_dev(&ndp->ndev);
336 336
337 return 0; 337 return 0;
338} 338}
@@ -360,9 +360,9 @@ static int ncsi_clear_interface_nl(struct sk_buff *msg, struct genl_info *info)
360 spin_unlock_irqrestore(&ndp->lock, flags); 360 spin_unlock_irqrestore(&ndp->lock, flags);
361 netdev_info(ndp->ndev.dev, "NCSI: Cleared preferred package/channel\n"); 361 netdev_info(ndp->ndev.dev, "NCSI: Cleared preferred package/channel\n");
362 362
363 /* Bounce the NCSI channel to set changes */ 363 /* Update channel configuration */
364 ncsi_stop_dev(&ndp->ndev); 364 if (!(ndp->flags & NCSI_DEV_RESET))
365 ncsi_start_dev(&ndp->ndev); 365 ncsi_reset_dev(&ndp->ndev);
366 366
367 return 0; 367 return 0;
368} 368}