summaryrefslogtreecommitdiff
path: root/scripts/rustdoc_test_builder.rs
diff options
context:
space:
mode:
authorCristian Marussi <cristian.marussi@arm.com>2023-07-18 11:17:26 +0100
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>2023-07-20 20:27:10 +0200
commit3e767d6850f867cc33ac16ca097350a1d2417982 (patch)
tree22999771715e0a85c2b3c3a76b00613e17cd16ca /scripts/rustdoc_test_builder.rs
parentfdf0eaf11452d72945af31804e2a1048ee1b574c (diff)
powercap: arm_scmi: Remove recursion while parsing zones
Powercap zones can be defined as arranged in a hierarchy of trees and when registering a zone with powercap_register_zone(), the kernel powercap subsystem expects this to happen starting from the root zones down to the leaves; on the other side, de-registration by powercap_deregister_zone() must begin from the leaf zones. Available SCMI powercap zones are retrieved dynamically from the platform at probe time and, while any defined hierarchy between the zones is described properly in the zones descriptor, the platform returns the availables zones with no particular well-defined order: as a consequence, the trees possibly composing the hierarchy of zones have to be somehow walked properly to register the retrieved zones from the root. Currently the ARM SCMI Powercap driver walks the zones using a recursive algorithm; this approach, even though correct and tested can lead to kernel stack overflow when processing a returned hierarchy of zones composed by particularly high trees. Avoid possible kernel stack overflow by substituting the recursive approach with an iterative one supported by a dynamically allocated stack-like data structure. Fixes: b55eef5226b7 ("powercap: arm_scmi: Add SCMI Powercap based driver") Signed-off-by: Cristian Marussi <cristian.marussi@arm.com> Acked-by: Sudeep Holla <sudeep.holla@arm.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Diffstat (limited to 'scripts/rustdoc_test_builder.rs')
0 files changed, 0 insertions, 0 deletions