PM / devfreq: Fix out of bounds access of transition table array

The previous_freq value for a device could be an invalid frequency that
results in a error value being returned from devfreq_get_freq_level().
Check for an error value before using that to index into the transition
table.

Not doing this check will result in memory corruption when previous_freq is
not a valid frequency.

Signed-off-by: Saravana Kannan <skannan@codeaurora.org>
Change-Id: Ia9f9f3dabf14b26c4dff54fb2bac3e77f33458c0
mmc: block: check for NULL pointer before dereferencing

mmc block data can be NULL. Hence, check for NULL before
dereferencing md.

CRs-Fixed: 562259
Change-Id: I0182c216ec73347cdd2ea464f593839fffd242a9
Signed-off-by: Asutosh Das <asutoshd@codeaurora.org>
qseecom: Add basic suspend resume functionality

If ce clock is not disabled in suspend state, memory may be corrupted and
device can not wake up. Thus,if clock is enabled, we disable it in qseecom
suspend function and re-enable it again in resume function.

Change-Id: I70349ad3070c340add1f3fbe392a4bec2b8af9bf
Signed-off-by: Zhen Kong <zkong@codeaurora.org>
msm: peripheral-loader: Change IOMAP_SIZE from SZ_4M to SZ_1M

The ioremap call made for zeroing out trailing memory is currently
requesting for a 4M memory region. This is resulting in vmalloc
allocation failures on some platforms.
Instead, request for 1M memory locations and zero out the area
in smaller chunks to make this failure less probable.

CRs-Fixed: 613426

Change-Id: I554dc42cbb37ec893306bd1cc625230216b9b6c9
Signed-off-by: Deepak Katragadda <dkatraga@codeaurora.org>
msm: lpm_levels: remove rpm handshake in l2_gdhs mode

Remove rpm handshake in l2_gdhs mode and adjust the
latency values for l2_gdhs mode. Add a new dt entry to
inform lpm_levels driver to send sleep votes to rpm.

CRs-fixed: 604873
Change-Id: I9eeae5fada4f84ee2ca2eb9d67707dee1adf56ac
Signed-off-by: Anil kumar mamidala <amami@codeaurora.org>
uio: provide vm access to UIO_MEM_PHYS maps

This makes it possible to let gdb access mappings of the process that is
being debugged.

uio_mmap_logical was moved and uio_vm_ops renamed to group related code
and differentiate to new stuff.

CRs-Fixed: 570735
Change-Id: I8a5ff343727cc58fedfeb73f3466cc9a7f153e84
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Git-commit: 7294151d0592e0ff48c61fca9fd7c93d613134da
Git-repo: http://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git
Signed-off-by: Pratibhasagar V <pratibha@codeaurora.org>
ASoC: msm: qdsp6v2: Check for null pointers

Add check for null data pointer in
adm_callback() and log error message if
true.

CRs-Fixed: 575222
Change-Id: I88a4d19cc2e78610249e404bce93831557995fab
Signed-off-by: Kenneth Westfield <kwestfie@codeaurora.org>
ASoC: msm: qdsp6v2: Add upper bounds check on index

Add upper bounds check for return value of
q6audio_get_port_index().

CRs-Fixed: 575227
Change-Id: I263fc6d759beffd2c2fecc7794c279939ab25401
Signed-off-by: Kenneth Westfield <kwestfie@codeaurora.org>
ASoC: msm: Add sample rates to PCM front-end

Add two additional sample rates to the PCM front-
end: 88200 KHz and 176400 KHz.

CRs-Fixed: 601715
Change-Id: If61fb034a60f41b5c63a00fd764da50db7333cb5
Signed-off-by: Kenneth Westfield <kwestfie@codeaurora.org>
regulatory: use correct regulatory initiator on wiphy register

The current regdomain was not always set by the core. This causes
cards with a custom regulatory domain to ignore user initiated changes
if done before the card was registered.

Signed-off-by: Arik Nemtsov <arik@wizery.com>
Acked-by: Luis R. Rodriguez <mcgrof@do-not-panic.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Git-commit: 23df0b731954502a9391e739b92927cee4360343
Git-repo: git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
CRs-Fixed: 569424
Change-Id: Ia5462145a27f5ecdd7a1eb9f4235992f7a801097
[smihir@codeaurora.org: changes to merge cleanly in older kernel]
Signed-off-by: Mihir Shete <smihir@codeaurora.org>
qseecom: Add support for bus scaling

Add support for scaling bus to various level:
LOW, MEDIUM, HIGH.  Expose IOCTL to user space
clients to enable selecting a specific bus bandwidth
setting.

Change-Id: I8ef94b84464e86d3a71e4c78c502e99ef2e0ec9a
Signed-off-by: Mona Hossain <mhossain@codeaurora.org>
Signed-off-by: Zhen Kong <zkong@codeaurora.org>
qseecom: Fix issues on key management scheme

The mechanism to update how a user is tied to an existing key is
added. And the app_access_lock mutex is removed in key management
APIs, as there is no need to lock app access while processing a
key related request.

Signed-off-by: Zhen Kong <zkong@codeaurora.org>
qseecom: Removal of flags and options to protect listener memory

With the new ION design all memory allocated from secure heaps is
secured already at allocation time. This commit effectively rolls
back a change introduced to secure this memory at runtime.

Change-Id: I94bf0a7f6d477b04da7ad6786111f8c970516842
Acked-by: Christian Bolis <cbolis@qti.qualcomm.com>
Signed-off-by: Hariprasad Dhalinarasimha <hnamgund@codeaurora.org>
qseecom: change key management apis

Remove 2 seconds sleep if create_key or update_key fails, and
this delay is now handled by TZ. change errno when maximum
attempt to input password is reached.

Change-Id: I14350219f43094d280ebc1e3717418285063448d
Signed-off-by: Zhen Kong <zkong@codeaurora.org>
qseecom: Add checks for user space buffer pointers

Validate pointers send from user space and pointers
embedded within the mesasge sent from user space.

Change-Id: I1be54924ef3d301908af6e8d4e6506f2aa7f6428
Signed-off-by: Mona Hossain <mhossain@codeaurora.org>
Signed-off-by: Zhen Kong <zkong@codeaurora.org>