linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/6] cxlflash: Miscellaneous fixes and updates
@ 2015-12-10 22:51 Uma Krishnan
  2015-12-10 22:53 ` [PATCH 1/6] cxlflash: Fix to escalate LINK_RESET also on port 1 Uma Krishnan
                   ` (5 more replies)
  0 siblings, 6 replies; 20+ messages in thread
From: Uma Krishnan @ 2015-12-10 22:51 UTC (permalink / raw)
  To: linux-scsi, James Bottomley, Martin K. Petersen, Matthew R. Ochs,
	Manoj N. Kumar, Brian King
  Cc: linuxppc-dev, Ian Munsie, Andrew Donnellan

This patch set contains miscellaneous fixes and adds support for
a future IBM CXL adapter. This series is intended for 4.5 and is
bisectable.

Manoj Kumar (4):
  cxlflash: Fix to escalate LINK_RESET also on port 1
  cxlflash: Fix to resolve cmd leak after host reset
  cxlflash: Resolve oops in wait_port_offline
  cxlflash: Enable device id for future IBM CXL adapter

Matthew R. Ochs (1):
  cxlflash: Fix to avoid virtual LUN failover failure

Uma Krishnan (1):
  cxlflash: Updated date of the driver

 drivers/scsi/cxlflash/common.h     |  2 ++
 drivers/scsi/cxlflash/main.c       | 51 +++++++++++++++++++++++++++++++++-----
 drivers/scsi/cxlflash/main.h       |  6 ++---
 drivers/scsi/cxlflash/vlun.c       |  2 ++
 include/uapi/scsi/cxlflash_ioctl.h | 10 ++++++++
 5 files changed, 62 insertions(+), 9 deletions(-)

-- 
2.1.0

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

* [PATCH 1/6] cxlflash: Fix to escalate LINK_RESET also on port 1
  2015-12-10 22:51 [PATCH 0/6] cxlflash: Miscellaneous fixes and updates Uma Krishnan
@ 2015-12-10 22:53 ` Uma Krishnan
  2015-12-14 17:30   ` Matthew R. Ochs
  2015-12-10 22:53 ` [PATCH 2/6] cxlflash: Fix to avoid virtual LUN failover failure Uma Krishnan
                   ` (4 subsequent siblings)
  5 siblings, 1 reply; 20+ messages in thread
From: Uma Krishnan @ 2015-12-10 22:53 UTC (permalink / raw)
  To: linux-scsi, James Bottomley, Martin K. Petersen, Matthew R. Ochs,
	Manoj N. Kumar, Brian King
  Cc: linuxppc-dev, Ian Munsie, Andrew Donnellan

From: Manoj Kumar <manoj@linux.vnet.ibm.com>

The original fix to escalate a 'login timed out' error
to a LINK_RESET was only made for one of the two ports
on the card. This fix resolves the same issue for
the second port (port 1).

Signed-off-by: Manoj N. Kumar <manoj@linux.vnet.ibm.com>
---
 drivers/scsi/cxlflash/main.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/scsi/cxlflash/main.c b/drivers/scsi/cxlflash/main.c
