Commit Graph

9 Commits

Author SHA1 Message Date
Elliot Berman
54bc0aa219 ANDROID: Guard hooks with their CONFIG_ options
ANDROID_VENDOR_HOOKS has implicit dependencies on the subsystems which
it hooks into whenever it directly uses an "internal" header for that
system. For instance, drivers/scsi/ufs/ufshcd.h doesn't compile unless
CONFIG_SCSI_UFSHCD is enabled:

  In file included from drivers/android/vendor_hooks.c:41:
  In file included from include/trace/hooks/ufshcd.h:21:
  include/../drivers/scsi/ufs/ufshcd.h:675:38: error: field has incomplete type 'struct devfreq_simple_ondemand_data'
          struct devfreq_simple_ondemand_data ondemand_data;
                                              ^
  include/../drivers/scsi/ufs/ufshcd.h:675:9: note: forward declaration of 'struct devfreq_simple_ondemand_data'
          struct devfreq_simple_ondemand_data ondemand_data;

To avoid these implicit dependencies, guard any "internal" header
includes with the respective CONFIG_ options when applicable. If the
CONFIG_ option is not enabled, then the forward-declared structs are
used. This is acceptable because those hooks would not have been called
anyway since the underlying subsytem wasn't enabled.

Fixes: commit 1590a0e8e1 ("ANDROID: GKI: include more type definitions in vendor hooks")
Bug: 240404657
Change-Id: I43d19136fdb1b534e80630067f5db92c379adc67
Signed-off-by: Elliot Berman <quic_eberman@quicinc.com>
(cherry picked from commit 573c7f061d)
2022-08-01 19:52:59 +00:00
Giuliano Procida
1590a0e8e1 ANDROID: GKI: include more type definitions in vendor hooks
The following types are now fully defined in ABI XML.

* `struct binder_transaction_data`
* `struct blk_mq_alloc_data`
* `struct media_link_desc`
* `struct packet_type`
* `struct printk_record`
* `struct printk_ringbuffer`

Bug: 233047575
Change-Id: Ib7a096c937cfa9facca89b8a26edd2f4b00416a1
Signed-off-by: Giuliano Procida <gprocida@google.com>
2022-06-23 18:21:44 +00:00
Konstantin Vyshetsky
e774e4eca6 ANDROID: scsi: ufs: add complete init vendor hook
Currently the core UFS driver does not have a vops to notify when the
device is operational. This commit introduces a hook, which serves to
notify device completing initialization and is ready to accept I/O.

This is required by the FIPS140-2 [1] self integrity test of inline
encryption engine, which must run whenever the host controller is reset.
The code requires sleeping while waiting for I/O to complete and allocating
some memory dynamically, which requires the vendor hook to be restricted.

[1] https://csrc.nist.gov/publications/detail/fips/140/2/final

Bug: 185809932
Signed-off-by: Konstantin Vyshetsky <vkon@google.com>
Change-Id: I6f476f9c2e2b50574d2898c3f1ef6b648d92df24
2021-10-04 18:26:03 +00:00
Eric Biggers
e2e063f507 ANDROID: scsi: ufs: add vendor hook to override key reprogramming
Some hardware has a way to restore all keyslots at once that is
significantly faster than restoring each keyslot individually, as is
done by blk_ksm_reprogram_all_keys().  Add a hook
"android_rvh_ufs_reprogram_all_keys" that allows overriding the
restoration of all keyslots after UFS reset.  This may sleep, so this
must be a "restricted" Android vendor hook rather than a regular one.

Note that currently this functionality can't be upstreamed, as support
for the hardware that needs it would need to be upstreamed first.

Bug: 162257402
Bug: 181905172
Change-Id: I0b25393a5131941f085892560e08a64e63cd1369
Signed-off-by: Eric Biggers <ebiggers@google.com>
2021-07-28 15:32:51 +00:00
Nitin Rawat
14dd90ab37 ANDROID: scsi: ufs: Add hook to influence the UFS clock scaling policy
Add a vendor hook in ufshcd_devfreq_target() to allow vendor modules to
influence the UFS clock scaling policy.

Bug: 192050146
Change-Id: Ice3e629e132460d240e07c2eba01307317d5aeca
Signed-off-by: Nitin Rawat <nitirawa@codeaurora.org>
Signed-off-by: Sahitya Tummala <stummala@codeaurora.org>
2021-07-02 19:33:14 +00:00
duwenchao
00185a421a ANDROID: vendor_hooks: Add hooks for ufs scheduler
Add hooks to support oem's ufs scheduler feature.

Bug: 183085044
Signed-off-by: duwenchao <duwenchao@xiaomi.com>
Change-Id: I09bf9cba33412c81e4da83292772c0e95cf32022
2021-03-18 18:26:18 +00:00
Jaegeuk Kim
4e98107b8c ANDROID: scsi: ufs: add hooks to track ufs commands
This adds some missing hooks for ufs commands, including request,
query, uic, task manager commands, and interrupt events for vendor.
Those can be used for vendor module to understand command history.

Bug: 172305874
Bug: 176940922
Signed-off-by: Jaegeuk Kim <jaegeuk@google.com>
Change-Id: Ie447860290f4fbc1e03ad8ae5f50bd02121756cb
2021-03-05 22:40:51 +00:00
Eric Biggers
1cfa4b71be ANDROID: scsi: ufs: replace fill_prdt with Android vendor hook
Like was done for the other non-upstream methods in
'struct ufs_hba_variant_ops', replace ->fill_prdt() with an Android
vendor hook.  This is considered to be better because it avoids any
conflicts with upstream changes to 'struct ufs_hba_variant_ops'.

Note that as a side effect of this change, fill_prdt is no longer
allowed to sleep.  That's fine for the only known use of this hook.

Bug: 162257402
Bug: 181359082
Change-Id: I8096932525c27b969193d769aff511a0114b35ad
Signed-off-by: Eric Biggers <ebiggers@google.com>
2021-03-04 23:20:39 +00:00
Jaegeuk Kim
0d213c5921 ANDROID: scsi: ufs: replace variants with android vendor hooks
This converts the existing android-specific hooks to official vendor hooks.
Per not-restricted hooks, vendor body should not enter into sleep mode by
mutex or similar.

Bug: 181359082
Signed-off-by: Jaegeuk Kim <jaegeuk@google.com>
Change-Id: Ic66077b3c42e63a5496a1d0c107bad8ae3601f3c
2021-03-01 14:41:44 -08:00