[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <BN8PR12MB3266F56D240A7BF0FC82B5B8D3AF0@BN8PR12MB3266.namprd12.prod.outlook.com>
Date: Mon, 27 Apr 2020 07:50:32 +0000
From: Jose Abreu <Jose.Abreu@...opsys.com>
To: Christoph Hellwig <hch@...radead.org>
CC: "linux-scsi@...r.kernel.org" <linux-scsi@...r.kernel.org>,
Joao Pinto <Joao.Pinto@...opsys.com>,
Joao Lima <Joao.Lima@...opsys.com>,
Alim Akhtar <alim.akhtar@...sung.com>,
Avri Altman <avri.altman@....com>,
"James E.J. Bottomley" <jejb@...ux.ibm.com>,
"Martin K. Petersen" <martin.petersen@...cle.com>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: RE: [PATCH 1/5] scsi: ufs: Allow UFS 3.0 as a valid version
From: Christoph Hellwig <hch@...radead.org>
Date: Apr/25/2020, 12:10:56 (UTC+00:00)
> On Fri, Apr 24, 2020 at 01:36:56PM +0200, Jose Abreu wrote:
> > Add a define for UFS version 3.0 and do not print an error message upon
> > probe when using this version.
>
> This doesn't really scale. Version checks only make sense for a minimum
> supported version. Rejecting newer versions is just a bad idea.
>
> > @@ -8441,7 +8441,8 @@ int ufshcd_init(struct ufs_hba *hba, void __iomem *mmio_base, unsigned int irq)
> > if ((hba->ufs_version != UFSHCI_VERSION_10) &&
> > (hba->ufs_version != UFSHCI_VERSION_11) &&
> > (hba->ufs_version != UFSHCI_VERSION_20) &&
> > - (hba->ufs_version != UFSHCI_VERSION_21))
> > + (hba->ufs_version != UFSHCI_VERSION_21) &&
> > + (hba->ufs_version != UFSHCI_VERSION_30))
>
> i.e. this should become
>
> if (hba->ufs_version < UFSHCI_VERSION_10)
>
> as an additional cleanup I think it makes more sense t use a UFSHCI_VER()
> macro similar to KERNEL_VERSION() or NVME_VS() instead of adding a new
> define for every version.
Yeah, unfortunately I don't think this can be done because of this:
enum {
UFSHCI_VERSION_10 = 0x00010000, /* 1.0 */
UFSHCI_VERSION_11 = 0x00010100, /* 1.1 */
UFSHCI_VERSION_20 = 0x00000200, /* 2.0 */
UFSHCI_VERSION_21 = 0x00000210, /* 2.1 */
};
So, version 1.0 and 1.1 have higher values of 2.0 and 2.1 in terms of
absolute value.
---
Thanks,
Jose Miguel Abreu
Powered by blists - more mailing lists