index 1e5bf0c..09fe252 100644
--- a/drivers/scsi/cxlflash/main.c
+++ b/drivers/scsi/cxlflash/main.c
@@ -1108,7 +1108,7 @@ static const struct asyc_intr_info ainfo[] = {
 	{SISL_ASTATUS_FC1_OTHER, "other error", 1, CLR_FC_ERROR | LINK_RESET},
 	{SISL_ASTATUS_FC1_LOGO, "target initiated LOGO", 1, 0},
 	{SISL_ASTATUS_FC1_CRC_T, "CRC threshold exceeded", 1, LINK_RESET},
-	{SISL_ASTATUS_FC1_LOGI_R, "login timed out, retrying", 1, 0},
+	{SISL_ASTATUS_FC1_LOGI_R, "login timed out, retrying", 1, LINK_RESET},
 	{SISL_ASTATUS_FC1_LOGI_F, "login failed", 1, CLR_FC_ERROR},
 	{SISL_ASTATUS_FC1_LOGI_S, "login succeeded", 1, SCAN_HOST},
 	{SISL_ASTATUS_FC1_LINK_DN, "link down", 1, 0},
-- 
2.1.0

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

* [PATCH 2/6] cxlflash: Fix to avoid virtual LUN failover failure
  2015-12-10 22:51 [PATCH 0/6] cxlflash: Miscellaneous fixes and updates Uma Krishnan
  2015-12-10 22:53 ` [PATCH 1/6] cxlflash: Fix to escalate LINK_RESET also on port 1 Uma Krishnan
@ 2015-12-10 22:53 ` Uma Krishnan
  2015-12-11 14:53   ` Manoj Kumar
                     ` (2 more replies)
  2015-12-10 22:54 ` [PATCH 3/6] cxlflash: Updated date of the driver Uma Krishnan
                   ` (3 subsequent siblings)
  5 siblings, 3 replies; 20+ messages in thread
From: Uma Krishnan @ 2015-12-10 22:53 UTC (permalink / raw)
  To: linux-scsi, James Bottomley, Martin K. Petersen, Matthew R. Ochs,
	Manoj N. Kumar, Brian King
  Cc: linuxppc-dev, Ian Munsie, Andrew Donnellan

From: "Matthew R. Ochs" <mrochs@linux.vnet.ibm.com>

Applications which use virtual LUN's that are backed by a physical LUN
over both adapter ports may experience an I/O failure in the event of
a link loss (e.g. cable pull).

Virtual LUNs may be accessed through one or both ports of the adapter.
This access is encoded in the translation entries that comprise the
virtual LUN and used by the AFU for load-balancing I/O and handling
failover scenarios. In a link loss scenario, even though the AFU is
able to maintain connectivity to the LUN, it is up to the application
to retry the failed I/O. When applications are unaware of the virtual
LUN's underlying topology, they are unable to make a sound decision of
when to retry an I/O and therefore are forced to make their reaction to
a failed I/O absolute. The result is either a failure to retry I/O or
increased latency for scenarios where a retry is pointless.

To remedy this scenario, provide feedback back to the application on
virtual LUN creation as to which ports the LUN may be accessed. LUN's
spanning both ports are candidates for a retry in a presence of an I/O
failure.

Signed-off-by: Matthew R. Ochs <mrochs@linux.vnet.ibm.com>
---
 drivers/scsi/cxlflash/vlun.c       |  2 ++
 include/uapi/scsi/cxlflash_ioctl.h | 10 ++++++++++
 2 files changed, 12 insertions(+)

diff --git a/drivers/scsi/cxlflash/vlun.c b/drivers/scsi/cxlflash/vlun.c
index a53f583..50f8e93 100644
--- a/drivers/scsi/cxlflash/vlun.c
+++ b/drivers/scsi/cxlflash/vlun.c
@@ -1008,6 +1008,8 @@ int cxlflash_disk_virtual_open(struct scsi_device *sdev, void *arg)
 	virt->last_lba = last_lba;
 	virt->rsrc_handle = rsrc_handle;
 
+	if (lli->port_sel == BOTH_PORTS)
+		virt->hdr.return_flags |= DK_CXLFLASH_ALL_PORTS_ACTIVE;
 out:
 	if (likely(ctxi))
 		put_context(ctxi);
diff --git a/include/uapi/scsi/cxlflash_ioctl.h b/include/uapi/scsi/cxlflash_ioctl.h
index 831351b..2302f3c 100644
--- a/include/uapi/scsi/cxlflash_ioctl.h
+++ b/include/uapi/scsi/cxlflash_ioctl.h
@@ -31,6 +31,16 @@ struct dk_cxlflash_hdr {
 };
 
 /*
+ * Return flag definitions available to all ioctls
+ *
+ * Similar to the input flags, these are grown from the bottom-up with the
+ * intention that ioctl-specific return flag definitions would grow from the
+ * top-down, allowing the two sets to co-exist. While not required/enforced
+ * at this time, this provides future flexibility.
+ */
+#define DK_CXLFLASH_ALL_PORTS_ACTIVE	0x0000000000000001ULL
+
+/*
  * Notes:
  * -----
  * The 'context_id' field of all ioctl structures contains the context
-- 
2.1.0

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

* [PATCH 3/6] cxlflash: Updated date of the driver
  2015-12-10 22:51 [PATCH 0/6] cxlflash: Miscellaneous fixes and updates Uma Krishnan
  2015-12-10 22:53 ` [PATCH 1/6] cxlflash: Fix to escalate LINK_RESET also on port 1 Uma Krishnan
  2015-12-10 22:53 ` [PATCH 2/6] cxlflash: Fix to avoid virtual LUN failover failure Uma Krishnan
@ 2015-12-10 22:54 ` Uma Krishnan
  2015-12-11  0:35   ` Daniel Axtens
  2015-12-10 22:54 ` [PATCH 4/6] cxlflash: Fix to resolve cmd leak after host reset Uma Krishnan
                   ` (2 subsequent siblings)
  5 siblings, 1 reply; 20+ messages in thread
From: Uma Krishnan @ 2015-12-10 22:54 UTC (permalink / raw)
  To: linux-scsi, James Bottomley, Martin K. Petersen, Matthew R. Ochs,
	Manoj N. Kumar, Brian King
  Cc: linuxppc-dev, Ian Munsie, Andrew Donnellan

This change is to update the date when last change was
made to the cxlflash driver

Signed-off-by: Uma Krishnan <ukrishn@linux.vnet.ibm.com>
---
 drivers/scsi/cxlflash/main.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/scsi/cxlflash/main.h b/drivers/scsi/cxlflash/main.h
index 6032456..ddc4a97 100644
--- a/drivers/scsi/cxlflash/main.h
+++ b/drivers/scsi/cxlflash/main.h
@@ -22,7 +22,7 @@
 
 #define CXLFLASH_NAME		"cxlflash"
 #define CXLFLASH_ADAPTER_NAME	"IBM POWER CXL Flash Adapter"
-#define CXLFLASH_DRIVER_DATE	"(August 13, 2015)"
+#define CXLFLASH_DRIVER_DATE	"(October 26, 2015)"
 
 #define PCI_DEVICE_ID_IBM_CORSA	0x04F0
 #define CXLFLASH_SUBS_DEV_ID	0x04F0
-- 
2.1.0

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

* [PATCH 4/6] cxlflash: Fix to resolve cmd leak after host reset
  2015-12-10 22:51 [PATCH 0/6] cxlflash: Miscellaneous fixes and updates Uma Krishnan
                   ` (2 preceding siblings ...)
  2015-12-10 22:54 ` [PATCH 3/6] cxlflash: Updated date of the driver Uma Krishnan
@ 2015-12-10 22:54 ` Uma Krishnan
  2015-12-14 17:31   ` Matthew R. Ochs
  2015-12-10 22:54 ` [PATCH 5/6] cxlflash: Resolve oops in wait_port_offline Uma Krishnan
  2015-12-10 22:54 ` [PATCH 6/6] cxlflash: Enable device id for future IBM CXL adapter Uma Krishnan
  5 siblings, 1 reply; 20+ messages in thread
From: Uma Krishnan @ 2015-12-10 22:54 UTC (permalink / raw)
  To: linux-scsi, James Bottomley, Martin K. Petersen, Matthew R. Ochs,
	Manoj N. Kumar, Brian King
  Cc: linuxppc-dev, Ian Munsie, Andrew Donnellan

From: Manoj Kumar <manoj@linux.vnet.ibm.com>

After a few iterations of resetting the card, either during EEH
recovery, or a host_reset the following is seen in the logs.
cxlflash 0008:00: cxlflash_queuecommand: could not get a free command

At every reset of the card, the commands that are outstanding are
being leaked.  No effort is being made to reap these commands.  A few
more resets later, the above error message floods the logs and the
card is rendered totally unusable as no free commands are available.

Iterated through the 'cmd' queue and printed out the 'free' counter
and found that on each reset certain commands were in-use and
stayed in-use through subsequent resets.

To resolve this issue, when the card is reset, reap all the commands
that are active/outstanding.

Signed-off-by: Manoj N. Kumar <manoj@linux.vnet.ibm.com>
---
 drivers/scsi/cxlflash/main.c | 19 +++++++++++++++++--
 1 file changed, 17 insertions(+), 2 deletions(-)

diff --git a/drivers/scsi/cxlflash/main.c b/drivers/scsi/cxlflash/main.c
index 09fe252..5d1d627 100644
--- a/drivers/scsi/cxlflash/main.c
+++ b/drivers/scsi/cxlflash/main.c
@@ -632,15 +632,30 @@ static void free_mem(struct cxlflash_cfg *cfg)
  * @cfg:	Internal structure associated with the host.
  *
  * Safe to call with AFU in a partially allocated/initialized state.
+ *
+ * Cleans up all state associated with the command queue, and unmaps
+ * the MMIO space.
+ *
+ *  - complete() will take care of commands we initiated (they'll be checked
+ *  in as part of the cleanup that occurs after the completion)
+ *
+ *  - cmd_checkin() will take care of entries that we did not initiate and that
+ *  have not (and will not) complete because they are sitting on a [now stale]
+ *  hardware queue
  */
 static void stop_afu(struct cxlflash_cfg *cfg)
 {
 	int i;
 	struct afu *afu = cfg->afu;
+	struct afu_cmd *cmd;
 
 	if (likely(afu)) {
-		for (i = 0; i < CXLFLASH_NUM_CMDS; i++)
-			complete(&afu->cmd[i].cevent);
+		for (i = 0; i < CXLFLASH_NUM_CMDS; i++) {
+			cmd = &afu->cmd[i];
+			complete(&cmd->cevent);
+			if (!atomic_read(&cmd->free))
+				cmd_checkin(cmd);
+		}
 
 		if (likely(afu->afu_map)) {
 			cxl_psa_unmap((void __iomem *)afu->afu_map);
-- 
2.1.0

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

* [PATCH 5/6] cxlflash: Resolve oops in wait_port_offline
  2015-12-10 22:51 [PATCH 0/6] cxlflash: Miscellaneous fixes and updates Uma Krishnan
                   ` (3 preceding siblings ...)
  2015-12-10 22:54 ` [PATCH 4/6] cxlflash: Fix to resolve cmd leak after host reset Uma Krishnan
@ 2015-12-10 22:54 ` Uma Krishnan
  2015-12-14 17:32   ` Matthew R. Ochs
  2015-12-17 22:30   ` Uma Krishnan
  2015-12-10 22:54 ` [PATCH 6/6] cxlflash: Enable device id for future IBM CXL adapter Uma Krishnan
  5 siblings, 2 replies; 20+ messages in thread
From: Uma Krishnan @ 2015-12-10 22:54 UTC (permalink / raw)
  To: linux-scsi, James Bottomley, Martin K. Petersen, Matthew R. Ochs,
	Manoj N. Kumar, Brian King
  Cc: linuxppc-dev, Ian Munsie, Andrew Donnellan

From: Manoj Kumar <manoj@linux.vnet.ibm.com>

If an async error interrupt is generated, and the error requires the FC
link to be reset, it cannot be performed in the interrupt context. So
a work element is scheduled to complete the link reset in a process
context. If either an EEH event or an escalation occurs in between
when the interrupt is generated and the scheduled work is started, the
MMIO space may no longer be available. This will cause an oops in the
worker thread.

[  606.806583] NIP kthread_data+0x28/0x40
[  606.806633] LR wq_worker_sleeping+0x30/0x100
[  606.806694] Call Trace:
[  606.806721] 0x50 (unreliable)
[  606.806796] wq_worker_sleeping+0x30/0x100
[  606.806884] __schedule+0x69c/0x8a0
[  606.806959] schedule+0x44/0xc0
[  606.807034] do_exit+0x770/0xb90
[  606.807109] die+0x300/0x460
[  606.807185] bad_page_fault+0xd8/0x150
[  606.807259] handle_page_fault+0x2c/0x30
[  606.807338] wait_port_offline.constprop.12+0x60/0x130 [cxlflash]

To prevent the problem space area from being unmapped, when there is
pending work, a mapcount (using the kref mechanism) is held.  The mapcount
is released only when the work is completed.  The last reference release
is tied to the unmapping service.

Signed-off-by: Manoj N. Kumar <manoj@linux.vnet.ibm.com>
---
 drivers/scsi/cxlflash/common.h |  2 ++
 drivers/scsi/cxlflash/main.c   | 27 ++++++++++++++++++++++++---
 2 files changed, 26 insertions(+), 3 deletions(-)

diff --git a/drivers/scsi/cxlflash/common.h b/drivers/scsi/cxlflash/common.h
index c11cd19..5ada926 100644
--- a/drivers/scsi/cxlflash/common.h
+++ b/drivers/scsi/cxlflash/common.h
@@ -165,6 +165,8 @@ struct afu {
 	struct sisl_host_map __iomem *host_map;		/* MC host map */
 	struct sisl_ctrl_map __iomem *ctrl_map;		/* MC control map */
 
+	struct kref mapcount;
+
 	ctx_hndl_t ctx_hndl;	/* master's context handle */
 	u64 *hrrq_start;
 	u64 *hrrq_end;
diff --git a/drivers/scsi/cxlflash/main.c b/drivers/scsi/cxlflash/main.c
index 5d1d627..021b526 100644
--- a/drivers/scsi/cxlflash/main.c
+++ b/drivers/scsi/cxlflash/main.c
@@ -368,6 +368,7 @@ out:
 
 no_room:
 	afu->read_room = true;
+	kref_get(&cfg->afu->mapcount);
 	schedule_work(&cfg->work_q);
 	rc = SCSI_MLQUEUE_HOST_BUSY;
 	goto out;
@@ -473,6 +474,16 @@ out:
 	return rc;
 }
 
+static void afu_unmap(struct kref *ref)
+{
+	struct afu *afu = container_of(ref, struct afu, mapcount);
+
+	if (likely(afu->afu_map)) {
+		cxl_psa_unmap((void __iomem *)afu->afu_map);
+		afu->afu_map = NULL;
+	}
+}
+
 /**
  * cxlflash_driver_info() - information handler for this host driver
  * @host:	SCSI host associated with device.
@@ -503,6 +514,7 @@ static int cxlflash_queuecommand(struct Scsi_Host *host, struct scsi_cmnd *scp)
 	ulong lock_flags;
 	short lflag = 0;
 	int rc = 0;
+	int kref_got = 0;
 
 	dev_dbg_ratelimited(dev, "%s: (scp=%p) %d/%d/%d/%llu "
 			    "cdb=(%08X-%08X-%08X-%08X)\n",
@@ -547,6 +559,9 @@ static int cxlflash_queuecommand(struct Scsi_Host *host, struct scsi_cmnd *scp)
 		goto out;
 	}
 
+	kref_get(&cfg->afu->mapcount);
+	kref_got = 1;
+
 	cmd->rcb.ctx_id = afu->ctx_hndl;
 	cmd->rcb.port_sel = port_sel;
 	cmd->rcb.lun_id = lun_to_lunid(scp->device->lun);
@@ -587,6 +602,8 @@ static int cxlflash_queuecommand(struct Scsi_Host *host, struct scsi_cmnd *scp)
 	}
 
 out:
+	if (kref_got)
+		kref_put(&afu->mapcount, afu_unmap);
 	pr_devel("%s: returning rc=%d\n", __func__, rc);
 	return rc;
 }
@@ -661,6 +678,7 @@ static void stop_afu(struct cxlflash_cfg *cfg)
 			cxl_psa_unmap((void __iomem *)afu->afu_map);
 			afu->afu_map = NULL;
 		}
+		kref_put(&afu->mapcount, afu_unmap);
 	}
 }
 
@@ -746,8 +764,8 @@ static void cxlflash_remove(struct pci_dev *pdev)
 		scsi_remove_host(cfg->host);
 		/* fall through */
 	case INIT_STATE_AFU:
-		term_afu(cfg);
 		cancel_work_sync(&cfg->work_q);
+		term_afu(cfg);
 	case INIT_STATE_PCI:
 		pci_release_regions(cfg->dev);
 		pci_disable_device(pdev);
@@ -1331,6 +1349,7 @@ static irqreturn_t cxlflash_async_err_irq(int irq, void *data)
 				__func__, port);
 			cfg->lr_state = LINK_RESET_REQUIRED;
 			cfg->lr_port = port;
+			kref_get(&cfg->afu->mapcount);
 			schedule_work(&cfg->work_q);
 		}
 
@@ -1351,6 +1370,7 @@ static irqreturn_t cxlflash_async_err_irq(int irq, void *data)
 
 		if (info->action & SCAN_HOST) {
 			atomic_inc(&cfg->scan_host_needed);
+			kref_get(&cfg->afu->mapcount);
 			schedule_work(&cfg->work_q);
 		}
 	}
@@ -1746,6 +1766,7 @@ static int init_afu(struct cxlflash_cfg *cfg)
 		rc = -ENOMEM;
 		goto err1;
 	}
