mirror of
https://github.com/torvalds/linux.git
synced 2026-06-07 05:55:44 +02:00
ANDROID: scsi: ufs: Allow prepare_command to return error code
Allow variant function "prepare_command" to return error code. This is useful for vendors to halt or retry command execution if needed. Signed-off-by: Stanley Chu <Stanley.Chu@mediatek.com> Bug: 172874931 Change-Id: Ibe327ab39b83644a1c5a29d821f01c08eb7ea6f1 Signed-off-by: Stanley Chu <stanley.chu@mediatek.com>
This commit is contained in:
parent
38945cac3d
commit
927f7e63fc
|
|
@ -2557,7 +2557,12 @@ static int ufshcd_queuecommand(struct Scsi_Host *host, struct scsi_cmnd *cmd)
|
|||
lrbp->lun = ufshcd_scsi_to_upiu_lun(cmd->device->lun);
|
||||
lrbp->intr_cmd = !ufshcd_is_intr_aggr_allowed(hba) ? true : false;
|
||||
|
||||
ufshcd_vops_prepare_command(hba, cmd->request, lrbp);
|
||||
err = ufshcd_vops_prepare_command(hba, cmd->request, lrbp);
|
||||
if (err) {
|
||||
lrbp->cmd = NULL;
|
||||
ufshcd_release(hba);
|
||||
goto out;
|
||||
}
|
||||
|
||||
ufshcd_prepare_lrbp_crypto(cmd->request, lrbp);
|
||||
|
||||
|
|
|
|||
|
|
@ -330,7 +330,7 @@ struct ufs_hba_variant_ops {
|
|||
const union ufs_crypto_cfg_entry *cfg, int slot);
|
||||
int (*fill_prdt)(struct ufs_hba *hba, struct ufshcd_lrb *lrbp,
|
||||
unsigned int segments);
|
||||
void (*prepare_command)(struct ufs_hba *hba,
|
||||
int (*prepare_command)(struct ufs_hba *hba,
|
||||
struct request *rq, struct ufshcd_lrb *lrbp);
|
||||
int (*update_sysfs)(struct ufs_hba *hba);
|
||||
void (*send_command)(struct ufs_hba *hba, struct ufshcd_lrb *lrbp);
|
||||
|
|
@ -1247,11 +1247,12 @@ static inline int ufshcd_vops_fill_prdt(struct ufs_hba *hba,
|
|||
return 0;
|
||||
}
|
||||
|
||||
static inline void ufshcd_vops_prepare_command(struct ufs_hba *hba,
|
||||
static inline int ufshcd_vops_prepare_command(struct ufs_hba *hba,
|
||||
struct request *rq, struct ufshcd_lrb *lrbp)
|
||||
{
|
||||
if (hba->vops && hba->vops->prepare_command)
|
||||
hba->vops->prepare_command(hba, rq, lrbp);
|
||||
return hba->vops->prepare_command(hba, rq, lrbp);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static inline int ufshcd_vops_update_sysfs(struct ufs_hba *hba)
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user