From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=74.125.82.174 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1795974766; b=1/+gs3fuQHxF9t5xT40STvVqCosUhNBWwWaQl9GwcZ+8fahj+6zvOrID0m/3qDEz8Kp6 VJt1Zzud8QFJoLIr/O9pPGBCZj32aPpQNqzbBftpBZ37d4hYBIDkxYdUCfaFPIlupGoo5 zwCkCIkTvtbOMJM+QvOJj97+/7+z4XSvjw92whoXCC6hc7p/9mJ/4V+nDAdpt9ryqC/ej mdmPwrQ4zsq1KwyWnyyLTbWCy4z1aukK84MQJ/by3oMl2sW5jkZNsL2Vbb6+CpLagSgW0 Mo9Uv3yYAZnLCHUBNBx7DNr0AOSPawuyq5mkSH2MTHiLdl1sRvPRhvp7UfU5DrN3FjA== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1795974766; h=DMARC-Filter:Received:DKIM-Signature:X-Google-DKIM-Signature: X-Gm-Message-State:X-Gm-Gg:X-Received:Received:Date:From:To:Cc: Subject:Message-ID:User-Agent; bh=6O60BMW28OwzmifnjLvjd0DVc+1+4CqzgM9Q+CuVIbE=; b=QQF/hA1u2qrH/MeZ1zGf+Al0Zg+FiyKdRvBj3OG4Dw97WLA8LBxuIwIpQJm5vLqLaZmP aNJ2Al4q1xc3XLaJ2PZ5HeHJ7RjZxVlDzk/a9pV4IzvFodZsFt9GGCslWM6hQ/ZE4LRWN 94sX3TD4AY5AZk84m43DTdkQIN/GqmL4PjpcXSICOYZB4jc5RrWOWVNd6tM/Lr5NllmsA 4u9837+VGjpMkEv56hrUaHxUqlb7hYkjU7/X4ybQfTYZoeb0P2BuxhNq6flQNWNbGnD3C 9yxXp+vvIYqi8ynz+iYLTKIWmJdp7TltD2Vu6koy0PX+uBqH2JpeEi8tauCI9cRD7fQ== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20260707 header.b="xBJtS/Gx"; arc=none smtp.remote-ip=74.125.82.174 Received: from mail-dy1-f174.google.com (mail-dy1-f174.google.com [74.125.82.174]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id F12C2606A323 for ; Sun, 29 Nov 2026 17:52:44 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org F12C2606A323 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20260707 header.b=xBJtS/Gx Received: by mail-dy1-f174.google.com with SMTP id 5a478bee46e88-3282db206d3so630107eec.0 for ; Sun, 29 Nov 2026 09:52:44 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20260707; t=1795974764; x=1796579564; darn=lists.linux.dev; h=user-agent:message-id:subject:cc:to:from:date:from:to:cc:subject :date:message-id:reply-to:content-type; bh=6O60BMW28OwzmifnjLvjd0DVc+1+4CqzgM9Q+CuVIbE=; b=xBJtS/Gx1srJGDbBsTP7TugNUjFm0226FP0uhPr79drPVHW4lyhoo/Fa8z5TScyn7x Ke6xo/j7/t5CdzGXfhqkU8HF8ktyBhfxsXow9CxTMUxW74AUu7rXQZ5pEv/o8FP99ry7 OqZyxb79qK/Mjmr3UtM8U/6wgXbvlA2LzLM0XlffWjtulbWPXs15Fw/eWCwKYeJsFdgb AICoQoJ8Z7gI8VswCg3rWtNxdll6VGf36ojYxKOkDZoXIl0IVx/SXwvZhuMzIWGFrmZ2 jly50uSw0/RwceB82H/k5Dc5BHbwzCcaHJklAXdc8CG1i6RYrg7ulM3KscmBex8U174a NePg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1795974764; x=1796579564; h=user-agent:message-id:subject:cc:to:from:date:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to :content-type; bh=6O60BMW28OwzmifnjLvjd0DVc+1+4CqzgM9Q+CuVIbE=; b=2DLeisxfQ4iVWamSnwKOy+5jVip4fFWBlTiF+cSfbFIkCBGfVmW2JX4ZY8nxutHZWU 5/nx/P2REDStfGwIsBjiI/XeBwqlOeoakdV3UoGzgvWtPYykMmSaUujBg467YN+RtDfc Is5HXLxg5nwuyFtEqJ7Bx8GVSepUOMo2/9bgKRrZQYu4K7M3jX8qcJwz0SWYSPm53wN2 b7vBk9KtSa7Y99R1I88OTGfe9H02uS+6ldrotL40UtrqIs0zDqyPaPPpp1+PrDgwseAq /SSapW0fr/eJadmKsBmdINwpjbc/dBN5lOhMo5u6TkGiPJhL4mrya8RaFKa/5RmFEVaX Dk+w== X-Gm-Message-State: APuU4Z8sy9sIAhgdB/UhMAMzCHEs+C7EsJBIhMHSsOwUPjDmoUzwnSAw 4X0Grvnor+yw9oSbg7kbA54f0p3QVZjLU/AgilPxOLd9rprfsqzkHv9l X-Gm-Gg: AZFdTZebcz/lBt8HgzC/0euJom+kNSxkb/dn4s2hFGcKOZOvBm1cY/MkWaHXtQmSsVR BD0XA6LgHxbjPLm1DzLR43YSwZgCyxkJ3+D6P5n5xC+CyQZuhmZP9GbD3ZwN8cTMUVhVx3sw43t jXPkYsTNYEvQbsqb1fyWn9PZ904fOuqDSUKfyaEIzCfb6nZsU1av4knLEk2ytgRUBJqCnXUwEoJ U3n/PHm86dsd24ABh0DE8tMIafRuhvYqERYFFCjWx3+WzbhlpX7i2EQxBsK05TWC1B8crEhgLUX ucbcZ6TT/odUdDyLicTe2eWa3CQM0EQQusOOiT0Jr8KftLkguNErVwRXaQatJiMe0MCksB32wx5 We/e0S+EFmoHFMt5SEqndVBwWbC2teG1lTXFuePwQc3n+TPtWMoFdQ/XdP/pk1qrY3Wv6PbliJb UBZGYlxnxS4uAxgIMq2MeVv88Y/MhLSSzVChxdiW/B9UGe2lX+IEhHZ90VdlcuTEKLD/tAtjdIG DG7f4uVYhoVWIxv/4UZQgZCPCnLitXo68JH31aE0zSI2tOaoC3sZQSKTKeMeMpCRv8SE6ubQNUf l0kyjTWaSusD0fR96eb5STHacQTpSGZp6o9pTHEVuHV3JSYOjJ1QVPWq5UUj8vyl7wT452EgPZz bvOmRfIsNf0aNOnwqtg== X-Received: by 2002:a05:7300:f498:b0:386:a716:916b with SMTP id 5a478bee46e88-386a7169544mr25174331eec.31.1795974764026; Sun, 29 Nov 2026 09:52:44 -0800 (PST) Received: from asus-ux3405ca ([2400:9800:1fb:2697:73c:c835:c2f3:172f]) by smtp.gmail.com with ESMTPSA id 5a478bee46e88-385c6830815sm84200918eec.20.2026.11.29.09.52.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 29 Nov 2026 09:52:43 -0800 (PST) Date: Mon, 30 Nov 2026 00:52:39 +0700 From: Muhammad Huda Nugroho 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 Message-ID: <20261129175239.Kyoce%mhudan21@gmail.com> User-Agent: mail v14.9.25 X-Mailing-List: mhi@lists.linux.dev List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list 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 --- 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