Skip to content

fastrpc: move ADSP duplicate session management to the driver - #1027

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

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

Conversation

@quic-vkatoch

@quic-vkatoch Vinayak Katoch (quic-vkatoch) commented Aug 27, 2026 •

Copy link
Copy Markdown

This series refactors how ADSP duplicate sessions are created, removing a DT-driven policy and replacing it with synchronous, driver-level initialisation.

[1/3] misc: fastrpc: iterate CB nodes manually instead of of_platform_populate

of_platform_populate() doesn't guarantee child probes complete before returning, leaving the channel partially initialised. Replace it with fastrpc_cb_devices_create() which calls fastrpc_cb_init() synchronously per CB node. Add fastrpc_cb_devices_destroy() as the teardown counterpart. Remove fastrpc_cb_driver as an independent platform driver and switch to module_rpmsg_driver().

[2/3] misc: fastrpc: move ADSP duplicate session creation to the driver

ADSP has few CBs; when daemons consume all sessions, user apps fail. The workaround was qcom,nsessions = <5> in DT, duplicating sessions inside fastrpc_cb_init(). Remove that and instead append FASTRPC_DUP_SESSIONS (4) copies of the last session after all CBs are initialised in fastrpc_rpmsg_probe().

[3/3] dt-bindings: misc: qcom,fastrpc: deprecate qcom,nsessions

Session duplication is now driver-managed; mark qcom,nsessions deprecated in the binding.

Link: https://lore.kernel.org/all/20260923-dup-sessions-v5-0-e953133a1827@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.

Introduce fastrpc_cb_devices_create() to iterate over child DT nodes
directly and call fastrpc_cb_init() synchronously for each
qcom,fastrpc-compute-cb node. This ensures all context banks are fully
initialised before fastrpc_rpmsg_probe() returns.

Introduce fastrpc_cb_devices_destroy() as the symmetric counterpart.
Before destroying the CB platform devices, invalidate all sessions under
the channel lock so that any fastrpc_user still holding a reference to
the channel context cannot acquire a new session backed by a destroyed
device.

Since fastrpc_cb_driver is no longer needed as an independent platform
driver, remove it along with its match table and remove callback. Use
module_rpmsg_driver() now that only a single driver registration remains.

Link: https://lore.kernel.org/all/20260923-dup-sessions-v5-1-e953133a1827@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/20260923-dup-sessions-v5-2-e953133a1827@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/20260923-dup-sessions-v5-3-e953133a1827@oss.qualcomm.com/
Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@oss.qualcomm.com>
Signed-off-by: Vinayak Katoch <vinayak.katoch@oss.qualcomm.com>
@qswat-orbit-external

Copy link
Copy Markdown

Dev Completion validation failed

CR: 4508505
Change Task: kernel.qli.2.0
Error: GenAI Assisted field must be set before moving change tasks to Development Complete. Please provide GenAI information.

The change task for this CR could not be moved to Dev Complete because of the error above. Please resolve the issue in Orbit and re-run the failed Orbit check.

@quic-vkatoch Vinayak Katoch (quic-vkatoch) changed the title FROMLIST: misc: fastrpc: fix ADSP duplicate session creation fastrpc: move ADSP duplicate session management to the driver Sep 23, 2026
@qswat-orbit-external

Copy link
Copy Markdown

Dev Completion validation failed

CR: 4508505
Change Task: kernel.qli.2.0
Error: GenAI Assisted field must be set before moving change tasks to Development Complete. Please provide GenAI information.

The change task for this CR could not be moved to Dev Complete because of the error above. Please resolve the issue in Orbit and re-run the failed Orbit check.

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