Commit 6442451b authored by Young Tack Jin's avatar Young Tack Jin Committed by Jim Harris
Browse files

nvme: add a quirk for identify 0x2



Change-Id: I9cfc237a8514a1d323313851e14576ba2ba69077
Signed-off-by: default avatarYoung Tack Jin <youngtack.jin@circuitblvd.com>
Reviewed-on: https://review.gerrithub.io/410529


Tested-by: default avatarSPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: default avatarDaniel Verkamp <daniel.verkamp@intel.com>
Reviewed-by: default avatarJim Harris <james.r.harris@intel.com>
parent 29c29ff9
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -49,6 +49,7 @@ extern "C" {
#define SPDK_PCI_VID_MEMBLAZE		0x1c5f
#define SPDK_PCI_VID_VIRTUALBOX		0x80ee
#define SPDK_PCI_VID_VIRTIO		0x1af4
#define SPDK_PCI_VID_CNEXLABS		0x1d1d

/**
 * PCI class code for NVMe devices.
+1 −1
Original line number Diff line number Diff line
@@ -819,7 +819,7 @@ nvme_ctrlr_identify_active_ns(struct spdk_nvme_ctrlr *ctrlr)
		return -ENOMEM;
	}
	status.done = false;
	if (ctrlr->vs.raw >= SPDK_NVME_VERSION(1, 1, 0)) {
	if (ctrlr->vs.raw >= SPDK_NVME_VERSION(1, 1, 0) && !(ctrlr->quirks & NVME_QUIRK_IDENTIFY_CNS)) {
		/*
		 * Iterate through the pages and fetch each chunk of 1024 namespaces until
		 * there are no more active namespaces
+5 −0
Original line number Diff line number Diff line
@@ -92,6 +92,11 @@
 */
#define NVME_QUIRK_READ_ZERO_AFTER_DEALLOCATE 0x20

/*
 * The controller doesn't handle Identify value others than 0 or 1 correctly.
 */
#define NVME_QUIRK_IDENTIFY_CNS 0x40

#define NVME_MAX_ASYNC_EVENTS	(8)

#define NVME_MIN_TIMEOUT_PERIOD		(5)
+7 −0
Original line number Diff line number Diff line
@@ -69,6 +69,12 @@ static const struct nvme_quirk nvme_quirks[] = {
	{	{SPDK_PCI_VID_VIRTUALBOX, 0x4e56, SPDK_PCI_ANY_ID, SPDK_PCI_ANY_ID},
		NVME_QUIRK_DELAY_AFTER_QUEUE_ALLOC
	},
	{	{SPDK_PCI_VID_INTEL, 0x5845, SPDK_PCI_ANY_ID, SPDK_PCI_ANY_ID},
		NVME_QUIRK_IDENTIFY_CNS
	},
	{	{SPDK_PCI_VID_CNEXLABS, 0x1f1f, SPDK_PCI_ANY_ID, SPDK_PCI_ANY_ID},
		NVME_QUIRK_IDENTIFY_CNS
	},
	{	{0x0000, 0x0000, 0x0000, 0x0000}, 0}
};

@@ -113,6 +119,7 @@ nvme_get_quirks(const struct spdk_pci_id *id)
			PRINT_QUIRK(NVME_INTEL_QUIRK_STRIPING);
			PRINT_QUIRK(NVME_QUIRK_DELAY_AFTER_QUEUE_ALLOC);
			PRINT_QUIRK(NVME_QUIRK_READ_ZERO_AFTER_DEALLOCATE);
			PRINT_QUIRK(NVME_QUIRK_IDENTIFY_CNS);

			return quirk->flags;
		}