From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from bkemail.birger-koblitz.de (bkemail.birger-koblitz.de [23.88.97.239]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 6CF2624A067; Wed, 29 Apr 2026 04:06:34 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=23.88.97.239 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1777435595; cv=none; b=rWVusDgPVpTyXeeSRGv9CrMq6J3lvx0t+FUhD/uZoHjMRBZDrkFhCeQJTm+m34x2iPp6cOuNLLhLd++gNq0bJTT2CbEDPOojtSX+eI/tRiC6MBhC5b6dHqfWBAVm8yFv/NQmsd+zCMKNKWGZfPC/E5FDCEB3iopqLhMralrzOTo= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1777435595; c=relaxed/simple; bh=j61Vay+FtdT936qn7W/yr4bXC4HItVT4+lmWwjGl/Oc=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=OvQN6ywc6FL2hvKAxcMsxr4mHjnY8CF/CUtrJB2Qwhzn/lhWN/FDf7LSV13Fkm+hBbv2uDKty/PLMve93P/vtfuosHPQhvVlWqSfpl3aUGhOnID9BbM/lMY9BKeCP3YGi9kJ4U5WqQ3gnimPxWRzUFe8KP0SuaaEbjrPDrmWg3g= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=birger-koblitz.de; spf=pass smtp.mailfrom=birger-koblitz.de; dkim=pass (2048-bit key) header.d=birger-koblitz.de header.i=@birger-koblitz.de header.b=yVyr+EhR; dkim=pass (2048-bit key) header.d=birger-koblitz.de header.i=@birger-koblitz.de header.b=ksdqMqjy; arc=none smtp.client-ip=23.88.97.239 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=birger-koblitz.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=birger-koblitz.de Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=birger-koblitz.de header.i=@birger-koblitz.de header.b="yVyr+EhR"; dkim=pass (2048-bit key) header.d=birger-koblitz.de header.i=@birger-koblitz.de header.b="ksdqMqjy" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=birger-koblitz.de; s=default; t=1777435592; bh=j61Vay+FtdT936qn7W/yr4bXC4HItVT4+lmWwjGl/Oc=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=yVyr+EhRXqlQfoIPoCNsOynXKrWvHDtsbLXmeRZXdiMuTKhZeTRBy4HCPIBWh0jbG tbSBUQmb5StDa1MB5kgMqkkt7ix1yUZ9Sx4mYYPQDkKA1aao+tloYH1elRcBm+tcb/ z2k6Yo3gNzxm/nLqlakkm9nlmpojv3uPphqIZ00A6H0HoEWe5QO4+ZMqzRZ0fRVAE1 s92rnDJ5FaxZOMJ9QTmOrumS6ZBIPqr/4530NQ+Gmis+Mu35FBwjkzkQ+uZ5JHez+7 UMG6h/RHnFWEGlaYKmL6Ec8GQWhuULVVYhv1zXMoBAypTvymztMZOeynzE85IUYJUv WX2kYNl5Itlww== Received: by bkemail.birger-koblitz.de (Postfix, from userid 109) id 8587B47DF8; Wed, 29 Apr 2026 04:06:32 +0000 (UTC) X-Spam-Level: DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=birger-koblitz.de; s=default; t=1777435591; bh=j61Vay+FtdT936qn7W/yr4bXC4HItVT4+lmWwjGl/Oc=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=ksdqMqjyQ1w62Zloz2LmQaXAq+ZYhrOlnuUTLVk+c0GV0PTdpC5ZxRP7liLHD1wTy n+NbtnO9Ak3W76yiUZxwnN3TC4TD6uxA0QbzKhygQg8nQ3r/iGGteSMLf/x2XS+vw+ FGERae8KROf57oFg7SOmUMNlEps5bfBY4SVBRiYZZ5/zynSzhmGyDMYXuvPWEyUH+Y P6RGt9kkhfJglx7x0kaUJO/znKjv2zGfIiUATGqpW+agMueRg26Jvc0cxF3WitqlS1 FQbbAm1/7yjeX+Nfjn3t8tEJRS9zVtb8armc1ydXrdj6uXU5e/PTdWqbzGQ3906p6d JJpEGCRBSboEQ== Received: from [IPV6:2a00:6020:47a3:e800:271c:c6c5:9fde:77cb] (unknown [IPv6:2a00:6020:47a3:e800:271c:c6c5:9fde:77cb]) by bkemail.birger-koblitz.de (Postfix) with ESMTPSA id A769E46FB3; Wed, 29 Apr 2026 04:06:31 +0000 (UTC) Message-ID: <9feb0bc1-b817-46f8-9092-e2beff30ec9d@birger-koblitz.de> Date: Wed, 29 Apr 2026 06:06:30 +0200 Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH net-next 3/4] r8152: Add irq mitigation for RTL8157/9 To: Andrew Lunn Cc: 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 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> From: Birger Koblitz Content-Language: en-US In-Reply-To: <06a42ba1-b714-45b1-be30-4a793752e495@lunn.ch> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit 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. That is, why it is already done in rtl8153_unload(), again like in the original driver, where it was more critical to prevent the warnings. I was hoping that Realtek could enlighten us. Birger