From: Ken Milmore <ken.milmore@gmail.com>
To: Heiner Kallweit <hkallweit1@gmail.com>, netdev@vger.kernel.org
Cc: nic_swsd@realtek.com
Subject: Re: r8169: transmit queue timeouts and IRQ masking
Date: Mon, 13 May 2024 01:27:24 +0100 [thread overview]
Message-ID: <d4e9e118-b4c0-4917-b9f0-39ac52229d30@gmail.com> (raw)
In-Reply-To: <35fa38fc-9d1e-4a22-86dd-a4c9147d7f70@gmail.com>
On 12/05/2024 23:08, Heiner Kallweit wrote:
> On 12.05.2024 21:49, Ken Milmore wrote:
>>
>> I had started out with the assumption that an interrupt acknowledgement coinciding with some part of the work being done in rtl8169_poll() might be the cause of the problem.
>> So it seemed natural to try guarding the whole block by disabling interrupts at the beginning.
>> But this seems to work just as well:
>>
>> diff --git linux-source-6.1~/drivers/net/ethernet/realtek/r8169_main.c linux-source-6.1/drivers/net/ethernet/realtek/r8169_main.c
>> index 6e34177..353ce99 100644
>> --- linux-source-6.1~/drivers/net/ethernet/realtek/r8169_main.c
>> +++ linux-source-6.1/drivers/net/ethernet/realtek/r8169_main.c
>> @@ -4659,8 +4659,10 @@ static int rtl8169_poll(struct napi_struct *napi, int budget)
>>
>> work_done = rtl_rx(dev, tp, budget);
>>
>> - if (work_done < budget && napi_complete_done(napi, work_done))
>> + if (work_done < budget && napi_complete_done(napi, work_done)) {
>> + rtl_irq_disable(tp);
>> rtl_irq_enable(tp);
>> + }
>>
>> return work_done;
>> }
>>
>> On this basis, I assume the problem may actually involve some subtlety with the behaviour of the interrupt mask and status registers.
>>
> In the register dump in your original report the interrupt mask is set.
> So it seems rtl_irq_enable() was executed. I don't have an explanation
> why a previous rtl_irq_disable() makes a difference.
> Interesting would be whether it has to be a write to the interrupt mask
> register, or whether a write to any register is sufficient.
>
In place of calling rtl_irq_disable(), I tried poking at the doorbell and at some of the unused timer registers. These had no effect.
I tried writing various different values to the mask register:
RTL_W32(tp, IntrMask_8125, 0x00); // worked, naturally
RTL_W32(tp, IntrMask_8125, 0x3f); // no effect
RTL_W32(tp, IntrMask_8125, 0x3b); // no effect
RTL_W32(tp, IntrMask_8125, 0x3a); // worked!
So masking both TxOK and RxOK before unmasking seemed to work, but masking either of them individually didn't.
Also, masking just TxOK then just RxOK in sequence, or vice versa didn't seem to work; they both had to be masked together.
YMMV! :-)
prev parent reply other threads:[~2024-05-13 0:27 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-05-06 21:28 r8169: transmit queue timeouts and IRQ masking Ken Milmore
2024-05-08 21:14 ` Heiner Kallweit
2024-05-09 22:24 ` Ken Milmore
2024-05-10 22:06 ` Heiner Kallweit
2024-05-10 22:29 ` Ken Milmore
2024-05-11 16:31 ` Heiner Kallweit
2024-05-12 19:49 ` Ken Milmore
2024-05-12 22:08 ` Heiner Kallweit
2024-05-13 0:27 ` Ken Milmore [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=d4e9e118-b4c0-4917-b9f0-39ac52229d30@gmail.com \
--to=ken.milmore@gmail.com \
--cc=hkallweit1@gmail.com \
--cc=netdev@vger.kernel.org \
--cc=nic_swsd@realtek.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.