Commit graph

24 commits

Author SHA1 Message Date
codeworkx
15f81a19b5 Merge tag 'LA.UM.7.4.r1-05300-8x98.0' into lineage-16.0
"LA.UM.7.4.r1-05300-8x98.0"

Change-Id: I8e27939efccb7d0bda0ac7c4e32afdf3c6d62507
2019-06-16 08:15:21 +02:00
Neeraj Soni
07c5f7c8c9 msm: ice: check for crypto engine availability
There can be many ice instances present in dtsi file but
not all of them will be initialized by storage driver.
Check if crypto instance is initialized before setting
it up for data encryption/decryption usage.

Change-Id: I7c9227007474052513b277dec5963a973781c524
Signed-off-by: Neeraj Soni <neersoni@codeaurora.org>
2019-04-08 12:15:48 -07:00
liochen
8148b9d900 Synchronize codes for OnePlus5 & 5T OxygenOS 9.0.0
kernel device tree source code for OnePlus 5 & 5T P device

Change-Id: I84f40e66833ea1ce30eb1d9a710d6e1529e9e637
2018-12-26 11:02:39 +08:00
Neeraj Soni
71a440a0c8 crypto: ice: Sanitize the ice device return address.
Even if ICE device is not found it is possible
for list device API to return non NULL pointer
which will pass all NULL checks in code. Ensure
to return proper address or NULL.

Change-Id: I1465614b86f1415376b2adffeec6e4da1a33ddd5
Signed-off-by: Neeraj Soni <neersoni@codeaurora.org>
2017-10-03 12:17:37 +05:30
Linux Build Service Account
a9009e8dd5 Merge "qcom: scm: update function return value and input parameter type" 2017-08-03 10:07:53 -07:00
Linux Build Service Account
e85a3cbb06 Merge "crypto: ice: Remove redundant checks" 2017-07-22 04:08:02 -07:00
Neeraj Soni
c1ab2e8a1a crypto: ice: Remove redundant checks
Check is implemented in required function as part of
new implementation.

Change-Id: I346cd27cb254abe7d9706f01a9b463750614245e
Signed-off-by: Neeraj Soni <neersoni@codeaurora.org>
2017-07-21 19:19:53 +05:30
Mohammed Khajapasha
18ae33111d qcom: scm: update function return value and input parameter type
Update the function return value and input scm_ret variable
type for restore secure configuration in scm_restore_sec_cfg() fn.
Adding scm_ret input variable for scm_get_feat_version() fn.  

Change-Id: Ideef914ded8dfdb4c780fd27d7273986eeb41f5c
Signed-off-by: Mohammed Khajapasha <mkhaja@codeaurora.org>
2017-07-19 14:22:44 +05:30
Linux Build Service Account
0c44f3c838 Merge "crypto: Change format specifier %p to %pK" 2017-07-06 12:32:05 -07:00
Linux Build Service Account
40f83efeab Merge "scsi: ufs: Unblock UFS while ICE HW configuration" 2017-06-29 11:34:46 -07:00
mohamed sunfeer
2ec173df69 crypto: Change format specifier %p to %pK
Format specifier %p can leak kernel addresses while not valuing the
kptr_restrict system settings. When kptr_restrict is set to (1), kernel
pointers printed using the %pK format specifier will be replaced with 0's

Change-Id: Iff8d82b12e958b938fc767bf3e8c3a3c8fc65c2a
Signed-off-by: mohamed sunfeer <msunfeer@codeaurora.org>
2017-06-29 15:13:34 +05:30
Neeraj Soni
2e4bedb43c scsi: ufs: Unblock UFS while ICE HW configuration
Blocking UFS requests while ICE HW is getting
configured is not required as block layer requeues
the requests anyway.

Change-Id: I5aacf772c93eb134a3e48c79b3fbdaefd8378581
Signed-off-by: Neeraj Soni <neersoni@codeaurora.org>
2017-06-20 18:06:19 +05:30
Neeraj Soni
adc03ee05b crypto: msm: Use appropriate logging function
Dynamic debug can be used to get the logs

Change-Id: I6510da111019022149190fd753a5da1cc816fffa
Signed-off-by: Neeraj Soni <neersoni@codeaurora.org>
2017-04-05 11:57:57 +05:30
AnilKumar Chimata
fee158d588 ice: Sent proper storage type for ICE configuration during reset
Read instance type from device tree node to know the storage type
for ICE configuration, which is used to program the corresponding
ICE register during ICE reset.

Change-Id: I0eb423fb84dc89115227abc7c5688df7ae9a4a3c
Signed-off-by: AnilKumar Chimata <anilc@codeaurora.org>
2017-02-14 20:50:16 +05:30
Andrey Markovytch
a1cd6239e4 ice: fix issue with losing ICE key configuration during reset
TZ is called to restore key configuration in case of UFS reset

