linux-block.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] lightnvm: add generic ocssd detection
@ 2017-02-24 17:16 Matias Bjørling
  2017-02-24 17:16 ` [PATCH 2/2] lightnvm: fix assert fixes and enable checks Matias Bjørling
  2017-02-25 18:21 ` [PATCH 1/2] lightnvm: add generic ocssd detection Christoph Hellwig
  0 siblings, 2 replies; 7+ messages in thread
From: Matias Bjørling @ 2017-02-24 17:16 UTC (permalink / raw)
  To: linux-block, linux-kernel; +Cc: Matias Bjørling

More implementations of OCSSDs are becoming available. Adding each using
pci ids are becoming a hassle. Instead, use a 16 byte string in the
vendor-specific area of the identification command to identify an
Open-Channel SSD.

The large string should make the collision probability with other
vendor-specific strings to be near nil.

Signed-off-by: Matias Bjørling <matias@cnexlabs.com>
---
 drivers/nvme/host/lightnvm.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/nvme/host/lightnvm.c b/drivers/nvme/host/lightnvm.c
index 4ea9c93..e37b432 100644
--- a/drivers/nvme/host/lightnvm.c
+++ b/drivers/nvme/host/lightnvm.c
@@ -986,6 +986,9 @@ int nvme_nvm_ns_supported(struct nvme_ns *ns, struct nvme_id_ns *id)
 	/* XXX: this is poking into PCI structures from generic code! */
 	struct pci_dev *pdev = to_pci_dev(ctrl->dev);
 
+	if (!strncmp((char *)id->vs, "open-channel ssd", 16))
+		return 1;
+
 	/* QEMU NVMe simulator - PCI ID + Vendor specific bit */
 	if (pdev->vendor == PCI_VENDOR_ID_CNEX &&
 				pdev->device == PCI_DEVICE_ID_CNEX_QEMU &&
-- 
2.9.3

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

end of thread, other threads:[~2017-02-27 18:42 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-02-24 17:16 [PATCH 1/2] lightnvm: add generic ocssd detection Matias Bjørling
2017-02-24 17:16 ` [PATCH 2/2] lightnvm: fix assert fixes and enable checks Matias Bjørling
2017-02-25 18:21 ` [PATCH 1/2] lightnvm: add generic ocssd detection Christoph Hellwig
2017-02-25 19:16   ` Matias Bjørling
2017-02-26  6:47     ` Christoph Hellwig
2017-02-27 18:35       ` Sagi Grimberg
2017-02-27 18:50         ` Keith Busch

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).