All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 1/5] ipr: Add delay to ensure coherent dumps.
@ 2015-11-03 18:26 Gabriel Krisman Bertazi
  2015-11-03 18:26 ` [PATCH v2 2/5] ipr: Don't set NO_ULEN_CHK bit when resource is a vset Gabriel Krisman Bertazi
                   ` (6 more replies)
  0 siblings, 7 replies; 17+ messages in thread
From: Gabriel Krisman Bertazi @ 2015-11-03 18:26 UTC (permalink / raw)
  To: linux-scsi; +Cc: brking, wenxiong, manoj, Gabriel Krisman Bertazi

Add a holding pattern prior to collecting dump data, to wait for the IOA
indication that the Mailbox register is stable and won't change without
an explicit reset.  This ensures we'll be collecting meaningful dump
data, even when dumping right after an adapter reset.

In the event of a timeout, we still force the dump, since a partial dump
still might be useful.

Changes since v1:
	- Fix checkpatch.pl warnings.

Signed-off-by: Gabriel Krisman Bertazi <krisman@linux.vnet.ibm.com>
---
 drivers/scsi/ipr.c | 51 +++++++++++++++++++++++++++++++++++++++------------
 drivers/scsi/ipr.h |  3 +++
 2 files changed, 42 insertions(+), 12 deletions(-)

diff --git a/drivers/scsi/ipr.c b/drivers/scsi/ipr.c
index b62836d..238efab 100644
--- a/drivers/scsi/ipr.c
+++ b/drivers/scsi/ipr.c
@@ -8277,6 +8277,42 @@ static int ipr_reset_get_unit_check_job(struct ipr_cmnd *ipr_cmd)
 	return IPR_RC_JOB_RETURN;
 }
 