+	kref_init(&afu->mapcount);
 
 	/* No byte reverse on reading afu_version or string will be backwards */
 	reg = readq(&afu->afu_map->global.regs.afu_version);
@@ -1780,8 +1801,7 @@ out:
 	return rc;
 
 err2:
-	cxl_psa_unmap((void __iomem *)afu->afu_map);
-	afu->afu_map = NULL;
+	kref_put(&afu->mapcount, afu_unmap);
 err1:
 	term_mc(cfg, UNDO_START);
 	goto out;
@@ -2354,6 +2374,7 @@ static void cxlflash_worker_thread(struct work_struct *work)
 
 	if (atomic_dec_if_positive(&cfg->scan_host_needed) >= 0)
 		scsi_scan_host(cfg->host);
+	kref_put(&afu->mapcount, afu_unmap);
 }
 
 /**
-- 
2.1.0

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

* [PATCH 6/6] cxlflash: Enable device id for future IBM CXL adapter
  2015-12-10 22:51 [PATCH 0/6] cxlflash: Miscellaneous fixes and updates Uma Krishnan
                   ` (4 preceding siblings ...)
  2015-12-10 22:54 ` [PATCH 5/6] cxlflash: Resolve oops in wait_port_offline Uma Krishnan
@ 2015-12-10 22:54 ` Uma Krishnan
  2015-12-14  3:47   ` Andrew Donnellan
  2015-12-14 17:32   ` Matthew R. Ochs
  5 siblings, 2 replies; 20+ messages in thread
From: Uma Krishnan @ 2015-12-10 22:54 UTC (permalink / raw)
  To: linux-scsi, James Bottomley, Martin K. Petersen, Matthew R. Ochs,
	Manoj N. Kumar, Brian King
  Cc: linuxppc-dev, Ian Munsie, Andrew Donnellan

From: Manoj Kumar <manoj@linux.vnet.ibm.com>

This drop enables a future card with a device id
of 0x0600 to be recognized by the cxlflash driver.
No card specific programming has been added. These
card specific changes will be staged in later.

Signed-off-by: Manoj N. Kumar <manoj@linux.vnet.ibm.com>
---
 drivers/scsi/cxlflash/main.c | 3 +++
 drivers/scsi/cxlflash/main.h | 4 ++--
 2 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/drivers/scsi/cxlflash/main.c b/drivers/scsi/cxlflash/main.c
index 021b526..ec26b12 100644
--- a/drivers/scsi/cxlflash/main.c
+++ b/drivers/scsi/cxlflash/main.c
@@ -2309,6 +2309,7 @@ static struct scsi_host_template driver_template = {
  * Device dependent values
  */
 static struct dev_dependent_vals dev_corsa_vals = { CXLFLASH_MAX_SECTORS };
