From 2e4db6c6be91ade074c1a150a6db2aeb4920e25c Mon Sep 17 00:00:00 2001 From: Gavin Shan Date: Thu, 4 Aug 2016 10:47:49 +1000 Subject: [PATCH] net/ncsi: Enable request timer before sending command 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 Signed-off-by: Joel Stanley --- 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 28f297ac5738d..9dbdcffc560f8 100644 --- a/net/ncsi/ncsi-cmd.c +++ b/net/ncsi/ncsi-cmd.c @@ -351,20 +351,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);