diff options
author | Kuiying Wang <kuiying.wang@intel.com> | 2019-10-29 06:28:29 +0300 |
---|---|---|
committer | Jae Hyun Yoo <jae.hyun.yoo@linux.intel.com> | 2021-11-05 10:22:09 +0300 |
commit | 138d8f3770f37de003b13ae80a9c8bd6872df87a (patch) | |
tree | 5560e29ccd9dc151a14888bc2a27c19dc1a2acf8 | |
parent | de83c9dda701454d5b8e5f381c6f00151e3a73e1 (diff) | |
download | linux-138d8f3770f37de003b13ae80a9c8bd6872df87a.tar.xz |
Fix NCSI driver issue caused by host shutdown due to overheated.
NCSI device cannot be recovered when host shutdown due to overheated.
Tested:
Heat host till shutdown due to overheated and then
run the ipmi command like power status
Signed-off-by: Kuiying Wang <kuiying.wang@intel.com>
-rw-r--r-- | net/ncsi/ncsi-manage.c | 19 |
1 files changed, 13 insertions, 6 deletions
diff --git a/net/ncsi/ncsi-manage.c b/net/ncsi/ncsi-manage.c index 7121ce2a47c0..729786f3ad7e 100644 --- a/net/ncsi/ncsi-manage.c +++ b/net/ncsi/ncsi-manage.c @@ -91,7 +91,6 @@ static void ncsi_channel_monitor(struct timer_list *t) struct ncsi_channel *nc = from_timer(nc, t, monitor.timer); struct ncsi_package *np = nc->package; struct ncsi_dev_priv *ndp = np->ndp; - struct ncsi_channel_mode *ncm; struct ncsi_cmd_arg nca; bool enabled, chained; unsigned int monitor_state; @@ -141,17 +140,14 @@ bad_state: netdev_err(ndp->ndev.dev, "NCSI Channel %d timed out!\n", nc->id); ncsi_report_link(ndp, true); - ndp->flags |= NCSI_DEV_RESHUFFLE; - ncm = &nc->modes[NCSI_MODE_LINK]; spin_lock_irqsave(&nc->lock, flags); nc->monitor.enabled = false; - nc->state = NCSI_CHANNEL_INVISIBLE; - ncm->data[2] &= ~0x1; + nc->state = NCSI_CHANNEL_INACTIVE; spin_unlock_irqrestore(&nc->lock, flags); spin_lock_irqsave(&ndp->lock, flags); - nc->state = NCSI_CHANNEL_ACTIVE; + ndp->flags |= NCSI_DEV_RESHUFFLE | NCSI_DEV_RESET; list_add_tail_rcu(&nc->link, &ndp->channel_queue); spin_unlock_irqrestore(&ndp->lock, flags); ncsi_process_next_channel(ndp); @@ -432,6 +428,7 @@ static void ncsi_request_timeout(struct timer_list *t) { struct ncsi_request *nr = from_timer(nr, t, timer); struct ncsi_dev_priv *ndp = nr->ndp; + struct ncsi_dev *nd = &ndp->ndev; struct ncsi_cmd_pkt *cmd; struct ncsi_package *np; struct ncsi_channel *nc; @@ -446,6 +443,16 @@ static void ncsi_request_timeout(struct timer_list *t) spin_unlock_irqrestore(&ndp->lock, flags); return; } + if (nd->state == ncsi_dev_state_suspend || + nd->state == ncsi_dev_state_suspend_select || + nd->state == ncsi_dev_state_suspend_gls || + nd->state == ncsi_dev_state_suspend_dcnt || + nd->state == ncsi_dev_state_suspend_dc || + nd->state == ncsi_dev_state_suspend_deselect || + nd->state == ncsi_dev_state_suspend_done) { + ndp->flags |= NCSI_DEV_RESET; + nd->state = ncsi_dev_state_suspend_done; + } spin_unlock_irqrestore(&ndp->lock, flags); if (nr->flags == NCSI_REQ_FLAG_NETLINK_DRIVEN) { |