cpufreq: interactive: we're safe to use 250ms again.

Signed-off-by: franciscofranco <franciscofranco.1990@gmail.com>
Revert "arm/dt: hammerhead: set power down vbatt level to 3.05V"

This reverts commit 1422013e6c9cfb8c2bfab401151d335235f577ca.
Revert "power: max17048: power down if the battery voltage is too low"

This reverts commit 71692bddc8b1c9e99acb8321029132df310b961f.
msm: thermal: there's no need to ask for a policy, we can simply lift the limit with LONG_MAX. Also queue only on cpu0.

Signed-off-by: franciscofranco <franciscofranco.1990@gmail.com>
alarm: revert previous CAF alarm changes.

Signed-off-by: franciscofranco <franciscofranco.1990@gmail.com>
Request based dm-crypt

dm-crypt provides bios based device mapper module. dm-crypt
operates on packets with 512 bytes size which is not effiicent
way for HW based crypto blocks. dm-req-crypt is developed to
address this. dm-req-crypt works on requests which carry upto
512KB of data for unmerged requests.

Change-Id: I479230b2f0c1ab2e2a1ddb84947ebaf0629dff8c
Signed-off-by: Dinesh K Garg <dineshg@codeaurora.org>
Signed-off-by: franciscofranco <franciscofranco.1990@gmail.com>
dm: updating crypto algorithm used by dm-req-crypt

dm-req-crypt uses AES-XTS algorithm implemented by HW crypto
engine. Crypto driver renamed the aes-xts algorithm to avoid
conflict with SW based implementation of AES-XTS. dm-req-crypt
must use the new name for AES-XTS provided by crypto driver.

Change-Id: I286b6435af33fd64673c7c1af4bb2447f3115868
Signed-off-by: Dinesh K Garg <dineshg@codeaurora.org>
Signed-off-by: franciscofranco <franciscofranco.1990@gmail.com>
dm: Clean up dm-req-crypt

dm-req-crypt defines optional functions from device mapper. These
functions are not required for dm-req-crypt. dm-req-crypt has few
memory de-allocation issues. This change removes unnecessary
functions and fixes memory deallocation issues as well.

Change-Id: Id36bd13989940ce41571a8a10277730048df6f6d
Signed-off-by: Dinesh K Garg <dineshg@codeaurora.org>
Signed-off-by: franciscofranco <franciscofranco.1990@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.

Change-Id: I22d3f6ab1dd6f83b0d5b83a681236719e2340934
Signed-off-by: Dinesh K Garg <dineshg@codeaurora.org>
Signed-off-by: franciscofranco <franciscofranco.1990@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.

Change-Id: I727ef11e252649f895a5e3f8a49ca848cea50795
Signed-off-by: Amir Samuelov <amirs@codeaurora.org>
Signed-off-by: franciscofranco <franciscofranco.1990@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: franciscofranco <franciscofranco.1990@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: franciscofranco <franciscofranco.1990@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: franciscofranco <franciscofranco.1990@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().

Change-Id: Ida1e4351742ae62cafb2ffa49727f490709351e2
Signed-off-by: Amir Samuelov <amirs@codeaurora.org>
Signed-off-by: franciscofranco <franciscofranco.1990@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.

Change-Id: I349cad54a978ed9919f960d55f0f95c1e53262e5
Signed-off-by: Amir Samuelov <amirs@codeaurora.org>
Signed-off-by: franciscofranco <franciscofranco.1990@gmail.com>
security: selinux: Add Per-File-Encryption hooks

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

Change-Id: I9d1f791b68d3552b1a508c21ff8336182e8527fa
Signed-off-by: Amir Samuelov <amirs@codeaurora.org>
Signed-off-by: franciscofranco <franciscofranco.1990@gmail.com>
ARM: dts: msm: Remove bus active-only property from TSPP

TSPP HW blocks would use the PNOC bus independent
of the power collapse state of the CPU. Making bus vote
with active-only will cause the vote to be removed by
RPM when CPU gets into power collapse state.

CRs-Fixed: 546090
Change-Id: Ia3963f84f96eb96747867d28a8b09889de8ca22f
Signed-off-by: Hamad Kadmany <hkadmany@codeaurora.org>
Signed-off-by: franciscofranco <franciscofranco.1990@gmail.com>
crypto: msm: check NULL pointer in _qcrypto_setkey_des()

add NULL pointer check before des_ekey()

Change-Id: I57c40b82fc5141c1666c3fd493b43e962f0d1ae9
Signed-off-by: Zhen Kong <zkong@codeaurora.org>
Signed-off-by: franciscofranco <franciscofranco.1990@gmail.com>
crypto: msm: Add support for aead

Add support for aead mode algorithms (simultaneous auth
and cipher operations)

Change-Id: I22cc530f8fe822504649cb3c60030a729e1305c2
Signed-off-by: Mona Hossain <mhossain@codeaurora.org>
Signed-off-by: Hariprasad Dhalinarasimha <hnamgund@codeaurora.org>
Signed-off-by: franciscofranco <franciscofranco.1990@gmail.com>
crypto: msm: Fix Uninitialized flags

Due to uninitialized "flags" field in the request structure,
incorrect choices are made in the qce driver layer with
regards to setting crypto hardware registers.

Initializing the flags fixes this incorrect setting of the
registers.

Change-Id: Ic40319ea5e15e66cbafd28f727a9bcc6ea41b1ca
Signed-off-by: Mona Hossain <mhossain@codeaurora.org>
Signed-off-by: franciscofranco <franciscofranco.1990@gmail.com>