sched: walt: fix sched_cluster initialization
If cluster topology parsing failed or system booted with single cpu,
then topology possible sibling mask could be empty. This leads to
initialization of sched_clusters with empty cpus and there are many
call sites, which use the cluster cpu mask without checking for empty mask.
They lead to accessing invalid cpus ( minus one) leading to crashes.
Fix it by resetting to an initial cluster structure that has all possible
cpus as cluster mask. Also, warn when an empty cluster is detected.
To continue using init_cluster on device tree failures:
- Use init_cluster as default entry in cluster_head, and once
cluster topology parsed successfully, cluster_head gets updated with
proper cpu cluster information.
- If cluster topology parsing failed, free allocated sched_clusters and
make sure rq points to init_cluster instead of invalid address.
- Remove unused cluster id bitmaps.
Change-Id: Ic65ba86ff90a271098fb593221d1679d634930b1
Signed-off-by:
Lingutla Chandrasekhar <clingutla@codeaurora.org>
Loading
Please register or sign in to comment