fastrpc: move ADSP duplicate session management to the driver - #1027
Open
Vinayak Katoch (quic-vkatoch) wants to merge 3 commits into
Open
Vinayak Katoch (quic-vkatoch) wants to merge 3 commits into
Vinayak Katoch (quic-vkatoch) wants to merge 3 commits into
Conversation
Vinayak Katoch (quic-vkatoch)
requested review from
a team,
Komal Bajaj (Komal-Bajaj),
Mukesh Ojha (mukeshojha-linux) and
Rajendra (rrnayak)
August 27, 2026 10:53
…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>
Vinayak Katoch (quic-vkatoch)
force-pushed
the
dup-sessions
branch
from
September 23, 2026 10:49
000708b to
c8866a3
Compare
|
Dev Completion validation failed CR: 4508505 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. |
|
Dev Completion validation failed CR: 4508505 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. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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