[PATCH dev-4.4] net/ncsi: Enable request timer before sending command

Gavin Shan gwshan at linux.vnet.ibm.com
Thu Aug 4 10:47:49 AEST 2016


The response is received upon the sent command before the request's
timer is enabled under extreme situation. The response packet won't
be processed as the corresponding request (request packet and timer)
isn't complete. It leads to NCSI failure - no package detected.

This fixes the issue by enabling the timer before sending the command.
The comments about the timer has been replaced by that in upstream
kernel.

Signed-off-by: Gavin Shan <gwshan at linux.vnet.ibm.com>
---
The issue exists in all branches. 4.7 has the issue at least. I
suggest applying it to all other branches or 4.7 only.
---
 net/ncsi/ncsi-cmd.c | 15 +++++++--------
 1 file changed, 7 insertions(+), 8 deletions(-)

diff --git a/net/ncsi/ncsi-cmd.c b/net/ncsi/ncsi-cmd.c
index b8503e1..d634a0e 100644
--- a/net/ncsi/ncsi-cmd.c
+++ b/net/ncsi/ncsi-cmd.c
@@ -359,20 +359,19 @@ int ncsi_xmit_cmd(struct ncsi_cmd_arg *nca)
 		eh->h_source[i] = 0xff;
 	}
 
+        /* Start the timer for the request that might not have
+         * corresponding response. Given NCSI is an internal
+         * connection a 1 second delay should be sufficient.
+         */
+	mod_timer(&nr->nr_timer, jiffies + 1 * HZ);
+	nr->nr_timer_enabled = true;
+
 	/* Send NCSI packet */
 	skb_get(nr->nr_cmd);
 	ret = dev_queue_xmit(nr->nr_cmd);
 	if (ret)
 		goto out;
 
-	/* Start the timer for the request that might not have
-	 * corresponding response. I'm not sure 1 second delay
-	 * here is enough. Anyway, NCSI is internal network, so
-	 * the responsiveness should be as fast as enough.
-	 */
-	nr->nr_timer_enabled = true;
-	mod_timer(&nr->nr_timer, jiffies + 1 * HZ);
-
 	return 0;
 out:
 	ncsi_free_req(nr, false, false);
-- 
2.1.0



More information about the openbmc mailing list