All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2] nvme-pci: Move enumeration by class to be last in the table
@ 2020-08-18  8:35 Andy Shevchenko
  2020-09-14 15:33 ` Andy Shevchenko
  2020-09-14 19:37 ` Keith Busch
  0 siblings, 2 replies; 4+ messages in thread
From: Andy Shevchenko @ 2020-08-18  8:35 UTC (permalink / raw)
  To: Keith Busch, Jens Axboe, linux-nvme
  Cc: Benjamin Herrenschmidt, Andy Shevchenko, Christoph Hellwig,
	Chaitanya Kulkarni, Sagi Grimberg

It's unusual that we have enumeration by class in the middle of the table.
It might potentially be problematic in the future if we add another entry
after it.

So, move class matching entry to be the last in the ID table.

Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Reviewed-by: Chaitanya Kulkarni <chaitanya.kulkarni@wdc.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Sagi Grimberg <sagi@grimberg.me>
---
v2: appended tags and rebased on top of v5.9-rc1
 drivers/nvme/host/pci.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/nvme/host/pci.c b/drivers/nvme/host/pci.c
index ba725ae47305..95ea671e5c9e 100644
--- a/drivers/nvme/host/pci.c
+++ b/drivers/nvme/host/pci.c
@@ -3185,7 +3185,6 @@ static const struct pci_device_id nvme_id_table[] = {
 				NVME_QUIRK_IGNORE_DEV_SUBNQN, },
 	{ PCI_DEVICE(0x1c5c, 0x1504),   /* SK Hynix PC400 */
 		.driver_data = NVME_QUIRK_DISABLE_WRITE_ZEROES, },
-	{ PCI_DEVICE_CLASS(PCI_CLASS_STORAGE_EXPRESS, 0xffffff) },
 	{ PCI_DEVICE(PCI_VENDOR_ID_APPLE, 0x2001),
 		.driver_data = NVME_QUIRK_SINGLE_VECTOR },
 	{ PCI_DEVICE(PCI_VENDOR_ID_APPLE, 0x2003) },
@@ -3193,6 +3192,8 @@ static const struct pci_device_id nvme_id_table[] = {
 		.driver_data = NVME_QUIRK_SINGLE_VECTOR |
 				NVME_QUIRK_128_BYTES_SQES |
 				NVME_QUIRK_SHARED_TAGS },
+
+	{ PCI_DEVICE_CLASS(PCI_CLASS_STORAGE_EXPRESS, 0xffffff) },
 	{ 0, }
 };
 MODULE_DEVICE_TABLE(pci, nvme_id_table);
-- 
2.28.0


_______________________________________________
Linux-nvme mailing list
Linux-nvme@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-nvme

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

* Re: [PATCH v2] nvme-pci: Move enumeration by class to be last in the table
  2020-08-18  8:35 [PATCH v2] nvme-pci: Move enumeration by class to be last in the table Andy Shevchenko
@ 2020-09-14 15:33 ` Andy Shevchenko
  2020-09-15  5:50   ` Christoph Hellwig
  2020-09-14 19:37 ` Keith Busch
  1 sibling, 1 reply; 4+ messages in thread
From: Andy Shevchenko @ 2020-09-14 15:33 UTC (permalink / raw)
  To: Keith Busch, Jens Axboe, linux-nvme
  Cc: Benjamin Herrenschmidt, Christoph Hellwig, Chaitanya Kulkarni,
	Sagi Grimberg

On Tue, Aug 18, 2020 at 11:35:30AM +0300, Andy Shevchenko wrote:
> It's unusual that we have enumeration by class in the middle of the table.
> It might potentially be problematic in the future if we add another entry
> after it.
> 
> So, move class matching entry to be the last in the ID table.

Is it good enough?

> Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> Reviewed-by: Chaitanya Kulkarni <chaitanya.kulkarni@wdc.com>
> Reviewed-by: Christoph Hellwig <hch@lst.de>
> Reviewed-by: Sagi Grimberg <sagi@grimberg.me>
> ---
> v2: appended tags and rebased on top of v5.9-rc1
>  drivers/nvme/host/pci.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/nvme/host/pci.c b/drivers/nvme/host/pci.c
> index ba725ae47305..95ea671e5c9e 100644
> --- a/drivers/nvme/host/pci.c
> +++ b/drivers/nvme/host/pci.c
> @@ -3185,7 +3185,6 @@ static const struct pci_device_id nvme_id_table[] = {
>  				NVME_QUIRK_IGNORE_DEV_SUBNQN, },
>  	{ PCI_DEVICE(0x1c5c, 0x1504),   /* SK Hynix PC400 */
>  		.driver_data = NVME_QUIRK_DISABLE_WRITE_ZEROES, },
> -	{ PCI_DEVICE_CLASS(PCI_CLASS_STORAGE_EXPRESS, 0xffffff) },
>  	{ PCI_DEVICE(PCI_VENDOR_ID_APPLE, 0x2001),
>  		.driver_data = NVME_QUIRK_SINGLE_VECTOR },
>  	{ PCI_DEVICE(PCI_VENDOR_ID_APPLE, 0x2003) },
> @@ -3193,6 +3192,8 @@ static const struct pci_device_id nvme_id_table[] = {
>  		.driver_data = NVME_QUIRK_SINGLE_VECTOR |
>  				NVME_QUIRK_128_BYTES_SQES |
>  				NVME_QUIRK_SHARED_TAGS },
> +
> +	{ PCI_DEVICE_CLASS(PCI_CLASS_STORAGE_EXPRESS, 0xffffff) },
>  	{ 0, }
>  };
>  MODULE_DEVICE_TABLE(pci, nvme_id_table);
> -- 
> 2.28.0
> 

-- 
With Best Regards,
Andy Shevchenko



_______________________________________________
Linux-nvme mailing list
Linux-nvme@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-nvme

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

* Re: [PATCH v2] nvme-pci: Move enumeration by class to be last in the table
  2020-08-18  8:35 [PATCH v2] nvme-pci: Move enumeration by class to be last in the table Andy Shevchenko
  2020-09-14 15:33 ` Andy Shevchenko
@ 2020-09-14 19:37 ` Keith Busch
  1 sibling, 0 replies; 4+ messages in thread
From: Keith Busch @ 2020-09-14 19:37 UTC (permalink / raw)
  To: Andy Shevchenko
  Cc: Sagi Grimberg, Chaitanya Kulkarni, Benjamin Herrenschmidt,
	linux-nvme, Jens Axboe, Christoph Hellwig

On Tue, Aug 18, 2020 at 11:35:30AM +0300, Andy Shevchenko wrote:
> It's unusual that we have enumeration by class in the middle of the table.
> It might potentially be problematic in the future if we add another entry
> after it.
> 
> So, move class matching entry to be the last in the ID table.

Everything below it uses a different class code, so the separation by
class sort of makes sense. But I agree it looks error prone if anyone
wants to append to it, so the change is okay with me.

Reviewed-by: Keith Busch <kbusch@kernel.org>
 
> Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> Reviewed-by: Chaitanya Kulkarni <chaitanya.kulkarni@wdc.com>
> Reviewed-by: Christoph Hellwig <hch@lst.de>
> Reviewed-by: Sagi Grimberg <sagi@grimberg.me>
> ---
> v2: appended tags and rebased on top of v5.9-rc1
>  drivers/nvme/host/pci.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/nvme/host/pci.c b/drivers/nvme/host/pci.c
> index ba725ae47305..95ea671e5c9e 100644
> --- a/drivers/nvme/host/pci.c
> +++ b/drivers/nvme/host/pci.c
> @@ -3185,7 +3185,6 @@ static const struct pci_device_id nvme_id_table[] = {
>  				NVME_QUIRK_IGNORE_DEV_SUBNQN, },
>  	{ PCI_DEVICE(0x1c5c, 0x1504),   /* SK Hynix PC400 */
>  		.driver_data = NVME_QUIRK_DISABLE_WRITE_ZEROES, },
> -	{ PCI_DEVICE_CLASS(PCI_CLASS_STORAGE_EXPRESS, 0xffffff) },
>  	{ PCI_DEVICE(PCI_VENDOR_ID_APPLE, 0x2001),
>  		.driver_data = NVME_QUIRK_SINGLE_VECTOR },
>  	{ PCI_DEVICE(PCI_VENDOR_ID_APPLE, 0x2003) },
> @@ -3193,6 +3192,8 @@ static const struct pci_device_id nvme_id_table[] = {
>  		.driver_data = NVME_QUIRK_SINGLE_VECTOR |
>  				NVME_QUIRK_128_BYTES_SQES |
>  				NVME_QUIRK_SHARED_TAGS },
> +
> +	{ PCI_DEVICE_CLASS(PCI_CLASS_STORAGE_EXPRESS, 0xffffff) },
>  	{ 0, }
>  };
>  MODULE_DEVICE_TABLE(pci, nvme_id_table);
> -- 
> 2.28.0
> 

_______________________________________________
Linux-nvme mailing list
Linux-nvme@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-nvme

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

* Re: [PATCH v2] nvme-pci: Move enumeration by class to be last in the table
  2020-09-14 15:33 ` Andy Shevchenko
@ 2020-09-15  5:50   ` Christoph Hellwig
  0 siblings, 0 replies; 4+ messages in thread
From: Christoph Hellwig @ 2020-09-15  5:50 UTC (permalink / raw)
  To: Andy Shevchenko
  Cc: Sagi Grimberg, Chaitanya Kulkarni, Benjamin Herrenschmidt,
	linux-nvme, Jens Axboe, Keith Busch, Christoph Hellwig

On Mon, Sep 14, 2020 at 06:33:22PM +0300, Andy Shevchenko wrote:
> On Tue, Aug 18, 2020 at 11:35:30AM +0300, Andy Shevchenko wrote:
> > It's unusual that we have enumeration by class in the middle of the table.
> > It might potentially be problematic in the future if we add another entry
> > after it.
> > 
> > So, move class matching entry to be the last in the ID table.
> 
> Is it good enough?

Yes.  This is in my for-5.10 queue, which just hasn't been pushed out
yet.

_______________________________________________
Linux-nvme mailing list
Linux-nvme@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-nvme

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

end of thread, other threads:[~2020-09-15  5:51 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-08-18  8:35 [PATCH v2] nvme-pci: Move enumeration by class to be last in the table Andy Shevchenko
2020-09-14 15:33 ` Andy Shevchenko
2020-09-15  5:50   ` Christoph Hellwig
2020-09-14 19:37 ` Keith Busch

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.