block: row: Fix crash when adding a new field in bio struct

When adding new field to struct bio there is a crash in the removed
code lines. This issue was introduced by commit
dcb5282b48eea4b2eb6878a04189576acd8c1c27 "block: row-iosched idling
triggered by readahead pages"

(Partly) reverting this patch till root cause is fixed (on FS level).

Signed-off-by: Tanya Brokhman <tlinder@codeaurora.org>
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
Setting correct HW crypto driver instance for FDE

HW crypto provides different instance for different use cases.
Dm-req-crypt should use the one for full disk encryption use case.

Signed-off-by: Dinesh K Garg <dineshg@codeaurora.org>
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
dm: dm-req-crypt: add support for Per-File-Encryption

Support Per-File-Encryption (PFE) based on file tagging.
The Per-File-Tagger (PFT) reports if a file should be encrypted or not.
The Per-File-Encryption can be used after Full-Disk-Encryption (FDE) was
completed or without FDE.
The PFE and FDE uses different keys, which are managed by the Trust-Zone.

Signed-off-by: Amir Samuelov <amirs@codeaurora.org>
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
platform: msm: add Per-File-Tagger (PFT) driver

This driver is part of the Per-File-Encryption (PFE) feature.
It allows to tag enterprise files and encrypt them
while keeping the user private files untagged and plain text.

Change-Id: I2ba8bffb2a8815991dc3994a1f94a0c52b937a25
Signed-off-by: Nir Ofry <nofry@codeaurora.org>
Signed-off-by: Amir Samuelov <amirs@codeaurora.org>
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
platform: msm: fix PFT char device major number

Dynamically allocate the major number
of the PFT character device.

Change-Id: I7877579781353203753f86a3993bc5731307db2a
Signed-off-by: Amir Samuelov <amirs@codeaurora.org>
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
platform: msm: pft: fix close all encrypted files

filp_close() eventually calls pft_file_close().
Simplify pft_close_opened_enc_files() and remove having mutex
in both places that cause a deadlock.

Change-Id: I0afa2d2f0806f18d430c027601fb9974855ef185
Signed-off-by: Amir Samuelov <amirs@codeaurora.org>
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
msm: cleanup and minor fixes for PFT driver

remove unused symlink hook.
free open-file-list on driver exit.
check return value of pft_add_file().

Signed-off-by: Amir Samuelov <amirs@codeaurora.org>
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
platform: msm: fix PFT when using direct-io

When we read/write a file using dircet-io (O_DIRECT),
we can't get the inode from a bio by walking the path
bio->bi_io_vec->bv_page->mapping->host
since the page is anonymous and not mapped.
On the other more typical cases when not using O_DIRECT,
the page cache is used and the bv_page is available.

Signed-off-by: Amir Samuelov <amirs@codeaurora.org>
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
security: selinux: Add Per-File-Encryption hooks

Add hooks for tagging/detecting Per-File-Encryption files.

Signed-off-by: Amir Samuelov <amirs@codeaurora.org>
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
defconfig: msm8974: Enable Per-File-Tagger driver

Add Per-File-Tagger (PFT) to allow Per-File-Encryption (PFE)
for msm8974 target.

Signed-off-by: Amir Samuelov <amirs@codeaurora.org>
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
cpufreq: interactive: Revert timer start modification

commit f3944527f57acde3162f8daeaffc4b11323a670f
(cpufreq: Sync on thread migration optimizations)
introduced a change to cpufreq_interactive_timer_start() in order
to reschedule the timer differently based on whether min or max
is changed. A better way is to reschedule the timer only when
necessary.

Revert timer start modification in preparation for the final fix.

Signed-off-by: Junjie Wu <junjiew@codeaurora.org>
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
cpufreq: interactive: restructure CPUFREQ_GOV_LIMITS

The cpufreq_interactive_timer gets cancelled and rescheduled
whenever the cpufreq_policy is changed. When the cpufreq policy is
changed at a rate faster than the sampling_rate of the interactive
governor, then the governor misses to change the target frequency
for long duration. The patch removes the need of cancelling the
timers when policy->min is changed.

Signed-off-by: Badhri Jagan Sridharan <Badhri@google.com>
Signed-off-by: Junjie Wu <junjiew@codeaurora.org>
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
msm: kgsl: Return HI offset from kgsl_perfcounter_get

Previously, kgsl_perfcounter_get only returned the offset
of the LO perf counter register. This assumed that the HI
register would always be adjacent to the LO register. With
VBIF 2.0, this assumption has now been broken, so both the
HI and LO register offsets must be returned.

Conflicts:

        drivers/gpu/msm/a4xx_reg.h
        drivers/gpu/msm/adreno_a3xx.c
        drivers/gpu/msm/adreno_a4xx.c
        include/uapi/linux/msm_kgsl.h

CRs-fixed: 578771
Change-Id: Ie74da5d797e58a143b89a61aba7ebaf1ed42ed5e
Signed-off-by: Kevin Matlage <kmatlage@codeaurora.org>
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
msm: kgsl: Add hang interrupt and change HW fault generation

Add a sysfs property to dynamically control HW hang interrupt.
HW fault is generated for hang interrupt only.

Change-Id: Ib50c57476e54cccfef0ae18a0cbb42fce29457c1
Signed-off-by: Shubhraprakash Das <sadas@codeaurora.org>
Signed-off-by: Tarun Karra <tkarra@codeaurora.org>
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
msm: kgsl: Increase the timeout value for fault detection

Increment the timeout value for detecting faults from 50ms to
200ms. The fault detection mechanism is a backup to hardware
fault detection. 50ms is small since it has been observed that
this mechanism triggers false positives with 50ms.

CRs-Fixed: 630776
Change-Id: I8f382051e06bdc47f152309a2868092e1980604e
Signed-off-by: Shubhraprakash Das <sadas@codeaurora.org>
Signed-off-by: Tarun Karra <tkarra@codeaurora.org>
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
msm: kgsl: Enable hang interrupt by setting right bits for A330V2

A330V2 hang interrupt bit is at a different location compared to
other A3XX cores. Set the right hang interrupt bit for A330V2.

Change-Id: I702f1653ed31907a708b19c7b2288644e2d45220
Signed-off-by: Shubhraprakash Das <sadas@codeaurora.org>
Signed-off-by: Tarun Karra <tkarra@codeaurora.org>
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
msm: kgsl: Enable hang interrupt for a330v2

Enable hang interrupt for a330v2 by default during
GPU initialization.

Signed-off-by: Tarun Karra <tkarra@codeaurora.org>
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
msm: camera: sensor: remove unnecessary logs

Use CDBG instead of pr_err for non-error logs.

Signed-off-by: Xu Han <hanxu@codeaurora.org>
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
msm: kgsl: Fix derp

Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
defconfig: Enable PFT

Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>