* [PATCH] bus: mhi: host: pci_generic: Enlarge the generic Qualcomm IP_HW0 rings to 512
@ 2026-11-29 17:52 Muhammad Huda Nugroho
0 siblings, 0 replies; only message in thread
From: Muhammad Huda Nugroho @ 2026-11-29 17:52 UTC (permalink / raw)
To: mani, jeff.hugo; +Cc: mhi, linux-arm-msm, linux-kernel
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
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2026-11-29 17:52 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-11-29 17:52 [PATCH] bus: mhi: host: pci_generic: Enlarge the generic Qualcomm IP_HW0 rings to 512 Muhammad Huda Nugroho
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®