Revert "scsi: ufs: send request sense after the link reinitialization"
This reverts commit a08f72e5e1453acac1d3fd50a4ed314ea5ff643c. This commit was added to workaround the issue seen with particular UFS device vendor. As this issue is already fixed by UFS device vendor, we no longer needs this workaround hence reverting the original patch. Change-Id: Ib2fd45a893042053eee18fe93554e7b02c4732c6 Signed-off-by: Subhash Jadavani <subhashj@codeaurora.org>
This commit is contained in:
parent
a5711f5c0d
commit
9151d39f3a
1 changed files with 30 additions and 59 deletions
|
@ -1038,48 +1038,6 @@ static bool ufshcd_is_unipro_pa_params_tuning_req(struct ufs_hba *hba)
|
|||
return false;
|
||||
}
|
||||
|
||||
static int
|
||||
ufshcd_send_request_sense(struct ufs_hba *hba, struct scsi_device *sdp)
|
||||
{
|
||||
unsigned char cmd[6] = {REQUEST_SENSE,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
UFSHCD_REQ_SENSE_SIZE,
|
||||
0};
|
||||
char *buffer;
|
||||
int ret;
|
||||
|
||||
buffer = kzalloc(UFSHCD_REQ_SENSE_SIZE, GFP_KERNEL);
|
||||
if (!buffer) {
|
||||
ret = -ENOMEM;
|
||||
goto out;
|
||||
}
|
||||
|
||||
ret = scsi_execute_req_flags(sdp, cmd, DMA_FROM_DEVICE, buffer,
|
||||
UFSHCD_REQ_SENSE_SIZE, NULL,
|
||||
msecs_to_jiffies(1000), 3, NULL, REQ_PM);
|
||||
if (ret)
|
||||
pr_err("%s: failed with err %d\n", __func__, ret);
|
||||
|
||||
kfree(buffer);
|
||||
out:
|
||||
return ret;
|
||||
}
|
||||
|
||||
static int ufshcd_send_request_sense_all_lus(struct ufs_hba *hba)
|
||||
{
|
||||
struct scsi_device *sdev;
|
||||
|
||||
__shost_for_each_device(sdev, hba->host) {
|
||||
int ret = ufshcd_send_request_sense(hba, sdev);
|
||||
if (ret)
|
||||
return ret;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* ufshcd_set_clk_freq - set UFS controller clock frequencies
|
||||
* @hba: per adapter instance
|
||||
|
@ -5524,15 +5482,6 @@ skip_err_handling:
|
|||
out:
|
||||
spin_unlock_irqrestore(hba->host->host_lock, flags);
|
||||
scsi_unblock_requests(hba->host);
|
||||
if (!err && needs_reset)
|
||||
/*
|
||||
* Clear UNIT ATTENTION condition on all LUs.
|
||||
* ufshcd_send_request_sense_all_lus() sends "REQUEST SENSE"
|
||||
* SCSI command to each LUs, call this function only after
|
||||
* scsi requests are unblocked.
|
||||
*/
|
||||
ufshcd_send_request_sense_all_lus(hba);
|
||||
|
||||
ufshcd_release_all(hba);
|
||||
pm_runtime_put_sync(hba->dev);
|
||||
}
|
||||
|
@ -7422,6 +7371,35 @@ static void ufshcd_hba_exit(struct ufs_hba *hba)
|
|||
}
|
||||
}
|
||||
|
||||
static int
|
||||
ufshcd_send_request_sense(struct ufs_hba *hba, struct scsi_device *sdp)
|
||||
{
|
||||
unsigned char cmd[6] = {REQUEST_SENSE,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
UFSHCD_REQ_SENSE_SIZE,
|
||||
0};
|
||||
char *buffer;
|
||||
int ret;
|
||||
|
||||
buffer = kzalloc(UFSHCD_REQ_SENSE_SIZE, GFP_KERNEL);
|
||||
if (!buffer) {
|
||||
ret = -ENOMEM;
|
||||
goto out;
|
||||
}
|
||||
|
||||
ret = scsi_execute_req_flags(sdp, cmd, DMA_FROM_DEVICE, buffer,
|
||||
UFSHCD_REQ_SENSE_SIZE, NULL,
|
||||
msecs_to_jiffies(1000), 3, NULL, REQ_PM);
|
||||
if (ret)
|
||||
pr_err("%s: failed with err %d\n", __func__, ret);
|
||||
|
||||
kfree(buffer);
|
||||
out:
|
||||
return ret;
|
||||
}
|
||||
|
||||
/**
|
||||
* ufshcd_set_dev_pwr_mode - sends START STOP UNIT command to set device
|
||||
* power mode
|
||||
|
@ -7760,9 +7738,7 @@ set_link_active:
|
|||
ufshcd_set_link_active(hba);
|
||||
} else if (ufshcd_is_link_off(hba)) {
|
||||
ufshcd_update_error_stats(hba, UFS_ERR_VOPS_SUSPEND);
|
||||
if (!ufshcd_host_reset_and_restore(hba))
|
||||
/* Clear UNIT ATTENTION condition on all LUs */
|
||||
ufshcd_send_request_sense_all_lus(hba);
|
||||
ufshcd_host_reset_and_restore(hba);
|
||||
}
|
||||
set_dev_active:
|
||||
if (!ufshcd_set_dev_pwr_mode(hba, UFS_ACTIVE_PWR_MODE))
|
||||
|
@ -7845,11 +7821,6 @@ static int ufshcd_resume(struct ufs_hba *hba, enum ufs_pm_op pm_op)
|
|||
goto vendor_suspend;
|
||||
/* mark link state as hibern8 exited */
|
||||
hba->hibern8_on_idle.state = HIBERN8_EXITED;
|
||||
|
||||
/* Clear UNIT ATTENTION condition on all LUs */
|
||||
ret = ufshcd_send_request_sense_all_lus(hba);
|
||||
if (ret)
|
||||
goto set_old_link_state;
|
||||
}
|
||||
|
||||
if (!ufshcd_is_ufs_dev_active(hba)) {
|
||||
|
|
Loading…
Add table
Reference in a new issue