+static int ipr_dump_mailbox_wait(struct ipr_cmnd *ipr_cmd)
+{
+	struct ipr_ioa_cfg *ioa_cfg = ipr_cmd->ioa_cfg;
+
+	ENTER;
+
+	if (ioa_cfg->sdt_state != GET_DUMP)
+		return IPR_RC_JOB_RETURN;
+
+	if (!ioa_cfg->sis64 || !ipr_cmd->u.time_left ||
+	    (readl(ioa_cfg->regs.sense_interrupt_reg) &
+	     IPR_PCII_MAILBOX_STABLE)) {
+
+		if (!ipr_cmd->u.time_left)
+			dev_err(&ioa_cfg->pdev->dev,
+				"Timed out waiting for Mailbox register.\n");
+
+		ioa_cfg->sdt_state = READ_DUMP;
+		ioa_cfg->dump_timeout = 0;
+		if (ioa_cfg->sis64)
+			ipr_reset_start_timer(ipr_cmd, IPR_SIS64_DUMP_TIMEOUT);
+		else
+			ipr_reset_start_timer(ipr_cmd, IPR_SIS32_DUMP_TIMEOUT);
+		ipr_cmd->job_step = ipr_reset_wait_for_dump;
+		schedule_work(&ioa_cfg->work_q);
+
+	} else {
+		ipr_cmd->u.time_left -= IPR_CHECK_FOR_RESET_TIMEOUT;
+		ipr_reset_start_timer(ipr_cmd,
+				      IPR_CHECK_FOR_RESET_TIMEOUT);
+	}
+
+	LEAVE;
+	return IPR_RC_JOB_RETURN;
+}
+
 /**
  * ipr_reset_restore_cfg_space - Restore PCI config space.
  * @ipr_cmd:	ipr command struct
@@ -8326,20 +8362,11 @@ static int ipr_reset_restore_cfg_space(struct ipr_cmnd *ipr_cmd)
 
 	if (ioa_cfg->in_ioa_bringdown) {
 		ipr_cmd->job_step = ipr_ioa_bringdown_done;
+	} else if (ioa_cfg->sdt_state == GET_DUMP) {
+		ipr_cmd->job_step = ipr_dump_mailbox_wait;
+		ipr_cmd->u.time_left = IPR_WAIT_FOR_MAILBOX;
 	} else {
 		ipr_cmd->job_step = ipr_reset_enable_ioa;
-
-		if (GET_DUMP == ioa_cfg->sdt_state) {
-			ioa_cfg->sdt_state = READ_DUMP;
-			ioa_cfg->dump_timeout = 0;
-			if (ioa_cfg->sis64)
-				ipr_reset_start_timer(ipr_cmd, IPR_SIS64_DUMP_TIMEOUT);
-			else
-				ipr_reset_start_timer(ipr_cmd, IPR_SIS32_DUMP_TIMEOUT);
-			ipr_cmd->job_step = ipr_reset_wait_for_dump;
-			schedule_work(&ioa_cfg->work_q);
-			return IPR_RC_JOB_RETURN;
-		}
 	}
 
 	LEAVE;
diff --git a/drivers/scsi/ipr.h b/drivers/scsi/ipr.h
index e4fb17a..69257c4 100644
--- a/drivers/scsi/ipr.h
+++ b/drivers/scsi/ipr.h
@@ -279,6 +279,9 @@
 #define IPR_IPL_INIT_STAGE_TIME_MASK			0x0000ffff
 #define IPR_PCII_IPL_STAGE_CHANGE			(0x80000000 >> 0)
 
+#define IPR_PCII_MAILBOX_STABLE				(0x80000000 >> 4)
+#define IPR_WAIT_FOR_MAILBOX				(2 * HZ)
+
 #define IPR_PCII_IOA_TRANS_TO_OPER			(0x80000000 >> 0)
 #define IPR_PCII_IOARCB_XFER_FAILED			(0x80000000 >> 3)
 #define IPR_PCII_IOA_UNIT_CHECKED			(0x80000000 >> 4)
-- 
2.1.0


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

* [PATCH v2 2/5] ipr: Don't set NO_ULEN_CHK bit when resource is a vset.
  2015-11-03 18:26 [PATCH v2 1/5] ipr: Add delay to ensure coherent dumps Gabriel Krisman Bertazi
@ 2015-11-03 18:26 ` Gabriel Krisman Bertazi
  2015-11-03 20:39   ` Manoj Kumar
                     ` (2 more replies)
  2015-11-03 18:26 ` [PATCH v2 3/5] ipr: Inquiry IOA page 0xC4 during initialization Gabriel Krisman Bertazi
                   ` (5 subsequent siblings)
  6 siblings, 3 replies; 17+ messages in thread
From: Gabriel Krisman Bertazi @ 2015-11-03 18:26 UTC (permalink / raw)
  To: linux-scsi; +Cc: brking, wenxiong, manoj, Gabriel Krisman Bertazi

According to the IPR specification, Inhibit Underlength Checking bit
must be disabled when issuing commands to vsets.  Enabling it in this
case might cause SCSI commands to fail with an Illegal Request, so make
sure we keep this bit cleared when resource is a vset.

Changes since v1:
	- Put gsci exclusive stuff in a separate block.

Signed-off-by: Gabriel Krisman Bertazi <krisman@linux.vnet.ibm.com>
---
 drivers/scsi/ipr.c | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/drivers/scsi/ipr.c b/drivers/scsi/ipr.c
index 238efab..6849b7f 100644
--- a/drivers/scsi/ipr.c
+++ b/drivers/scsi/ipr.c
@@ -6363,15 +6363,19 @@ static int ipr_queuecommand(struct Scsi_Host *shost,
 	ipr_cmd->scsi_cmd = scsi_cmd;
 	ipr_cmd->done = ipr_scsi_eh_done;
 
-	if (ipr_is_gscsi(res) || ipr_is_vset_device(res)) {
+	if (ipr_is_gscsi(res)) {
 		if (scsi_cmd->underflow == 0)
 			ioarcb->cmd_pkt.flags_hi |= IPR_FLAGS_HI_NO_ULEN_CHK;
 
-		ioarcb->cmd_pkt.flags_hi |= IPR_FLAGS_HI_NO_LINK_DESC;
-		if (ipr_is_gscsi(res) && res->reset_occurred) {
+		if (res->reset_occurred) {
 			res->reset_occurred = 0;
 			ioarcb->cmd_pkt.flags_lo |= IPR_FLAGS_LO_DELAY_AFTER_RST;
 		}
+	}
+
+	if (ipr_is_gscsi(res) || ipr_is_vset_device(res)) {
+		ioarcb->cmd_pkt.flags_hi |= IPR_FLAGS_HI_NO_LINK_DESC;
+
 		ioarcb->cmd_pkt.flags_lo |= IPR_FLAGS_LO_ALIGNED_BFR;
 		if (scsi_cmd->flags & SCMD_TAGGED)
 			ioarcb->cmd_pkt.flags_lo |= IPR_FLAGS_LO_SIMPLE_TASK;
-- 
2.1.0


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

* [PATCH v2 3/5] ipr: Inquiry IOA page 0xC4 during initialization.
  2015-11-03 18:26 [PATCH v2 1/5] ipr: Add delay to ensure coherent dumps Gabriel Krisman Bertazi
  2015-11-03 18:26 ` [PATCH v2 2/5] ipr: Don't set NO_ULEN_CHK bit when resource is a vset Gabriel Krisman Bertazi
@ 2015-11-03 18:26 ` Gabriel Krisman Bertazi
  2015-11-04  2:53   ` Brian King
  2015-11-04 18:51   ` wenxiong
  2015-11-03 18:26 ` [PATCH v2 4/5] ipr: Issue Configure Cache Parameters command Gabriel Krisman Bertazi
                   ` (4 subsequent siblings)
  6 siblings, 2 replies; 17+ messages in thread
From: Gabriel Krisman Bertazi @ 2015-11-03 18:26 UTC (permalink / raw)
  To: linux-scsi; +Cc: brking, wenxiong, manoj, Gabriel Krisman Bertazi

Add an IOA Inquiry command for Page 0xC4 during IOA initialization to
collect cache capabilities, particularly to check if Sync IOA Write
Cache is supported.

Inquiry will happen right after Cap Inquiry on page 0xD0; and will
execute only if the "Supported Pages" field in Inquiry Page 0x0 shows
support for Page 0xC4.  Otherwise, assume Sync IOA Write Cache is
not supported.

Changes since v1:
        - Fix checkpatch.pl warnings.

Signed-off-by: Gabriel Krisman Bertazi <krisman@linux.vnet.ibm.com>
---
 drivers/scsi/ipr.c | 35 ++++++++++++++++++++++++++++++++++-
 drivers/scsi/ipr.h | 11 +++++++++++
 2 files changed, 45 insertions(+), 1 deletion(-)

diff --git a/drivers/scsi/ipr.c b/drivers/scsi/ipr.c
index 6849b7f..5efc7ef 100644
--- a/drivers/scsi/ipr.c
+++ b/drivers/scsi/ipr.c
@@ -7726,6 +7726,39 @@ static int ipr_inquiry_page_supported(struct ipr_inquiry_page0 *page0, u8 page)
 }
 
 /**
+ * ipr_ioafp_pageC4_inquiry - Send a Page 0xC4 Inquiry to the adapter.
+ * @ipr_cmd:	ipr command struct
+ *
+ * This function sends a Page 0xC4 inquiry to the adapter
+ * to retrieve software VPD information.
+ *
+ * Return value:
+ *	IPR_RC_JOB_CONTINUE / IPR_RC_JOB_RETURN
+ **/
+static int ipr_ioafp_pageC4_inquiry(struct ipr_cmnd *ipr_cmd)
+{
+	struct ipr_ioa_cfg *ioa_cfg = ipr_cmd->ioa_cfg;
+	struct ipr_inquiry_page0 *page0 = &ioa_cfg->vpd_cbs->page0_data;
+	struct ipr_inquiry_pageC4 *pageC4 = &ioa_cfg->vpd_cbs->pageC4_data;
+
+	ENTER;
+	ipr_cmd->job_step = ipr_ioafp_query_ioa_cfg;
+	memset(pageC4, 0, sizeof(*pageC4));
+
+	if (ipr_inquiry_page_supported(page0, 0xC4)) {
+		ipr_ioafp_inquiry(ipr_cmd, 1, 0xC4,
+				  (ioa_cfg->vpd_cbs_dma
+				   + offsetof(struct ipr_misc_cbs,
+					      pageC4_data)),
+				  sizeof(struct ipr_inquiry_pageC4));
+		return IPR_RC_JOB_RETURN;
+	}
+
+	LEAVE;
+	return IPR_RC_JOB_CONTINUE;
+}
+
+/**
  * ipr_ioafp_cap_inquiry - Send a Page 0xD0 Inquiry to the adapter.
  * @ipr_cmd:	ipr command struct
  *
@@ -7742,7 +7775,7 @@ static int ipr_ioafp_cap_inquiry(struct ipr_cmnd *ipr_cmd)
 	struct ipr_inquiry_cap *cap = &ioa_cfg->vpd_cbs->cap;
 
 	ENTER;
-	ipr_cmd->job_step = ipr_ioafp_query_ioa_cfg;
+	ipr_cmd->job_step = ipr_ioafp_pageC4_inquiry;
 	memset(cap, 0, sizeof(*cap));
 
 	if (ipr_inquiry_page_supported(page0, 0xD0)) {
diff --git a/drivers/scsi/ipr.h b/drivers/scsi/ipr.h
index 69257c4..7be1271 100644
--- a/drivers/scsi/ipr.h
+++ b/drivers/scsi/ipr.h
@@ -849,6 +849,16 @@ struct ipr_inquiry_page0 {
 	u8 page[IPR_INQUIRY_PAGE0_ENTRIES];
 }__attribute__((packed));
 
+struct ipr_inquiry_pageC4 {
+	u8 peri_qual_dev_type;
+	u8 page_code;
+	u8 reserved1;
+	u8 len;
+	u8 cache_cap[4];
+#define IPR_CAP_SYNC_CACHE		0x08
+	u8 reserved2[20];
+} __packed;
+
 struct ipr_hostrcb_device_data_entry {
 	struct ipr_vpd vpd;
 	struct ipr_res_addr dev_res_addr;
@@ -1322,6 +1332,7 @@ struct ipr_misc_cbs {
 	struct ipr_inquiry_page0 page0_data;
 	struct ipr_inquiry_page3 page3_data;
 	struct ipr_inquiry_cap cap;
+	struct ipr_inquiry_pageC4 pageC4_data;
 	struct ipr_mode_pages mode_pages;
 	struct ipr_supported_device supp_dev;
 };
-- 
2.1.0


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

* [PATCH v2 4/5] ipr: Issue Configure Cache Parameters command.
  2015-11-03 18:26 [PATCH v2 1/5] ipr: Add delay to ensure coherent dumps Gabriel Krisman Bertazi
  2015-11-03 18:26 ` [PATCH v2 2/5] ipr: Don't set NO_ULEN_CHK bit when resource is a vset Gabriel Krisman Bertazi
  2015-11-03 18:26 ` [PATCH v2 3/5] ipr: Inquiry IOA page 0xC4 during initialization Gabriel Krisman Bertazi
@ 2015-11-03 18:26 ` Gabriel Krisman Bertazi
  2015-11-04  2:53   ` Brian King
  2015-11-04 18:52   ` wenxiong
  2015-11-03 18:26 ` [PATCH v2 5/5] ipr: Driver version 2.6.3 Gabriel Krisman Bertazi
                   ` (3 subsequent siblings)
  6 siblings, 2 replies; 17+ messages in thread
From: Gabriel Krisman Bertazi @ 2015-11-03 18:26 UTC (permalink / raw)
  To: linux-scsi; +Cc: brking, wenxiong, manoj, Gabriel Krisman Bertazi

Some new adapters require a special Configure Cache Parameters command
to enable the adapter write cache, so send this during the adapter
initialization if the adapter requires it.

Changes since v1:
        - Fix checkpatch.pl warnings.

Signed-off-by: Gabriel Krisman Bertazi <krisman@linux.vnet.ibm.com>
---
 drivers/scsi/ipr.c | 59 +++++++++++++++++++++++++++++++++++++++++++++++++++++-
 drivers/scsi/ipr.h |  4 ++++
 2 files changed, 62 insertions(+), 1 deletion(-)

diff --git a/drivers/scsi/ipr.c b/drivers/scsi/ipr.c
index 5efc7ef..79fd9ff 100644
--- a/drivers/scsi/ipr.c
+++ b/drivers/scsi/ipr.c
@@ -7675,6 +7675,63 @@ static int ipr_ioafp_query_ioa_cfg(struct ipr_cmnd *ipr_cmd)
 	return IPR_RC_JOB_RETURN;
 }
 
+static int ipr_ioa_service_action_failed(struct ipr_cmnd *ipr_cmd)
+{
+	u32 ioasc = be32_to_cpu(ipr_cmd->s.ioasa.hdr.ioasc);
+
+	if (ioasc == IPR_IOASC_IR_INVALID_REQ_TYPE_OR_PKT)
+		return IPR_RC_JOB_CONTINUE;
+
+	return ipr_reset_cmd_failed(ipr_cmd);
+}
+
+static void ipr_build_ioa_service_action(struct ipr_cmnd *ipr_cmd,
+					 __be32 res_handle, u8 sa_code)
+{
+	struct ipr_ioarcb *ioarcb = &ipr_cmd->ioarcb;
+
+	ioarcb->res_handle = res_handle;
+	ioarcb->cmd_pkt.cdb[0] = IPR_IOA_SERVICE_ACTION;
+	ioarcb->cmd_pkt.cdb[1] = sa_code;
+	ioarcb->cmd_pkt.request_type = IPR_RQTYPE_IOACMD;
+}
+
+/**
+ * ipr_ioafp_set_caching_parameters - Issue Set Cache parameters service
+ * action
+ *
+ * Return value:
+ *	none
+ **/
+static int ipr_ioafp_set_caching_parameters(struct ipr_cmnd *ipr_cmd)
+{
+	struct ipr_ioarcb *ioarcb = &ipr_cmd->ioarcb;
+	struct ipr_ioa_cfg *ioa_cfg = ipr_cmd->ioa_cfg;
+	struct ipr_inquiry_pageC4 *pageC4 = &ioa_cfg->vpd_cbs->pageC4_data;
+
+	ENTER;
+
+	ipr_cmd->job_step = ipr_ioafp_query_ioa_cfg;
+
+	if (pageC4->cache_cap[0] & IPR_CAP_SYNC_CACHE) {
+		ipr_build_ioa_service_action(ipr_cmd,
+					     cpu_to_be32(IPR_IOA_RES_HANDLE),
+					     IPR_IOA_SA_CHANGE_CACHE_PARAMS);
+
+		ioarcb->cmd_pkt.cdb[2] = 0x40;
+
+		ipr_cmd->job_step_failed = ipr_ioa_service_action_failed;
+		ipr_do_req(ipr_cmd, ipr_reset_ioa_job, ipr_timeout,
+			   IPR_SET_SUP_DEVICE_TIMEOUT);
+
+		LEAVE;
+		return IPR_RC_JOB_RETURN;
+	}
+
+	LEAVE;
+	return IPR_RC_JOB_CONTINUE;
+}
+
 /**
  * ipr_ioafp_inquiry - Send an Inquiry to the adapter.
  * @ipr_cmd:	ipr command struct
@@ -7742,7 +7799,7 @@ static int ipr_ioafp_pageC4_inquiry(struct ipr_cmnd *ipr_cmd)
 	struct ipr_inquiry_pageC4 *pageC4 = &ioa_cfg->vpd_cbs->pageC4_data;
 
 	ENTER;
-	ipr_cmd->job_step = ipr_ioafp_query_ioa_cfg;
+	ipr_cmd->job_step = ipr_ioafp_set_caching_parameters;
 	memset(pageC4, 0, sizeof(*pageC4));
 
 	if (ipr_inquiry_page_supported(page0, 0xC4)) {
diff --git a/drivers/scsi/ipr.h b/drivers/scsi/ipr.h
index 7be1271..b16bcd1 100644
--- a/drivers/scsi/ipr.h
+++ b/drivers/scsi/ipr.h
@@ -216,6 +216,10 @@
 #define IPR_SET_ALL_SUPPORTED_DEVICES			0x80
 #define IPR_IOA_SHUTDOWN				0xF7
 #define	IPR_WR_BUF_DOWNLOAD_AND_SAVE			0x05
+#define IPR_IOA_SERVICE_ACTION				0xD2
+
+/* IOA Service Actions */
+#define IPR_IOA_SA_CHANGE_CACHE_PARAMS			0x14
 
 /*
  * Timeouts
-- 
2.1.0


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

* [PATCH v2 5/5] ipr: Driver version 2.6.3.
  2015-11-03 18:26 [PATCH v2 1/5] ipr: Add delay to ensure coherent dumps Gabriel Krisman Bertazi
                   ` (2 preceding siblings ...)
  2015-11-03 18:26 ` [PATCH v2 4/5] ipr: Issue Configure Cache Parameters command Gabriel Krisman Bertazi
@ 2015-11-03 18:26 ` Gabriel Krisman Bertazi
  2015-11-04  2:53   ` Brian King
  2015-11-04 18:51   ` wenxiong
  2015-11-04  2:52 ` [PATCH v2 1/5] ipr: Add delay to ensure coherent dumps Brian King
                   ` (2 subsequent siblings)
  6 siblings, 2 replies; 17+ messages in thread
From: Gabriel Krisman Bertazi @ 2015-11-03 18:26 UTC (permalink / raw)
  To: linux-scsi; +Cc: brking, wenxiong, manoj, Gabriel Krisman Bertazi

Signed-off-by: Gabriel Krisman Bertazi <krisman@linux.vnet.ibm.com>
---
 drivers/scsi/ipr.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/scsi/ipr.h b/drivers/scsi/ipr.h
index b16bcd1..a34c7a5 100644
--- a/drivers/scsi/ipr.h
+++ b/drivers/scsi/ipr.h
@@ -39,8 +39,8 @@
 /*
  * Literals
  */
