public inbox for linux-arm-kernel@lists.infradead.org
 help / color / mirror / Atom feed
* [PATCH] scsi: ufs: Enable WB flush during suspend only if WB is enabled
@ 2020-12-07  5:50 Stanley Chu
  2020-12-07 10:59 ` Bean Huo
  0 siblings, 1 reply; 3+ messages in thread
From: Stanley Chu @ 2020-12-07  5:50 UTC (permalink / raw)
  To: linux-scsi, martin.petersen, avri.altman, alim.akhtar, jejb
  Cc: Stanley Chu, alice.chao, bvanassche, andy.teng, cc.chou,
	chun-hung.wu, kuohong.wang, linux-kernel, jiajie.hao, cang,
	linux-mediatek, peter.wang, matthias.bgg, beanhuo, chaotian.jing,
	linux-arm-kernel, asutoshd

WriteBootser flush during suspend is not necessary to be enabled if
WriteBooster feature is disabled. Simply adding a check to prevent
unexpected power drain.

Signed-off-by: Stanley Chu <stanley.chu@mediatek.com>
---
 drivers/scsi/ufs/ufshcd.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/scsi/ufs/ufshcd.c b/drivers/scsi/ufs/ufshcd.c
index 4879e87577e1..89fa8b9ac11d 100644
--- a/drivers/scsi/ufs/ufshcd.c
+++ b/drivers/scsi/ufs/ufshcd.c
@@ -5458,7 +5458,7 @@ static bool ufshcd_wb_need_flush(struct ufs_hba *hba)
 	u32 avail_buf;
 	u8 index;
 
-	if (!ufshcd_is_wb_allowed(hba))
+	if (!ufshcd_is_wb_allowed(hba) || !hba->wb_enabled)
 		return false;
 	/*
 	 * The ufs device needs the vcc to be ON to flush.
-- 
2.18.0
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2020-12-07 13:55 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-12-07  5:50 [PATCH] scsi: ufs: Enable WB flush during suspend only if WB is enabled Stanley Chu
2020-12-07 10:59 ` Bean Huo
2020-12-07 13:43   ` Stanley Chu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox