linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Avri Altman <avri.altman@wdc.com>
To: "James E . J . Bottomley" <jejb@linux.vnet.ibm.com>,
	"Martin K . Petersen" <martin.petersen@oracle.com>,
	linux-scsi@vger.kernel.org,
	Adrian Hunter <adrian.hunter@intel.com>
Cc: linux-kernel@vger.kernel.org, Avri Altman <avri.altman@wdc.com>,
	Alex Lemberg <alex.lemberg@wdc.com>
Subject: [PATCH] scsi: ufs: Check for bkops in runtime suspend
Date: Sun, 18 Apr 2021 10:21:50 +0300	[thread overview]
Message-ID: <20210418072150.3288-1-avri.altman@wdc.com> (raw)

The UFS driver allowed BKOPS and WB Flush operations to be completed on
Runtime suspend. Adding the DeepSleep support, this is no longer true:
the driver will ignore BKOPS and WB Flush states, and force a link state
transition to UIC_LINK_OFF_STATE.

Do not ignore BKOPS and WB Flush on runtme suspend flow.

fixes: fe1d4c2ebcae (scsi: ufs: Add DeepSleep feature)

Suggested-by: Alex Lemberg <alex.lemberg@wdc.com>
Signed-off-by: Avri Altman <avri.altman@wdc.com>
---
 drivers/scsi/ufs/ufshcd.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/scsi/ufs/ufshcd.c b/drivers/scsi/ufs/ufshcd.c
index 58d7f264c664..1a0cac670aba 100644
--- a/drivers/scsi/ufs/ufshcd.c
+++ b/drivers/scsi/ufs/ufshcd.c
@@ -8755,7 +8755,8 @@ static int ufshcd_suspend(struct ufs_hba *hba, enum ufs_pm_op pm_op)
 	 * In the case of DeepSleep, the device is expected to remain powered
 	 * with the link off, so do not check for bkops.
 	 */
-	check_for_bkops = !ufshcd_is_ufs_dev_deepsleep(hba);
+	check_for_bkops = !ufshcd_is_ufs_dev_deepsleep(hba) ||
+			  hba->dev_info.b_rpm_dev_flush_capable;
 	ret = ufshcd_link_state_transition(hba, req_link_state, check_for_bkops);
 	if (ret)
 		goto set_dev_active;
-- 
2.25.1


             reply	other threads:[~2021-04-18  7:22 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-18  7:21 Avri Altman [this message]
2021-04-18 17:51 ` [PATCH] scsi: ufs: Check for bkops in runtime suspend Adrian Hunter
2021-04-18 18:25   ` Avri Altman

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=20210418072150.3288-1-avri.altman@wdc.com \
    --to=avri.altman@wdc.com \
    --cc=adrian.hunter@intel.com \
    --cc=alex.lemberg@wdc.com \
    --cc=jejb@linux.vnet.ibm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-scsi@vger.kernel.org \
    --cc=martin.petersen@oracle.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;
as well as URLs for NNTP newsgroup(s).