From patchwork Wed Apr 8 21:48:40 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Asutosh Das (asd)" X-Patchwork-Id: 11480979 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 2B022912 for ; Wed, 8 Apr 2020 21:49:30 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 118852074F for ; Wed, 8 Apr 2020 21:49:30 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726587AbgDHVt3 (ORCPT ); Wed, 8 Apr 2020 17:49:29 -0400 Received: from alexa-out-sd-02.qualcomm.com ([199.106.114.39]:44429 "EHLO alexa-out-sd-02.qualcomm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726582AbgDHVt3 (ORCPT ); Wed, 8 Apr 2020 17:49:29 -0400 Received: from unknown (HELO ironmsg-SD-alpha.qualcomm.com) ([10.53.140.30]) by alexa-out-sd-02.qualcomm.com with ESMTP; 08 Apr 2020 14:49:28 -0700 Received: from asutoshd-linux1.qualcomm.com ([10.46.160.39]) by ironmsg-SD-alpha.qualcomm.com with ESMTP; 08 Apr 2020 14:49:27 -0700 Received: by asutoshd-linux1.qualcomm.com (Postfix, from userid 92687) id E7B0C209D0; Wed, 8 Apr 2020 14:49:27 -0700 (PDT) From: Asutosh Das To: cang@codeaurora.org, martin.petersen@oracle.com, Avri.Altman@wdc.com, linux-scsi@vger.kernel.org Cc: Asutosh Das , linux-arm-msm@vger.kernel.org, Andy Gross , Bjorn Andersson , Alim Akhtar , Avri Altman , "James E.J. Bottomley" , linux-kernel@vger.kernel.org (open list) Subject: [PATCH v1 2/3] ufs-qcom: scsi: configure write booster type Date: Wed, 8 Apr 2020 14:48:40 -0700 Message-Id: <70ac879265780c0f68a18c4539c7bc9a838d93f6.1586382357.git.asutoshd@codeaurora.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: References: In-Reply-To: <3c186284280c37c76cf77bf482dde725359b8a8a.1586382357.git.asutoshd@codeaurora.org> References: <3c186284280c37c76cf77bf482dde725359b8a8a.1586382357.git.asutoshd@codeaurora.org> Sender: linux-arm-msm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org Configure the WriteBooster type to preserve user-space mode. This would ensure that no user-space capacity is reduced when write booster is enabled. Enable WB for Qualcomm platform. Signed-off-by: Asutosh Das --- drivers/scsi/ufs/ufs-qcom.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/drivers/scsi/ufs/ufs-qcom.c b/drivers/scsi/ufs/ufs-qcom.c index 19aa5c4..def1e09 100644 --- a/drivers/scsi/ufs/ufs-qcom.c +++ b/drivers/scsi/ufs/ufs-qcom.c @@ -1071,6 +1071,7 @@ static void ufs_qcom_set_caps(struct ufs_hba *hba) hba->caps |= UFSHCD_CAP_CLK_GATING | UFSHCD_CAP_HIBERN8_WITH_CLK_GATING; hba->caps |= UFSHCD_CAP_CLK_SCALING; hba->caps |= UFSHCD_CAP_AUTO_BKOPS_SUSPEND; + hba->caps |= UFSHCD_CAP_WB_EN; if (host->hw_ver.major >= 0x2) { host->caps = UFS_QCOM_CAP_QUNIPRO | @@ -1713,6 +1714,12 @@ static void ufs_qcom_config_scaling_param(struct ufs_hba *hba, } #endif +static u32 ufs_qcom_wb_get_user_cap_mode(struct ufs_hba *hba) +{ + /* QCom prefers no user-space reduction mode */ + return UFS_WB_BUFF_PRESERVE_USER_SPACE; +} + /** * struct ufs_hba_qcom_vops - UFS QCOM specific variant operations * @@ -1735,6 +1742,7 @@ static const struct ufs_hba_variant_ops ufs_hba_qcom_vops = { .dbg_register_dump = ufs_qcom_dump_dbg_regs, .device_reset = ufs_qcom_device_reset, .config_scaling_param = ufs_qcom_config_scaling_param, + .wb_get_user_cap_mode = ufs_qcom_wb_get_user_cap_mode, }; /**