Re: [PATCH 1/2] bus: mhi: host: Add debug port personality switching

From: Jeff Hugo

Date: Fri Nov 13 2026 - 17:14:53 EST


On 11/13/2026 5:23 AM, Hongxing Xu wrote:
diff --git a/Documentation/ABI/stable/sysfs-bus-mhi b/Documentation/ABI/stable/sysfs-bus-mhi
index 8b9698f..1fe8510 100644
--- a/Documentation/ABI/stable/sysfs-bus-mhi
+++ b/Documentation/ABI/stable/sysfs-bus-mhi
@@ -30,6 +30,20 @@ Description: Initiates a SoC reset on the MHI controller. A SoC reset is
non-responsive, or as a means of loading new firmware as a
system administration task.
+What: /sys/bus/mhi/devices/.../debug_ports
+Date: November 2026
+KernelVersion: 7.5
+Contact: mhi@xxxxxxxxxxxxxxx
+Description: Controls which set of ports the MHI controller enumerates.
+ Writing 0 selects the commercial personality, in which the
+ channels that are only useful for debugging are not
+ enumerated. Writing 1 selects the debug personality and
+ additionally enumerates those channels, so that the extra
+ WWAN ports appear, e.g. one for the diagnostic interface.
+ Reading returns the currently active personality.
+ Controllers that do not describe any debug-only channel are
+ unaffected by this attribute.
+

Why sysfs and not debugfs?

/**
@@ -381,6 +384,16 @@ struct mhi_controller_config {
* @no_m3: Device doesn't support M3 state
* @irq_flags: irq flags passed to request_irq (optional)
* @mru: the default MRU for the MHI device
+ * @debug_ports: Whether the debug port personality is active, i.e. whether the
+ * channels marked with debug_only are enumerated. Controlled
+ * from userspace through the debug_ports sysfs attribute and
+ * applied by debug_ports_work. Zero-initialised, so a
+ * controller starts in the commercial personality.
+ * @debug_ports_pending: Latest personality requested from userspace, applied
+ * by debug_ports_work
+ * @debug_ports_work: Applies @debug_ports_pending from the ordered high
+ * priority workqueue, so the device creation it performs
+ * cannot race with a state transition

Are these optional?