Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp1271808ybl; Fri, 23 Aug 2019 16:38:58 -0700 (PDT) X-Google-Smtp-Source: APXvYqzgq7KBq7HIZ/PtriaHTJINeQik79I4vLOkxAnM6YTQvb5ZiZydoxIZDBnKaj1Qt/H93zm4 X-Received: by 2002:a17:902:1123:: with SMTP id d32mr7579578pla.218.1566603538152; Fri, 23 Aug 2019 16:38:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1566603538; cv=none; d=google.com; s=arc-20160816; b=tu5eI1ytSI5Lbo1+IXj+JalQhRZ+84qSCN1kVGt0wybYaNgaVjhBOCB4LXF0CXhJ5j AKTjhtZYQ95fXbCms6YVHMcIbeXo1PyrGvZ+ZKxRDGUFi5OA92KJlwsu/0icVmIcnKgU ko/Hozq4ADjCyjv2Xirp7A5WxvxeJVv9mQW1EkqiHUu3XVmdCHE73zIuDGd8GQlUXVuq HSlFY45Xg7SrqDkHim/yIP+pKQoZjTpRMBzNX5viOVX9brmKAsy85A7XvcjiBVQK9rL+ +ttNKzvwm76LlwBD3OsTxsOE99T+eCjKivO5v4zcB8vMUHASc/KPDQyo3aXxVaMyIMJj o2WQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:from:subject:cc:to:message-id:date; bh=W45EKeOuG9UBjIhacoYZRA1hLXUxzR1YLupCcvNhpZA=; b=oTa0E9iEIben7rDapET7fnNs3fH2rza3bGIw6TkBc4oNOkqkW/ATZGAKeQdy3UNfPk 3Co4lzpG7P7QUXOVdhCLBtq83kIBnyKhE1GCDLZRrD8SSt7jLvJE5zoTFlkKRDvv4qjM SVY4mrK4XMbDtJK/dStm+PVJ0J8pzcYbsCmy8T2bf31cEhn9egFW3BX7jjy7Uv/teO6+ iPRl8ihONfC5T2ZuQabuQHG+D5nNf6sSrFjAjK9m6uJfEyA/uh5drNkW6VzeQn3VpZ3R eTNpj1izLujtzHy5sp+WgKpiygSUo+yGTZVSI0wg9+4CZrdlnetrdW8OSe5IE6iGsOqV 2O3w== 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 z26si3042540pgl.562.2019.08.23.16.38.42; Fri, 23 Aug 2019 16:38:58 -0700 (PDT) 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 S2436954AbfHWVdw (ORCPT + 99 others); Fri, 23 Aug 2019 17:33:52 -0400 Received: from shards.monkeyblade.net ([23.128.96.9]:38164 "EHLO shards.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732682AbfHWVdv (ORCPT ); Fri, 23 Aug 2019 17:33:51 -0400 Received: from localhost (unknown [IPv6:2601:601:9f80:35cd::d71]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) (Authenticated sender: davem-davemloft) by shards.monkeyblade.net (Postfix) with ESMTPSA id 2D74B1543B2AA; Fri, 23 Aug 2019 14:33:51 -0700 (PDT) Date: Fri, 23 Aug 2019 14:33:50 -0700 (PDT) Message-Id: <20190823.143350.122492125918705806.davem@davemloft.net> To: hayeswang@realtek.com Cc: netdev@vger.kernel.org, nic_swsd@realtek.com, linux-kernel@vger.kernel.org, jslaby@suse.cz Subject: Re: [PATCH net 2/2] r8152: avoid using napi_disable after netif_napi_del. From: David Miller In-Reply-To: <1394712342-15778-316-Taiwan-albertk@realtek.com> References: <1394712342-15778-314-Taiwan-albertk@realtek.com> <1394712342-15778-316-Taiwan-albertk@realtek.com> X-Mailer: Mew version 6.8 on Emacs 26.1 Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.5.12 (shards.monkeyblade.net [149.20.54.216]); Fri, 23 Aug 2019 14:33:51 -0700 (PDT) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Hayes Wang Date: Fri, 23 Aug 2019 16:53:02 +0800 > Exchange netif_napi_del() and unregister_netdev() in rtl8152_disconnect() > to avoid using napi_disable() after netif_napi_del(). > > Signed-off-by: Hayes Wang > --- > drivers/net/usb/r8152.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/net/usb/r8152.c b/drivers/net/usb/r8152.c > index 690a24d1ef82..29390eda5251 100644 > --- a/drivers/net/usb/r8152.c > +++ b/drivers/net/usb/r8152.c > @@ -5364,8 +5364,8 @@ static void rtl8152_disconnect(struct usb_interface *intf) > if (tp) { > rtl_set_unplug(tp); > > - netif_napi_del(&tp->napi); > unregister_netdev(tp->netdev); > + netif_napi_del(&tp->napi); > cancel_delayed_work_sync(&tp->hw_phy_work); > tp->rtl_ops.unload(tp); > free_netdev(tp->netdev); This is completely redundant because free_netdev() will perform all of the necessary netif_napi_del() calls.