+static struct dev_dependent_vals dev_flash_gt_vals = { CXLFLASH_MAX_SECTORS };
 
 /*
  * PCI device binding table
@@ -2316,6 +2317,8 @@ static struct dev_dependent_vals dev_corsa_vals = { CXLFLASH_MAX_SECTORS };
 static struct pci_device_id cxlflash_pci_table[] = {
 	{PCI_VENDOR_ID_IBM, PCI_DEVICE_ID_IBM_CORSA,
 	 PCI_ANY_ID, PCI_ANY_ID, 0, 0, (kernel_ulong_t)&dev_corsa_vals},
+	{PCI_VENDOR_ID_IBM, PCI_DEVICE_ID_IBM_FLASH_GT,
+	 PCI_ANY_ID, PCI_ANY_ID, 0, 0, (kernel_ulong_t)&dev_flash_gt_vals},
 	{}
 };
 
diff --git a/drivers/scsi/cxlflash/main.h b/drivers/scsi/cxlflash/main.h
index ddc4a97..5d2c7ae 100644
--- a/drivers/scsi/cxlflash/main.h
+++ b/drivers/scsi/cxlflash/main.h
@@ -24,8 +24,8 @@
 #define CXLFLASH_ADAPTER_NAME	"IBM POWER CXL Flash Adapter"
 #define CXLFLASH_DRIVER_DATE	"(October 26, 2015)"
 
-#define PCI_DEVICE_ID_IBM_CORSA	0x04F0
-#define CXLFLASH_SUBS_DEV_ID	0x04F0
+#define PCI_DEVICE_ID_IBM_CORSA		0x04F0
+#define PCI_DEVICE_ID_IBM_FLASH_GT	0x0600
 
 /* Since there is only one target, make it 0 */
 #define CXLFLASH_TARGET		0
