From: Jeff Hugo <jeff.hugo@oss.qualcomm.com>
To: Sumit Kumar <sumit.kumar@oss.qualcomm.com>,
Manivannan Sadhasivam <mani@kernel.org>
Cc: mhi@lists.linux.dev, linux-arm-msm@vger.kernel.org,
linux-kernel@vger.kernel.org,
Krishna Chaitanya Chundru <krishna.chundru@oss.qualcomm.com>
Subject: Re: [PATCH v6 1/3] bus: mhi: host: clients: Add loopback driver with sysfs interface
Date: Fri, 2 Oct 2026 09:57:21 -0600 [thread overview]
Message-ID: <2cc22f12-25c2-4e01-9375-653b39d8b62d@oss.qualcomm.com> (raw)
In-Reply-To: <d05a60d1-3787-4318-b28d-9901d7fd7a00@oss.qualcomm.com>
On 9/29/2026 11:56 PM, Sumit Kumar wrote:
>
>
> On 9/26/2026 4:36 PM, Manivannan Sadhasivam wrote:
>> On Tue, Sep 08, 2026 at 02:57:22PM +0530, Sumit Kumar wrote:
>>> The MHI specification defines a LOOPBACK channel. The endpoint firmware
>>> echoes back whatever the host sends on this channel. Without a host-side
>>> driver, there is no way to exercise this channel to validate MHI data
>>> path
>>> integrity between host and endpoint.
>>>
>>> Add a host-side loopback driver that binds to the LOOPBACK channel and
>>> expose a sysfs interface for data path testing. The sysfs interface
>>> allows
>>> users to configure TRE buffer size and count, trigger a loopback
>>> test, and
>>> read the result.
>>>
>>> The new sysfs ABI is documented under Documentation/ABI/testing/, not
>>> stable/, since this is a new interface without established API
>>> guarantees yet. It is unrelated to the existing stable MHI sysfs ABI
>>> documented in Documentation/ABI/stable/sysfs-bus-mhi, despite both
>>> being covered by the same MAINTAINERS entry.
>>>
>>> Co-developed-by: Krishna Chaitanya Chundru
>>> <krishna.chundru@oss.qualcomm.com>
>>> Signed-off-by: Krishna Chaitanya Chundru
>>> <krishna.chundru@oss.qualcomm.com>
>>> Signed-off-by: Sumit Kumar <sumit.kumar@oss.qualcomm.com>
>>> ---
>>> .../ABI/testing/sysfs-bus-mhi-devices-loopback | 40 +++
>>> MAINTAINERS | 1 +
>>> drivers/bus/mhi/host/Kconfig | 1 +
>>> drivers/bus/mhi/host/Makefile | 1 +
>>> drivers/bus/mhi/host/clients/Kconfig | 17 ++
>>> drivers/bus/mhi/host/clients/Makefile | 2 +
>>> drivers/bus/mhi/host/clients/loopback.c | 287 ++++++++++
>>> +++++++++++
>>> 7 files changed, 349 insertions(+)
>>>
>>> diff --git a/Documentation/ABI/testing/sysfs-bus-mhi-devices-loopback
>>> b/Documentation/ABI/testing/sysfs-bus-mhi-devices-loopback
>>> new file mode 100644
>>> index
>>> 0000000000000000000000000000000000000000..9e47e8443f309199691a50d70adadf84f3237037
>>> --- /dev/null
>>> +++ b/Documentation/ABI/testing/sysfs-bus-mhi-devices-loopback
>>> @@ -0,0 +1,40 @@
>>> +What: /sys/bus/mhi/devices/mhi<N>_LOOPBACK/tre_size
>>> +Date: August 2026
>>> +KernelVersion: 7.4
>>> +Contact: mhi@lists.linux.dev
>>> +Description:
>>> + (RW) Size of each Transfer Ring Element (TRE) buffer in bytes
>>> + used for the loopback test. Valid range is 1 to the value
>>> + reported by max_tre_size. Default value is 32 bytes.
>>> +
>>> +What: /sys/bus/mhi/devices/mhi<N>_LOOPBACK/max_tre_size
>>> +Date: August 2026
>>> +KernelVersion: 7.4
>>> +Contact: mhi@lists.linux.dev
>>> +Description:
>>> + (RO) Maximum allowed Transfer Ring Element (TRE) size in bytes.
>>> + Reading this file returns the upper bound for the tre_size
>>> + attribute.
>>> +
>>> +What: /sys/bus/mhi/devices/mhi<N>_LOOPBACK/num_tre
>>> +Date: August 2026
>>> +KernelVersion: 7.4
>>> +Contact: mhi@lists.linux.dev
>>> +Description:
>>> + (RW) Number of Transfer Ring Elements (TREs) to use per
>>> + loopback test. Must be greater than zero and must not exceed
>>> + the channel ring capacity. Default value is 1.
>> How does the user know 'channel ring capacity'?
> If the user enters a number greater than the ring capacity the error
> will log the max num_tre value.
> Would you prefer having a new sysfs entry similar to 'max_tre_size'?
> something like 'max_num_tre'.
Yes, a new sysfs entry sounds like a reasonable idea. Having the user
guess, and then try to read an error log which they may or may not have
sounds like a way to cause frustration in users, particularly for any
kind of scripted use.
next prev parent reply other threads:[~2026-10-02 15:57 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-08 9:27 [PATCH v6 0/3] bus: mhi: Add loopback driver Sumit Kumar
2026-09-08 9:27 ` [PATCH v6 1/3] bus: mhi: host: clients: Add loopback driver with sysfs interface Sumit Kumar
2026-09-26 11:06 ` Manivannan Sadhasivam
2026-09-30 5:56 ` Sumit Kumar
2026-10-02 15:57 ` Jeff Hugo [this message]
2026-09-08 9:27 ` [PATCH v6 2/3] bus: mhi: ep: Add mhi_ep_queue_buf() API for raw buffer queuing Sumit Kumar
2026-09-26 11:09 ` Manivannan Sadhasivam
2026-09-08 9:27 ` [PATCH v6 3/3] bus: mhi: ep: clients: Add loopback driver for data path testing Sumit Kumar
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=2cc22f12-25c2-4e01-9375-653b39d8b62d@oss.qualcomm.com \
--to=jeff.hugo@oss.qualcomm.com \
--cc=krishna.chundru@oss.qualcomm.com \
--cc=linux-arm-msm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mani@kernel.org \
--cc=mhi@lists.linux.dev \
--cc=sumit.kumar@oss.qualcomm.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®