From: Jeff Hugo <jeff.hugo@oss.qualcomm.com>
To: Slark Xiao <slark_xiao@163.com>, mani@kernel.org, bbhatt@codeaurora.org
Cc: mhi@lists.linux.dev, linux-arm-msm@vger.kernel.org,
linux-kernel@vger.kernel.org, stable@vger.kernel.org
Subject: Re: [PATCH] bus: mhi: host: Only expose controller sysfs attributes on the controller device
Date: Fri, 13 Nov 2026 11:42:46 -0700 [thread overview]
Message-ID: <826c1746-137b-4a5a-968e-8e0449a25e78@oss.qualcomm.com> (raw)
In-Reply-To: <20261111115659.11943-1-slark_xiao@163.com>
On 11/11/2026 4:56 AM, Slark Xiao wrote:
> The serial_number, oem_pk_hash and soc_reset attributes are registered
> through mhi_bus_type.dev_groups, so the driver core creates them for
> every device on the MHI bus. MHI client devices (the per-channel
> devices such as mhi0_DUN or mhi0_MBIM) are also MHI bus devices, so
> each of them ends up with its own copies of these files even though
> they all operate on the same mhi_controller:
>
> $ ls /sys/bus/mhi/devices/mhi0_DUN/
> driver oem_pk_hash power serial_number soc_reset subsystem uevent
>
> This is wrong for several reasons:
>
> - The attributes describe the controller, not the channel. Their
> callbacks all dereference mhi_dev->mhi_cntrl and read BHI registers
> or issue a controller-wide SoC reset, so writing soc_reset through
> mhi0_DUN resets the whole device while looking like a per-channel
> operation.
> - oem_pk_hash reports failures with dev_err(dev, ...), so a single
> failing controller produces one log line per registered channel
> device instead of one.
> - Userspace has no way to tell which copy is authoritative.
>
> Move the attributes off the bus and attach them to the controller
> device only. mhi_register_controller() now installs the group via
> mhi_dev->dev.groups before device_add(), while the channel devices
> created by mhi_create_devices() are left untouched. No functional
> change for the controller device; the files stay at the paths listed
> in Documentation/ABI/stable/sysfs-bus-mhi.
>
> Note that trigger_edl was already handled this way, through an explicit
> sysfs_create_file() on the controller kobject, which is why it never
> appeared on the channel devices.
I agree with the rationale, but this does appear to change uAPI. Are you
sure no one is using these on the channel devices?
-Jeff
prev parent reply other threads:[~2026-11-13 18:42 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-11 11:56 Slark Xiao
2026-11-13 18:42 ` Jeff Hugo [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=826c1746-137b-4a5a-968e-8e0449a25e78@oss.qualcomm.com \
--to=jeff.hugo@oss.qualcomm.com \
--cc=bbhatt@codeaurora.org \
--cc=linux-arm-msm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mani@kernel.org \
--cc=mhi@lists.linux.dev \
--cc=slark_xiao@163.com \
--cc=stable@vger.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
all inboxes | Powered by JetHome®