mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-08-24 01:41:39 +00:00
Revert "scsi: ufs: add queries retry mechanism"
This reverts commit 61e073590b
.
The patch introduced redundant query retries as we already had such
mechanism provided with _retry functions. Both ufshcd_read_desc and
ufshcd_read_unit_desc_param functions call ufshcd_query_descriptor_retry
wrapper.
Signed-off-by: Szymon Mielczarek <szymonx.mielczarek@intel.com>
Reviewed-by: Subhash Jadavani <subhashj@codeaurora.org>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
This commit is contained in:
parent
5765d180fd
commit
dbd34a61c3
1 changed files with 9 additions and 45 deletions
|
@ -3032,18 +3032,7 @@ static inline int ufshcd_read_power_desc(struct ufs_hba *hba,
|
||||||
u8 *buf,
|
u8 *buf,
|
||||||
u32 size)
|
u32 size)
|
||||||
{
|
{
|
||||||
int err = 0;
|
return ufshcd_read_desc(hba, QUERY_DESC_IDN_POWER, 0, buf, size);
|
||||||
int retries;
|
|
||||||
|
|
||||||
for (retries = QUERY_REQ_RETRIES; retries > 0; retries--) {
|
|
||||||
/* Read descriptor*/
|
|
||||||
err = ufshcd_read_desc(hba, QUERY_DESC_IDN_POWER, 0, buf, size);
|
|
||||||
if (!err)
|
|
||||||
break;
|
|
||||||
dev_dbg(hba->dev, "%s: error %d retrying\n", __func__, err);
|
|
||||||
}
|
|
||||||
|
|
||||||
return err;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static int ufshcd_read_device_desc(struct ufs_hba *hba, u8 *buf, u32 size)
|
static int ufshcd_read_device_desc(struct ufs_hba *hba, u8 *buf, u32 size)
|
||||||
|
@ -4201,24 +4190,16 @@ static void ufshcd_set_queue_depth(struct scsi_device *sdev)
|
||||||
{
|
{
|
||||||
int ret = 0;
|
int ret = 0;
|
||||||
u8 lun_qdepth;
|
u8 lun_qdepth;
|
||||||
int retries;
|
|
||||||
struct ufs_hba *hba;
|
struct ufs_hba *hba;
|
||||||
|
|
||||||
hba = shost_priv(sdev->host);
|
hba = shost_priv(sdev->host);
|
||||||
|
|
||||||
lun_qdepth = hba->nutrs;
|
lun_qdepth = hba->nutrs;
|
||||||
for (retries = QUERY_REQ_RETRIES; retries > 0; retries--) {
|
ret = ufshcd_read_unit_desc_param(hba,
|
||||||
/* Read descriptor*/
|
ufshcd_scsi_to_upiu_lun(sdev->lun),
|
||||||
ret = ufshcd_read_unit_desc_param(hba,
|
UNIT_DESC_PARAM_LU_Q_DEPTH,
|
||||||
ufshcd_scsi_to_upiu_lun(sdev->lun),
|
&lun_qdepth,
|
||||||
UNIT_DESC_PARAM_LU_Q_DEPTH,
|
sizeof(lun_qdepth));
|
||||||
&lun_qdepth,
|
|
||||||
sizeof(lun_qdepth));
|
|
||||||
if (!ret || ret == -ENOTSUPP)
|
|
||||||
break;
|
|
||||||
|
|
||||||
dev_dbg(hba->dev, "%s: error %d retrying\n", __func__, ret);
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Some WLUN doesn't support unit descriptor */
|
/* Some WLUN doesn't support unit descriptor */
|
||||||
if (ret == -EOPNOTSUPP)
|
if (ret == -EOPNOTSUPP)
|
||||||
|
@ -5891,24 +5872,6 @@ static u32 ufshcd_find_max_sup_active_icc_level(struct ufs_hba *hba,
|
||||||
return icc_level;
|
return icc_level;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int ufshcd_set_icc_levels_attr(struct ufs_hba *hba, u32 icc_level)
|
|
||||||
{
|
|
||||||
int ret = 0;
|
|
||||||
int retries;
|
|
||||||
|
|
||||||
for (retries = QUERY_REQ_RETRIES; retries > 0; retries--) {
|
|
||||||
/* write attribute */
|
|
||||||
ret = ufshcd_query_attr(hba, UPIU_QUERY_OPCODE_WRITE_ATTR,
|
|
||||||
QUERY_ATTR_IDN_ACTIVE_ICC_LVL, 0, 0, &icc_level);
|
|
||||||
if (!ret)
|
|
||||||
break;
|
|
||||||
|
|
||||||
dev_dbg(hba->dev, "%s: failed with error %d\n", __func__, ret);
|
|
||||||
}
|
|
||||||
|
|
||||||
return ret;
|
|
||||||
}
|
|
||||||
|
|
||||||
static void ufshcd_init_icc_levels(struct ufs_hba *hba)
|
static void ufshcd_init_icc_levels(struct ufs_hba *hba)
|
||||||
{
|
{
|
||||||
int ret;
|
int ret;
|
||||||
|
@ -5929,8 +5892,9 @@ static void ufshcd_init_icc_levels(struct ufs_hba *hba)
|
||||||
dev_dbg(hba->dev, "%s: setting icc_level 0x%x",
|
dev_dbg(hba->dev, "%s: setting icc_level 0x%x",
|
||||||
__func__, hba->init_prefetch_data.icc_level);
|
__func__, hba->init_prefetch_data.icc_level);
|
||||||
|
|
||||||
ret = ufshcd_set_icc_levels_attr(hba,
|
ret = ufshcd_query_attr_retry(hba, UPIU_QUERY_OPCODE_WRITE_ATTR,
|
||||||
hba->init_prefetch_data.icc_level);
|
QUERY_ATTR_IDN_ACTIVE_ICC_LVL, 0, 0,
|
||||||
|
&hba->init_prefetch_data.icc_level);
|
||||||
|
|
||||||
if (ret)
|
if (ret)
|
||||||
dev_err(hba->dev,
|
dev_err(hba->dev,
|
||||||
|
|
Loading…
Reference in a new issue