-- 
2.1.0

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

* Re: [PATCH 3/6] cxlflash: Updated date of the driver
  2015-12-10 22:54 ` [PATCH 3/6] cxlflash: Updated date of the driver Uma Krishnan
@ 2015-12-11  0:35   ` Daniel Axtens
  2015-12-14 19:29     ` Uma Krishnan
  0 siblings, 1 reply; 20+ messages in thread
From: Daniel Axtens @ 2015-12-11  0:35 UTC (permalink / raw)
  To: Uma Krishnan, linux-scsi, James Bottomley, Martin K. Petersen,
	Matthew R. Ochs, Manoj N. Kumar, Brian King
  Cc: linuxppc-dev, Ian Munsie, Andrew Donnellan

[-- Attachment #1: Type: text/plain, Size: 209 bytes --]

Hi Uma,

It looks like CXLFLASH_DRIVER_DATE is only used once, on init, and it's
just printed. Is it necessary? It looks like having it will require
sending a patch to update it quite often.

Regards,
Daniel


[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 859 bytes --]

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

* Re: [PATCH 2/6] cxlflash: Fix to avoid virtual LUN failover failure
  2015-12-10 22:53 ` [PATCH 2/6] cxlflash: Fix to avoid virtual LUN failover failure Uma Krishnan
@ 2015-12-11 14:53   ` Manoj Kumar
  2015-12-14  5:00   ` Daniel Axtens
  2015-12-17 22:19   ` Uma Krishnan
  2 siblings, 0 replies; 20+ messages in thread
From: Manoj Kumar @ 2015-12-11 14:53 UTC (permalink / raw)
  To: Uma Krishnan, linux-scsi, James Bottomley, Martin K. Petersen,
	Matthew R. Ochs, Brian King
  Cc: linuxppc-dev, Ian Munsie, Andrew Donnellan

On 12/10/2015 4:53 PM, Uma Krishnan wrote:
> From: "Matthew R. Ochs" <mrochs@linux.vnet.ibm.com>
> To remedy this scenario, provide feedback back to the application on
> virtual LUN creation as to which ports the LUN may be accessed. LUN's
> spanning both ports are candidates for a retry in a presence of an I/O
> failure.
>
> Signed-off-by: Matthew R. Ochs <mrochs@linux.vnet.ibm.com>

Acked-by: Manoj Kumar <manoj@linux.vnet.ibm.com>

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

* Re: [PATCH 6/6] cxlflash: Enable device id for future IBM CXL adapter
  2015-12-10 22:54 ` [PATCH 6/6] cxlflash: Enable device id for future IBM CXL adapter Uma Krishnan
