mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-07 19:30:30 +09:00
ANDROID: scsi: ufs: Add suspend/resume SCSI command processing support
This functionality is needed by UFS drivers to e.g. suspend SCSI command processing while reprogramming encryption keys if the hardware does not support concurrent I/O and key reprogramming. Bug: 227177294 Change-Id: I10f11e67da81fae7063674838760903d2c178baf Signed-off-by: Bart Van Assche <bvanassche@google.com>
This commit is contained in:
committed by
Todd Kjos
parent
64293a57f1
commit
fae5207ecc
@@ -1700,6 +1700,26 @@ unblock_reqs:
|
|||||||
ufshcd_scsi_unblock_requests(hba);
|
ufshcd_scsi_unblock_requests(hba);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Block processing of new SCSI commands and wait until pending SCSI
|
||||||
|
* commands and TMFs have finished. ufshcd_exec_dev_cmd() and
|
||||||
|
* ufshcd_issue_devman_upiu_cmd() are not affected by this function.
|
||||||
|
*
|
||||||
|
* Return: 0 upon success; -EBUSY upon timeout.
|
||||||
|
*/
|
||||||
|
int ufshcd_freeze_scsi_devs(struct ufs_hba *hba, u64 timeout_us)
|
||||||
|
{
|
||||||
|
return ufshcd_clock_scaling_prepare(hba, timeout_us);
|
||||||
|
}
|
||||||
|
EXPORT_SYMBOL_GPL(ufshcd_freeze_scsi_devs);
|
||||||
|
|
||||||
|
/* Resume processing of SCSI commands. */
|
||||||
|
void ufshcd_unfreeze_scsi_devs(struct ufs_hba *hba)
|
||||||
|
{
|
||||||
|
ufshcd_clock_scaling_unprepare(hba, true);
|
||||||
|
}
|
||||||
|
EXPORT_SYMBOL_GPL(ufshcd_unfreeze_scsi_devs);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* ufshcd_hold - Enable clocks that were gated earlier due to ufshcd_release.
|
* ufshcd_hold - Enable clocks that were gated earlier due to ufshcd_release.
|
||||||
* Also, exit from hibern8 mode and set the link as active.
|
* Also, exit from hibern8 mode and set the link as active.
|
||||||
|
|||||||
@@ -1241,6 +1241,9 @@ int ufshcd_read_string_desc(struct ufs_hba *hba, u8 desc_index,
|
|||||||
int ufshcd_hold(struct ufs_hba *hba, bool async);
|
int ufshcd_hold(struct ufs_hba *hba, bool async);
|
||||||
void ufshcd_release(struct ufs_hba *hba);
|
void ufshcd_release(struct ufs_hba *hba);
|
||||||
|
|
||||||
|
int ufshcd_freeze_scsi_devs(struct ufs_hba *hba, u64 timeout_us);
|
||||||
|
void ufshcd_unfreeze_scsi_devs(struct ufs_hba *hba);
|
||||||
|
|
||||||
void ufshcd_map_desc_id_to_length(struct ufs_hba *hba, enum desc_idn desc_id,
|
void ufshcd_map_desc_id_to_length(struct ufs_hba *hba, enum desc_idn desc_id,
|
||||||
int *desc_length);
|
int *desc_length);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user