Received: by 2002:a05:6a10:17d3:0:0:0:0 with SMTP id hz19csp653700pxb; Fri, 16 Apr 2021 14:57:12 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzV60W6igQUkkL/y6he0e9DSNfM4pKXP1/xPGkT6gKnWhgs7YhQ2TIA+6fU7mwJUpLF7eIP X-Received: by 2002:a17:90b:1948:: with SMTP id nk8mr9795456pjb.154.1618610232493; Fri, 16 Apr 2021 14:57:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1618610232; cv=none; d=google.com; s=arc-20160816; b=i7Xsszz9JcqDIEoeASu1N0tbpxIJrnbsoNyzblf+MpqMLiCSrIKc6W7Vym4fy+a9Hu f5fjKYCa5SoH8ggdqE1p8REgCqL0rkZ04ZYCVEBvmYKXQtJCWqEpCEMMTS7xFnZ0lWir lhS0VCQIfVK9sz6EXFXuBm4Z0S4RfVcOA6l/QK4h7qGkiQ0H5r0JXjsZ/PgR9lyvFYQR uCuSiwLR8A4OzP4EnZg4gTyy3VFyKT7ZwVnOhYlzl4TAThcjEzmvgpB1TTMEPYsF+kaA eLh6Oueqe2hB6aNkbiWcFSpssrRG/o8Cc8MH72hA+w/RTbMP+TZfB6z9OA5IRyJgfLYu PU/A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:references:in-reply-to:references:in-reply-to :message-id:date:subject:cc:to:from:ironport-sdr; bh=GoMJSmuu2BpxKG32RVdAfj0Taib3c1II1YOvqidk/B4=; b=w718ILrvfw/ubHif70FB/8M/jIlbq+YoGnOfezZNBrN6DfOFcmpVM5c2bu8XBAUbqf AYfi9PLGZcOF4tf9Ae9RVVH9FhIRFkGbfBVDArwg5HZwSdz3NuLPpOkZwBG/JKDEpygQ IY/09eiUrSl2KVeolpM/n/mUuT6yDRSE2vAC0IW+TXe6GR4UpcGsA6nyM4v5Ok0CfEM7 BDrFVp5f1qLyXD7wcEM0F3DyX9kb//qy9914tirv7Q+0M6yosFvlt+al41NZSFVVK+8R EuEV1ZfIyLRYrOrXv2Aw7Dtv3jC/0pSwQbT6TqPNJhlQNS3FWqcL77CetqfEPPAflacK GZ8w== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id z16si7835091plo.14.2021.04.16.14.57.00; Fri, 16 Apr 2021 14:57:12 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S244262AbhDPTug (ORCPT + 99 others); Fri, 16 Apr 2021 15:50:36 -0400 Received: from labrats.qualcomm.com ([199.106.110.90]:59341 "EHLO labrats.qualcomm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S244238AbhDPTuf (ORCPT ); Fri, 16 Apr 2021 15:50:35 -0400 IronPort-SDR: /cmpk1Vf/uZWhxGsWJ/rslqkonax7N2zTytWGqtak4VGFoGVBXWomK6aNXxkPAcYjavX87zrJ7 nmJsuZKP8Gu7lXesmdEMrNhI5hspaENCUW+xsGQ9dKpeIivBpvhu3QwNQqNccFJcLcJhfJbdiN TtY1/+r1imVHGKmCth75Zp4+HtpLU4dZFVqaJ1EGCm8tAxMaG5PGivJFGUIPHg4RvQISaEPwvd Von6YJ/O7quBR9AvLL2EKhDluEEvS25fdcaBrei9IupKGEtOKoTQfE3zrapl7aR2s/bVkJfJ00 9No= X-IronPort-AV: E=Sophos;i="5.82,228,1613462400"; d="scan'208";a="29752531" Received: from unknown (HELO ironmsg03-sd.qualcomm.com) ([10.53.140.143]) by labrats.qualcomm.com with ESMTP; 16 Apr 2021 12:50:09 -0700 X-QCInternal: smtphost Received: from stor-presley.qualcomm.com ([192.168.140.85]) by ironmsg03-sd.qualcomm.com with ESMTP; 16 Apr 2021 12:50:02 -0700 Received: by stor-presley.qualcomm.com (Postfix, from userid 92687) id D9680213F9; Fri, 16 Apr 2021 12:50:01 -0700 (PDT) From: Asutosh Das To: cang@codeaurora.org, martin.petersen@oracle.com, adrian.hunter@intel.com, linux-scsi@vger.kernel.org Cc: Asutosh Das , linux-arm-msm@vger.kernel.org, Alim Akhtar , Avri Altman , "James E.J. Bottomley" , Stanley Chu , Bean Huo , linux-kernel@vger.kernel.org (open list) Subject: [PATCH v20 2/2] ufs: sysfs: Resume the proper scsi device Date: Fri, 16 Apr 2021 12:49:26 -0700 Message-Id: <5a179c73b613a8832b437ecff6f61bd20cf0368a.1618600985.git.asutoshd@codeaurora.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: References: In-Reply-To: References: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Resumes the actual scsi device the unit descriptor of which is being accessed instead of the hba alone. Reviewed-by: Adrian Hunter Reviewed-by: Can Guo Signed-off-by: Asutosh Das --- 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; -- Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, a Linux Foundation Collaborative Project.