@ 2015-12-14  3:47   ` Andrew Donnellan
  2015-12-14 17:18     ` Manoj Kumar
  2015-12-14 17:32   ` Matthew R. Ochs
  1 sibling, 1 reply; 20+ messages in thread
From: Andrew Donnellan @ 2015-12-14  3:47 UTC (permalink / raw)
  To: Uma Krishnan, linux-scsi, James Bottomley, Martin K. Petersen,
	Matthew R. Ochs, Manoj N. Kumar, Brian King
  Cc: linuxppc-dev, Ian Munsie

On 11/12/15 09:54, Uma Krishnan wrote:
> From: Manoj Kumar <manoj@linux.vnet.ibm.com>
>
> This drop enables a future card with a device id
> of 0x0600 to be recognized by the cxlflash driver.
> No card specific programming has been added. These
> card specific changes will be staged in later.
>
> Signed-off-by: Manoj N. Kumar <manoj@linux.vnet.ibm.com>

Without the card-specific code, how does the driver behave if the new 
card is plugged in?


Andrew

-- 
Andrew Donnellan              Software Engineer, OzLabs
andrew.donnellan@au1.ibm.com  Australia Development Lab, Canberra
+61 2 6201 8874 (work)        IBM Australia Limited

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

* Re: [PATCH 2/6] cxlflash: Fix to avoid virtual LUN failover failure
  2015-12-10 22:53 ` [PATCH 2/6] cxlflash: Fix to avoid virtual LUN failover failure Uma Krishnan
  2015-12-11 14:53   ` Manoj Kumar
@ 2015-12-14  5:00   ` Daniel Axtens
  2015-12-17 22:19   ` Uma Krishnan
  2 siblings, 0 replies; 20+ messages in thread
From: Daniel Axtens @ 2015-12-14  5:00 UTC (permalink / raw)
  To: Uma Krishnan, linux-scsi, James Bottomley, Martin K. Petersen,
	Matthew R. Ochs, Manoj N. Kumar, Brian King
  Cc: linuxppc-dev, Ian Munsie, Andrew Donnellan

[-- Attachment #1: Type: text/plain, Size: 2950 bytes --]


> Virtual LUNs may be accessed through one or both ports of the adapter.

Is it possible that there might ever be adapters with a number of ports
other than 2? In particular, is it possible for 3 or 4 port adapters to
exist?

If so, do you need something with a bit more fidelity?

If not, this is a good approach.

Regards,
Daniel

> This access is encoded in the translation entries that comprise the
> virtual LUN and used by the AFU for load-balancing I/O and handling
> failover scenarios. In a link loss scenario, even though the AFU is
> able to maintain connectivity to the LUN, it is up to the application
> to retry the failed I/O. When applications are unaware of the virtual
> LUN's underlying topology, they are unable to make a sound decision of
> when to retry an I/O and therefore are forced to make their reaction to
> a failed I/O absolute. The result is either a failure to retry I/O or
> increased latency for scenarios where a retry is pointless.
>
> To remedy this scenario, provide feedback back to the application on
> virtual LUN creation as to which ports the LUN may be accessed. LUN's
> spanning both ports are candidates for a retry in a presence of an I/O
> failure.
>
> Signed-off-by: Matthew R. Ochs <mrochs@linux.vnet.ibm.com>
> ---
>  drivers/scsi/cxlflash/vlun.c       |  2 ++
>  include/uapi/scsi/cxlflash_ioctl.h | 10 ++++++++++
>  2 files changed, 12 insertions(+)
>
> diff --git a/drivers/scsi/cxlflash/vlun.c b/drivers/scsi/cxlflash/vlun.c
> index a53f583..50f8e93 100644
> --- a/drivers/scsi/cxlflash/vlun.c
> +++ b/drivers/scsi/cxlflash/vlun.c
> @@ -1008,6 +1008,8 @@ int cxlflash_disk_virtual_open(struct scsi_device *sdev, void *arg)
>  	virt->last_lba = last_lba;
>  	virt->rsrc_handle = rsrc_handle;
>  
> +	if (lli->port_sel == BOTH_PORTS)
> +		virt->hdr.return_flags |= DK_CXLFLASH_ALL_PORTS_ACTIVE;
>  out:
>  	if (likely(ctxi))
>  		put_context(ctxi);
> diff --git a/include/uapi/scsi/cxlflash_ioctl.h b/include/uapi/scsi/cxlflash_ioctl.h
> index 831351b..2302f3c 100644
> --- a/include/uapi/scsi/cxlflash_ioctl.h
> +++ b/include/uapi/scsi/cxlflash_ioctl.h
> @@ -31,6 +31,16 @@ struct dk_cxlflash_hdr {
>  };
>  
>  /*
> + * Return flag definitions available to all ioctls
> + *
> + * Similar to the input flags, these are grown from the bottom-up with the
> + * intention that ioctl-specific return flag definitions would grow from the
> + * top-down, allowing the two sets to co-exist. While not required/enforced
> + * at this time, this provides future flexibility.
> + */
> +#define DK_CXLFLASH_ALL_PORTS_ACTIVE	0x0000000000000001ULL
> +
> +/*
>   * Notes:
>   * -----
>   * The 'context_id' field of all ioctl structures contains the context
> -- 
> 2.1.0
>
> _______________________________________________
> Linuxppc-dev mailing list
> Linuxppc-dev@lists.ozlabs.org
> https://lists.ozlabs.org/listinfo/linuxppc-dev

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 859 bytes --]

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

* Re: [PATCH 6/6] cxlflash: Enable device id for future IBM CXL adapter
  2015-12-14  3:47   ` Andrew Donnellan
@ 2015-12-14 17:18     ` Manoj Kumar
  0 siblings, 0 replies; 20+ messages in thread
From: Manoj Kumar @ 2015-12-14 17:18 UTC (permalink / raw)
  To: Andrew Donnellan, Uma Krishnan, linux-scsi, James Bottomley,
	Martin K. Petersen, Matthew R. Ochs, Brian King
  Cc: linuxppc-dev, Ian Munsie

On 12/13/2015 9:47 PM, Andrew Donnellan wrote:
> On 11/12/15 09:54, Uma Krishnan wrote:
>> From: Manoj Kumar <manoj@linux.vnet.ibm.com>
>>
>> This drop enables a future card with a device id
>> of 0x0600 to be recognized by the cxlflash driver.
>> No card specific programming has been added. These
>> card specific changes will be staged in later.
>>
>> Signed-off-by: Manoj N. Kumar <manoj@linux.vnet.ibm.com>
>
> Without the card-specific code, how does the driver behave if the new
> card is plugged in?

Andrew:

As per the design, the Accelerator Function Unit (AFU)
for this new IBM CXL Flash Adapater retains the same host
interface as the previous generation. For the early prototypes
of the new card, the driver with this change behaves exactly as
the driver prior to this behaved with the earlier generation
card. i.e. No card specific changes are required. However, I
left the staging comment in there, in case later versions of the
card deviate from the prototype.

- Manoj

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

* Re: [PATCH 1/6] cxlflash: Fix to escalate LINK_RESET also on port 1
  2015-12-10 22:53 ` [PATCH 1/6] cxlflash: Fix to escalate LINK_RESET also on port 1 Uma Krishnan
