msm: rq_stats: update related_cpus in the cpu_load runtime

"related_cpu" indicates the list of CPUs that need some
sort of frequency coordination, whether software or hardware.
ex:- if all cpus shares the same clock, all 4 cpus belongs to
related_cpus.

cpufreq driver updates the related_cpus during hotplug offline/online
events. Hence update related_cpus for all cpus during hotplug notifier.

CRs-fixed: 548631
Change-Id: I6543ddaeebf73d18334066b090ee7c4a72466e4a
Signed-off-by: Anji Jonnala <anjir@codeaurora.org>
msm: rq_stats: Calculate load based on current freq limit

Prior to this patch, load has been calculated based on an
initial value of policy.cpuinfo.max_freq. This value may
change for several reasons: userspace settings or thermal
throttling (hello hammerhead!). This results in unreliable
calculations that confuse mpdecision which accesses
/sys/devices/system/cpu/cpu0/rq-stats/* for stats info.
Consider current policy.max to fix this behaviour.

Change-Id: Iae1f2fc7f4aa470f7e80371c1ebcf7be423f51ca
soc: qcom: rq_stats: remove the redundant iowait check

Iowait_time check is redundant and it would lead to heavy load
due to miscaluculation of idle time. Hence remove this check
as iowait will considered based on io_busy flag.

Change-Id: I4dd9f9c79205eca588daea8cc0fe892394a83391
CRs-fixed: 662052
Signed-off-by: Anji Jonnala <anjir@codeaurora.org>
power: qpnp-bms: increase resolution of temperature lookups

Currently, the BMS driver rounds to the nearest degree when doing
table lookups on FCC, rbatt, and OCV. This is done with no
interpolation.

This can be harmful because in low temperatures, a change in 1/10th of a
degree C can cause very big swings in UUC due to the rbatt lookup
crossing a threshold. There has been cases seen in -20 degC testing
where when SoC goes from -3.9C to -4C, a shift of 80 mOhms of rbatt was
observed. This increased the UUC by 8% and caused large SoC swings.

Fix this by interpolating between the temperature ranges more smoothly.

Change-Id: I21ba32fd56b802c5a68f5c193f0904e445b6a798
Signed-off-by: Xiaozhe Shi <xiaozhes@codeaurora.org>
power: batterydata-lib: fix out of bound errors

If the battery data lookup tables are misconfigured, there can exist an
array index out of bound error when doing ocv or scaling factor
interpolation using the batterydata-lib functions.

This can happen when the pc being looked up is below the minimum pc
provided by the lookup table. Fix this by not running the search loop if
the pc is out of bounds and instead just return the lowest possible
looked up value.

Change-Id: Ib87925c73576eccb3cdb736229daee12b444964b
Signed-off-by: Xiaozhe Shi <xiaozhes@codeaurora.org>
msm: pil-pronto: Set PMU register SSR bit to indicate WCNSS

Set PMU register bit only in WLAN SSR power-up routine to indicate
WCNSS which can do necessary synchronization between WLAN and BT
during SSR.

CRs-fixed: 639185
Change-Id: I4f8a7beea699ffa42588aa7e3830c665fd76114a
Signed-off-by: Yue Ma <yuem@codeaurora.org>
msm:rpm-log: add the mutex to protect read opertion

This commit will protect rpm log read operation. Then multithread
read the same rpm log buffer will not corruption.

CRs-Fixed: 646485
Change-Id: I0af7d8b3025d036cfa8927c2e37ef865075ff312
Signed-off-by: Pan Fang <fangpan@codeaurora.org>