mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Muhammad Huda Nugroho <mhudan21@gmail.com>
To: mani@kernel.org, jeff.hugo@oss.qualcomm.com
Cc: mhi@lists.linux.dev, linux-arm-msm@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: [PATCH] bus: mhi: host: pci_generic: Enlarge the generic Qualcomm IP_HW0 rings to 512
Date: Mon, 30 Nov 2026 00:52:39 +0700	[thread overview]
Message-ID: <20261129175239.Kyoce%mhudan21@gmail.com> (raw)

modem_qcom_v1_mhi_channels gives the hardware-accelerated IP_HW0 UL/DL
channels 128 ring descriptors. On a Quectel RG520N-EB (SDX6x) behind a
dual-core Cortex-A53 (IPQ5018) that is too shallow: under sustained
downlink the DL ring drains faster than mhi_net's delayed-work refill can
replenish it, the ring runs empty, and the modem's hardware DL engine then
stops for good - rx frozen, tx still flowing, link still up, and nothing
short of a modem reset recovers it. It wedged after 30-43k packets, a few
tens of MB.

Give the two channels 512 descriptors. 512 x 16-byte TRE is 8 KiB of ring
per direction, and the deeper ring absorbs the refill latency: the same
board now sustains 648 MB (450,768 rmnet packets at ~2.0k packets/s) with
no stall, no rx error and no drop, where it used to wedge an order of
magnitude earlier. The dedicated HW DL event ring (2048 entries) already
satisfies the "event ring >= 2x channel ring" rule.

512 is also what Qualcomm's own out-of-tree pcie_mhi driver uses
(NUM_MHI_IPA_IN/OUT_RING_ELEMENTS), and what two profiles in this file,
mhi_sierra_em919x and mhi_mv3x, already use for channels 100 and 101.

Note that the table is shared: mhi_qcom_sdx24_info, mhi_qcom_sdx55_info,
mhi_qcom_sdx65_info and mhi_qcom_sdx75_info all reference it, so every
generic Qualcomm modem matched to one of them gets the larger rings, not
just the RG520N-EB this was measured on. The cost is the extra 8 KiB of
coherent DMA per direction and per channel.

What has not been measured is a faster link: the testing above ran at
25-35 Mbps, and a link several times quicker could drain even a
512-descriptor ring within one worker delay.

Signed-off-by: Muhammad Huda Nugroho <mhudan21@gmail.com>
---
 drivers/bus/mhi/host/pci_generic.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/bus/mhi/host/pci_generic.c b/drivers/bus/mhi/host/pci_generic.c
index ca9ef4a..9635ab0 100644
--- a/drivers/bus/mhi/host/pci_generic.c
+++ b/drivers/bus/mhi/host/pci_generic.c
@@ -328,8 +328,8 @@ static const struct mhi_channel_config modem_qcom_v1_mhi_channels[] = {
 	MHI_CHANNEL_CONFIG_DL_FP(35, "FIREHOSE", 32, 0),
 	MHI_CHANNEL_CONFIG_UL(46, "IP_SW0", 64, 2),
 	MHI_CHANNEL_CONFIG_DL(47, "IP_SW0", 64, 3),
-	MHI_CHANNEL_CONFIG_HW_UL(100, "IP_HW0", 128, 4),
-	MHI_CHANNEL_CONFIG_HW_DL(101, "IP_HW0", 128, 5),
+	MHI_CHANNEL_CONFIG_HW_UL(100, "IP_HW0", 512, 4),
+	MHI_CHANNEL_CONFIG_HW_DL(101, "IP_HW0", 512, 5),
 };
 
 static struct mhi_event_config modem_qcom_v1_mhi_events[] = {
-- 
2.55.0


                 reply	other threads:[~2026-11-29 17:52 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=20261129175239.Kyoce%mhudan21@gmail.com \
    --to=mhudan21@gmail.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®