Change-Id: Id434e7f9ec6befdce97f52fd350957b66adcb15f
Signed-off-by: Andrey Markovytch <andreym@codeaurora.org>
2017-02-08 04:35:20 -08:00
Brahmaji K
fb77e96735 crypto: ice: Fix NULL pointer exception in ice.
While enabling ICE setup and on error conditions, the regulator
is disabled. Before disabling the regulator, check if the
regulator is up and able to access the registers of regulator.

Change-Id: I94dd2b3e25444818f7bdf2f791f4fa9efaefce15
Signed-off-by: Brahmaji K <bkomma@codeaurora.org>
2017-02-02 12:56:34 +05:30
Andrey Markovytch
ebd74eee2d ice: fix security issue with validating error in pointer
get_ice_device_from_storage_type can return error pointer which is
not NULL in case of error, this was not checked, changes fixes this.

Change-Id: I7dd8a068454a7bd250189ff9467c685af449f81b
Signed-off-by: Andrey Markovytch <andreym@codeaurora.org>
2016-12-25 23:06:12 -08:00
Andrey Markovytch
32d2461585 ice: added missing register dump in case of error for ICE 3.0
QCOM_ICE_INVALID_CCFG_ERR_STTS is now also dumped in case of error
for ICE 3.0

Change-Id: Ib7f522d0143f5131880c8c1badf4e64461810e72
Signed-off-by: Andrey Markovytch <andreym@codeaurora.org>
2016-08-11 03:13:58 -07:00
Andrey Markovytch
fe9cbb77bf crypto: ice: split the config callback
The requests configuration has to be split so clients can inform
ICE laeyr when the request is completed.
Rename the 'config' callback to 'config_start' and add
'config_end' callback.

Change-Id: Ife0b5b62805b827449a1bb1002348db445f03c60
Signed-off-by: Gilad Broner <gbroner@codeaurora.org>
Signed-off-by: Andrey Markovytch <andreym@codeaurora.org>
2016-04-25 17:45:49 -07:00
Andrey Markovytch
e29851c910 PFK: fix race between key set and key invalidate in TZ
When working with multiple files and multiple threads, the following
scenario can occur:
1. File Close -> Key cache removal -> context switch
2. Open new file -> occupy the entry cleaned in 1
   -> TZ_ES_SET_ICE_KEY -> context switch
3. Back to 1 -> TZ_ES_INVALIDATE_ICE_KEY
4. Back to 2 -> ICE uses the key that is already invalid
5. Crash due to PARTIALLY_SET_KEY_USED

To fix this, pfk must know when requests using some key are completed.
Only then key removal shall be allowed and until then key invalidation
must wait.
A new callback was added to let clients inform PFK when requests end.

Change-Id: Id7f8a3302fac9fafd1203d8d56ca13d59b45bbd5
Signed-off-by: Gilad Broner <gbroner@codeaurora.org>
Signed-off-by: Andrey Markovytch <andreym@codeaurora.org>
2016-04-25 17:45:36 -07:00
Andrey Markovytch
0fb5a0c53e crypto: ice: add stub bus scaling functions
Bus scaling might be disabled in the kernel configuration of
some platforms, in which case initialization will fail due
to the lack of bus scaling support.
Add stub functions to allow initialization without bus scaling.

Change-Id: Ib1edeac145ef1696e657f775cd938839b79dbac0
Signed-off-by: Gilad Broner <gbroner@codeaurora.org>
Signed-off-by: Andrey Markovytch <andreym@codeaurora.org>
2016-04-25 17:45:12 -07:00
Andrey Markovytch
07d9b132b4 crypto: ice: update ICE HCI v3
ICE HCI has been updated to v3 so some registers and sequences
were changed. Update the driver to reflect the updated HCI.

Change-Id: I59ba98d86bf0532a7e4c2cfa03d65e57e6a7fdcf
Signed-off-by: Gilad Broner <gbroner@codeaurora.org>
Signed-off-by: Andrey Markovytch <andreym@codeaurora.org>
2016-04-25 17:45:01 -07:00
Andrey Markovytch
b4f695428f crypto: ice: general driver clean-up
* Removed spinlock as it was not locking against anything
* Removed conversion of interrupt status to error number
  as it is not used by API client, and in case several bits are
  set only 1 error is ever handled and the rest get lost.
  Instead pass to the client the complete status.
* Removed redundant includes, variables
* vops structure is returned after performing a lookup in the DTS.
  There's no need for that as we already know the structure
  to return.
* Other minor corrections

Change-Id: I6d2549ce04c9e4b19fdd8fe3dfee03d83bfd9d77
Signed-off-by: Gilad Broner <gbroner@codeaurora.org>
Signed-off-by: Andrey Markovytch <andreym@codeaurora.org>
2016-04-22 11:57:42 -07:00
Gilad Broner
ce93b221ca crypto: msm: add inline crypto engine (ICE) driver snapshot
This snapshot is taken as of msm-3.18 commit e70ad0c ("Promotion of kernel.lnx.3.18-151201")

Signed-off-by: Gilad Broner <gbroner@codeaurora.org>
2016-03-23 21:24:13 -07:00