From: Caleb Connolly <caleb@connolly.tech>
To: 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: scsi: ufshcd: use a macro for UFS versions
Date: Mon, 08 Mar 2021 00:58:16 +0000 [thread overview]
Message-ID: <20210308005739.1998483-1-caleb@connolly.tech> (raw)
When using a device with UFS > 2.1 the error "invalid UFS version" is
misleadingly printed in dmesg. There was a patch for this almost a year
ago to which this solution was suggested, lets avoid growing a list of
versions and just use a macro instead.
I've also dropped that check entirely as it seems to be more misleading
than useful, and hasn't been accurate for a long time.
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_VER(3, 0))
...
I've tested this on a device with UFS 3.0 and a device with UFS 2.1
however I don't own any older versions to test with.
Caleb
---
Caleb Connolly (3):
scsi: ufshcd: switch to a version macro
scsi: ufs: qcom: use UFSHCI_VER macro
scsi: ufshcd: remove version check
drivers/scsi/ufs/ufs-qcom.c | 4 +--
drivers/scsi/ufs/ufshcd.c | 65 ++++++++++++++++------------------------
drivers/scsi/ufs/ufshci.h | 16 +++++-----
3 files changed, 36 insertions(+), 49 deletions(-)
next reply other threads:[~2021-03-08 0:59 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-03-08 0:58 Caleb Connolly [this message]
2021-03-08 0:58 ` [PATCH 1/3] scsi: ufshcd: switch to a version macro Caleb Connolly
2021-03-08 8:00 ` Christoph Hellwig
2021-03-08 10:42 ` Caleb Connolly
2021-03-09 9:32 ` Christoph Hellwig
2021-03-08 0:58 ` [PATCH 2/3] scsi: ufs: qcom: use UFSHCI_VER macro Caleb Connolly
2021-03-08 0:59 ` [PATCH 3/3] scsi: ufshcd: remove version check Caleb Connolly
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=20210308005739.1998483-1-caleb@connolly.tech \
--to=caleb@connolly.tech \
--cc=alim.akhtar@samsung.com \
--cc=asutoshd@codeaurora.org \
--cc=avri.altman@wdc.com \
--cc=beanhuo@micron.com \
--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