Linux SCSI subsystem development
 help / color / mirror / Atom feed
From: Bean Huo <huobean@gmail.com>
To: Caleb Connolly <caleb@connolly.tech>
Cc: alim.akhtar@samsung.com, avri.altman@wdc.com, ejb@linux.ibm.com,
	martin.petersen@oracle.com, stanley.chu@mediatek.com,
	cang@codeaurora.org, beanhuo@micron.com, jaegeuk@kernel.org,
	asutoshd@codeaurora.org, linux-scsi@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: v3: scsi: ufshcd: use a macro for UFS versions
Date: Thu, 11 Mar 2021 09:19:45 +0100	[thread overview]
Message-ID: <3a5c555cb69ee24f56e986097ebf2a212dd017f8.camel@gmail.com> (raw)
In-Reply-To: <20210310153215.371227-1-caleb@connolly.tech>

On Wed, 2021-03-10 at 15:33 +0000, Caleb Connolly wrote:
> When using a device with UFS > 2.1 the error "invalid UFS version" is
> misleadingly printed. There was a patch for this almost a year
> ago to which this solution was suggested.
> 
> This series replaces the use of the growing UFSHCI_VERSION_xy macros
> with
> an inline function to encode a major and minor version into the
> scheme
> used on devices, that being:
> 
>         (major << 8) + (minor << 4)
> 
> I dealt with the different encoding used for UFS 1.x by converting it
> to match the newer versions in ufshcd_get_ufs_version(). That means
> it's
> possible to use comparisons for version checks, e.g.
> 
>         if (hba->ufs_version < ufshci_version(3, 0))
>                 ...
> 
> I've also dropped the "invalid UFS version" check entirely as it
> seems to
> be more misleading than useful, and hasn't been accurate for a long
> time.
> 
> This has been tested on a device with UFS 3.0 and a device with UFS
> 2.1,
> however I don't own any older devices to test with.
> 
>         Caleb
> ---
> Changes since v1:
>  * Switch from macro to static inline function
>  * Address Christoph's formatting comments
>  * Add Nitin's signoff on patch 3 ("scsi: ufshcd: remove version
> check")
> Resend:
>  * Fix patches 1/3 referencing the macro from v1
>    instead of the new inline function
> Changes since v2:
>  * Remove excessive parentheses from ufshci_version()
>  * Pick up Christoph's Reviewed-by
> 
> Caleb Connolly (3):
>       scsi: ufshcd: use a function to calculate versions
>       scsi: ufs: qcom: use ufshci_version function
>       scsi: ufshcd: remove version check
> 
>  drivers/scsi/ufs/ufs-qcom.c |  4 +--
>  drivers/scsi/ufs/ufshcd.c   | 66 ++++++++++++++++++-----------------
> ----------
>  drivers/scsi/ufs/ufshci.h   | 17 +++++++-----
>  3 files changed, 38 insertions(+), 49 deletions(-)
> 
> 
Thanks for your patch, good look to me.

Reviewed-by: Bean Huo <beanhuo@micron.com>


  parent reply	other threads:[~2021-03-11  8:20 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-10 15:33 v3: scsi: ufshcd: use a macro for UFS versions Caleb Connolly
2021-03-10 15:33 ` [PATCH v3 1/3] scsi: ufshcd: use a function to calculate versions Caleb Connolly
2021-03-10 16:34   ` Avri Altman
2021-03-10 17:06     ` Caleb Connolly
2021-03-11  7:35       ` Avri Altman
2021-03-10 15:33 ` [PATCH v3 2/3] scsi: ufs: qcom: use ufshci_version function Caleb Connolly
2021-03-10 15:34 ` [PATCH v3 3/3] scsi: ufshcd: remove version check Caleb Connolly
2021-03-11  8:19 ` Bean Huo [this message]
2021-03-17  3:21 ` v3: scsi: ufshcd: use a macro for UFS versions Martin K. Petersen
2021-03-19  3:46 ` Martin K. Petersen

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=3a5c555cb69ee24f56e986097ebf2a212dd017f8.camel@gmail.com \
    --to=huobean@gmail.com \
    --cc=alim.akhtar@samsung.com \
    --cc=asutoshd@codeaurora.org \
    --cc=avri.altman@wdc.com \
    --cc=beanhuo@micron.com \
    --cc=caleb@connolly.tech \
    --cc=cang@codeaurora.org \
    --cc=ejb@linux.ibm.com \
    --cc=jaegeuk@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-scsi@vger.kernel.org \
    --cc=martin.petersen@oracle.com \
    --cc=stanley.chu@mediatek.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox