From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.1 required=3.0 tests=DKIM_INVALID,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6AC28C10DCE for ; Thu, 12 Mar 2020 17:35:06 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 381B42067C for ; Thu, 12 Mar 2020 17:35:06 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=mg.codeaurora.org header.i=@mg.codeaurora.org header.b="TF21M2fs" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726508AbgCLRfF (ORCPT ); Thu, 12 Mar 2020 13:35:05 -0400 Received: from mail26.static.mailgun.info ([104.130.122.26]:50754 "EHLO mail26.static.mailgun.info" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726194AbgCLRfE (ORCPT ); Thu, 12 Mar 2020 13:35:04 -0400 DKIM-Signature: a=rsa-sha256; v=1; c=relaxed/relaxed; d=mg.codeaurora.org; q=dns/txt; s=smtp; t=1584034504; h=Content-Transfer-Encoding: Content-Type: In-Reply-To: MIME-Version: Date: Message-ID: From: References: Cc: To: Subject: Sender; bh=JqD3oxXgpm5gEOCIMzEhLs3L1rpyh7voYQV1LqU4Ak4=; b=TF21M2fss7zEvWhZdgLTNuedMSD1nd0ACM6vR6fsYC2wyYiTrm1i4K1ikQzSDytxj1efbd+v qlP8C9G9p6pAS04hbcQAYGT/0l1ntWNP4Mjn9miDU3Vig6jmMm3jP9UqP68jrvzJ9G4PvUbl fUS6m9gNhQcOmQqGZLoi/Gkc08I= X-Mailgun-Sending-Ip: 104.130.122.26 X-Mailgun-Sid: WyI0MWYwYSIsICJsaW51eC1rZXJuZWxAdmdlci5rZXJuZWwub3JnIiwgImJlOWU0YSJd Received: from smtp.codeaurora.org (ec2-35-166-182-171.us-west-2.compute.amazonaws.com [35.166.182.171]) by mxa.mailgun.org with ESMTP id 5e6a72c1.7f1ae47630a0-smtp-out-n02; Thu, 12 Mar 2020 17:34:57 -0000 (UTC) Received: by smtp.codeaurora.org (Postfix, from userid 1001) id A9DC0C43637; Thu, 12 Mar 2020 17:34:57 +0000 (UTC) Received: from [10.46.161.159] (i-global254.qualcomm.com [199.106.103.254]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: asutoshd) by smtp.codeaurora.org (Postfix) with ESMTPSA id A1C67C433CB; Thu, 12 Mar 2020 17:34:55 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org A1C67C433CB Authentication-Results: aws-us-west-2-caf-mail-1.web.codeaurora.org; dmarc=none (p=none dis=none) header.from=codeaurora.org Authentication-Results: aws-us-west-2-caf-mail-1.web.codeaurora.org; spf=none smtp.mailfrom=asutoshd@codeaurora.org Subject: Re: [PATCH v2 3/8] scsi: ufs: use an enum for host capabilities To: Stanley Chu , linux-scsi@vger.kernel.org, martin.petersen@oracle.com, avri.altman@wdc.com, alim.akhtar@samsung.com, jejb@linux.ibm.com Cc: beanhuo@micron.com, cang@codeaurora.org, matthias.bgg@gmail.com, bvanassche@acm.org, linux-mediatek@lists.infradead.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, kuohong.wang@mediatek.com, peter.wang@mediatek.com, chun-hung.wu@mediatek.com, andy.teng@mediatek.com References: <20200312110908.14895-1-stanley.chu@mediatek.com> <20200312110908.14895-4-stanley.chu@mediatek.com> From: "Asutosh Das (asd)" Message-ID: Date: Thu, 12 Mar 2020 10:34:55 -0700 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:68.0) Gecko/20100101 Thunderbird/68.5.0 MIME-Version: 1.0 In-Reply-To: <20200312110908.14895-4-stanley.chu@mediatek.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 3/12/2020 4:09 AM, Stanley Chu wrote: > Use an enum to specify the host capabilities instead of #defines inside the > structure definition. > > Signed-off-by: Stanley Chu > Reviewed-by: Can Guo > --- Reviewed-by: Asutosh Das > drivers/scsi/ufs/ufshcd.h | 65 ++++++++++++++++++++++----------------- > 1 file changed, 37 insertions(+), 28 deletions(-) > > diff --git a/drivers/scsi/ufs/ufshcd.h b/drivers/scsi/ufs/ufshcd.h > index 5cf79d2319a6..fec004cd8054 100644 > --- a/drivers/scsi/ufs/ufshcd.h > +++ b/drivers/scsi/ufs/ufshcd.h > @@ -501,6 +501,43 @@ enum ufshcd_quirks { > UFSHCD_QUIRK_BROKEN_UFS_HCI_VERSION = 1 << 5, > }; > > +enum ufshcd_caps { > + /* Allow dynamic clk gating */ > + UFSHCD_CAP_CLK_GATING = 1 << 0, > + > + /* Allow hiberb8 with clk gating */ > + UFSHCD_CAP_HIBERN8_WITH_CLK_GATING = 1 << 1, > + > + /* Allow dynamic clk scaling */ > + UFSHCD_CAP_CLK_SCALING = 1 << 2, > + > + /* Allow auto bkops to enabled during runtime suspend */ > + UFSHCD_CAP_AUTO_BKOPS_SUSPEND = 1 << 3, > + > + /* > + * This capability allows host controller driver to use the UFS HCI's > + * interrupt aggregation capability. > + * CAUTION: Enabling this might reduce overall UFS throughput. > + */ > + UFSHCD_CAP_INTR_AGGR = 1 << 4, > + > + /* > + * This capability allows the device auto-bkops to be always enabled > + * except during suspend (both runtime and suspend). > + * Enabling this capability means that device will always be allowed > + * to do background operation when it's active but it might degrade > + * the performance of ongoing read/write operations. > + */ > + UFSHCD_CAP_KEEP_AUTO_BKOPS_ENABLED_EXCEPT_SUSPEND = 1 << 5, > + > + /* > + * This capability allows host controller driver to automatically > + * enable runtime power management by itself instead of waiting > + * for userspace to control the power management. > + */ > + UFSHCD_CAP_RPM_AUTOSUSPEND = 1 << 6, > +}; > + > /** > * struct ufs_hba - per adapter private structure > * @mmio_base: UFSHCI base register address > @@ -653,34 +690,6 @@ struct ufs_hba { > struct ufs_clk_gating clk_gating; > /* Control to enable/disable host capabilities */ > u32 caps; > - /* Allow dynamic clk gating */ > -#define UFSHCD_CAP_CLK_GATING (1 << 0) > - /* Allow hiberb8 with clk gating */ > -#define UFSHCD_CAP_HIBERN8_WITH_CLK_GATING (1 << 1) > - /* Allow dynamic clk scaling */ > -#define UFSHCD_CAP_CLK_SCALING (1 << 2) > - /* Allow auto bkops to enabled during runtime suspend */ > -#define UFSHCD_CAP_AUTO_BKOPS_SUSPEND (1 << 3) > - /* > - * This capability allows host controller driver to use the UFS HCI's > - * interrupt aggregation capability. > - * CAUTION: Enabling this might reduce overall UFS throughput. > - */ > -#define UFSHCD_CAP_INTR_AGGR (1 << 4) > - /* > - * This capability allows the device auto-bkops to be always enabled > - * except during suspend (both runtime and suspend). > - * Enabling this capability means that device will always be allowed > - * to do background operation when it's active but it might degrade > - * the performance of ongoing read/write operations. > - */ > -#define UFSHCD_CAP_KEEP_AUTO_BKOPS_ENABLED_EXCEPT_SUSPEND (1 << 5) > - /* > - * This capability allows host controller driver to automatically > - * enable runtime power management by itself instead of waiting > - * for userspace to control the power management. > - */ > -#define UFSHCD_CAP_RPM_AUTOSUSPEND (1 << 6) > > struct devfreq *devfreq; > struct ufs_clk_scaling clk_scaling; > -- The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum, Linux Foundation Collaborative Project