Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp3716722imu; Tue, 18 Dec 2018 03:04:04 -0800 (PST) X-Google-Smtp-Source: AFSGD/VFarvfW1CNwE0sPd+wRtNHnQI7PvFQ30VQm7GTz+jB22Tg44WjD81z2DCtYhDoCtSGCk0Z X-Received: by 2002:a62:c42:: with SMTP id u63mr15839792pfi.73.1545131044171; Tue, 18 Dec 2018 03:04:04 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1545131044; cv=none; d=google.com; s=arc-20160816; b=R4av6ymxUjv+GZAmyJZCgQ7F+hzmi/tkoeTutV6e9VJF0dAUE97olS7kHq3sLVLY4L rxWyXK4I7jfvaFmjNnxEXUPfrqjHKALRWhd2upcUnPADYN3DYjGkpE7BhF4VrkAP5Y9g nr5RdhDwVWV+DH0e7j+wVTDZ+1RGHoBBnCAyxJYtYByVmwrTf7RpK7v0mqgtcbcHwhzV xHhRJbrA/ZbtVYhjE0A8Xqym/S18QKaGjasnY81KDPgba9jk4icSdPipQ+DN9nS2uKs/ pnHYDTsi1QihNSsUHZnPMdHw9o2f5QsZdemmxdwuzM+4DNAfyiAdjDvKTdZKoDvwcWu/ 2/6w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from; bh=vSwI2z60oRodAFwmkV7s9HNy+fkNIKzwvaEtu2hCRfw=; b=UZGu50rNYiIqfTRar+FccC+/dzl58jaOeVA2lu8ZCM9E4pzhWNEkavtBx3OYxvZYo+ qfP7TW9cv2E7e7dDQuPJylPQ01buPHqNC3MyUcSE4Wok/Zp62cq+7zU7+kOTuS0PZjid RswHY2GUYw+Xw/p1Q9xyNNFu+ubaWyloJHN47kXWRHdFJtJc8VvFhn/zCnmTdmN16By9 YTriFH9BRXIA9wf/55cOcreSh5dwru7JKKIIgVxLEizC5bt4HzRf9ECII+wG0dUo0N5o w+OzKWCKeZ43PKQTeEb7nW6E/E5KCqEUD+k7AA9OnSH8n3hsHdPgIdgAPbYpErvNALAR 9esw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id v6si11585786pfv.181.2018.12.18.03.03.46; Tue, 18 Dec 2018 03:04:04 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726777AbeLRLCN (ORCPT + 99 others); Tue, 18 Dec 2018 06:02:13 -0500 Received: from szxga06-in.huawei.com ([45.249.212.32]:38228 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726593AbeLRLCI (ORCPT ); Tue, 18 Dec 2018 06:02:08 -0500 Received: from DGGEMS406-HUB.china.huawei.com (unknown [172.30.72.58]) by Forcepoint Email with ESMTP id EA10B3AFEB62; Tue, 18 Dec 2018 19:02:03 +0800 (CST) Received: from linux-ioko.site (10.71.200.31) by DGGEMS406-HUB.china.huawei.com (10.3.19.206) with Microsoft SMTP Server id 14.3.408.0; Tue, 18 Dec 2018 19:01:56 +0800 From: Peng Li To: CC: , , , , , Subject: [PATCH net-next 03/12] net: hns3: fix napi_disable not return problem Date: Tue, 18 Dec 2018 19:37:50 +0800 Message-ID: <1545133079-79605-4-git-send-email-lipeng321@huawei.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1545133079-79605-1-git-send-email-lipeng321@huawei.com> References: <1545133079-79605-1-git-send-email-lipeng321@huawei.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.71.200.31] X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Huazhong Tan 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: ff0699e04b97 ("net: hns3: stop napi polling when HNS3_NIC_STATE_DOWN is set") Signed-off-by: Huazhong Tan Signed-off-by: Peng Li --- drivers/net/ethernet/hisilicon/hns3/hns3_enet.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3_enet.c b/drivers/net/ethernet/hisilicon/hns3/hns3_enet.c index 2081e2e..e7cde08 100644 --- a/drivers/net/ethernet/hisilicon/hns3/hns3_enet.c +++ b/drivers/net/ethernet/hisilicon/hns3/hns3_enet.c @@ -2909,8 +2909,8 @@ static int hns3_nic_common_poll(struct napi_struct *napi, int budget) if (!clean_complete) return budget; - if (likely(!test_bit(HNS3_NIC_STATE_DOWN, &priv->state)) && - napi_complete(napi)) { + if (napi_complete(napi) && + likely(!test_bit(HNS3_NIC_STATE_DOWN, &priv->state))) { hns3_update_new_int_gl(tqp_vector); hns3_mask_vector_irq(tqp_vector, 1); } -- 1.9.1