mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Navon John Lukose <navonjohnlukose@gmail.com>
To: Mika Westerberg <mika.westerberg@linux.intel.com>
Cc: Andy Shevchenko <andriy.shevchenko@linux.intel.com>,
	Andi Shyti <andi.shyti@kernel.org>,
	linux-i2c@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] i2c: designware: size the RX FIFO threshold to the queued transfer
Date: Tue, 22 Sep 2026 18:53:34 +0530	[thread overview]
Message-ID: <20260922132334.34682-1-navonjohnlukose@gmail.com> (raw)
In-Reply-To: <20260922122902.GE106095@black.igk.intel.com>

On Tue, Sep 22, 2026 at 02:29:02PM +0200, Mika Westerberg wrote:
> Yeah I don't think 0.7ms is much but we have things like touchscreens and
> the like with various report sizes so at least it would be good to check if
> those have any issues.
>
> Unfortunately I don't have any of such devices anymore but I asked our
> validation to check if they have something that could be used to test this.

I have a Goodix touchscreen on a second controller on the same machine, so
I ran it at three report sizes. GET_REPORT at 100 Hz, 2000 transfers per
cell, three interleaved passes, ~normal desktop use in the background:

    bytes   interrupts/report      mean latency
       7      4.17 ->  2.00     1776 -> 2093 us
      21     10.06 ->  2.00     2131 -> 2676 us
      64     63.97 ->  3.21     2303 -> 3512 us

64 bytes is past rx_fifo_depth on this part, so that is also the first
exercise of the half-FIFO cap.

So the latency is not a fixed 0.7 ms as I implied earlier, it grows with
the report size. Breaking down where it goes, with kprobes on i2c_dw_xfer
and i2c_dw_isr, for 64 bytes:

    segment                       stock   patched
    xfer start -> first ISR          78       146
    first ISR -> last ISR          2157      2748
    last ISR -> xfer return         101       147
    i2c-hid and ioctl overhead       12        49

84% of it is between the first and last interrupt. Stock's 65 interrupts
are 33 us apart, too close together for the CPU to idle deeply, so each
wakeup is cheap. Patched leaves 3 gaps of around 900 us, deep enough to
idle properly, and pays the exit latency on each one.

So the power saving and the added latency are the same effect seen from
either end. Lowering the cap trades one back for the other at roughly the
same rate, so if the latency needs bounding (I personally think it is
overkill) it wants a QoS request as Andy suggested.

I can send the raw data and the scripts if needed.

Assisted-by: LLM # for the kprobe measurements :)

  reply	other threads:[~2026-09-22 13:23 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-19 23:26 Navon John Lukose
2026-09-21 12:05 ` Mika Westerberg
2026-09-21 17:04   ` Navon John Lukose
2026-09-22  6:50     ` Mika Westerberg
2026-09-22 12:12       ` Navon John Lukose
2026-09-22 12:29         ` Mika Westerberg
2026-09-22 13:23           ` Navon John Lukose [this message]
2026-09-23 13:36             ` Mika Westerberg
2026-09-22  9:57 ` Andy Shevchenko
2026-09-22 12:12   ` Navon John Lukose
2026-09-22 12:48     ` Andy Shevchenko
2026-10-03 22:36 ` Navon John Lukose
2026-10-04  8:12   ` Andy Shevchenko

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=20260922132334.34682-1-navonjohnlukose@gmail.com \
    --to=navonjohnlukose@gmail.com \
    --cc=andi.shyti@kernel.org \
    --cc=andriy.shevchenko@linux.intel.com \
    --cc=linux-i2c@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mika.westerberg@linux.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

all inboxes | Powered by JetHome®