From: Jiri Slaby Subject: Re: Hangs in r8152 connected to power management in kernels at least up v4.17-rc4 Date: Wed, 16 May 2018 15:36:21 +0200 Message-ID: References: <1526388188.2724.5.camel@suse.com> <0835B3720019904CB8F7AA43166CEEB2D2E47ABE@RTITMBSV06.realtek.com.tw> <1526459203.25281.2.camel@suse.com> <0835B3720019904CB8F7AA43166CEEB2D2E47EB4@RTITMBSV06.realtek.com.tw> <1526465391.25281.7.camel@suse.com> <0835B3720019904CB8F7AA43166CEEB2D2E47F8B@RTITMBSV06.realtek.com.tw> <60052c70-ae38-7be8-5f70-5598104a13bd@suse.cz> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Cc: "netdev@vger.kernel.org" To: Hayes Wang , Oliver Neukum Return-path: Received: from mail-wr0-f193.google.com ([209.85.128.193]:36411 "EHLO mail-wr0-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751510AbeEPNgX (ORCPT ); Wed, 16 May 2018 09:36:23 -0400 Received: by mail-wr0-f193.google.com with SMTP id p4-v6so1223611wrh.3 for ; Wed, 16 May 2018 06:36:23 -0700 (PDT) In-Reply-To: <60052c70-ae38-7be8-5f70-5598104a13bd@suse.cz> Content-Language: en-GB Sender: netdev-owner@vger.kernel.org List-ID: On 05/16/2018, 03:29 PM, Jiri Slaby wrote: > On 05/16/2018, 02:07 PM, Hayes Wang wrote: >> Oliver Neukum [mailto:oneukum@suse.com] >>> Sent: Wednesday, May 16, 2018 6:10 PM >> [...] >>>> Besides, I find a similar issue as following. >>>> https://www.spinics.net/lists/netdev/msg493512.html >>> >>> Well, if we have an imbalance in NAPI it should strike whereever >>> it is used, not just in suspend(). Is there debugging for NAPI >>> we could activate? >> >> No. The driver doesn't embed such debugging about it. > > Despite of that, Oliver, I have a kernel with a debug patch (attached) > at (suse-only link): > https://build.suse.de/project/show/home:jirislaby:stable-drm > >> And I don't find an imbalance between napi_disable() and napi_enable(). > > There is none, apparently (the warns never triggered). BUt still the > driver sucks wrt both power mgmt and dock plug/unplug. Since I am using > the patch (it upper-bounds the napi_disable loop count) and the udev > rule below, I can really use the nic. BTW the added warning to napi_disable indeed triggers: > xzgrep -a -B 2 kernel:.*WARNING.*napi messages-20180* > messages-20180503.xz:2018-04-27T09:57:00.048922+02:00 anemoi2 kernel: [158616.363052] ------------[ cut here ]------------ > messages-20180503.xz:2018-04-27T09:57:00.048979+02:00 anemoi2 kernel: [158616.363070] NAPI_STATE_SCHED never cleared > messages-20180503.xz:2018-04-27T09:57:00.048988+02:00 anemoi2 kernel: [158616.363120] WARNING: CPU: 1 PID: 14365 at ../net/core/dev.c:5665 napi_disable+0x3d/0x80 And since I do 'ip l set dev ethX down' before unplugging the dock with the NIC, I have not seen a single occurrence. So I assume it must be a problem of making usb->disconnect without prior ndo->close (or alike). thanks, -- js suse labs