linux/drivers/bus
Manivannan Sadhasivam 51731792a2 net: qrtr: Drop the MHI auto_queue feature for IPCR DL channels
MHI stack offers the 'auto_queue' feature, which allows the MHI stack to
auto queue the buffers for the RX path (DL channel). Though this feature
simplifies the client driver design, it introduces race between the client
drivers and the MHI stack. For instance, with auto_queue, the 'dl_callback'
for the DL channel may get called before the client driver is fully probed.
This means, by the time the dl_callback gets called, the client driver's
structures might not be initialized, leading to NULL ptr dereference.

Currently, the drivers have to workaround this issue by initializing the
internal structures before calling mhi_prepare_for_transfer_autoqueue().
But even so, there is a chance that the client driver's internal code path
may call the MHI queue APIs before mhi_prepare_for_transfer_autoqueue() is
called, leading to similar NULL ptr dereference. This issue has been
reported on the Qcom X1E80100 CRD machines affecting boot.

So to properly fix all these races, drop the MHI 'auto_queue' feature
altogether and let the client driver (QRTR) manage the RX buffers manually.
In the QRTR driver, queue the RX buffers based on the ring length during
probe and recycle the buffers in 'dl_callback' once they are consumed. This
also warrants removing the setting of 'auto_queue' flag from controller
drivers.

Currently, this 'auto_queue' feature is only enabled for IPCR DL channel.
So only the QRTR client driver requires the modification.

Fixes: 227fee5fc9 ("bus: mhi: core: Add an API for auto queueing buffers for DL channel")
Fixes: 68a838b84e ("net: qrtr: start MHI channel after endpoit creation")
Reported-by: Johan Hovold <johan@kernel.org>
Closes: https://lore.kernel.org/linux-arm-msm/ZyTtVdkCCES0lkl4@hovoldconsulting.com
Suggested-by: Chris Lew <quic_clew@quicinc.com>
Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@oss.qualcomm.com>
Reviewed-by: Jeff Hugo <jeff.hugo@oss.qualcomm.com>
Reviewed-by: Loic Poulain <loic.poulain@oss.qualcomm.com>
Acked-by: Jeff Johnson <jjohnson@kernel.org> # drivers/net/wireless/ath/...
Acked-by: Jeff Hugo <jeff.hugo@oss.qualcomm.com>
Acked-by: Paolo Abeni <pabeni@redhat.com>
Cc: stable@vger.kernel.org
Link: https://patch.msgid.link/20251218-qrtr-fix-v2-1-c7499bfcfbe0@oss.qualcomm.com
2025-12-31 16:24:04 +05:30
..
fsl-mc treewide: Remove in_irq() 2025-10-24 21:39:27 +02:00
mhi net: qrtr: Drop the MHI auto_queue feature for IPCR DL channels 2025-12-31 16:24:04 +05:30
arm-cci.c bus: arm-cci: remove unnecessary unreachable() 2018-05-14 01:22:49 -07:00
arm-integrator-lm.c bus: integrator-lm: fix OF node leak in probe() 2024-09-02 10:18:43 +02:00
brcmstb_gisb.c bus: brcmstb_gisb: use dev_groups to register attribute groups 2025-04-07 10:35:43 -07:00
bt1-apb.c bus: bt1-apb: change to use devm_clk_get_enabled() helper 2024-08-29 10:45:13 +02:00
bt1-axi.c bus: bt1-axi: change to use devm_clk_get_enabled() helper 2024-08-29 10:44:53 +02:00
da8xx-mstpri.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500 2019-06-19 17:09:55 +02:00
hisi_lpc.c bus: Switch back to struct platform_driver::remove() 2024-11-12 15:53:37 +01:00
imx-aipstz.c bus: imx-aipstz: allow creating pdevs for child buses 2025-07-11 16:32:08 +08:00
imx-weim.c bus: imx-weim: change to use devm_clk_get_enabled() helper 2024-09-01 17:06:33 +08:00
intel-ixp4xx-eb.c bus: ixp4xx: fix IXP4XX_EXP_T1_MASK 2023-07-05 22:22:55 +02:00
Kconfig bus: add driver for IMX AIPSTZ bridge 2025-07-01 22:23:21 +08:00
Makefile bus: add driver for IMX AIPSTZ bridge 2025-07-01 22:23:21 +08:00
mips_cdmm.c driver core: have match() callback in struct bus_type take a const * 2024-07-03 15:16:54 +02:00
moxtet.c bus: moxtet: Use dev_fwnode() 2025-07-24 11:42:22 +02:00
mvebu-mbus.c syscore: Pass context data to callbacks 2025-11-14 10:01:52 +01:00
omap-ocp2scp.c bus: Switch back to struct platform_driver::remove() 2024-11-12 15:53:37 +01:00
omap_l3_noc.c treewide: Replace GPLv2 boilerplate/reference with SPDX - gpl-2.0_320.RULE 2022-06-10 14:51:36 +02:00
omap_l3_noc.h treewide: Replace GPLv2 boilerplate/reference with SPDX - gpl-2.0_320.RULE 2022-06-10 14:51:36 +02:00
omap_l3_smx.c bus: Switch back to struct platform_driver::remove() 2024-11-12 15:53:37 +01:00
omap_l3_smx.h treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 156 2019-05-30 11:26:35 -07:00
qcom-ebi2.c bus: qcom: remove MODULE_LICENSE in non-modules 2023-04-13 13:13:50 -07:00
qcom-ssc-block-bus.c bus: qcom-ssc-block-bus: Fix the error handling path of qcom_ssc_block_bus_probe() 2025-03-13 17:11:56 -05:00
simple-pm-bus.c bus: simple-pm-bus: fix forced runtime PM use 2025-02-20 15:22:02 +01:00
stm32_etzpc.c bus: etzpc: introduce ETZPC firewall controller driver 2024-04-25 14:44:39 +02:00
stm32_firewall.c bus: stm32_firewall: fix off by one in stm32_firewall_get_firewall() 2024-04-25 14:44:39 +02:00
stm32_firewall.h firewall: introduce stm32_firewall framework 2024-04-05 16:49:14 +02:00
stm32_rifsc.c bus: rifsc: add debugfs entry to dump the firewall configuration 2025-11-14 09:49:09 +01:00
sun50i-de2.c bus: Switch back to struct platform_driver::remove() 2024-11-12 15:53:37 +01:00
sunxi-rsb.c bus: sunxi-rsb: Remove redundant pm_runtime_mark_last_busy() calls 2025-10-29 01:10:10 +08:00
tegra-aconnect.c bus: Switch back to struct platform_driver::remove() 2024-11-12 15:53:37 +01:00
tegra-gmi.c bus: Switch back to struct platform_driver::remove() 2024-11-12 15:53:37 +01:00
ti-pwmss.c bus: Switch back to struct platform_driver::remove() 2024-11-12 15:53:37 +01:00
ti-sysc.c ti-sysc: allow OMAP2 and OMAP4 timers to be reserved on AM33xx 2025-11-04 14:48:47 -08:00
ts-nbus.c bus: Switch back to struct platform_driver::remove() 2024-11-12 15:53:37 +01:00
uniphier-system-bus.c bus: uniphier-system-bus: Remove open coded "ranges" parsing 2023-03-30 13:37:21 -05:00
vexpress-config.c bus: vexpress-config: Add missing MODULE_DESCRIPTION() macro 2024-06-20 09:43:33 +01:00