-#define IPR_DRIVER_VERSION "2.6.2"
-#define IPR_DRIVER_DATE "(June 11, 2015)"
+#define IPR_DRIVER_VERSION "2.6.3"
+#define IPR_DRIVER_DATE "(October 17, 2015)"
 
 /*
  * IPR_MAX_CMD_PER_LUN: This defines the maximum number of outstanding
-- 
2.1.0


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

* Re: [PATCH v2 2/5] ipr: Don't set NO_ULEN_CHK bit when resource is a vset.
  2015-11-03 18:26 ` [PATCH v2 2/5] ipr: Don't set NO_ULEN_CHK bit when resource is a vset Gabriel Krisman Bertazi
@ 2015-11-03 20:39   ` Manoj Kumar
  2015-11-04  2:52   ` Brian King
  2015-11-04 18:50   ` wenxiong
  2 siblings, 0 replies; 17+ messages in thread
From: Manoj Kumar @ 2015-11-03 20:39 UTC (permalink / raw)
  To: Gabriel Krisman Bertazi, linux-scsi; +Cc: brking, wenxiong

Gabriel:

On applying this patch, I noticed that this statement
seems to be unnecessary:

                 else
                         ioarcb->cmd_pkt.flags_lo |= 
IPR_FLAGS_LO_UNTAGGED_TASK;

As the value is 0x00:
#define IPR_FLAGS_LO_UNTAGGED_TASK              0x00

You can resolve this in a future update.

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

---
Manoj Kumar

On 11/3/2015 12:26 PM, Gabriel Krisman Bertazi wrote:
> According to the IPR specification, Inhibit Underlength Checking bit
> must be disabled when issuing commands to vsets.  Enabling it in this
> case might cause SCSI commands to fail with an Illegal Request, so make
> sure we keep this bit cleared when resource is a vset.
>
> Changes since v1:
> 	- Put gsci exclusive stuff in a separate block.
>
> Signed-off-by: Gabriel Krisman Bertazi <krisman@linux.vnet.ibm.com>
> ---
>   drivers/scsi/ipr.c | 10 +++++++---
>   1 file changed, 7 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/scsi/ipr.c b/drivers/scsi/ipr.c
> index 238efab..6849b7f 100644
> --- a/drivers/scsi/ipr.c
> +++ b/drivers/scsi/ipr.c
> @@ -6363,15 +6363,19 @@ static int ipr_queuecommand(struct Scsi_Host *shost,
>   	ipr_cmd->scsi_cmd = scsi_cmd;
>   	ipr_cmd->done = ipr_scsi_eh_done;
>
> -	if (ipr_is_gscsi(res) || ipr_is_vset_device(res)) {
> +	if (ipr_is_gscsi(res)) {
>   		if (scsi_cmd->underflow == 0)
>   			ioarcb->cmd_pkt.flags_hi |= IPR_FLAGS_HI_NO_ULEN_CHK;
>
> -		ioarcb->cmd_pkt.flags_hi |= IPR_FLAGS_HI_NO_LINK_DESC;
> -		if (ipr_is_gscsi(res) && res->reset_occurred) {
> +		if (res->reset_occurred) {
>   			res->reset_occurred = 0;
>   			ioarcb->cmd_pkt.flags_lo |= IPR_FLAGS_LO_DELAY_AFTER_RST;
>   		}
> +	}
> +
> +	if (ipr_is_gscsi(res) || ipr_is_vset_device(res)) {
> +		ioarcb->cmd_pkt.flags_hi |= IPR_FLAGS_HI_NO_LINK_DESC;
> +
>   		ioarcb->cmd_pkt.flags_lo |= IPR_FLAGS_LO_ALIGNED_BFR;
>   		if (scsi_cmd->flags & SCMD_TAGGED)
>   			ioarcb->cmd_pkt.flags_lo |= IPR_FLAGS_LO_SIMPLE_TASK;
>


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

* Re: [PATCH v2 1/5] ipr: Add delay to ensure coherent dumps.
  2015-11-03 18:26 [PATCH v2 1/5] ipr: Add delay to ensure coherent dumps Gabriel Krisman Bertazi
                   ` (3 preceding siblings ...)
  2015-11-03 18:26 ` [PATCH v2 5/5] ipr: Driver version 2.6.3 Gabriel Krisman Bertazi
@ 2015-11-04  2:52 ` Brian King
  2015-11-04 18:51 ` wenxiong
  2015-11-10  0:34 ` Martin K. Petersen
  6 siblings, 0 replies; 17+ messages in thread
From: Brian King @ 2015-11-04  2:52 UTC (permalink / raw)
  To: Gabriel Krisman Bertazi, linux-scsi; +Cc: wenxiong, manoj

Acked-by: Brian King <brking@linux.vnet.ibm.com>

-- 
Brian King
Power Linux I/O
IBM Linux Technology Center


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

* Re: [PATCH v2 2/5] ipr: Don't set NO_ULEN_CHK bit when resource is a vset.
  2015-11-03 18:26 ` [PATCH v2 2/5] ipr: Don't set NO_ULEN_CHK bit when resource is a vset Gabriel Krisman Bertazi
  2015-11-03 20:39   ` Manoj Kumar
@ 2015-11-04  2:52   ` Brian King
  2015-11-04 18:50   ` wenxiong
  2 siblings, 0 replies; 17+ messages in thread
From: Brian King @ 2015-11-04  2:52 UTC (permalink / raw)
  To: Gabriel Krisman Bertazi, linux-scsi; +Cc: wenxiong, manoj

Acked-by: Brian King <brking@linux.vnet.ibm.com>

-- 
Brian King
Power Linux I/O
IBM Linux Technology Center


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

* Re: [PATCH v2 3/5] ipr: Inquiry IOA page 0xC4 during initialization.
  2015-11-03 18:26 ` [PATCH v2 3/5] ipr: Inquiry IOA page 0xC4 during initialization Gabriel Krisman Bertazi
@ 2015-11-04  2:53   ` Brian King
  2015-11-04 18:51   ` wenxiong
  1 sibling, 0 replies; 17+ messages in thread
From: Brian King @ 2015-11-04  2:53 UTC (permalink / raw)
  To: Gabriel Krisman Bertazi, linux-scsi; +Cc: wenxiong, manoj

Acked-by: Brian King <brking@linux.vnet.ibm.com>

-- 
Brian King
Power Linux I/O
IBM Linux Technology Center


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

* Re: [PATCH v2 4/5] ipr: Issue Configure Cache Parameters command.
  2015-11-03 18:26 ` [PATCH v2 4/5] ipr: Issue Configure Cache Parameters command Gabriel Krisman Bertazi
@ 2015-11-04  2:53   ` Brian King
  2015-11-04 18:52   ` wenxiong
  1 sibling, 0 replies; 17+ messages in thread
From: Brian King @ 2015-11-04  2:53 UTC (permalink / raw)
  To: Gabriel Krisman Bertazi, linux-scsi; +Cc: wenxiong, manoj

Acked-by: Brian King <brking@linux.vnet.ibm.com>


-- 
Brian King
Power Linux I/O
IBM Linux Technology Center


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

* Re: [PATCH v2 5/5] ipr: Driver version 2.6.3.
  2015-11-03 18:26 ` [PATCH v2 5/5] ipr: Driver version 2.6.3 Gabriel Krisman Bertazi
@ 2015-11-04  2:53   ` Brian King
  2015-11-04 18:51   ` wenxiong
  1 sibling, 0 replies; 17+ messages in thread
From: Brian King @ 2015-11-04  2:53 UTC (permalink / raw)
  To: Gabriel Krisman Bertazi, linux-scsi; +Cc: wenxiong, manoj

Acked-by: Brian King <brking@linux.vnet.ibm.com>

-- 
Brian King
Power Linux I/O
IBM Linux Technology Center


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

* Re: [PATCH v2 2/5] ipr: Don't set NO_ULEN_CHK bit when resource is a vset.
  2015-11-03 18:26 ` [PATCH v2 2/5] ipr: Don't set NO_ULEN_CHK bit when resource is a vset Gabriel Krisman Bertazi
  2015-11-03 20:39   ` Manoj Kumar
  2015-11-04  2:52   ` Brian King
@ 2015-11-04 18:50   ` wenxiong
  2 siblings, 0 replies; 17+ messages in thread
From: wenxiong @ 2015-11-04 18:50 UTC (permalink / raw)
  To: Gabriel Krisman Bertazi; +Cc: linux-scsi, brking, manoj

Reviewed-by: Wen Xiong <wenxiong@linux.vnet.ibm.com>

Thanks,
Wendy

Quoting Gabriel Krisman Bertazi <krisman@linux.vnet.ibm.com>:

> According to the IPR specification, Inhibit Underlength Checking bit
> must be disabled when issuing commands to vsets.  Enabling it in this
> case might cause SCSI commands to fail with an Illegal Request, so make
> sure we keep this bit cleared when resource is a vset.
>
> Changes since v1:
> 	- Put gsci exclusive stuff in a separate block.
>
> Signed-off-by: Gabriel Krisman Bertazi <krisman@linux.vnet.ibm.com>
> ---
>  drivers/scsi/ipr.c | 10 +++++++---
>  1 file changed, 7 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/scsi/ipr.c b/drivers/scsi/ipr.c
> index 238efab..6849b7f 100644
> --- a/drivers/scsi/ipr.c
> +++ b/drivers/scsi/ipr.c
> @@ -6363,15 +6363,19 @@ static int ipr_queuecommand(struct Scsi_Host *shost,
>  	ipr_cmd->scsi_cmd = scsi_cmd;
>  	ipr_cmd->done = ipr_scsi_eh_done;
>
> -	if (ipr_is_gscsi(res) || ipr_is_vset_device(res)) {
> +	if (ipr_is_gscsi(res)) {
>  		if (scsi_cmd->underflow == 0)
>  			ioarcb->cmd_pkt.flags_hi |= IPR_FLAGS_HI_NO_ULEN_CHK;
>
> -		ioarcb->cmd_pkt.flags_hi |= IPR_FLAGS_HI_NO_LINK_DESC;
> -		if (ipr_is_gscsi(res) && res->reset_occurred) {
> +		if (res->reset_occurred) {
>  			res->reset_occurred = 0;
>  			ioarcb->cmd_pkt.flags_lo |= IPR_FLAGS_LO_DELAY_AFTER_RST;
>  		}
> +	}
> +
> +	if (ipr_is_gscsi(res) || ipr_is_vset_device(res)) {
> +		ioarcb->cmd_pkt.flags_hi |= IPR_FLAGS_HI_NO_LINK_DESC;
> +
>  		ioarcb->cmd_pkt.flags_lo |= IPR_FLAGS_LO_ALIGNED_BFR;
>  		if (scsi_cmd->flags & SCMD_TAGGED)
>  			ioarcb->cmd_pkt.flags_lo |= IPR_FLAGS_LO_SIMPLE_TASK;
> --
> 2.1.0



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

* Re: [PATCH v2 3/5] ipr: Inquiry IOA page 0xC4 during initialization.
  2015-11-03 18:26 ` [PATCH v2 3/5] ipr: Inquiry IOA page 0xC4 during initialization Gabriel Krisman Bertazi
  2015-11-04  2:53   ` Brian King
@ 2015-11-04 18:51   ` wenxiong
  1 sibling, 0 replies; 17+ messages in thread
From: wenxiong @ 2015-11-04 18:51 UTC (permalink / raw)
  To: Gabriel Krisman Bertazi; +Cc: linux-scsi, brking, manoj

Reviewed-by: Wen Xiong <wenxiong@linux.vnet.ibm.com>

Thanks,
Wendy

Quoting Gabriel Krisman Bertazi <krisman@linux.vnet.ibm.com>:

> Add an IOA Inquiry command for Page 0xC4 during IOA initialization to
> collect cache capabilities, particularly to check if Sync IOA Write
> Cache is supported.
>
> Inquiry will happen right after Cap Inquiry on page 0xD0; and will
> execute only if the "Supported Pages" field in Inquiry Page 0x0 shows
> support for Page 0xC4.  Otherwise, assume Sync IOA Write Cache is
> not supported.
>
> Changes since v1:
>         - Fix checkpatch.pl warnings.
>
> Signed-off-by: Gabriel Krisman Bertazi <krisman@linux.vnet.ibm.com>
> ---
>  drivers/scsi/ipr.c | 35 ++++++++++++++++++++++++++++++++++-
>  drivers/scsi/ipr.h | 11 +++++++++++
>  2 files changed, 45 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/scsi/ipr.c b/drivers/scsi/ipr.c
> index 6849b7f..5efc7ef 100644
> --- a/drivers/scsi/ipr.c
> +++ b/drivers/scsi/ipr.c
> @@ -7726,6 +7726,39 @@ static int ipr_inquiry_page_supported(struct  
> ipr_inquiry_page0 *page0, u8 page)
>  }
>
>  /**
> + * ipr_ioafp_pageC4_inquiry - Send a Page 0xC4 Inquiry to the adapter.
> + * @ipr_cmd:	ipr command struct
> + *
> + * This function sends a Page 0xC4 inquiry to the adapter
> + * to retrieve software VPD information.
> + *
> + * Return value:
> + *	IPR_RC_JOB_CONTINUE / IPR_RC_JOB_RETURN
> + **/
> +static int ipr_ioafp_pageC4_inquiry(struct ipr_cmnd *ipr_cmd)
> +{
> +	struct ipr_ioa_cfg *ioa_cfg = ipr_cmd->ioa_cfg;
> +	struct ipr_inquiry_page0 *page0 = &ioa_cfg->vpd_cbs->page0_data;
> +	struct ipr_inquiry_pageC4 *pageC4 = &ioa_cfg->vpd_cbs->pageC4_data;
> +
> +	ENTER;
> +	ipr_cmd->job_step = ipr_ioafp_query_ioa_cfg;
> +	memset(pageC4, 0, sizeof(*pageC4));
> +
> +	if (ipr_inquiry_page_supported(page0, 0xC4)) {
> +		ipr_ioafp_inquiry(ipr_cmd, 1, 0xC4,
> +				  (ioa_cfg->vpd_cbs_dma
> +				   + offsetof(struct ipr_misc_cbs,
> +					      pageC4_data)),
> +				  sizeof(struct ipr_inquiry_pageC4));
> +		return IPR_RC_JOB_RETURN;
> +	}
> +
> +	LEAVE;
> +	return IPR_RC_JOB_CONTINUE;
> +}
> +
> +/**
>   * ipr_ioafp_cap_inquiry - Send a Page 0xD0 Inquiry to the adapter.
>   * @ipr_cmd:	ipr command struct
>   *
> @@ -7742,7 +7775,7 @@ static int ipr_ioafp_cap_inquiry(struct  
> ipr_cmnd *ipr_cmd)
>  	struct ipr_inquiry_cap *cap = &ioa_cfg->vpd_cbs->cap;
>
>  	ENTER;
> -	ipr_cmd->job_step = ipr_ioafp_query_ioa_cfg;
> +	ipr_cmd->job_step = ipr_ioafp_pageC4_inquiry;
>  	memset(cap, 0, sizeof(*cap));
>
>  	if (ipr_inquiry_page_supported(page0, 0xD0)) {
> diff --git a/drivers/scsi/ipr.h b/drivers/scsi/ipr.h
> index 69257c4..7be1271 100644
> --- a/drivers/scsi/ipr.h
> +++ b/drivers/scsi/ipr.h
> @@ -849,6 +849,16 @@ struct ipr_inquiry_page0 {
>  	u8 page[IPR_INQUIRY_PAGE0_ENTRIES];
>  }__attribute__((packed));
>
> +struct ipr_inquiry_pageC4 {
> +	u8 peri_qual_dev_type;
> +	u8 page_code;
> +	u8 reserved1;
> +	u8 len;
> +	u8 cache_cap[4];
> +#define IPR_CAP_SYNC_CACHE		0x08
> +	u8 reserved2[20];
> +} __packed;
> +
>  struct ipr_hostrcb_device_data_entry {
>  	struct ipr_vpd vpd;
>  	struct ipr_res_addr dev_res_addr;
> @@ -1322,6 +1332,7 @@ struct ipr_misc_cbs {
>  	struct ipr_inquiry_page0 page0_data;
>  	struct ipr_inquiry_page3 page3_data;
>  	struct ipr_inquiry_cap cap;
> +	struct ipr_inquiry_pageC4 pageC4_data;
>  	struct ipr_mode_pages mode_pages;
>  	struct ipr_supported_device supp_dev;
>  };
> --
> 2.1.0



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

* Re: [PATCH v2 5/5] ipr: Driver version 2.6.3.
  2015-11-03 18:26 ` [PATCH v2 5/5] ipr: Driver version 2.6.3 Gabriel Krisman Bertazi
  2015-11-04  2:53   ` Brian King
@ 2015-11-04 18:51   ` wenxiong
  1 sibling, 0 replies; 17+ messages in thread
From: wenxiong @ 2015-11-04 18:51 UTC (permalink / raw)
  To: Gabriel Krisman Bertazi; +Cc: linux-scsi, brking, manoj

Reviewed-by: Wen Xiong <wenxiong@linux.vnet.ibm.com>

Thanks,
Wendy

Quoting Gabriel Krisman Bertazi <krisman@linux.vnet.ibm.com>:

> Signed-off-by: Gabriel Krisman Bertazi <krisman@linux.vnet.ibm.com>
> ---
>  drivers/scsi/ipr.h | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/scsi/ipr.h b/drivers/scsi/ipr.h
> index b16bcd1..a34c7a5 100644
> --- a/drivers/scsi/ipr.h
> +++ b/drivers/scsi/ipr.h
> @@ -39,8 +39,8 @@
>  /*
>   * Literals
>   */
> -#define IPR_DRIVER_VERSION "2.6.2"
> -#define IPR_DRIVER_DATE "(June 11, 2015)"
> +#define IPR_DRIVER_VERSION "2.6.3"
> +#define IPR_DRIVER_DATE "(October 17, 2015)"
>
>  /*
>   * IPR_MAX_CMD_PER_LUN: This defines the maximum number of outstanding
> --
> 2.1.0



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

* Re: [PATCH v2 1/5] ipr: Add delay to ensure coherent dumps.
  2015-11-03 18:26 [PATCH v2 1/5] ipr: Add delay to ensure coherent dumps Gabriel Krisman Bertazi
                   ` (4 preceding siblings ...)
  2015-11-04  2:52 ` [PATCH v2 1/5] ipr: Add delay to ensure coherent dumps Brian King
@ 2015-11-04 18:51 ` wenxiong
  2015-11-10  0:34 ` Martin K. Petersen
  6 siblings, 0 replies; 17+ messages in thread
From: wenxiong @ 2015-11-04 18:51 UTC (permalink / raw)
  To: Gabriel Krisman Bertazi; +Cc: linux-scsi, brking, manoj

Reviewed-by: Wen Xiong <wenxiong@linux.vnet.ibm.com>

Thanks,
Wendy


Quoting Gabriel Krisman Bertazi <krisman@linux.vnet.ibm.com>:

> Add a holding pattern prior to collecting dump data, to wait for the IOA
> indication that the Mailbox register is stable and won't change without
> an explicit reset.  This ensures we'll be collecting meaningful dump
> data, even when dumping right after an adapter reset.
>
> In the event of a timeout, we still force the dump, since a partial dump
> still might be useful.
>
> Changes since v1:
> 	- Fix checkpatch.pl warnings.
>
> Signed-off-by: Gabriel Krisman Bertazi <krisman@linux.vnet.ibm.com>
> ---
>  drivers/scsi/ipr.c | 51 +++++++++++++++++++++++++++++++++++++++------------
>  drivers/scsi/ipr.h |  3 +++
>  2 files changed, 42 insertions(+), 12 deletions(-)
>
> diff --git a/drivers/scsi/ipr.c b/drivers/scsi/ipr.c
> index b62836d..238efab 100644
> --- a/drivers/scsi/ipr.c
> +++ b/drivers/scsi/ipr.c
> @@ -8277,6 +8277,42 @@ static int  
> ipr_reset_get_unit_check_job(struct ipr_cmnd *ipr_cmd)
>  	return IPR_RC_JOB_RETURN;
>  }
>
> +static int ipr_dump_mailbox_wait(struct ipr_cmnd *ipr_cmd)
> +{
> +	struct ipr_ioa_cfg *ioa_cfg = ipr_cmd->ioa_cfg;
> +
> +	ENTER;
> +
> +	if (ioa_cfg->sdt_state != GET_DUMP)
> +		return IPR_RC_JOB_RETURN;
> +
> +	if (!ioa_cfg->sis64 || !ipr_cmd->u.time_left ||
> +	    (readl(ioa_cfg->regs.sense_interrupt_reg) &
> +	     IPR_PCII_MAILBOX_STABLE)) {
> +
> +		if (!ipr_cmd->u.time_left)
> +			dev_err(&ioa_cfg->pdev->dev,
> +				"Timed out waiting for Mailbox register.\n");
> +
> +		ioa_cfg->sdt_state = READ_DUMP;
> +		ioa_cfg->dump_timeout = 0;
> +		if (ioa_cfg->sis64)
> +			ipr_reset_start_timer(ipr_cmd, IPR_SIS64_DUMP_TIMEOUT);
> +		else
> +			ipr_reset_start_timer(ipr_cmd, IPR_SIS32_DUMP_TIMEOUT);
> +		ipr_cmd->job_step = ipr_reset_wait_for_dump;
> +		schedule_work(&ioa_cfg->work_q);
> +
> +	} else {
> +		ipr_cmd->u.time_left -= IPR_CHECK_FOR_RESET_TIMEOUT;
> +		ipr_reset_start_timer(ipr_cmd,
> +				      IPR_CHECK_FOR_RESET_TIMEOUT);
> +	}
> +
> +	LEAVE;
> +	return IPR_RC_JOB_RETURN;
> +}
> +
>  /**
>   * ipr_reset_restore_cfg_space - Restore PCI config space.
>   * @ipr_cmd:	ipr command struct
> @@ -8326,20 +8362,11 @@ static int  
> ipr_reset_restore_cfg_space(struct ipr_cmnd *ipr_cmd)
>
>  	if (ioa_cfg->in_ioa_bringdown) {
>  		ipr_cmd->job_step = ipr_ioa_bringdown_done;
> +	} else if (ioa_cfg->sdt_state == GET_DUMP) {
> +		ipr_cmd->job_step = ipr_dump_mailbox_wait;
> +		ipr_cmd->u.time_left = IPR_WAIT_FOR_MAILBOX;
>  	} else {
>  		ipr_cmd->job_step = ipr_reset_enable_ioa;
> -
> -		if (GET_DUMP == ioa_cfg->sdt_state) {
> -			ioa_cfg->sdt_state = READ_DUMP;
> -			ioa_cfg->dump_timeout = 0;
> -			if (ioa_cfg->sis64)
> -				ipr_reset_start_timer(ipr_cmd, IPR_SIS64_DUMP_TIMEOUT);
> -			else
> -				ipr_reset_start_timer(ipr_cmd, IPR_SIS32_DUMP_TIMEOUT);
> -			ipr_cmd->job_step = ipr_reset_wait_for_dump;
> -			schedule_work(&ioa_cfg->work_q);
> -			return IPR_RC_JOB_RETURN;
> -		}
>  	}
>
>  	LEAVE;
> diff --git a/drivers/scsi/ipr.h b/drivers/scsi/ipr.h
> index e4fb17a..69257c4 100644
> --- a/drivers/scsi/ipr.h
> +++ b/drivers/scsi/ipr.h
> @@ -279,6 +279,9 @@
>  #define IPR_IPL_INIT_STAGE_TIME_MASK			0x0000ffff
>  #define IPR_PCII_IPL_STAGE_CHANGE			(0x80000000 >> 0)
>
> +#define IPR_PCII_MAILBOX_STABLE				(0x80000000 >> 4)
> +#define IPR_WAIT_FOR_MAILBOX				(2 * HZ)
> +
>  #define IPR_PCII_IOA_TRANS_TO_OPER			(0x80000000 >> 0)
>  #define IPR_PCII_IOARCB_XFER_FAILED			(0x80000000 >> 3)
>  #define IPR_PCII_IOA_UNIT_CHECKED			(0x80000000 >> 4)
> --
> 2.1.0



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

* Re: [PATCH v2 4/5] ipr: Issue Configure Cache Parameters command.
  2015-11-03 18:26 ` [PATCH v2 4/5] ipr: Issue Configure Cache Parameters command Gabriel Krisman Bertazi
  2015-11-04  2:53   ` Brian King
@ 2015-11-04 18:52   ` wenxiong
  1 sibling, 0 replies; 17+ messages in thread
From: wenxiong @ 2015-11-04 18:52 UTC (permalink / raw)
  To: Gabriel Krisman Bertazi; +Cc: linux-scsi, brking, manoj

Reviewed-by: Wen Xiong <wenxiong@linux.vnet.ibm.com>

Thanks,
Wendy

Quoting Gabriel Krisman Bertazi <krisman@linux.vnet.ibm.com>:

> Some new adapters require a special Configure Cache Parameters command
> to enable the adapter write cache, so send this during the adapter
> initialization if the adapter requires it.
>
> Changes since v1:
>         - Fix checkpatch.pl warnings.
>
> Signed-off-by: Gabriel Krisman Bertazi <krisman@linux.vnet.ibm.com>
> ---
>  drivers/scsi/ipr.c | 59  
> +++++++++++++++++++++++++++++++++++++++++++++++++++++-
>  drivers/scsi/ipr.h |  4 ++++
>  2 files changed, 62 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/scsi/ipr.c b/drivers/scsi/ipr.c
> index 5efc7ef..79fd9ff 100644
> --- a/drivers/scsi/ipr.c
> +++ b/drivers/scsi/ipr.c
> @@ -7675,6 +7675,63 @@ static int ipr_ioafp_query_ioa_cfg(struct  
> ipr_cmnd *ipr_cmd)
>  	return IPR_RC_JOB_RETURN;
>  }
>
> +static int ipr_ioa_service_action_failed(struct ipr_cmnd *ipr_cmd)
> +{
> +	u32 ioasc = be32_to_cpu(ipr_cmd->s.ioasa.hdr.ioasc);
> +
> +	if (ioasc == IPR_IOASC_IR_INVALID_REQ_TYPE_OR_PKT)
> +		return IPR_RC_JOB_CONTINUE;
> +
> +	return ipr_reset_cmd_failed(ipr_cmd);
> +}
> +
> +static void ipr_build_ioa_service_action(struct ipr_cmnd *ipr_cmd,
> +					 __be32 res_handle, u8 sa_code)
> +{
> +	struct ipr_ioarcb *ioarcb = &ipr_cmd->ioarcb;
> +
> +	ioarcb->res_handle = res_handle;
> +	ioarcb->cmd_pkt.cdb[0] = IPR_IOA_SERVICE_ACTION;
> +	ioarcb->cmd_pkt.cdb[1] = sa_code;
> +	ioarcb->cmd_pkt.request_type = IPR_RQTYPE_IOACMD;
> +}
> +
> +/**
> + * ipr_ioafp_set_caching_parameters - Issue Set Cache parameters service
> + * action
> + *
> + * Return value:
> + *	none
> + **/
> +static int ipr_ioafp_set_caching_parameters(struct ipr_cmnd *ipr_cmd)
> +{
> +	struct ipr_ioarcb *ioarcb = &ipr_cmd->ioarcb;
> +	struct ipr_ioa_cfg *ioa_cfg = ipr_cmd->ioa_cfg;
> +	struct ipr_inquiry_pageC4 *pageC4 = &ioa_cfg->vpd_cbs->pageC4_data;
> +
> +	ENTER;
> +
> +	ipr_cmd->job_step = ipr_ioafp_query_ioa_cfg;
> +
> +	if (pageC4->cache_cap[0] & IPR_CAP_SYNC_CACHE) {
> +		ipr_build_ioa_service_action(ipr_cmd,
> +					     cpu_to_be32(IPR_IOA_RES_HANDLE),
> +					     IPR_IOA_SA_CHANGE_CACHE_PARAMS);
> +
> +		ioarcb->cmd_pkt.cdb[2] = 0x40;
> +
> +		ipr_cmd->job_step_failed = ipr_ioa_service_action_failed;
> +		ipr_do_req(ipr_cmd, ipr_reset_ioa_job, ipr_timeout,
> +			   IPR_SET_SUP_DEVICE_TIMEOUT);
> +
> +		LEAVE;
> +		return IPR_RC_JOB_RETURN;
> +	}
> +
> +	LEAVE;
> +	return IPR_RC_JOB_CONTINUE;
> +}
> +
>  /**
>   * ipr_ioafp_inquiry - Send an Inquiry to the adapter.
>   * @ipr_cmd:	ipr command struct
> @@ -7742,7 +7799,7 @@ static int ipr_ioafp_pageC4_inquiry(struct  
> ipr_cmnd *ipr_cmd)
>  	struct ipr_inquiry_pageC4 *pageC4 = &ioa_cfg->vpd_cbs->pageC4_data;
>
>  	ENTER;
> -	ipr_cmd->job_step = ipr_ioafp_query_ioa_cfg;
> +	ipr_cmd->job_step = ipr_ioafp_set_caching_parameters;
>  	memset(pageC4, 0, sizeof(*pageC4));
>
>  	if (ipr_inquiry_page_supported(page0, 0xC4)) {
> diff --git a/drivers/scsi/ipr.h b/drivers/scsi/ipr.h
> index 7be1271..b16bcd1 100644
> --- a/drivers/scsi/ipr.h
> +++ b/drivers/scsi/ipr.h
> @@ -216,6 +216,10 @@
>  #define IPR_SET_ALL_SUPPORTED_DEVICES			0x80
>  #define IPR_IOA_SHUTDOWN				0xF7
>  #define	IPR_WR_BUF_DOWNLOAD_AND_SAVE			0x05
> +#define IPR_IOA_SERVICE_ACTION				0xD2
> +
> +/* IOA Service Actions */
> +#define IPR_IOA_SA_CHANGE_CACHE_PARAMS			0x14
>
>  /*
>   * Timeouts
> --
> 2.1.0



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

* Re: [PATCH v2 1/5] ipr: Add delay to ensure coherent dumps.
  2015-11-03 18:26 [PATCH v2 1/5] ipr: Add delay to ensure coherent dumps Gabriel Krisman Bertazi
                   ` (5 preceding siblings ...)
  2015-11-04 18:51 ` wenxiong
@ 2015-11-10  0:34 ` Martin K. Petersen
  6 siblings, 0 replies; 17+ messages in thread
From: Martin K. Petersen @ 2015-11-10  0:34 UTC (permalink / raw)
  To: Gabriel Krisman Bertazi; +Cc: linux-scsi, brking, wenxiong, manoj

>>>>> "Gabriel" == Gabriel Krisman Bertazi <krisman@linux.vnet.ibm.com> writes:

Gabriel> Add a holding pattern prior to collecting dump data, to wait
Gabriel> for the IOA indication that the Mailbox register is stable and
Gabriel> won't change without an explicit reset.  This ensures we'll be
Gabriel> collecting meaningful dump data, even when dumping right after
Gabriel> an adapter reset.

I have applied patches 1-5.

-- 
Martin K. Petersen	Oracle Linux Engineering

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

end of thread, other threads:[~2015-11-10  0:34 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-11-03 18:26 [PATCH v2 1/5] ipr: Add delay to ensure coherent dumps Gabriel Krisman Bertazi
2015-11-03 18:26 ` [PATCH v2 2/5] ipr: Don't set NO_ULEN_CHK bit when resource is a vset Gabriel Krisman Bertazi
2015-11-03 20:39   ` Manoj Kumar
2015-11-04  2:52   ` Brian King
2015-11-04 18:50   ` wenxiong
2015-11-03 18:26 ` [PATCH v2 3/5] ipr: Inquiry IOA page 0xC4 during initialization Gabriel Krisman Bertazi
2015-11-04  2:53   ` Brian King
2015-11-04 18:51   ` wenxiong
2015-11-03 18:26 ` [PATCH v2 4/5] ipr: Issue Configure Cache Parameters command Gabriel Krisman Bertazi
2015-11-04  2:53   ` Brian King
2015-11-04 18:52   ` wenxiong
2015-11-03 18:26 ` [PATCH v2 5/5] ipr: Driver version 2.6.3 Gabriel Krisman Bertazi
2015-11-04  2:53   ` Brian King
2015-11-04 18:51   ` wenxiong
2015-11-04  2:52 ` [PATCH v2 1/5] ipr: Add delay to ensure coherent dumps Brian King
2015-11-04 18:51 ` wenxiong
2015-11-10  0:34 ` Martin K. Petersen

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.