ipr: Add delay to ensure coherent dumps.
Subsystems (2)
PATCH v2 1/5 ipr: Add delay to ensure coherent dumps.
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.
--- drivers/scsi/ipr.c | 51 +++++++++++++++++++++++++++++++++++++++------------ drivers/scsi/ipr.h | 3 +++ 2 files changed, 42 insertions(+), 12 deletions(-)
drivers/scsi/ipr.c +39 -12
@@ -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 ;
drivers/scsi/ipr.h +3 -0
@@ -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)
Signature · 1 line
2.1.0
PATCH v2 2/5 ipr: Don't set NO_ULEN_CHK bit when resource is a vset.
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.
--- drivers/scsi/ipr.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-)
drivers/scsi/ipr.c +7 -3
@@ -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 ;
Signature · 1 line
2.1.0
PATCH v2 5/5 ipr: Driver version 2.6.3.
In reply to Gabriel Krisman Bertazi--- drivers/scsi/ipr.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/scsi/ipr.h +2 -2
@@ -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
Signature · 1 line
2.1.0
PATCH v2 3/5 ipr: Inquiry IOA page 0xC4 during initialization.
In reply to Gabriel Krisman BertaziAdd 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.
--- drivers/scsi/ipr.c | 35 ++++++++++++++++++++++++++++++++++- drivers/scsi/ipr.h | 11 +++++++++++ 2 files changed, 45 insertions(+), 1 deletion(-)
drivers/scsi/ipr.c +34 -1
@@ -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 )) {
drivers/scsi/ipr.h +11 -0
@@ -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; };
Signature · 1 line
2.1.0
PATCH v2 4/5 ipr: Issue Configure Cache Parameters command.
In reply to Gabriel Krisman BertaziSome 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.
--- drivers/scsi/ipr.c | 59 +++++++++++++++++++++++++++++++++++++++++++++++++++++- drivers/scsi/ipr.h | 4 ++++ 2 files changed, 62 insertions(+), 1 deletion(-)
drivers/scsi/ipr.c +58 -1
@@ -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 )) {
drivers/scsi/ipr.h +4 -0
@@ -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
Signature · 1 line
2.1.0
Re: [PATCH v2 2/5] ipr: Don't set NO_ULEN_CHK bit when resource is a vset.
In reply to Gabriel Krisman BertaziGabriel:
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.
---
Manoj Kumar
Quoted 41 lines · 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 <[email protected]>--- drivers/scsi/ipr.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-)drivers/scsi/ipr.c +7
-3@@ -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 ;
Signature · 3 lines
Brian King Power Linux I/O IBM Linux Technology Center
Re: [PATCH v2 2/5] ipr: Don't set NO_ULEN_CHK bit when resource is a vset.
In reply to Gabriel Krisman BertaziSignature · 3 lines
Brian King Power Linux I/O IBM Linux Technology Center
Re: [PATCH v2 3/5] ipr: Inquiry IOA page 0xC4 during initialization.
In reply to Gabriel Krisman BertaziSignature · 3 lines
Brian King Power Linux I/O IBM Linux Technology Center
Re: [PATCH v2 4/5] ipr: Issue Configure Cache Parameters command.
In reply to Gabriel Krisman BertaziSignature · 3 lines
Brian King Power Linux I/O IBM Linux Technology Center
Re: [PATCH v2 5/5] ipr: Driver version 2.6.3.
In reply to Gabriel Krisman BertaziSignature · 3 lines
Brian King Power Linux I/O IBM Linux Technology Center
Re: [PATCH v2 2/5] ipr: Don't set NO_ULEN_CHK bit when resource is a vset.
In reply to Gabriel Krisman BertaziThanks,
Wendy
Quoting Gabriel Krisman Bertazi <[email protected]>:
Quoted 42 lines
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 <[email protected]>--- drivers/scsi/ipr.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-)drivers/scsi/ipr.c +7
-4@@ -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
Re: [PATCH v2 3/5] ipr: Inquiry IOA page 0xC4 during initialization.
In reply to Gabriel Krisman BertaziThanks,
Wendy
Quoting Gabriel Krisman Bertazi <[email protected]>:
Quoted 104 lines
Add an IOA Inquiry command for Page
0xC4during 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 Page0x0shows support for Page0xC4. Otherwise, assume Sync IOA Write Cache is not supported.Changes since v1:
- Fix checkpatch.pl warnings.Signed-off-by Gabriel Krisman Bertazi <[email protected]>--- drivers/scsi/ipr.c | 35 ++++++++++++++++++++++++++++++++++- drivers/scsi/ipr.h | 11 +++++++++++ 2 files changed, 45 insertions(+), 1 deletion(-)drivers/scsi/ipr.c +33
-0@@ -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 *
drivers/scsi/ipr.c +1
-1@@ -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));drivers/scsi/ipr.c +0
-0if (ipr_inquiry_page_supported (page0,0xD0 )) {drivers/scsi/ipr.h +11
-1@@ -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
Re: [PATCH v2 5/5] ipr: Driver version 2.6.3.
In reply to Gabriel Krisman BertaziThanks,
Wendy
Quoting Gabriel Krisman Bertazi <[email protected]>:
Quoted 22 lines
Signed-off-by Gabriel Krisman Bertazi <[email protected]>--- drivers/scsi/ipr.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)drivers/scsi/ipr.h +2
-3@@ -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
Thanks,
Wendy
Quoting Gabriel Krisman Bertazi <[email protected]>:
Quoted 106 lines
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 <[email protected]>--- drivers/scsi/ipr.c | 51 +++++++++++++++++++++++++++++++++++++++------------ drivers/scsi/ipr.h | 3 +++ 2 files changed, 42 insertions(+), 12 deletions(-)drivers/scsi/ipr.c +36
-0@@ -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
drivers/scsi/ipr.c +3
-12@@ -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 ; - } }drivers/scsi/ipr.c +0
-0LEAVE ;drivers/scsi/ipr.h +3
-1@@ -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
Re: [PATCH v2 4/5] ipr: Issue Configure Cache Parameters command.
In reply to Gabriel Krisman BertaziThanks,
Wendy
Quoting Gabriel Krisman Bertazi <[email protected]>:
Quoted 110 lines
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 <[email protected]>--- drivers/scsi/ipr.c | 59 +++++++++++++++++++++++++++++++++++++++++++++++++++++- drivers/scsi/ipr.h | 4 ++++ 2 files changed, 62 insertions(+), 1 deletion(-)drivers/scsi/ipr.c +57
-0@@ -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
drivers/scsi/ipr.c +1
-1@@ -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));drivers/scsi/ipr.c +0
-0if (ipr_inquiry_page_supported (page0,0xC4 )) {drivers/scsi/ipr.h +4
-1@@ -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
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
"Gabriel" == Gabriel Krisman Bertazi <[email protected]> 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.
Signature · 1 line
Martin K. Petersen Oracle Linux Engineering