mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Hongxing Xu <xing1989093@163.com>
To: Manivannan Sadhasivam <mani@kernel.org>
Cc: Jeff Hugo <jeff.hugo@oss.qualcomm.com>,
	mhi@lists.linux.dev, linux-arm-msm@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: [PATCH 2/2] bus: mhi: host: Add debug-only channel config macros
Date: Fri, 13 Nov 2026 20:23:02 +0800	[thread overview]
Message-ID: <20261113122302.2174-2-xing1989093@163.com> (raw)
In-Reply-To: <20261113122302.2174-1-xing1989093@163.com>

The debug_only flag added by the preceding patch has no users: set it
per channel config, and there is no helper for the channel entries that
need it, so every such entry would have to be spelled out in full.

Add MHI_CHANNEL_CONFIG_UL_DEBUG_ONLY() / _DL_DEBUG_ONLY() next to the
existing MHI_CHANNEL_CONFIG_UL()/DL() macros. They are those macros with
.debug_only = true and are used for channels that only exist in the
debug port personality, i.e. the diagnostic and debugger channels.

The suffix is _DEBUG_ONLY rather than _DEBUG because the existing _SBL
and _FP variants select a execution environment, while these macros
still target MHI_EE_AMSS: only the enumeration condition differs.
_DEBUG would suggest a third EE and mislead readers into looking for
one.

Use them for the DIAG channels of modem_qcom_v1_mhi_channels, which is
shared by the SDX55, SDX65 and SDX24 modems. The diagnostic port is
what userspace gains by switching to the debug personality on those
devices, and the QDSS trace channel they also expose is not declared
for this channel set.

Signed-off-by: Hongxing Xu <xing1989093@163.com>
---
 drivers/bus/mhi/host/pci_generic.c | 36 ++++++++++++++++++++++++++++--
 1 file changed, 34 insertions(+), 2 deletions(-)

diff --git a/drivers/bus/mhi/host/pci_generic.c b/drivers/bus/mhi/host/pci_generic.c
index 7193a38..9a51711 100644
--- a/drivers/bus/mhi/host/pci_generic.c
+++ b/drivers/bus/mhi/host/pci_generic.c
@@ -197,6 +197,38 @@ struct mhi_pci_dev_info {
 		.doorbell_mode_switch = false,		\
 	}
 
+#define MHI_CHANNEL_CONFIG_UL_DEBUG_ONLY(ch_num, ch_name, el_count, ev_ring) \
+	{						\
+		.num = ch_num,				\
+		.name = ch_name,			\
+		.num_elements = el_count,		\
+		.event_ring = ev_ring,			\
+		.dir = DMA_TO_DEVICE,			\
+		.ee_mask = BIT(MHI_EE_AMSS),		\
+		.pollcfg = 0,				\
+		.doorbell = MHI_DB_BRST_DISABLE,	\
+		.lpm_notify = false,			\
+		.offload_channel = false,		\
+		.doorbell_mode_switch = false,		\
+		.debug_only = true,			\
+	}
+
+#define MHI_CHANNEL_CONFIG_DL_DEBUG_ONLY(ch_num, ch_name, el_count, ev_ring) \
+	{						\
+		.num = ch_num,				\
+		.name = ch_name,			\
+		.num_elements = el_count,		\
+		.event_ring = ev_ring,			\
+		.dir = DMA_FROM_DEVICE,			\
+		.ee_mask = BIT(MHI_EE_AMSS),		\
+		.pollcfg = 0,				\
+		.doorbell = MHI_DB_BRST_DISABLE,	\
+		.lpm_notify = false,			\
+		.offload_channel = false,		\
+		.doorbell_mode_switch = false,		\
+		.debug_only = true,			\
+	}
+
 #define MHI_EVENT_CONFIG_DATA(ev_ring, el_count) \
 	{					\
 		.num_elements = el_count,	\
@@ -314,8 +346,8 @@ static struct mhi_event_config mhi_qcom_sa8775p_events[] = {
 };
 
 static const struct mhi_channel_config modem_qcom_v1_mhi_channels[] = {
-	MHI_CHANNEL_CONFIG_UL(4, "DIAG", 16, 1),
-	MHI_CHANNEL_CONFIG_DL(5, "DIAG", 16, 1),
+	MHI_CHANNEL_CONFIG_UL_DEBUG_ONLY(4, "DIAG", 16, 1),
+	MHI_CHANNEL_CONFIG_DL_DEBUG_ONLY(5, "DIAG", 16, 1),
 	MHI_CHANNEL_CONFIG_UL(12, "MBIM", 4, 0),
 	MHI_CHANNEL_CONFIG_DL(13, "MBIM", 4, 0),
 	MHI_CHANNEL_CONFIG_UL(14, "QMI", 4, 0),
-- 
2.40.0.windows.1


      reply	other threads:[~2026-11-13 12:23 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-13 12:23 [PATCH 1/2] bus: mhi: host: Add debug port personality switching Hongxing Xu
2026-11-13 12:23 ` Hongxing Xu [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=20261113122302.2174-2-xing1989093@163.com \
    --to=xing1989093@163.com \
    --cc=jeff.hugo@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 \
    /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®