cpufreq: cpu-boost: Don't register for cpufreq notifiers too early

The cpufreq notifiers should be registered only after all the data
structures used in the notifier callbacks have been initialized. So, move
the cpufreq notifier registration to a later point in the init function.

Change-Id: I043ab5bc0ebb98164c40549fe151a8d801c8c186
Signed-off-by: Saravana Kannan <skannan@codeaurora.org>
msm: kgsl: Flush the UCHE when context changes

Add commands to flush the GPU UCHE when a new context submits
commands to GPU. The ensures that the new context does not use
stale data present in UCHE.

CRs-Fixed: 607976
Change-Id: I123a323be5f3fb9d1f9f96fed5bb68b8d0d27d76
Signed-off-by: Shubhraprakash Das <sadas@codeaurora.org>
Signed-off-by: Hareesh Gundu <hareeshg@codeaurora.org>
qseecom: Validate the pointer returned by ion_import_dma_buf

Do a "IS_ERR_OR_NULL" check for the return value of
ion_import_dma_buf.

Change-Id: Iaac8b59b1f076d002430e0e6aba055bd88c83ed7
Signed-off-by: Hariprasad Dhalinarasimha <hnamgund@codeaurora.org>
net: flow_dissector: fail on evil iph->ihl

We don't validate iph->ihl which may lead a dead loop if we meet a IPIP
skb whose iph->ihl is zero. Fix this by failing immediately when iph->ihl
is evil (less than 5).

CRs-Fixed: 589913
Change-Id: Ifd7be75d153d7504704e7ff9d8f63fe3767326d2
Acked-by: David Arinzon <darinzon@qti.qualcomm.com>
Signed-off-by: Subash Abhinov Kasiviswanathan <subashab@codeaurora.org>
mmc: core: do not reinsert prepeared FUA and FLUSH requests in stop flow

When mmc context has unblocked from waiting current request because of
urgent request notification coming from block layer, there is prepeared
request.  In the case, when the request is REQ_FUA or REQ_FLUSH, the
flow should not reinsert it back to i/o scheduler (since according to
block layer logic flush requests with data should never enter elevator).
Instead this request starts immediately.

Change-Id: Ia78b56c6135dd1a8d75a98fd5b771a5035e5c360
Signed-off-by: Konstantin Dorfman <kdorfman@codeaurora.org>
Merge "cpufreq: cpu-boost: Don't register for cpufreq notifiers too early"
Merge "qseecom: Validate the pointer returned by ion_import_dma_buf"
ARM: dts: msm: set maximum voltage after uplift to 1.33V for msm8226

Uplifted APC voltage should not exceed 1.33v according to new voltage plan
for 8x26. Change it to comply with the new plan and still maintain
VDD_APC<=VDD_MX with MX max=1.3375v.

Change-Id: Ia0f137a1ba68680e3b943a6e98575be10689de91
CRs-Fixed: 630579
Signed-off-by: Ke Liu <keliu@codeaurora.org>
Merge "ARM: dts: msm: set maximum voltage after uplift to 1.33V for msm8226"
Merge "net: flow_dissector: fail on evil iph->ihl"
ASoC: msm: qdsp6v2: fix possible integer overflow

Check integer overflow before multiplying struct size. If that happens
should return immediately. In addition if param length is greater than
MAX size from spec, better return error.

Change-Id: Ib96cb419ade042d21a1213f6d8c2ff339f5d1c56
CRs-fixed: 605273
Signed-off-by: Fred Oh <fred@codeaurora.org>
Merge "mmc: core: do not reinsert prepeared FUA and FLUSH requests in stop flow"
ASoC: msm: qdspv2: Add hw_free for mi2s backend

In the current driver we did not implement hw_free callback.
During stability test, hw_params is called twice without shutdown
and startup due to this there is mismatch in hw_params.
In this case hw_free is trigerred, so implement hw_free and if
hw_free is called take appropriate action in hw_params.

CRs-Fixed: 611216
Change-Id: I4afa59adc81aa361147937b2211fe021b6e47b40
Signed-off-by: Yeleswarapu, Nagaradhesh <nagaradh@codeaurora.org>
diag: Add mutex protection while writing to smd

Add mutex protection to diag ctrl channel to avoid concurrency
issues with smd_write() to the diag ctrl channel.

Change-Id: Ief0867584da558a7952e68757da324430af3c58a
CRs-Fixed: 587775
Signed-off-by: Sreelakshmi Gownipalli <sgownipa@codeaurora.org>
Merge "diag: Add mutex protection while writing to smd"
Merge "ASoC: msm: qdspv2: Add hw_free for mi2s backend"
Merge "ASoC: msm: qdsp6v2: fix possible integer overflow"
power: qpnp-bms: estimate OCVs based on temperature.

The BMS driver will throw out the hardware taken open circuit voltage
(OCV) if there has been a warm reset and the PMIC did not go through
the power on sequence. This is to throw out the stale OCVs from the
last boot.

However, if there is no shutdown SOC stored, the BMS driver must
estimate an OCV. When estimating an OCV, there is no information about
the battery state of charge yet, so the default battery resistance is
used to do the estimation. However, this only works in cases where the
battery temperature is not cold.

When the battery temperature is cold, the real rbatt will be much larger
than the default rbatt. If the default rbatt is used, the estimated OCV
will most likely be much too low, and a faulty SOC will be used. This
issue is exacerbated by the fact that the shutdown SOC is thrown out
when the battery is cold, so this situation can arise much more
frequently.

Fix this by estimating the battery OCV based on temperature and just
using a default rbatt SOC of 50%.

Conflicts:

	drivers/power/qpnp-bms.c

Change-Id: Ibc89fcd74a295bb2196be2d8c977e8b1b8598d7a
Signed-off-by: Xiaozhe Shi <xiaozhes@codeaurora.org>
Signed-off-by: Abhinav Gurram <c_abhina@codeaurora.org>
Merge "msm: kgsl: Flush the UCHE when context changes"
Merge "power: qpnp-bms: estimate OCVs based on temperature."