From: Mathias Nyman <mathias.nyman@linux.intel.com>
To: joswang <joswang1221@gmail.com>
Cc: mathias.nyman@intel.com, gregkh@linuxfoundation.org,
linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org,
joswang <joswang@lenovo.com>
Subject: Re: [RFC 1/1] usb: host: xhci-plat: add enable XHCI-AVOID-BEI quirk by dts
Date: Tue, 11 Jun 2024 17:58:05 +0300 [thread overview]
Message-ID: <b5deb873-7151-46fa-164e-9e2c6a339636@linux.intel.com> (raw)
In-Reply-To: <CAMtoTm2G-w+yRjechji7scJO-JZo6N==VK6Wun3ATRc7do9rEg@mail.gmail.com>
On 11.6.2024 17.45, joswang wrote:
> On Tue, Jun 11, 2024 at 6:01 PM Mathias Nyman
> <mathias.nyman@linux.intel.com> wrote:
>>
>> On 6.6.2024 17.08, joswang wrote:
>>> On Wed, Jun 5, 2024 at 6:31 PM Mathias Nyman
>>> <mathias.nyman@linux.intel.com> wrote:
>> ...
>>>>
>>>> I was thinking of turning XHCI_AVOID_BEI behavior into the new default, so no
>>>> quirk flag would be needed:
>>>>
>>>> Currently without the quirk flag:
>>>>
>>>> - ISOC TRBs trigger interrupt if TRB is the last in the TD
>>>>
>>>> Currently with XHCI_AVOID_BEI quirk flag:
>>>>
>>>> - ISOC TRBs trigger interrupt if TRB is the last in the TD
>>>> - Interrupt is additionally triggered every 32 isoc TRB (initially).
>>>> - if more than 128 events are processed in one interrupt then the
>>>> 32 is halved, and we trigger an interrupts every 16th isoc TRB, and so
>>>> on, 16 -> 8...
>>>>
>>>> I would remove the quirk flag, and make all controllers interrupt
>>>> behave as if it was set. i.e. interrupt at least every 32 isoc TRB
>>>
>>> Thank you for your detailed analysis.
>>> Excuse me, I have a question, do you mean to set "Currently with
>>> XHCI_AVOID_BEI quirk flag" as the default behavior?
>>
>> Yes, unless it causes some issues or there are strong objections
>>
>>>>
>>>> Is there an actual real world case where interrupting every 32nd ISOC TRB is
>>>> too often?
>>>
>>> I mean that if the XHCI_AVOID_BEI quirk flag is set, an interrupt will
>>> be triggered every 8 TRBs, which makes the interrupts seem to be quite
>>> frequent.
>>> Thanks
>>> Jos
>>>
>>
>> It should start with interrupting every 32nd isoc TD, not 8th
>>
>> #define AVOID_BEI_INTERVAL_MAX 32
>>
>> ir->isoc_bei_interval = AVOID_BEI_INTERVAL_MAX;
>>
>> Thanks
>> Mathias
>
> As you mentioned,if more than 128 events are processed in one
> interrupt then the 32 is halved, and we trigger an interrupts every
> 16th isoc TRB, and so on, 16 -> 8...
> xhci_handle_events()
> ......
> if (event_loop++ > TRBS_PER_SEGMENT / 2) {
> if (ir->isoc_bei_interval > AVOID_BEI_INTERVAL_MIN)
> ir->isoc_bei_interval = ir->isoc_bei_interval / 2;
> }
> .......
Yes, and to me this seems reasonable .
If there are over 128 events per interrupt then we should interrupt more often.
Would this work as the default for the Synopsys hosts you are working with?
Thanks
Mathias
next prev parent reply other threads:[~2024-06-11 15:00 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-06-01 12:06 [RFC 1/1] usb: host: xhci-plat: add enable XHCI-AVOID-BEI quirk by dts joswang
2024-06-03 12:22 ` Mathias Nyman
2024-06-05 5:37 ` joswang
2024-06-05 10:33 ` Mathias Nyman
2024-06-06 14:08 ` joswang
2024-06-11 10:03 ` Mathias Nyman
2024-06-11 14:45 ` joswang
2024-06-11 14:58 ` Mathias Nyman [this message]
2024-06-12 14:23 ` joswang
2024-07-01 11:44 ` joswang
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=b5deb873-7151-46fa-164e-9e2c6a339636@linux.intel.com \
--to=mathias.nyman@linux.intel.com \
--cc=gregkh@linuxfoundation.org \
--cc=joswang1221@gmail.com \
--cc=joswang@lenovo.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-usb@vger.kernel.org \
--cc=mathias.nyman@intel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox