public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* scsi: ufshcd: use a macro for UFS versions
@ 2021-03-08  0:58 Caleb Connolly
  2021-03-08  0:58 ` [PATCH 1/3] scsi: ufshcd: switch to a version macro Caleb Connolly
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Caleb Connolly @ 2021-03-08  0:58 UTC (permalink / raw)
  To: caleb
  Cc: alim.akhtar, avri.altman, ejb, martin.petersen, stanley.chu, cang,
	beanhuo, jaegeuk, asutoshd, linux-scsi, linux-kernel

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(-)



^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2021-03-09  9:33 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-03-08  0:58 scsi: ufshcd: use a macro for UFS versions Caleb Connolly
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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox