From patchwork Sat Sep 30 06:22:05 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alim Akhtar X-Patchwork-Id: 9979195 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id D59E660375 for ; Sat, 30 Sep 2017 06:30:42 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D0DFE29759 for ; Sat, 30 Sep 2017 06:30:42 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C58FE29714; Sat, 30 Sep 2017 06:30:42 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=unavailable version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5F17729714 for ; Sat, 30 Sep 2017 06:30:42 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751375AbdI3GaD (ORCPT ); Sat, 30 Sep 2017 02:30:03 -0400 Received: from mailout2.samsung.com ([203.254.224.25]:31388 "EHLO mailout2.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751191AbdI3GaB (ORCPT ); Sat, 30 Sep 2017 02:30:01 -0400 Received: from epcas2p3.samsung.com (unknown [182.195.41.55]) by mailout2.samsung.com (KnoxPortal) with ESMTP id 20170930062958epoutp026f58c8fcdc8ad2297438c17495942db6~pD96K92bH0470704707epoutp02h; Sat, 30 Sep 2017 06:29:58 +0000 (GMT) Received: from epsmges2p3.samsung.com (unknown [182.195.42.71]) by epcas2p4.samsung.com (KnoxPortal) with ESMTP id 20170930062958epcas2p4c2b9a1f17729d0d89cf8041c295685dc~pD952HBmU0901409014epcas2p4r; Sat, 30 Sep 2017 06:29:58 +0000 (GMT) Received: from epcas2p2.samsung.com ( [182.195.41.54]) by epsmges2p3.samsung.com (Symantec Messaging Gateway) with SMTP id 8E.39.04372.6E93FC95; Sat, 30 Sep 2017 15:29:58 +0900 (KST) Received: from epsmgms2p2new.samsung.com (unknown [182.195.42.143]) by epcas2p3.samsung.com (KnoxPortal) with ESMTP id 20170930062957epcas2p3ccba5b5b7614eed0e63b7a8424531022~pD95I9SoB0693106931epcas2p3_; Sat, 30 Sep 2017 06:29:57 +0000 (GMT) X-AuditID: b6c32a47-499ff70000001114-d0-59cf39e6611d Received: from epmmp2 ( [203.254.227.17]) by epsmgms2p2new.samsung.com (Symantec Messaging Gateway) with SMTP id 84.A1.06856.5E93FC95; Sat, 30 Sep 2017 15:29:57 +0900 (KST) Received: from exypnos.sisodomain.com ([107.108.73.28]) by mmp2.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTPA id <0OX2005Y9Y1GV610@mmp2.samsung.com>; Sat, 30 Sep 2017 15:29:57 +0900 (KST) From: Alim Akhtar To: linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org Cc: vinholikatti@gmail.com, martin.petersen@oracle.com, subhashj@codeaurora.org, Bart.VanAssche@wdc.com Subject: [PATCH 2/3] scsi: ufs-qcom: Remove uses of UFS_BIT() macro Date: Sat, 30 Sep 2017 11:52:05 +0530 Message-id: <1506752526-27014-2-git-send-email-alim.akhtar@samsung.com> X-Mailer: git-send-email 2.7.4 In-reply-to: <1506752526-27014-1-git-send-email-alim.akhtar@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFlrNIsWRmVeSWpSXmKPExsWy7bCmme4zy/ORBr8WSFlc+vOF0eLyrjls Ft3Xd7BZLD/+j8nixuKdbBY7FlY5sHlc7utl8tg56y67x8ent1g8Pm+S82g/0M0Uw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+yjKBkWcBI8MqRsnUguLc 9NxiowKjvNRyveLE3OLSvHS95PzcTYzAsNl2WKt/B+PjJfGHGAU4GJV4eG94nYsUYk0sK67M PcQowcGsJMK7wex8pBBvSmJlVWpRfnxRaU5q8SFGaQ4WJXFe/vxjkUIC6YklqdmpqQWpRTBZ Jg5OqQbGTc8L9+ccquornbpts//q8xM3dqXJro66pVTq92zrvCVdV6z7Hxjd4JS70GOoKSN1 ZXlz/kbZYyfvBeVcS1olWrgreJbLL4GpZ3asU+o94WRm1xH2zO9VeMvZ/RLizT+PXme7z8YW +jDalPtx/BPvq2/NrrYaHV6/ULD2nMa8v+xrNsa+z/hbpcRSnJFoqMVcVJwIALBFx28XAgAA X-CMS-MailID: 20170930062957epcas2p3ccba5b5b7614eed0e63b7a8424531022 X-Msg-Generator: CA X-Sender-IP: 182.195.42.143 X-Local-Sender: =?UTF-8?B?7JWM66a8G1NTSVItRkRTIFNXG+yCvOyEseyghOyekBsuL1Nl?= =?UTF-8?B?bmlvciBDaGllZiBFbmdpbmVlcg==?= X-Global-Sender: =?UTF-8?B?QUxJTSBBS0hUQVIbU1NJUi1GRFMgU1cbU2Ftc3VuZyBFbGVj?= =?UTF-8?B?dHJvbmljcxsuL1NlbmlvciBDaGllZiBFbmdpbmVlcg==?= X-Sender-Code: =?UTF-8?B?QzEwG1NXQUhRG0MxMElEMDdJRDAxMDk5Nw==?= CMS-TYPE: 102P X-CMS-RootMailID: 20170930062957epcas2p3ccba5b5b7614eed0e63b7a8424531022 X-RootMTR: 20170930062957epcas2p3ccba5b5b7614eed0e63b7a8424531022 References: <1506752526-27014-1-git-send-email-alim.akhtar@samsung.com> Sender: linux-scsi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Use actaul bit position instead of UFS_BIT() macro. This patch also changes bit-17 to meaningful #define. This change is as per discussion here [1] [1] -> https://lkml.org/lkml/2017/8/28/786 Signed-off-by: Alim Akhtar Cc: Subhash Jadavani --- This patch is only complied tested, appreciate testing on actual h/w drivers/scsi/ufs/ufs-qcom.c | 4 ++-- drivers/scsi/ufs/ufs-qcom.h | 7 ++++--- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/drivers/scsi/ufs/ufs-qcom.c b/drivers/scsi/ufs/ufs-qcom.c index c87d770..6a548e7 100644 --- a/drivers/scsi/ufs/ufs-qcom.c +++ b/drivers/scsi/ufs/ufs-qcom.c @@ -1458,7 +1458,7 @@ static void ufs_qcom_print_hw_debug_reg_all(struct ufs_hba *hba, print_fn(hba, reg, 44, "UFS_UFS_DBG_RD_REG_OCSC ", priv); reg = ufshcd_readl(hba, REG_UFS_CFG1); - reg |= UFS_BIT(17); + reg |= UTP_DBG_RAMS_EN; ufshcd_writel(hba, reg, REG_UFS_CFG1); reg = ufs_qcom_get_debug_reg_offset(host, UFS_UFS_DBG_RD_EDTL_RAM); @@ -1471,7 +1471,7 @@ static void ufs_qcom_print_hw_debug_reg_all(struct ufs_hba *hba, print_fn(hba, reg, 64, "UFS_UFS_DBG_RD_PRDT_RAM ", priv); /* clear bit 17 - UTP_DBG_RAMS_EN */ - ufshcd_rmwl(hba, UFS_BIT(17), 0, REG_UFS_CFG1); + ufshcd_rmwl(hba, UTP_DBG_RAMS_EN, 0, REG_UFS_CFG1); reg = ufs_qcom_get_debug_reg_offset(host, UFS_DBG_RD_REG_UAWM); print_fn(hba, reg, 4, "UFS_DBG_RD_REG_UAWM ", priv); diff --git a/drivers/scsi/ufs/ufs-qcom.h b/drivers/scsi/ufs/ufs-qcom.h index 076f528..295f4be 100644 --- a/drivers/scsi/ufs/ufs-qcom.h +++ b/drivers/scsi/ufs/ufs-qcom.h @@ -92,7 +92,8 @@ enum { #define UFS_CNTLR_3_x_x_VEN_REGS_OFFSET(x) (0x400 + x) /* bit definitions for REG_UFS_CFG1 register */ -#define QUNIPRO_SEL UFS_BIT(0) +#define QUNIPRO_SEL 0x1 +#define UTP_DBG_RAMS_EN 0x20000 #define TEST_BUS_EN BIT(18) #define TEST_BUS_SEL GENMASK(22, 19) #define UFS_REG_TEST_BUS_EN BIT(30) @@ -213,13 +214,13 @@ struct ufs_qcom_host { * Note: By default this capability will be kept enabled if host * controller supports the QUniPro mode. */ - #define UFS_QCOM_CAP_QUNIPRO UFS_BIT(0) + #define UFS_QCOM_CAP_QUNIPRO 0x1 /* * Set this capability if host controller can retain the secure * configuration even after UFS controller core power collapse. */ - #define UFS_QCOM_CAP_RETAIN_SEC_CFG_AFTER_PWR_COLLAPSE UFS_BIT(1) + #define UFS_QCOM_CAP_RETAIN_SEC_CFG_AFTER_PWR_COLLAPSE 0x2 u32 caps; struct phy *generic_phy;