From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-lf1-f48.google.com (mail-lf1-f48.google.com [209.85.167.48]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 169EA34EEF1 for ; Wed, 29 Apr 2026 18:02:21 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.167.48 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1777485744; cv=none; b=F2WvLWCk9z7HcMSEiYx0W6lLFrFY0TsW1n5zQG3N1IQ1e5F9BroxL2fCCZ6JpaDf9elR9kKDNzO/5ji8/ebk6qFcsb/7/ysP8VKZzGodC823ik2XhYO5e+ObnVwy3g5m7gumsawNGg2lPyJptpNq8EY7zoSBbUHziVDODuVHx4Y= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1777485744; c=relaxed/simple; bh=ZYDm6LQjx6z8qEP8enhW6C4tZcrjPsHDjbFGVaexpiQ=; h=Date:From:To:Cc:Subject:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=GOabtGXWBOgNJIIfkKNcUmNnakYSLco4ZTM2XUCA3Q4k18APP6aXaO0bAhpJGDirOpyisHhj5g+oPEoC6sy2FLsv8R/yE49AFFkZh/tWGGe3Zcg8NAq5r7czmjUfzh6t4/OOQ4zEwVPFI8aKe4WbzIeXamo1nmv7cJH/cSYyy6o= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=s0Bsz5fe; arc=none smtp.client-ip=209.85.167.48 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="s0Bsz5fe" Received: by mail-lf1-f48.google.com with SMTP id 2adb3069b0e04-5a525aedb24so10423e87.2 for ; Wed, 29 Apr 2026 11:02:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1777485740; x=1778090540; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:subject:cc:to:from:date:from:to:cc:subject:date :message-id:reply-to; bh=OxhOyUtiJJnwjvooR0tpgz13ADxv2UwdgT9k4qtUzLg=; b=s0Bsz5fe6dZgzzw5hk9TYVrgCyD33/5e07jskNoWgSTYXo4LQu32VKvYKCVSm4k5YZ Sog7syc/qZKJf2qSrcPuyrzWf6gxgC5nqBBBERKmJFaGRsmYUJ7rH4Bkx/rvyr3H+5wh MEaWegpsNwGW/z48eDQXmmuixAQnyq0crK/eKNUl9tHNZE+tNYuVHlH4JrQ2Mo33EFKG nEqmmQzUul4R4iKl2B6eMV4bT0qkn18uk4rc3eIOIhCv5bsOa9rOtRVtZuYuXsJr5ZcH Sglj+roz0JFuHkgSHC+dDW7B+37AM6mzlRLuwZPd7dRWHhVTEXSgvbzc6HDiGOyeqeuj 6Q3g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1777485740; x=1778090540; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:subject:cc:to:from:date:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=OxhOyUtiJJnwjvooR0tpgz13ADxv2UwdgT9k4qtUzLg=; b=Vosg5hB/iY6WrBUgoTEEJ1x4VBuut6sjrGIn1+rfrcehchPumDq8+IgM7Dc/0gTNrZ qhmozU0Mwa63mgi1vj5wG4/MzZeR/ZF7P8577z0CI1aHghQbVeY3yUrNSuCKm1/LATjZ A/9P9QhD6tOLg5Axe6WRnPJAtiefotHKbtrJngByzyjd/D4eIgQculKkMB0Vhw4S11IO 4hGho0FRbDon8yxdlX98vAezgzyh5z2YWcD3CVda9FkBdvSlbNC+wfJ3PkF7MpxUG8DE jTjfQEq12gMwy559o+oHzIC4bIBPz7vywT8QvzhYrO5srAaMwRSFJX86BzITHUkwfDzG 7YZQ== X-Forwarded-Encrypted: i=1; AFNElJ9v8/tuERMNZtEa4i3kV3A9wWPi/OUyduMmDZgblEtLekC2DGNK2EbHO9jFOIiFq8Rxjw/6BqxS3Iecves=@vger.kernel.org X-Gm-Message-State: AOJu0YxFjcD9bPGQNmnMG5XWkEPcJYx94XmQ3SqjlJ0c+SDKuGXfCJA9 2tOu0BCbRRHGCxtHSbZ6ifxUfMLJpA45L99s+CL9EN32yTtZ4LcP546H X-Gm-Gg: AeBDievxpPevjwBWiY8M5ZeoHzGNfPUc++xGRnDE8jNt7WLqs9AGzKq+YLXZLisGOYO AEqhfjbKgmV6wkGcYlTg1InXT0NOE2aYN07URfdTupLbipgqdTonrLESo8tSBbangcs0IlJaKpO wWrPWlMooDoNQArtsZmqhAfobXmSxFkBnu5lZs18pQMFYgtjjHJVMfQiyIAb8aRiSHQMdxF69e3 72PHbFgt5+WKOeVvnoA16jg5HP+0JN5f5Ol8scFHmbPeXh3tbbBZhZ4N85UGiibbRuLpoJ0vLI3 xWMaC0eqJyxp3RjAlGhIM46mQf46BRlI2SvL+x00zMUCtfOFaT+9SMLtfkxBkx8LCi2YIBXVDh7 njrQvwPWvjEgHxvLId7AEXHjMlTFsDJA3bpyu528+d5Sx4RcnuoTWsw5sLXc/mamRQ0Sl7kaVhG +7q5iB35dtegJlp0Z3VychlBF6EB23cdlOaoI6sCqbdVKOHQfKqi7HPw== X-Received: by 2002:a05:6512:1394:b0:5a3:ecf7:71c0 with SMTP id 2adb3069b0e04-5a746409f38mr2777358e87.5.1777485739988; Wed, 29 Apr 2026 11:02:19 -0700 (PDT) Received: from foxbook (bfh75.neoplus.adsl.tpnet.pl. [83.28.45.75]) by smtp.gmail.com with ESMTPSA id 2adb3069b0e04-5a74a756c8fsm729425e87.38.2026.04.29.11.02.17 (version=TLS1_2 cipher=AES128-SHA bits=128/128); Wed, 29 Apr 2026 11:02:19 -0700 (PDT) Date: Wed, 29 Apr 2026 20:02:14 +0200 From: Michal Pecio To: Birger Koblitz Cc: Andrew Lunn , Andrew Lunn , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , linux-usb@vger.kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Chih Kai Hsu Subject: Re: [PATCH net-next 3/4] r8152: Add irq mitigation for RTL8157/9 Message-ID: <20260429200214.3e8dee67.michal.pecio@gmail.com> In-Reply-To: <9feb0bc1-b817-46f8-9092-e2beff30ec9d@birger-koblitz.de> References: <20260428-rtl8159_net_next-v1-0-52d03927b46f@birger-koblitz.de> <20260428-rtl8159_net_next-v1-3-52d03927b46f@birger-koblitz.de> <06a42ba1-b714-45b1-be30-4a793752e495@lunn.ch> <9feb0bc1-b817-46f8-9092-e2beff30ec9d@birger-koblitz.de> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit On Wed, 29 Apr 2026 06:06:30 +0200, Birger Koblitz wrote: > On 29/04/2026 3:56 am, Andrew Lunn wrote: > > On Tue, Apr 28, 2026 at 05:47:23AM +0200, Birger Koblitz wrote: > >> Add interrupt mitigation code for both RTL8157 and RTL8159 that prevents > >> USB interrupt callbacks with urb->status ESHUTDOWN being triggered. While the > >> issue is rarely seen on the RTL8157, without the mitigation, it is > >> common on the RTL8159: > >> [273.561863] r8152 7-1:1.0 enx88c9b3b5xxxx: Stop submitting intr, status -108 > >> > >> Signed-off-by: Birger Koblitz > >> --- > >> drivers/net/usb/r8152.c | 6 ++++++ > >> 1 file changed, 6 insertions(+) > >> > >> diff --git a/drivers/net/usb/r8152.c b/drivers/net/usb/r8152.c > >> index 8255261d73148a7b4dabe0188faf07cb1f356437..08cc3c1dae0facb2400890ba4d093c97ed56d40b 100644 > >> --- a/drivers/net/usb/r8152.c > >> +++ b/drivers/net/usb/r8152.c > >> @@ -8444,6 +8444,12 @@ static void r8156_init(struct r8152 *tp) > >> else > >> r8153_u2p3en(tp, false); > >> > >> + if (tp->version >= RTL_VER_16) { > >> + /* Disable Interrupt Mitigation */ > >> + ocp_byte_clr_bits(tp, MCU_TYPE_USB, 0xcf04, > >> + BIT(0) | BIT(1) | BIT(2) | BIT(7)); > >> + } > > > > What does interrupt mitigation do? > > > > Is this a different name for interrupt coalescence, where the MAC > > delays interrupts for a period of time so more packets are in the > > receive ring when it does interrupt, so reducing the number of > > interrupts, and bigger bursts of packets are processed at once? > > > > I do not understand what the mechanism behind this is, there is no > more documentation in the original driver. I experimented with this > for some time and the effect that I see is that it prevents > interrupts after shutdown. What do you mean by "after shutdown", driver unbind? You shouldn't be seeing URB completions then if the disconnect() method unlinks them. And if it doesn't, completions may be using driver data after free. Or maybe you have pending URBs while calling set_configuration() or set_interface(), which is dodgy too but at least not asking for panic. Other cause of ESHUTDOWN might be serious host controller failure, but you would likely get other log noise with that, at least with xhci. What shows up if you repro with this enabled? echo 'module usbcore +p' >/proc/dynamic_debug/control Regards, Michal