sched/tune: Remove BUG_ON in schedtune_add_cluster_nrg

schedtune_add_cluster_nrg contains a sanity check that verifies
that only certain sched-domain levels have the energy-model attached
to them. However this check assumes the existence of a parent
domain, which may not be true depending on how many CPUs the kernel
brings up at boot (maxcpus or boot_cpus). The BUG check is buggy,
since a parent domain may not exist, causing the following kernel
panic. Let's just remove the BUG_ON, since the system can very well
continue operation in the case that we find an unexpected energy model
attached to a domain.

[    0.294530] schedtune: init normalization constants...
[    0.299794] schedtune: CLUSTER[0]        min_pwr:    12 max_pwr:   152
[    0.306366] schedtune: CPU[0]            min_pwr:    12 max_pwr:   152
[    0.312960] Unable to handle kernel NULL pointer dereference at virtual
[    0.321123] pgd = ffffff9cc2199000
[    0.534390] ------------[ cut here ]------------
[    0.539039] Kernel BUG at ffffff9cc04fe444 [verbose debug info unavaila
[    0.546056] Internal error: Oops: 96000005 [#1] PREEMPT SMP
[    0.551668] Modules linked in:
[    0.554782] CPU: 0 PID: 1 Comm: swapper/0 Not tainted 4.9.27-perf+ #426
[    0.561440] Hardware name: Qualcomm Technologies, Inc. MSM sdm845 v1 MTP
[    0.568623] task: fffffffe39658000 task.stack: fffffffe39660000
[    0.574607] PC is at schedtune_init+0x240/0x3a0
[    0.579168] LR is at schedtune_init+0x234/0x3a0

Change-Id: Ie106091bf7c9c3197c90e242b51f9f9a43a61f12
Signed-off-by: Vikram Mulukutla <markivx@codeaurora.org>
1 file changed