lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Date:   Mon, 7 Dec 2020 13:50:06 +0800
From:   Stanley Chu <stanley.chu@...iatek.com>
To:     <linux-scsi@...r.kernel.org>, <martin.petersen@...cle.com>,
        <avri.altman@....com>, <alim.akhtar@...sung.com>,
        <jejb@...ux.ibm.com>
CC:     <beanhuo@...ron.com>, <asutoshd@...eaurora.org>,
        <cang@...eaurora.org>, <matthias.bgg@...il.com>,
        <bvanassche@....org>, <linux-mediatek@...ts.infradead.org>,
        <linux-arm-kernel@...ts.infradead.org>,
        <linux-kernel@...r.kernel.org>, <kuohong.wang@...iatek.com>,
        <peter.wang@...iatek.com>, <chun-hung.wu@...iatek.com>,
        <andy.teng@...iatek.com>, <chaotian.jing@...iatek.com>,
        <cc.chou@...iatek.com>, <jiajie.hao@...iatek.com>,
        <alice.chao@...iatek.com>, Stanley Chu <stanley.chu@...iatek.com>
Subject: [PATCH] scsi: ufs: Enable WB flush during suspend only if WB is enabled

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@...iatek.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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