[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <3e88725f-166d-114b-506d-17a41c2a5c72@intel.com>
Date: Thu, 15 Apr 2021 12:21:52 +0300
From: Adrian Hunter <adrian.hunter@...el.com>
To: Asutosh Das <asutoshd@...eaurora.org>, cang@...eaurora.org,
martin.petersen@...cle.com, linux-scsi@...r.kernel.org
Cc: linux-arm-msm@...r.kernel.org,
Alim Akhtar <alim.akhtar@...sung.com>,
Avri Altman <avri.altman@....com>,
"James E.J. Bottomley" <jejb@...ux.ibm.com>,
Stanley Chu <stanley.chu@...iatek.com>,
Bean Huo <beanhuo@...ron.com>, Yue Hu <huyue2@...ong.com>,
open list <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH v18 2/2] ufs: sysfs: Resume the proper scsi device
On 14/04/21 9:58 pm, Asutosh Das wrote:
> Resumes the actual scsi device the unit descriptor of which
> is being accessed instead of the hba alone.
>
> Reviewed-by: Can Guo <cang@...eaurora.org>
> Signed-off-by: Asutosh Das <asutoshd@...eaurora.org>
Reviewed-by: Adrian Hunter <adrian.hunter@...el.com>
> ---
> drivers/scsi/ufs/ufs-sysfs.c | 24 ++++++++++++------------
> 1 file changed, 12 insertions(+), 12 deletions(-)
>
> diff --git a/drivers/scsi/ufs/ufs-sysfs.c b/drivers/scsi/ufs/ufs-sysfs.c
> index d7c3cff..4d9d4d8 100644
> --- a/drivers/scsi/ufs/ufs-sysfs.c
> +++ b/drivers/scsi/ufs/ufs-sysfs.c
> @@ -245,9 +245,9 @@ static ssize_t wb_on_store(struct device *dev, struct device_attribute *attr,
> goto out;
> }
>
> - pm_runtime_get_sync(hba->dev);
> + ufshcd_rpm_get_sync(hba);
> res = ufshcd_wb_toggle(hba, wb_enable);
> - pm_runtime_put_sync(hba->dev);
> + ufshcd_rpm_put_sync(hba);
> out:
> up(&hba->host_sem);
> return res < 0 ? res : count;
> @@ -297,10 +297,10 @@ static ssize_t ufs_sysfs_read_desc_param(struct ufs_hba *hba,
> goto out;
> }
>
> - pm_runtime_get_sync(hba->dev);
> + ufshcd_rpm_get_sync(hba);
> ret = ufshcd_read_desc_param(hba, desc_id, desc_index,
> param_offset, desc_buf, param_size);
> - pm_runtime_put_sync(hba->dev);
> + ufshcd_rpm_put_sync(hba);
> if (ret) {
> ret = -EINVAL;
> goto out;
> @@ -678,7 +678,7 @@ static ssize_t _name##_show(struct device *dev, \
> up(&hba->host_sem); \
> return -ENOMEM; \
> } \
> - pm_runtime_get_sync(hba->dev); \
> + ufshcd_rpm_get_sync(hba); \
> ret = ufshcd_query_descriptor_retry(hba, \
> UPIU_QUERY_OPCODE_READ_DESC, QUERY_DESC_IDN_DEVICE, \
> 0, 0, desc_buf, &desc_len); \
> @@ -695,7 +695,7 @@ static ssize_t _name##_show(struct device *dev, \
> goto out; \
> ret = sysfs_emit(buf, "%s\n", desc_buf); \
> out: \
> - pm_runtime_put_sync(hba->dev); \
> + ufshcd_rpm_put_sync(hba); \
> kfree(desc_buf); \
> up(&hba->host_sem); \
> return ret; \
> @@ -744,10 +744,10 @@ static ssize_t _name##_show(struct device *dev, \
> } \
> if (ufshcd_is_wb_flags(QUERY_FLAG_IDN##_uname)) \
> index = ufshcd_wb_get_query_index(hba); \
> - pm_runtime_get_sync(hba->dev); \
> + ufshcd_rpm_get_sync(hba); \
> ret = ufshcd_query_flag(hba, UPIU_QUERY_OPCODE_READ_FLAG, \
> QUERY_FLAG_IDN##_uname, index, &flag); \
> - pm_runtime_put_sync(hba->dev); \
> + ufshcd_rpm_put_sync(hba); \
> if (ret) { \
> ret = -EINVAL; \
> goto out; \
> @@ -813,10 +813,10 @@ static ssize_t _name##_show(struct device *dev, \
> } \
> if (ufshcd_is_wb_attrs(QUERY_ATTR_IDN##_uname)) \
> index = ufshcd_wb_get_query_index(hba); \
> - pm_runtime_get_sync(hba->dev); \
> + ufshcd_rpm_get_sync(hba); \
> ret = ufshcd_query_attr(hba, UPIU_QUERY_OPCODE_READ_ATTR, \
> QUERY_ATTR_IDN##_uname, index, 0, &value); \
> - pm_runtime_put_sync(hba->dev); \
> + ufshcd_rpm_put_sync(hba); \
> if (ret) { \
> ret = -EINVAL; \
> goto out; \
> @@ -964,10 +964,10 @@ static ssize_t dyn_cap_needed_attribute_show(struct device *dev,
> goto out;
> }
>
> - pm_runtime_get_sync(hba->dev);
> + ufshcd_rpm_get_sync(hba);
> ret = ufshcd_query_attr(hba, UPIU_QUERY_OPCODE_READ_ATTR,
> QUERY_ATTR_IDN_DYN_CAP_NEEDED, lun, 0, &value);
> - pm_runtime_put_sync(hba->dev);
> + ufshcd_rpm_put_sync(hba);
> if (ret) {
> ret = -EINVAL;
> goto out;
>
Powered by blists - more mailing lists