summaryrefslogtreecommitdiff
path: root/meta-openbmc-mods/meta-common/recipes-kernel/linux/linux-aspeed/0078-Fix-NCSI-driver-issue-caused-by-host-shutdown.patch
diff options
context:
space:
mode:
Diffstat (limited to 'meta-openbmc-mods/meta-common/recipes-kernel/linux/linux-aspeed/0078-Fix-NCSI-driver-issue-caused-by-host-shutdown.patch')
-rw-r--r--meta-openbmc-mods/meta-common/recipes-kernel/linux/linux-aspeed/0078-Fix-NCSI-driver-issue-caused-by-host-shutdown.patch70
1 files changed, 70 insertions, 0 deletions
diff --git a/meta-openbmc-mods/meta-common/recipes-kernel/linux/linux-aspeed/0078-Fix-NCSI-driver-issue-caused-by-host-shutdown.patch b/meta-openbmc-mods/meta-common/recipes-kernel/linux/linux-aspeed/0078-Fix-NCSI-driver-issue-caused-by-host-shutdown.patch
new file mode 100644
index 000000000..c02131b6a
--- /dev/null
+++ b/meta-openbmc-mods/meta-common/recipes-kernel/linux/linux-aspeed/0078-Fix-NCSI-driver-issue-caused-by-host-shutdown.patch
@@ -0,0 +1,70 @@
+From 3e698a7666ec54582d0e2b4842f3e7f27fabe303 Mon Sep 17 00:00:00 2001
+From: Kuiying Wang <kuiying.wang@intel.com>
+Date: Tue, 29 Oct 2019 11:28:29 +0800
+Subject: [PATCH] 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>
+---
+ net/ncsi/ncsi-manage.c | 18 +++++++++++++-----
+ 1 file changed, 13 insertions(+), 5 deletions(-)
+
+diff --git a/net/ncsi/ncsi-manage.c b/net/ncsi/ncsi-manage.c
+index 755aab66dcab..2c5294582ef6 100644
+--- a/net/ncsi/ncsi-manage.c
++++ b/net/ncsi/ncsi-manage.c
+@@ -133,18 +133,15 @@ static void ncsi_channel_monitor(struct timer_list *t)
+ netdev_err(ndp->ndev.dev, "NCSI Channel %d timed out!\n",
+ nc->id);
+ ncsi_report_link(ndp, true);
+- ndp->flags |= NCSI_DEV_RESHUFFLE;
+
+ ncsi_stop_channel_monitor(nc);
+
+- ncm = &nc->modes[NCSI_MODE_LINK];
+ spin_lock_irqsave(&nc->lock, flags);
+- 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);
+@@ -425,6 +422,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;
+@@ -439,6 +437,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) {
+--
+2.7.4
+