All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Asutosh Das (asd)" <asutoshd@codeaurora.org>
To: Christoph Hellwig <hch@lst.de>, linux-scsi@vger.kernel.org
Cc: Alim Akhtar <alim.akhtar@samsung.com>, Avri Altman <avri.altman@wdc.com>
Subject: Re: [PATCH 2/2] ufshcd: use an enum for quirks
Date: Fri, 21 Feb 2020 10:18:55 -0800	[thread overview]
Message-ID: <7f2394fb-d1fc-830b-eab7-30650c92e87f@codeaurora.org> (raw)
In-Reply-To: <20200221140812.476338-3-hch@lst.de>

Hi Christoph

On 2/21/2020 6:08 AM, Christoph Hellwig wrote:
> Use an enum to specify the various quirks instead of #defines inside
> the structure definition.
> 
> Signed-off-by: Christoph Hellwig <hch@lst.de>
> ---
>   drivers/scsi/ufs/ufshcd.h | 82 ++++++++++++++++++++-------------------
>   1 file changed, 42 insertions(+), 40 deletions(-)
> 
> diff --git a/drivers/scsi/ufs/ufshcd.h b/drivers/scsi/ufs/ufshcd.h
> index 9c2b80f87b9f..f68b3cd2e465 100644
> --- a/drivers/scsi/ufs/ufshcd.h
> +++ b/drivers/scsi/ufs/ufshcd.h
> @@ -469,6 +469,48 @@ struct ufs_stats {
>   	struct ufs_err_reg_hist task_abort;
>   };
>   
> +enum ufshcd_quirks {
> +	/* Interrupt aggregation support is broken */
> +	UFSHCD_QUIRK_BROKEN_INTR_AGGR			= 1 << 0,
> +

How about using BIT() here?
> +	/*
> +	 * delay before each dme command is required as the unipro
> +	 * layer has shown instabilities
> +	 */
> +	UFSHCD_QUIRK_DELAY_BEFORE_DME_CMDS		= 1 << 1,
> +
> +	/*
> +	 * If UFS host controller is having issue in processing LCC (Line
> +	 * Control Command) coming from device then enable this quirk.
> +	 * When this quirk is enabled, host controller driver should disable
> +	 * the LCC transmission on UFS device (by clearing TX_LCC_ENABLE
> +	 * attribute of device to 0).
> +	 */
> +	UFSHCD_QUIRK_BROKEN_LCC				= 1 << 2,
> +
> +	/*
> +	 * The attribute PA_RXHSUNTERMCAP specifies whether or not the
> +	 * inbound Link supports unterminated line in HS mode. Setting this
> +	 * attribute to 1 fixes moving to HS gear.
> +	 */
> +	UFSHCD_QUIRK_BROKEN_PA_RXHSUNTERMCAP		= 1 << 3,
> +
> +	/*
> +	 * This quirk needs to be enabled if the host contoller only allows
> +	 * accessing the peer dme attributes in AUTO mode (FAST AUTO or
> +	 * SLOW AUTO).
> +	 */
> +	UFSHCD_QUIRK_DME_PEER_ACCESS_AUTO_MODE		= 1 << 4,
> +
> +	/*
> +	 * This quirk needs to be enabled if the host contoller doesn't
> +	 * advertise the correct version in UFS_VER register. If this quirk
> +	 * is enabled, standard UFS host driver will call the vendor specific
> +	 * ops (get_ufs_hci_version) to get the correct version.
> +	 */
> +	UFSHCD_QUIRK_BROKEN_UFS_HCI_VERSION		= 1 << 5,
> +};
> +
>   /**
>    * struct ufs_hba - per adapter private structure
>    * @mmio_base: UFSHCI base register address
> @@ -572,46 +614,6 @@ struct ufs_hba {
>   	bool is_irq_enabled;
>   	enum ufs_ref_clk_freq dev_ref_clk_freq;
>   
> -	/* Interrupt aggregation support is broken */
> -	#define UFSHCD_QUIRK_BROKEN_INTR_AGGR			0x1
> -
> -	/*
> -	 * delay before each dme command is required as the unipro
> -	 * layer has shown instabilities
> -	 */
> -	#define UFSHCD_QUIRK_DELAY_BEFORE_DME_CMDS		0x2
> -
> -	/*
> -	 * If UFS host controller is having issue in processing LCC (Line
> -	 * Control Command) coming from device then enable this quirk.
> -	 * When this quirk is enabled, host controller driver should disable
> -	 * the LCC transmission on UFS device (by clearing TX_LCC_ENABLE
> -	 * attribute of device to 0).
> -	 */
> -	#define UFSHCD_QUIRK_BROKEN_LCC				0x4
> -
> -	/*
> -	 * The attribute PA_RXHSUNTERMCAP specifies whether or not the
> -	 * inbound Link supports unterminated line in HS mode. Setting this
> -	 * attribute to 1 fixes moving to HS gear.
> -	 */
> -	#define UFSHCD_QUIRK_BROKEN_PA_RXHSUNTERMCAP		0x8
> -
> -	/*
> -	 * This quirk needs to be enabled if the host contoller only allows
> -	 * accessing the peer dme attributes in AUTO mode (FAST AUTO or
> -	 * SLOW AUTO).
> -	 */
> -	#define UFSHCD_QUIRK_DME_PEER_ACCESS_AUTO_MODE		0x10
> -
> -	/*
> -	 * This quirk needs to be enabled if the host contoller doesn't
> -	 * advertise the correct version in UFS_VER register. If this quirk
> -	 * is enabled, standard UFS host driver will call the vendor specific
> -	 * ops (get_ufs_hci_version) to get the correct version.
> -	 */
> -	#define UFSHCD_QUIRK_BROKEN_UFS_HCI_VERSION		0x20
> -
>   	unsigned int quirks;	/* Deviations from standard UFSHCI spec. */
>   
>   	/* Device deviations from standard UFS device spec. */
> 

-asd

-- 
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
Linux Foundation Collaborative Project

  reply	other threads:[~2020-02-21 18:19 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-02-21 14:08 ufshcd quirk cleanup v2 Christoph Hellwig
2020-02-21 14:08 ` [PATCH 1/2] ufshcd: remove unused quirks Christoph Hellwig
2020-02-22  2:46   ` Bart Van Assche
2020-02-22  3:05   ` Alim Akhtar
2020-02-22 12:55     ` Avri Altman
2020-02-21 14:08 ` [PATCH 2/2] ufshcd: use an enum for quirks Christoph Hellwig
2020-02-21 18:18   ` Asutosh Das (asd) [this message]
2020-02-22  2:45     ` Bart Van Assche
2020-02-24 17:16       ` Christoph Hellwig
2020-02-22  2:46   ` Bart Van Assche
2020-02-29  1:37 ` ufshcd quirk cleanup v2 Martin K. Petersen
  -- strict thread matches above, loose matches on Subject: below --
2020-02-18 23:44 ufshcd quirk cleanup Christoph Hellwig
2020-02-18 23:44 ` [PATCH 2/2] ufshcd: use an enum for quirks Christoph Hellwig
2020-02-19  0:10   ` Bart Van Assche
2020-02-20 17:25     ` Christoph Hellwig

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=7f2394fb-d1fc-830b-eab7-30650c92e87f@codeaurora.org \
    --to=asutoshd@codeaurora.org \
    --cc=alim.akhtar@samsung.com \
    --cc=avri.altman@wdc.com \
    --cc=hch@lst.de \
    --cc=linux-scsi@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.