From: Can Guo <cang@codeaurora.org>
To: asutoshd@codeaurora.org, nguyenb@codeaurora.org,
hongwus@codeaurora.org, linux-scsi@vger.kernel.org,
kernel-team@android.com, cang@codeaurora.org
Cc: Alim Akhtar <alim.akhtar@samsung.com>,
Avri Altman <avri.altman@wdc.com>,
"James E.J. Bottomley" <jejb@linux.ibm.com>,
"Martin K. Petersen" <martin.petersen@oracle.com>,
Stanley Chu <stanley.chu@mediatek.com>,
Bean Huo <beanhuo@micron.com>, Jaegeuk Kim <jaegeuk@kernel.org>,
linux-kernel@vger.kernel.org (open list)
Subject: [PATCH v2 2/6] scsi: ufs: Update the return value of supplier pm ops
Date: Mon, 24 May 2021 01:47:21 -0700 [thread overview]
Message-ID: <1621846046-22204-3-git-send-email-cang@codeaurora.org> (raw)
In-Reply-To: <1621846046-22204-1-git-send-email-cang@codeaurora.org>
rpm_get_suppliers() is returning an error only if the error is negative.
However, ufshcd_wl_resume() may return a positive error code, e.g., when
hibern8 or SSU cmd fails. Make the positive return value a negative error
code so that consumers are aware of any resume failure from their supplier.
Make the same change to ufshcd_wl_suspend() just to keep symmetry.
Signed-off-by: Can Guo <cang@codeaurora.org>
---
drivers/scsi/ufs/ufshcd.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/scsi/ufs/ufshcd.c b/drivers/scsi/ufs/ufshcd.c
index 3836a0a..809d0cb 100644
--- a/drivers/scsi/ufs/ufshcd.c
+++ b/drivers/scsi/ufs/ufshcd.c
@@ -8912,7 +8912,7 @@ static int __ufshcd_wl_suspend(struct ufs_hba *hba, enum ufs_pm_op pm_op)
ufshcd_release(hba);
}
hba->wl_pm_op_in_progress = false;
- return ret;
+ return ret <= 0 ? ret : -EINVAL;
}
static int __ufshcd_wl_resume(struct ufs_hba *hba, enum ufs_pm_op pm_op)
@@ -8999,7 +8999,7 @@ static int __ufshcd_wl_resume(struct ufs_hba *hba, enum ufs_pm_op pm_op)
hba->clk_gating.is_suspended = false;
ufshcd_release(hba);
hba->wl_pm_op_in_progress = false;
- return ret;
+ return ret <= 0 ? ret : -EINVAL;
}
static int ufshcd_wl_runtime_suspend(struct device *dev)
--
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, a Linux Foundation Collaborative Project.
next prev parent reply other threads:[~2021-05-24 8:47 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-05-24 8:47 [PATCH v2 0/6] Complementary changes for error handling Can Guo
2021-05-24 8:47 ` [PATCH v2 1/6] scsi: ufs: Differentiate status between hba pm ops and wl pm ops Can Guo
2021-05-24 8:47 ` Can Guo [this message]
2021-05-24 8:47 ` [PATCH v2 3/6] scsi: ufs: Simplify error handling preparation Can Guo
2021-05-24 8:47 ` [PATCH v2 4/6] scsi: ufs: Update ufshcd_recover_pm_error() Can Guo
2021-05-24 8:47 ` [PATCH v2 5/6] scsi: ufs: Let host_sem cover the entire system suspend/resume Can Guo
2021-05-24 16:56 ` Bart Van Assche
2021-05-25 2:04 ` Can Guo
2021-05-24 8:47 ` [PATCH v2 6/6] scsi: ufs: Update the fast abort path in ufshcd_abort() for PM requests Can Guo
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1621846046-22204-3-git-send-email-cang@codeaurora.org \
--to=cang@codeaurora.org \
--cc=alim.akhtar@samsung.com \
--cc=asutoshd@codeaurora.org \
--cc=avri.altman@wdc.com \
--cc=beanhuo@micron.com \
--cc=hongwus@codeaurora.org \
--cc=jaegeuk@kernel.org \
--cc=jejb@linux.ibm.com \
--cc=kernel-team@android.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-scsi@vger.kernel.org \
--cc=martin.petersen@oracle.com \
--cc=nguyenb@codeaurora.org \
--cc=stanley.chu@mediatek.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox