Skip to content

FROMLIST: misc: fastrpc: fix ADSP duplicate session creation - #1027

Open
Vinayak Katoch (quic-vkatoch) wants to merge 3 commits into
qualcomm-linux:qcom-6.18.yfrom
quic-vkatoch:dup-sessions
Open

FROMLIST: misc: fastrpc: fix ADSP duplicate session creation#1027
Vinayak Katoch (quic-vkatoch) wants to merge 3 commits into
qualcomm-linux:qcom-6.18.yfrom
quic-vkatoch:dup-sessions

Conversation

@quic-vkatoch

Copy link
Copy Markdown
  • Patch 1: Replace of_platform_populate() with a manual synchronous loop over qcom,fastrpc-compute-cb child nodes, calling fastrpc_cb_init() (renamed from fastrpc_cb_probe()) directly. This ensures all context banks are fully initialised before fastrpc_rpmsg_probe() returns, eliminating the async probe race. Removes fastrpc_cb_driver, its match table, and remove callback, and adds session invalidation on teardown.
  • Patch 2: Remove the qcom,nsessions DT property read and per-CB duplication logic from fastrpc_cb_init(). After all context banks are initialised in fastrpc_rpmsg_probe(), append FASTRPC_DUP_SESSIONS (4) copies of the last probed session for the ADSP domain, keeping the duplication policy entirely at the driver level.
  • Patch 3: Mark the qcom,nsessions DT property as deprecated since session duplication is now handled at the driver level.

Link: https://lore.kernel.org/all/20260826-dup-sessions-v4-0-35555d2bfed4@oss.qualcomm.com/
CRs-Fixed: 4508505

…form_populate

of_platform_populate() only guarantees that child devices are registered,
not that their probes have completed before it returns. This creates a
window where fastrpc_cb_init() may not have run for all context bank
nodes, leaving the channel context partially initialised.

Iterate over the child device tree nodes directly, initialising each
qcom,fastrpc-compute-cb device synchronously. This ensures all context
banks are fully initialised before fastrpc_rpmsg_probe() returns. Since
fastrpc_cb_driver is no longer needed as an independent platform driver,
remove it along with its match table and remove callback. Set
OF_POPULATED_BUS on the rpmsg node so that of_platform_depopulate()
correctly removes the manually created CB devices on teardown.

Link: https://lore.kernel.org/all/20260826-dup-sessions-v4-1-35555d2bfed4@oss.qualcomm.com/
Signed-off-by: Vinayak Katoch <vinayak.katoch@oss.qualcomm.com>
…driver

For ADSP, only a limited number of FastRPC context banks (CBs) are
available. Each CB supports a single session, which means only a few
processes can run on ADSP simultaneously. If all sessions are consumed
by fastrpc daemons, no session remains available when a user application
starts, causing the application to fail.

To work around this, qcom,nsessions = <5> was set in DT to duplicate
sessions inline during fastrpc_cb_init(). This policy does not belong
in DT and should be handled at the driver level instead.

Remove the qcom,nsessions DT property read and the per-CB duplication
logic from fastrpc_cb_init(). After all context banks have been
initialised in fastrpc_rpmsg_probe(), append FASTRPC_DUP_SESSIONS (4)
copies of the last session for the ADSP domain.

Link: https://lore.kernel.org/all/20260826-dup-sessions-v4-2-35555d2bfed4@oss.qualcomm.com/
Signed-off-by: Vinayak Katoch <vinayak.katoch@oss.qualcomm.com>
The qcom,nsessions property was used to duplicate FastRPC sessions
inline during context bank initialisation. Session duplication is now
handled at the driver level, making this DT property redundant. Mark
it deprecated.

Link: https://lore.kernel.org/all/20260826-dup-sessions-v4-3-35555d2bfed4@oss.qualcomm.com/
Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@oss.qualcomm.com>
Signed-off-by: Vinayak Katoch <vinayak.katoch@oss.qualcomm.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant