Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp2160808pxu; Sun, 6 Dec 2020 21:53:46 -0800 (PST) X-Google-Smtp-Source: ABdhPJx+r1xPon3ErSxeElxL4jTD4JIIKC5Pnlneai4DWjAla73tDz59LtLfPcEyEPhAzK9QRWG1 X-Received: by 2002:a50:cdc8:: with SMTP id h8mr2850747edj.293.1607320426644; Sun, 06 Dec 2020 21:53:46 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1607320426; cv=none; d=google.com; s=arc-20160816; b=KB5cGMtHvfwthQbFxbVlI6MY3TDJYz1GhqmIMmQ/tDSCxyvd1OfqDP9JyIfRES8A4O PSx80DWWRp0BtFlHvwiy5u2ALH75B67bPLvJfd/eljpOfLWxRoXS0n4tBynbB/26DBUK 30Vy6vOvReJo4J+Xq9OihG8+S2S2KCyxgnRa/tdV3No378ieZpVxGYH4P0PesSPCpRMa hv7L3O67SQVDCaO5iRbqNltQ1h2GhsQjHcj9nLtkoDR+t2oc1mWKTMVuISGihSI0BinA AmMlNF3dfTF2WZjTPIvniZSkfojnCoEs9pFgE1ahyFFMfncnd+E9indZVrX/OpWH8ao4 /Asw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:message-id:date:subject:cc:to:from; bh=hBP0+fa+rNZu0BMBgGFGS56V5/Su2OdSwugkJvmcSVc=; b=PfNbDp5CzQZDRGXQ4vfIEbvE736jjV63RBqL4M8IiMAGiuIUe6vUKQmnmlVzOHc+l9 KiD+kDo8uD8tvQHSpGhnj96fT3H4E9Pjvobj4hlz31T4HtSXSNmKFB3rPuKUdaMFBvYQ 2r+Ic1CaVjDLhtGerZyvrLEVvN5epqpvOabwkWooJwiuI717QUxF5XunS1gLnf3PBche OQ7Ka7A8Fva+ujRGFD85+eP1HBUxFiPxzGZdzb7Op0/iSXtIlBpzVKe+n3gw8UGAL4W7 L5i2cnfEI/1FevsFzU9Ipi5VjWUpOwx+aaD0Hn6tgXsyuNcMJkB6P1d1D18L4QqlVLRw p11A== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=mediatek.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id v18si6756801edd.267.2020.12.06.21.53.24; Sun, 06 Dec 2020 21:53:46 -0800 (PST) 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=mediatek.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726052AbgLGFuv (ORCPT + 99 others); Mon, 7 Dec 2020 00:50:51 -0500 Received: from mailgw01.mediatek.com ([210.61.82.183]:60583 "EHLO mailgw01.mediatek.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1725799AbgLGFuv (ORCPT ); Mon, 7 Dec 2020 00:50:51 -0500 X-UUID: 9559639d0b5a4169aed1f4ad40a2a174-20201207 X-UUID: 9559639d0b5a4169aed1f4ad40a2a174-20201207 Received: from mtkcas11.mediatek.inc [(172.21.101.40)] by mailgw01.mediatek.com (envelope-from ) (Cellopoint E-mail Firewall v4.1.14 Build 0819 with TLSv1.2 ECDHE-RSA-AES256-SHA384 256/256) with ESMTP id 585174363; Mon, 07 Dec 2020 13:50:08 +0800 Received: from mtkcas11.mediatek.inc (172.21.101.40) by mtkmbs08n2.mediatek.inc (172.21.101.56) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Mon, 7 Dec 2020 13:50:05 +0800 Received: from mtksdccf07.mediatek.inc (172.21.84.99) by mtkcas11.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.0.1497.2 via Frontend Transport; Mon, 7 Dec 2020 13:50:05 +0800 From: Stanley Chu To: , , , , CC: , , , , , , , , , , , , , , , , Stanley Chu Subject: [PATCH] scsi: ufs: Enable WB flush during suspend only if WB is enabled Date: Mon, 7 Dec 2020 13:50:06 +0800 Message-ID: <20201207055006.24471-1-stanley.chu@mediatek.com> X-Mailer: git-send-email 2.18.0 MIME-Version: 1.0 Content-Type: text/plain X-TM-SNTS-SMTP: 7ECFD28C327FC532B2FC8FDB68299D886D91BB65601C989360DB1525EEFAE1122000:8 X-MTK: N Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- 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