@ 2015-12-14 17:30   ` Matthew R. Ochs
  2015-12-17 21:24     ` Uma Krishnan
  0 siblings, 1 reply; 20+ messages in thread
From: Matthew R. Ochs @ 2015-12-14 17:30 UTC (permalink / raw)
  To: Uma Krishnan
  Cc: linux-scsi, James Bottomley, Martin K. Petersen, Manoj N. Kumar,
	Brian King, linuxppc-dev, Ian Munsie, Andrew Donnellan

Acked-by: Matthew R. Ochs <mrochs@linux.vnet.ibm.com>

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

* Re: [PATCH 4/6] cxlflash: Fix to resolve cmd leak after host reset
  2015-12-10 22:54 ` [PATCH 4/6] cxlflash: Fix to resolve cmd leak after host reset Uma Krishnan
@ 2015-12-14 17:31   ` Matthew R. Ochs
  0 siblings, 0 replies; 20+ messages in thread
From: Matthew R. Ochs @ 2015-12-14 17:31 UTC (permalink / raw)
  To: Uma Krishnan
  Cc: linux-scsi, James Bottomley, Martin K. Petersen, Manoj N. Kumar,
	Brian King, linuxppc-dev, Ian Munsie, Andrew Donnellan

Acked-by: Matthew R. Ochs <mrochs@linux.vnet.ibm.com>

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

* Re: [PATCH 5/6] cxlflash: Resolve oops in wait_port_offline
  2015-12-10 22:54 ` [PATCH 5/6] cxlflash: Resolve oops in wait_port_offline Uma Krishnan
@ 2015-12-14 17:32   ` Matthew R. Ochs
  2015-12-17 22:30   ` Uma Krishnan
  1 sibling, 0 replies; 20+ messages in thread
From: Matthew R. Ochs @ 2015-12-14 17:32 UTC (permalink / raw)
  To: Uma Krishnan
  Cc: linux-scsi, James Bottomley, Martin K. Petersen, Manoj N. Kumar,
	Brian King, linuxppc-dev, Ian Munsie, Andrew Donnellan

Acked-by: Matthew R. Ochs <mrochs@linux.vnet.ibm.com>

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

* Re: [PATCH 6/6] cxlflash: Enable device id for future IBM CXL adapter
  2015-12-10 22:54 ` [PATCH 6/6] cxlflash: Enable device id for future IBM CXL adapter Uma Krishnan
  2015-12-14  3:47   ` Andrew Donnellan
@ 2015-12-14 17:32   ` Matthew R. Ochs
  1 sibling, 0 replies; 20+ messages in thread
From: Matthew R. Ochs @ 2015-12-14 17:32 UTC (permalink / raw)
  To: Uma Krishnan
  Cc: linux-scsi, James Bottomley, Martin K. Petersen, Manoj N. Kumar,
	Brian King, linuxppc-dev, Ian Munsie, Andrew Donnellan

Acked-by: Matthew R. Ochs <mrochs@linux.vnet.ibm.com>

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

* Re: [PATCH 3/6] cxlflash: Updated date of the driver
  2015-12-11  0:35   ` Daniel Axtens
@ 2015-12-14 19:29     ` Uma Krishnan
  0 siblings, 0 replies; 20+ messages in thread
From: Uma Krishnan @ 2015-12-14 19:29 UTC (permalink / raw)
  To: Daniel Axtens, linux-scsi, James Bottomley, Martin K. Petersen,
	Matthew R. Ochs, Manoj N. Kumar, Brian King
  Cc: linuxppc-dev, Ian Munsie, Andrew Donnellan

On 12/10/2015 6:35 PM, Daniel Axtens wrote:
> Hi Uma,
>
> It looks like CXLFLASH_DRIVER_DATE is only used once, on init, and it's
> just printed. Is it necessary? It looks like having it will require
> sending a patch to update it quite often.
>

Hi Daniel,

Valid point. I will pull this out from the code. This should be included
in the second version of the patch series.

Thanks,
Uma Krishnan

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

* Re: [PATCH 1/6] cxlflash: Fix to escalate LINK_RESET also on port 1
  2015-12-14 17:30   ` Matthew R. Ochs
@ 2015-12-17 21:24     ` Uma Krishnan
  0 siblings, 0 replies; 20+ messages in thread
From: Uma Krishnan @ 2015-12-17 21:24 UTC (permalink / raw)
  To: Matthew R. Ochs
  Cc: linux-scsi, James Bottomley, Martin K. Petersen, Manoj N. Kumar,
	Brian King, linuxppc-dev, Ian Munsie, Andrew Donnellan

On 12/14/2015 11:30 AM, Matthew R. Ochs wrote:
> Acked-by: Matthew R. Ochs <mrochs@linux.vnet.ibm.com>
>

Reviewed-by: Uma Krishnan <ukrishn@linux.vnet.ibm.com>

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

* Re: [PATCH 2/6] cxlflash: Fix to avoid virtual LUN failover failure
  2015-12-10 22:53 ` [PATCH 2/6] cxlflash: Fix to avoid virtual LUN failover failure Uma Krishnan
  2015-12-11 14:53   ` Manoj Kumar
  2015-12-14  5:00   ` Daniel Axtens
@ 2015-12-17 22:19   ` Uma Krishnan
  2 siblings, 0 replies; 20+ messages in thread
