From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796146448; b=42J370D3WJ1AvOrZ7Uqs5v69qfE6NZ3gPxrf+EET4wSCy48tALr7T2YUBj3oGJaT2kTy uwat4qMUv0PSqgMddxEBCaFgIsAsrw+taa6L5InBU05G5uVc5rngDgglF5eCwqXByDEyA 6HnwFN81tBq15sku/pgSH6kTwut/qARimWaH3PqBJ26njwNM6KiFr8FO9KUbBA4JPYYub mNCdpk+6RSx7ibJeCfJq8o6HtGhdRS0J75skVvYQUqDLV42OUutkW+rESXqmhOPFWzjrH +uqwbpU9SE/ctTC9THH5XQrcmmojEZqKbX9mO/7EFZgE/eCHsyZTpBTDjpiPQ1rGxVw== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796146448; h=Received:DKIM-Signature:MIME-Version:Content-Type: Content-Transfer-Encoding:Subject:From:To:Cc:In-Reply-To:References: Date:Message-Id:X-Mailer:X-Developer-Signature:X-Developer-Key; bh=eZlFcTNq7+c5sZAjqYvHwj07394LVnhOmPOehluecgA=; b=yqMTugCy4ix6KRm+iQUuTdTHGYfcg9yK/3XCX/9znpxvyUEpHQ3YzT4D/tXBGoF3Pf9v 7onGjys5cliP+qrOZYRzIZTUnYuMrDfV34QfLg90dMSomQz5M0no9e/kGHQpU4uWVTIlv SzhG/QTOonhgXcBz4iYBp/WEINRhwGQNO1iVK06jZsdst3q9qLJ5hizM1xfwQstK+Fyky pQ7xn8Ou23Bze7p58MCE4GtZAWq3saZ9+5xebMd8MjZDKEghByv4kbnakVKd/jmiYRqHl ErdxQvhhq2sZ6uQmUR/2FX+Fbl1pi1a+cEyTigzl1F7H7jv2AThSLbmYo7Zs4KtZJaQ== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=hl7HVzo7; arc=none smtp.remote-ip=100.103.45.18 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 22ECB606A31A; Tue, 1 Dec 2026 17:34:07 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=hl7HVzo7 Received: by smtp.kernel.org (Postfix) with ESMTPSA id F10FA1F00897; Tue, 1 Dec 2026 17:34:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796146447; bh=eZlFcTNq7+c5sZAjqYvHwj07394LVnhOmPOehluecgA=; h=Subject:From:To:Cc:In-Reply-To:References:Date; b=hl7HVzo7VqNZ4RcUv7gDTqXQYwo4V2SAeIQzg0gO9fheGpBnQqleuvJ2Uy1OK+ZUa moaJoUHA2a2h8VFZRn3ay9984z63+sH0/G+62tX72z3JOtzlhV5E4hcqKQ0w8951m8 MQo1zD/4DPJJpGdk3ypENxtsU798Z9PFNVE7uaUe7RBinntv6QF+LHQ2j6kDiVspBs e+enu3FssfMMSOXoM4smQAAYFAXX353AAuzGzxmGJkbxmKG7wm7OIaDVFBAiLNfvAv FTWzE7GMySaXY+wQhRGKXtpgHIC/LQgppNEIjFSpkrvMWMzCu9Ife4OVEy6TDcaWBW kDMKLrT+cQmuA== X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Subject: Re: [PATCH] bus: mhi: host: Only expose controller sysfs attributes on the controller device From: Manivannan Sadhasivam To: Jeff Hugo Cc: Slark Xiao , mani@kernel.org, mhi@lists.linux.dev, linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, stable@vger.kernel.org In-Reply-To: References: <20261111115659.11943-1-slark_xiao@163.com> <826c1746-137b-4a5a-968e-8e0449a25e78@oss.qualcomm.com> <3cb75687.54e4.1a1ed794488.Coremail.slark_xiao@163.com> Date: Tue, 01 Dec 2026 23:04:01 +0530 Message-Id: <179614644105.121678.8972170254912502442.b4-reply@b4> X-Mailer: b4 0.16.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=3810; i=manivannan.sadhasivam@oss.qualcomm.com; h=from:subject:message-id; bh=RvI9Blk4Ym9EOdh+RzZC5J9nWddG5yTx3NxASOUidL4=; b=owEBbQGS/pANAwAKAVWfEeb+kc71AcsmYgBrDwULWaEZ9281CnGX6giSY+FhxUC8Ixy0jBBsT Q3w/Ufh3XqJATMEAAEKAB0WIQRnpUMqgUjL2KRYJ5dVnxHm/pHO9QUCaw8FCwAKCRBVnxHm/pHO 9dmFB/sHfDAbISqyAWteVkC/tEAX1Muh69FZXG60u650Kqb2HYQovBg93aDZXSCLKgbZicEFjr/ FSaLYkF+j7yVgpDZoMcBcN5l81T5iY+xpfOoOC4DFdry/qAz8803frFUWuIO57VRJl6+tbeqtII N6196JbncyCz3EWVoJCZcq3hq0taB6vG04EX8w4gdFQg6xZsWC95qr5c9W6nLTJltOIQbXUZZ93 G/xgWvrLlZTrvONeYXZwOiSqvcAI+vPeT905P4XygjHO4mdbmIaLZiocE2x6c0+hnfr5blbbVVM 9JVm0wxjTBVifW52ElTrOcq+Qse/dwjzYWkORV4Ge61/dsIp X-Developer-Key: i=manivannan.sadhasivam@oss.qualcomm.com; a=openpgp; fpr=C668AEC3C3188E4C611465E7488550E901166008 On 2026-11-20 09:45 -0700, Jeff Hugo wrote: > On 11/18/2026 12:05 AM, Slark Xiao wrote: > > > > At 2026-11-14 02:42:46, "Jeff Hugo" wrote: > >> 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 > > Hi Jeff, > > For oem_pk_hash and serial_number, all interface returns same value. > > I think there is no need to keep these interfaces under the channel > > devices. > > > > For soc_reset, it write the register directly and it works for the entire > > device rather than a single channel. > > > > So I think there is no problem to remove them. > > These are uAPI. The golden rule of the kernel is that we do not break > userspace. It does not matter that their existence is a "bug", if there > is userspace using them, then we must keep them. > That's certainly true. > I could agree with you assessment that having these items on the channel > device is a mistake (and I do), but that does not change the rule. > > So far you have not provided any data to say that userspace is in fact > not using these, and therefore removing them would have no impact. > > Without that analysis, I am sorry to say I am uncomfortable proceeding > with this change. Mani is free to ignore my concerns and apply this > patch at his own risk. > No. I didn't suggest dropping the sysfs attributes from the channel devices altogether. Since these channel attributes are ABIs, they need to be documented in 'obsolete' directory in the ABI documentation first with a proposed removal version and then the existing entries in 'stable' needs to be tweaked to be controller specific. And then we can remove the channel specific attributes only after the proposed kernel version. But now I'm really thinking if it is worth doing or not. - Mani