arm_scmi: Fix infinite recursion in transport probe#46
Open
USAVault wants to merge 1 commit into
Open
Conversation
Collaborator
|
Thank you about this. We are focusing on acpi now so this issue is missed. It's nice to fix it. |
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.
Hi CIX-ians, thanks for your hard work! :) I'm trying to run your kernel by applying patches to my OS, and ran into an issue
When
DEFINE_SCMI_TRANSPORT_DRIVER()creates an "arm-scmi" child device for each transport (SMC, mailbox, etc.), it also copies the parent'sdev->of_nodealong with the rest of the fwnode. So the child ends up with the same OF node as its parentWhen the child device is added,
platform_match()callsof_driver_match_device(), sees the node matches the transport driver'sof_match_table, and probes away spawning another "arm-scmi" -> another probe -> infinite recursion -> stack overflowTo break the cycle, keep the fwnode, but use
device_set_of_node_from_dev()for of_node instead. This setsof_node_reused = true, soof_match_device()skips it and the transport driver never matches its own child.Bonus: refcounting is now balanced too,,
device_set_of_node_from_dev()doesof_node_get(), which pairs withof_node_put()inplatform_device_release()