From: Uma Krishnan @ 2015-12-17 22:19 UTC (permalink / raw)
  To: linux-scsi, James Bottomley, Martin K. Petersen, Matthew R. Ochs,
	Manoj N. Kumar, Brian King
  Cc: linuxppc-dev, Ian Munsie, Andrew Donnellan

On 12/10/2015 4:53 PM, Uma Krishnan wrote:
> From: "Matthew R. Ochs" <mrochs@linux.vnet.ibm.com>
>
> Applications which use virtual LUN's that are backed by a physical LUN
> over both adapter ports may experience an I/O failure in the event of
> a link loss (e.g. cable pull).
>
> Virtual LUNs may be accessed through one or both ports of the adapter.
> This access is encoded in the translation entries that comprise the
> virtual LUN and used by the AFU for load-balancing I/O and handling
> failover scenarios. In a link loss scenario, even though the AFU is
> able to maintain connectivity to the LUN, it is up to the application
> to retry the failed I/O. When applications are unaware of the virtual
> LUN's underlying topology, they are unable to make a sound decision of
> when to retry an I/O and therefore are forced to make their reaction to
> a failed I/O absolute. The result is either a failure to retry I/O or
> increased latency for scenarios where a retry is pointless.
>
> To remedy this scenario, provide feedback back to the application on
> virtual LUN creation as to which ports the LUN may be accessed. LUN's
> spanning both ports are candidates for a retry in a presence of an I/O
> failure.
>
> Signed-off-by: Matthew R. Ochs <mrochs@linux.vnet.ibm.com>
> ---

Reviewed-by: Uma Krishnan <ukrishn@linux.vnet.ibm.com>

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

* Re: [PATCH 5/6] cxlflash: Resolve oops in wait_port_offline
  2015-12-10 22:54 ` [PATCH 5/6] cxlflash: Resolve oops in wait_port_offline Uma Krishnan
  2015-12-14 17:32   ` Matthew R. Ochs
@ 2015-12-17 22:30   ` Uma Krishnan
  1 sibling, 0 replies; 20+ messages in thread
From: Uma Krishnan @ 2015-12-17 22:30 UTC (permalink / raw)
  To: linux-scsi, James Bottomley, Martin K. Petersen, Matthew R. Ochs,
	Manoj N. Kumar, Brian King
  Cc: linuxppc-dev, Ian Munsie, Andrew Donnellan

On 12/10/2015 4:54 PM, Uma Krishnan wrote:
> From: Manoj Kumar <manoj@linux.vnet.ibm.com>
>
> If an async error interrupt is generated, and the error requires the FC
> link to be reset, it cannot be performed in the interrupt context. So
> a work element is scheduled to complete the link reset in a process
> context. If either an EEH event or an escalation occurs in between
> when the interrupt is generated and the scheduled work is started, the
> MMIO space may no longer be available. This will cause an oops in the
> worker thread.
>
> [  606.806583] NIP kthread_data+0x28/0x40
> [  606.806633] LR wq_worker_sleeping+0x30/0x100
> [  606.806694] Call Trace:
> [  606.806721] 0x50 (unreliable)
> [  606.806796] wq_worker_sleeping+0x30/0x100
> [  606.806884] __schedule+0x69c/0x8a0
> [  606.806959] schedule+0x44/0xc0
> [  606.807034] do_exit+0x770/0xb90
> [  606.807109] die+0x300/0x460
> [  606.807185] bad_page_fault+0xd8/0x150
> [  606.807259] handle_page_fault+0x2c/0x30
> [  606.807338] wait_port_offline.constprop.12+0x60/0x130 [cxlflash]
>
> To prevent the problem space area from being unmapped, when there is
> pending work, a mapcount (using the kref mechanism) is held.  The mapcount
> is released only when the work is completed.  The last reference release
> is tied to the unmapping service.
>
> Signed-off-by: Manoj N. Kumar <manoj@linux.vnet.ibm.com>
> ---

Reviewed-by: Uma Krishnan <ukrishn@linux.vnet.ibm.com>

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

end of thread, other threads:[~2015-12-17 22:30 UTC | newest]

Thread overview: 20+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-12-10 22:51 [PATCH 0/6] cxlflash: Miscellaneous fixes and updates Uma Krishnan
2015-12-10 22:53 ` [PATCH 1/6] cxlflash: Fix to escalate LINK_RESET also on port 1 Uma Krishnan
2015-12-14 17:30   ` Matthew R. Ochs
2015-12-17 21:24     ` Uma Krishnan
2015-12-10 22:53 ` [PATCH 2/6] cxlflash: Fix to avoid virtual LUN failover failure Uma Krishnan
2015-12-11 14:53   ` Manoj Kumar
2015-12-14  5:00   ` Daniel Axtens
2015-12-17 22:19   ` Uma Krishnan
2015-12-10 22:54 ` [PATCH 3/6] cxlflash: Updated date of the driver Uma Krishnan
2015-12-11  0:35   ` Daniel Axtens
2015-12-14 19:29     ` Uma Krishnan
2015-12-10 22:54 ` [PATCH 4/6] cxlflash: Fix to resolve cmd leak after host reset Uma Krishnan
2015-12-14 17:31   ` Matthew R. Ochs
2015-12-10 22:54 ` [PATCH 5/6] cxlflash: Resolve oops in wait_port_offline Uma Krishnan
2015-12-14 17:32   ` Matthew R. Ochs
2015-12-17 22:30   ` Uma Krishnan
2015-12-10 22:54 ` [PATCH 6/6] cxlflash: Enable device id for future IBM CXL adapter Uma Krishnan
2015-12-14  3:47   ` Andrew Donnellan
2015-12-14 17:18     ` Manoj Kumar
2015-12-14 17:32   ` Matthew R. Ochs

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