Commit 531eba0f authored by Huazhong Tan's avatar Huazhong Tan Committed by David S. Miller

net: hns3: fix napi_disable not return problem

While doing DOWN, the calling of napi_disable() may not return, since the
napi_complete() in the hns3_nic_common_poll() will never be called when
HNS3_NIC_STATE_DOWN is set. So we need to call napi_complete() before
checking HNS3_NIC_STETE_DOWN.

Fixes: ff0699e0 ("net: hns3: stop napi polling when HNS3_NIC_STATE_DOWN is set")
Signed-off-by: default avatarHuazhong Tan <tanhuazhong@huawei.com>
Signed-off-by: default avatarPeng Li <lipeng321@huawei.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent e3338205
...@@ -2909,8 +2909,8 @@ static int hns3_nic_common_poll(struct napi_struct *napi, int budget) ...@@ -2909,8 +2909,8 @@ static int hns3_nic_common_poll(struct napi_struct *napi, int budget)
if (!clean_complete) if (!clean_complete)
return budget; return budget;
if (likely(!test_bit(HNS3_NIC_STATE_DOWN, &priv->state)) && if (napi_complete(napi) &&
napi_complete(napi)) { likely(!test_bit(HNS3_NIC_STATE_DOWN, &priv->state))) {
hns3_update_new_int_gl(tqp_vector); hns3_update_new_int_gl(tqp_vector);
hns3_mask_vector_irq(tqp_vector, 1); hns3_mask_vector_irq(tqp_vector, 1);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment