From: <Dharma.B@microchip.com>
To: <dlechner@baylibre.com>, <kamel.bouhara@bootlin.com>,
<wbg@kernel.org>, <Nicolas.Ferre@microchip.com>,
<alexandre.belloni@bootlin.com>, <claudiu.beznea@tuxon.dev>
Cc: <linux-arm-kernel@lists.infradead.org>,
<linux-iio@vger.kernel.org>, <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH 2/2] counter: microchip-tcb-capture: Add DMA support for TC_RAB register reads
Date: Wed, 4 Jun 2025 06:15:31 +0000 [thread overview]
Message-ID: <27407669-a580-482c-8c60-226b56562ce6@microchip.com> (raw)
In-Reply-To: <b45ea46b-3e17-4cb9-8e69-9eea0a3f8241@baylibre.com>
On 29/05/25 9:03 pm, David Lechner wrote:
> EXTERNAL EMAIL: Do not click links or open attachments unless you know the content is safe
>
> On 5/28/25 1:13 AM, Dharma Balasubiramani wrote:
>> Add optional DMA-based data transfer support to read the TC_RAB register,
>> which provides the next unread captured value from either RA or RB. This
>> improves performance and offloads CPU when mchp,use-dma-cap is enabled in
>> the device tree.
>
> It looks like this is using DMA to read a single register in the implementation
> of a sysfs read. Do you have measurements to show the performance difference?
> I find it hard to believe that this would actually make a significant difference
> compared to the overhead of the read syscall to read the sysfs attribute.
>
Hi David,
Thanks for the feedback.
You're right — in our current testing setup, I didn't observe any
significant performance benefit from using DMA to read the TC_RAB
register via sysfs. I benchmarked both DMA-based and direct MMIO
register access using a userspace program generating high-frequency
capture events, and the overhead of the sysfs read path seems to
dominate in both cases.
Our initial motivation for using DMA was that the TCB IP in Microchip
SoCs includes optional DMA support specifically for capture value
transfers. I wanted to evaluate the potential benefit of offloading CPU
load when frequent capture events are occurring. However, in practice,
the complexity added (especially due to blocking behavior in atomic
contexts like watch) does not appear to be justified, at least via sysfs
or simple polling.
I also tried routing the DMA-based read through the
COUNTER_COMPONENT_EXTENSION watch path, but as you may expect, that
ended up hanging due to blocking behavior in non-sleepable contexts. So
that route seems unsuitable without a more complex asynchronous
buffering model.
Would you suggest exploring a different approach or a more appropriate
interface for DMA-based capture (e.g., via a dedicated ioctl or char
device with async support)? I’m happy to rework it if there's a suitable
context where DMA adds measurable value.
Thanks again for your review and time.
--
With Best Regards,
Dharma B.
next prev parent reply other threads:[~2025-06-04 6:15 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-05-28 6:13 [PATCH 0/2] TCB: Add DMA support to read the capture register AB Dharma Balasubiramani
2025-05-28 6:13 ` [PATCH 1/2] counter: microchip-tcb-capture: Retrieve and map parent base address Dharma Balasubiramani
2025-05-28 6:13 ` [PATCH 2/2] counter: microchip-tcb-capture: Add DMA support for TC_RAB register reads Dharma Balasubiramani
2025-05-29 9:21 ` kernel test robot
2025-05-29 15:33 ` David Lechner
2025-06-04 6:15 ` Dharma.B [this message]
2025-06-04 13:21 ` David Lechner
2025-05-29 15:26 ` [PATCH 0/2] TCB: Add DMA support to read the capture register AB David Lechner
2025-06-04 6:17 ` Dharma.B
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=27407669-a580-482c-8c60-226b56562ce6@microchip.com \
--to=dharma.b@microchip.com \
--cc=Nicolas.Ferre@microchip.com \
--cc=alexandre.belloni@bootlin.com \
--cc=claudiu.beznea@tuxon.dev \
--cc=dlechner@baylibre.com \
--cc=kamel.bouhara@bootlin.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-iio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=wbg@kernel.org \
/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