Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp4714828ybl; Mon, 26 Aug 2019 14:53:14 -0700 (PDT) X-Google-Smtp-Source: APXvYqyqSF9RiVFMWCTIrF2BmumKkQ/gSuaOP/4ShZ+ess6wRkGycyllwQKAABwbp3bSEz7FxVur X-Received: by 2002:a17:90a:8914:: with SMTP id u20mr17028687pjn.111.1566856394663; Mon, 26 Aug 2019 14:53:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1566856394; cv=none; d=google.com; s=arc-20160816; b=fxQ2DOAYHV4Vv4qF6N+fUHL/QiU/9ZE+HEqbzIWyHdPzogJT8UdFgvCVFPzvk5icgW Vdh2Lnbify9SqMseFEFBddt2KaeoojJbUzT32gUKRK30cl5O+5u4/fNlgxkBYXu1bAtR RM5YB/4gXfXJ5080TR7k+U6T20eMn/gI7+XHPqrNyxGHcj+KtDZwlF+7Or74ZYgZn2Rx e/V3ERG8A5IK1WYYXCzfI+sIGzEUzVG5sG0zTyyzube5Czj8XayqsY5zUZjr+/35cdyN oa8cF0Iebnh4SuIBW+Cqtvu4VpoZPMt4rMDNQqFP5bl99g72YuQL1qKB/GZRcD12iKmK xriA== 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=YG4r0UNL1HzUcuu4gik1TRsT2lArdKVs30jFJpoBgQM=; b=k9bVvSqoWaZgqU5mBGezuz5Nfi4MwdWVIsR4kS2A7nyZjSsNtzz/b4KtGDoWbkygRp wFWpCl7rj66oFIqsf2PpmOMAouM372xfPX309S6YOd1ZffqOnojhVRI2gb/Gh/nPq1pJ GVWElkN5u7jtY+vd6e0JnKPE8+85tvh7UsAAZ8ZmHkjALDCu1SNUUyEKjTADsBYeehEJ Xr/WPD8ihzYsOGfL6R60tENQX1aZNMVZrJO4bs9xxGuHqH8u23hmLxNylf9vF79pd4pG nHx05mR39kve91XYov2G9RXN1WzS8uKCMImRhtVwrye8C3NceyIfBHFjAcGqp1c3K6Bk DiEQ== 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 c14si11894569pfb.252.2019.08.26.14.52.59; Mon, 26 Aug 2019 14:53:14 -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 S1727002AbfHZUzx (ORCPT + 99 others); Mon, 26 Aug 2019 16:55:53 -0400 Received: from shards.monkeyblade.net ([23.128.96.9]:38092 "EHLO shards.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725806AbfHZUzx (ORCPT ); Mon, 26 Aug 2019 16:55:53 -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 9D3F014FC802C; Mon, 26 Aug 2019 13:55:52 -0700 (PDT) Date: Mon, 26 Aug 2019 13:55:49 -0700 (PDT) Message-Id: <20190826.135549.1075785443210666224.davem@davemloft.net> To: hayeswang@realtek.com Cc: jslaby@suse.cz, netdev@vger.kernel.org, nic_swsd@realtek.com, linux-kernel@vger.kernel.org Subject: Re: [PATCH net v2 1/2] Revert "r8152: napi hangup fix after disconnect" From: David Miller In-Reply-To: <0835B3720019904CB8F7AA43166CEEB2F18D6733@RTITMBSVM03.realtek.com.tw> References: <1394712342-15778-318-Taiwan-albertk@realtek.com> <1f707377-7b61-4ba1-62bf-f275d0360749@suse.cz> <0835B3720019904CB8F7AA43166CEEB2F18D6733@RTITMBSVM03.realtek.com.tw> 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]); Mon, 26 Aug 2019 13:55:52 -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: Mon, 26 Aug 2019 09:43:32 +0000 > Jiri Slaby [mailto:jslaby@suse.cz] >> Sent: Monday, August 26, 2019 4:55 PM > [...] >> Could you clarify *why* it conflicts? And how is the problem fixed by >> 0ee1f473496 avoided now? > > In rtl8152_disconnect(), the flow would be as following. > > static void rtl8152_disconnect(struct usb_interface *intf) > { > ... > - netif_napi_del(&tp->napi); > - unregister_netdev(tp->netdev); > - rtl8152_close > - napi_disable > > Therefore you add a checking of RTL8152_UNPLUG to avoid > calling napi_disable() after netif_napi_del(). However, > after commit ffa9fec30ca0 ("r8152: set RTL8152_UNPLUG > only for real disconnection"), RTL8152_UNPLUG is not > always set when calling rtl8152_disconnect(). That is, > napi_disable() would be called after netif_napi_del(), > if RTL8152_UNPLUG is not set. > > The best way is to avoid calling netif_napi_del() before > calling unregister_netdev(). And I has submitted such > patch following this one. These details belong in the commit message, always.