qla2xxx bug fixes
Subsystems (2)
Nilesh Javali
maintainerv2 cover qla2xxx bug fixes
Martin,
Please apply the qla2xxx bug fixes to the scsi tree at your earliest convenience.
v1=>v2:
Incorporate review comments
Add call trace details
Add missing Fixes and stable tag
Add Reviewed-by tag
Thanks,
Nilesh
Arun Easi (5):
qla2xxx: Fix compilation issue in PPC systems
qla2xxx: Fix crash during driver load on big endian machines
qla2xxx: Fix FW initialization error on big endian machines
qla2xxx: Fix flash update in 28XX adapters on big endian machines
qla2xxx: Fix device loss on 4G and older HBAs.
Daniel Wagner (1):
scsi: qla2xxx: Return EBUSY on fcport deletion
Nilesh Javali (1):
qla2xxx: Update version to 10.02.00.104-k
Quinn Tran (3):
qla2xxx: limit interrupt vectors to number of cpu
qla2xxx: tear down session if FW say its down
qla2xxx: fix N2N and NVME connect retry failure
Saurav Kashyap (5):
qla2xxx: Change post del message from debug level to log level
qla2xxx: Don't check for fw_started while posting nvme command
qla2xxx: Handle aborts correctly for port undergoing deletion
qla2xxx: Fix the call trace for flush workqueue
qla2xxx: If fcport is undergoing deletion return IO with retry
drivers/scsi/qla2xxx/qla_gs.c | 8 ++-- drivers/scsi/qla2xxx/qla_init.c | 74 ++++++++++++++++++++++-------- drivers/scsi/qla2xxx/qla_isr.c | 34 ++++++++++++-- drivers/scsi/qla2xxx/qla_mbx.c | 9 ++-- drivers/scsi/qla2xxx/qla_nvme.c | 14 +++--- drivers/scsi/qla2xxx/qla_nx.c | 2 +- drivers/scsi/qla2xxx/qla_nx2.c | 4 +- drivers/scsi/qla2xxx/qla_os.c | 10 ++-- drivers/scsi/qla2xxx/qla_sup.c | 10 ++-- drivers/scsi/qla2xxx/qla_target.c | 2 +- drivers/scsi/qla2xxx/qla_tmpl.c | 9 ++-- drivers/scsi/qla2xxx/qla_tmpl.h | 2 +- drivers/scsi/qla2xxx/qla_version.h | 4 +- 13 files changed, 121 insertions(+), 61 deletions(-)
base-commit: cf4d4d8ebdb838ee996e09e3ee18deb9a7737dea
Signature · 1 line
2.19.0.rc0
Nilesh Javali
maintainerPATCH v2 1/15 scsi: qla2xxx: Return EBUSY on fcport deletion
From: Daniel Wagner <[email protected]>
When the fcport is about to be deleted we should return EBUSY instead of ENODEV. Only for EBUSY will the request be requeued in a multipath setup.
Also return EBUSY when the firmware has not yet started to avoid dropping the request.
--- drivers/scsi/qla2xxx/qla_nvme.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)
drivers/scsi/qla2xxx/qla_nvme.c +4 -2
@@ -554,10 +554,12 @@ static int qla_nvme_post_cmd(struct nvme_fc_local_port *lport, fcport = qla_rport->fcport; -if (!qpair || !fcport || (qpair && !qpair->fw_started) || - (fcport && fcport->deleted)) +if (!qpair || !fcport)return -ENODEV ; +if (!qpair->fw_started || fcport->deleted) +return -EBUSY ; + vha = fcport->vha;if (!(fcport->nvme_flag &NVME_FLAG_REGISTERED ))
Signature · 1 line
2.19.0.rc0
Nilesh Javali
maintainerPATCH v2 2/15 qla2xxx: Change post del message from debug level to log level
In reply to Nilesh JavaliFrom: Saurav Kashyap <[email protected]>
Change the message debug level.
--- drivers/scsi/qla2xxx/qla_gs.c | 8 ++++---- drivers/scsi/qla2xxx/qla_target.c | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-)
drivers/scsi/qla2xxx/qla_gs.c +4 -4
@@ -3558,10 +3558,10 @@ void qla24xx_async_gnnft_done(scsi_qla_host_t *vha, srb_t *sp)if (fcport->flags &FCF_FCP2_DEVICE ) fcport->logout_on_delete =0 ; -ql_dbg (ql_dbg_disc, vha,0x20f0 , -"%s %d %8phC post del sess\n" , - __func__, __LINE__, - fcport->port_name); +ql_log (ql_log_warn, vha,0x20f0 , +"%s %d %8phC post del sess\n" , + __func__, __LINE__, + fcport->port_name);qlt_schedule_sess_for_deletion (fcport);continue ;
drivers/scsi/qla2xxx/qla_target.c +1 -1
@@ -1273,7 +1273,7 @@ void qlt_schedule_sess_for_deletion(struct fc_port *sess)qla24xx_chk_fcp_state (sess); -ql_dbg (ql_dbg_disc, sess->vha,0xe001 , +ql_dbg (ql_log_warn, sess->vha,0xe001 ,"Scheduling sess %p for deletion %8phC\n" , sess, sess->port_name);
Signature · 1 line
2.19.0.rc0
Nilesh Javali
maintainerPATCH v2 3/15 qla2xxx: limit interrupt vectors to number of cpu
In reply to Nilesh JavaliFrom: Quinn Tran <[email protected]>
Driver created too many QPairs(126) with 28xx adapter. Limit the number of CPUs to lower wasted resources.
--- drivers/scsi/qla2xxx/qla_isr.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)
drivers/scsi/qla2xxx/qla_isr.c +4 -2
@@ -3952,10 +3952,12 @@ qla24xx_enable_msix(struct qla_hw_data *ha, struct rsp_que *rsp)if (USER_CTRL_IRQ (ha) || !ha->mqiobase) {/* user wants to control IRQ setting for target mode */ ret =pci_alloc_irq_vectors (ha->pdev, min_vecs, - ha->msix_count,PCI_IRQ_MSIX ); +min ((u16 )ha->msix_count, (u16 )num_online_cpus ()), +PCI_IRQ_MSIX ); }else ret =pci_alloc_irq_vectors_affinity (ha->pdev, min_vecs, - ha->msix_count,PCI_IRQ_MSIX |PCI_IRQ_AFFINITY , +min ((u16 )ha->msix_count, (u16 )num_online_cpus ()), +PCI_IRQ_MSIX |PCI_IRQ_AFFINITY , &desc);if (ret <0 ) {
Signature · 1 line
2.19.0.rc0
Nilesh Javali
maintainerPATCH v2 4/15 qla2xxx: tear down session if FW say its down
In reply to Nilesh JavaliFrom: Quinn Tran <[email protected]>
The completion status 0x28 (ppc = be = 0x2800) below indicate session is not there, trigger session deletion.
qla2xxx [000b:04:00.1]-8009:8: DEVICE RESET ISSUED nexus=8:1:51 cmd=c000001432d0f600. qla2xxx [000b:04:00.1]-5039:8: Async-tmf error - hdl=67b completion status(2800).
qla2xxx [000b:04:00.1]-8030:8: TM IOCB failed (102).
qla2xxx [000b:04:00.1]-800c:8: do_reset failed for cmd=c000001432d0f600.
qla2xxx [000b:04:00.1]-800f:8: DEVICE RESET FAILED: Task management failed nexus=8:1:51 cmd=c000001432d0f600. qla2xxx [000b:04:00.1]-8009:8: DEVICE RESET ISSUED nexus=8:1:52 cmd=c000001432d0c200. qla2xxx [000b:04:00.1]-5039:8: Async-tmf error - hdl=67c completion status(2800).
qla2xxx [000b:04:00.1]-8030:8: TM IOCB failed (102).
--- drivers/scsi/qla2xxx/qla_isr.c | 28 +++++++++++++++++++++++++++- 1 file changed, 27 insertions(+), 1 deletion(-)
drivers/scsi/qla2xxx/qla_isr.c +27 -1
@@ -2226,11 +2226,13 @@ qla24xx_tm_iocb_entry(scsi_qla_host_t *vha, struct req_que *req, void *tsk)srb_t *sp;struct srb_iocb *iocb;struct sts_entry_24xx *sts = (struct sts_entry_24xx *)tsk; +u16 comp_status; sp =qla2x00_get_sp_from_handle (vha, func, req, tsk);if (!sp)return ; + comp_status =le16_to_cpu (sts->comp_status); iocb = &sp->u.iocb_cmd; type = sp->name; fcport = sp->fcport;
@@ -2244,7 +2246,7 @@ qla24xx_tm_iocb_entry(scsi_qla_host_t *vha, struct req_que *req, void *tsk) }else if (sts->comp_status !=cpu_to_le16 (CS_COMPLETE )) {ql_log (ql_log_warn, fcport->vha,0x5039 ,"Async-%s error - hdl=%x completion status(%x).\n" , - type, sp->handle, sts->comp_status); + type, sp->handle, comp_status); iocb->u.tmf.data =QLA_FUNCTION_FAILED ; }else if ((le16_to_cpu (sts->scsi_status) &SS_RESPONSE_INFO_LEN_VALID )) {
@@ -2260,6 +2262,30 @@ qla24xx_tm_iocb_entry(scsi_qla_host_t *vha, struct req_que *req, void *tsk) } } +switch (comp_status) { +case CS_PORT_LOGGED_OUT : +case CS_PORT_CONFIG_CHG : +case CS_PORT_BUSY : +case CS_INCOMPLETE : +case CS_PORT_UNAVAILABLE : +case CS_TIMEOUT : +case CS_RESET : +if (atomic_read (&fcport->state) ==FCS_ONLINE ) { +ql_dbg (ql_dbg_disc, fcport->vha,0x3021 , +"-Port to be marked lost on fcport=%02x%02x%02x, current port state= %s comp_status %x.\n" , + fcport->d_id.b.domain, fcport->d_id.b.area, + fcport->d_id.b.al_pa, + port_state_str[FCS_ONLINE ], + comp_status); + +qlt_schedule_sess_for_deletion (fcport); + } +break ; + +default : +break ; + } +if (iocb->u.tmf.data !=QLA_SUCCESS )ql_dump_buffer (ql_dbg_async + ql_dbg_buffer, sp->vha,0x5055 , sts,sizeof (*sts));
Signature · 1 line
2.19.0.rc0
Nilesh Javali
maintainerPATCH v2 5/15 qla2xxx: Don't check for fw_started while posting nvme command
In reply to Nilesh JavaliFrom: Saurav Kashyap <[email protected]>
NVMe commands can come only after successful addition of rport and nvme connect, and rport is only registered after FW started bit is set. Remove the redundant check.
--- drivers/scsi/qla2xxx/qla_nvme.c | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-)
drivers/scsi/qla2xxx/qla_nvme.c +4 -8
@@ -554,19 +554,15 @@ static int qla_nvme_post_cmd(struct nvme_fc_local_port *lport, fcport = qla_rport->fcport; -if (!qpair || !fcport) -return -ENODEV ; - -if (!qpair->fw_started || fcport->deleted) +if (unlikely (!qpair || !fcport || fcport->deleted))return -EBUSY ; - vha = fcport->vha; -if (!(fcport->nvme_flag &NVME_FLAG_REGISTERED ))return -ENODEV ; -if (test_bit (ABORT_ISP_ACTIVE , &vha->dpc_flags) || - (qpair && !qpair->fw_started) || fcport->deleted) + vha = fcport->vha; + +if (test_bit (ABORT_ISP_ACTIVE , &vha->dpc_flags))return -EBUSY ;/*
Signature · 1 line
2.19.0.rc0
Nilesh Javali
maintainerPATCH v2 6/15 qla2xxx: Fix compilation issue in PPC systems
In reply to Nilesh JavaliFrom: Arun Easi <[email protected]>
Fix compile time errors reported on PPC systems,
qla_gbl.h:991:20: error: inlining failed in call to always_inline
‘qla_nvme_abort_set_option’: function body not available
--- drivers/scsi/qla2xxx/qla_nx.c | 2 +- drivers/scsi/qla2xxx/qla_nx2.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-)
drivers/scsi/qla2xxx/qla_nx.c +1 -1
@@ -965,7 +965,7 @@ qla82xx_read_status_reg(struct qla_hw_data *ha, uint32_t *val)static int qla82xx_flash_wait_write_finish (struct qla_hw_data *ha) { -uint32_t val; +uint32_t val =0 ;int i, ret;scsi_qla_host_t *vha =pci_get_drvdata (ha->pdev);
drivers/scsi/qla2xxx/qla_nx2.c +2 -2
@@ -139,7 +139,7 @@ qla8044_poll_wait_for_ready(struct scsi_qla_host *vha, uint32_t addr1, uint32_t mask) {unsigned long timeout; -uint32_t temp; +uint32_t temp =0 ;/* jiffies after 100ms */ timeout = jiffies +msecs_to_jiffies (TIMEOUT_100_MS );
@@ -2594,7 +2594,7 @@ qla8044_minidump_process_rdmux(struct scsi_qla_host *vha,struct qla8044_minidump_entry_hdr *entry_hdr, uint32_t **d_ptr) { - uint32_t r_addr, s_stride, s_addr, s_value, loop_cnt, i, r_value; + uint32_t r_addr, s_stride, s_addr, s_value, loop_cnt, i, r_value = 0;struct qla8044_minidump_entry_mux *mux_hdr;uint32_t *data_ptr = *d_ptr;
Signature · 1 line
2.19.0.rc0
Nilesh Javali
maintainerPATCH v2 7/15 qla2xxx: Fix crash during driver load on big endian machines
In reply to Nilesh JavaliFrom: Arun Easi <[email protected]>
Crash stack:
[576544.715489] Unable to handle kernel paging request for data at address 0xd00000000f970000 [576544.715497] Faulting instruction address: 0xd00000000f880f64 [576544.715503] Oops: Kernel access of bad area, sig: 11 [#1] [576544.715506] SMP NR_CPUS=2048 NUMA pSeries : [576544.715703] NIP [d00000000f880f64] .qla27xx_fwdt_template_valid+0x94/0x100 [qla2xxx] [576544.715722] LR [d00000000f7952dc] .qla24xx_load_risc_flash+0x2fc/0x590 [qla2xxx] [576544.715726] Call Trace: [576544.715731] [c0000004d0ffb000] [c0000006fe02c350] 0xc0000006fe02c350 (unreliable) [576544.715750] [c0000004d0ffb080] [d00000000f7952dc] .qla24xx_load_risc_flash+0x2fc/0x590 [qla2xxx] [576544.715770] [c0000004d0ffb170] [d00000000f7aa034] .qla81xx_load_risc+0x84/0x1a0 [qla2xxx] [576544.715789] [c0000004d0ffb210] [d00000000f79f7c8] .qla2x00_setup_chip+0xc8/0x910 [qla2xxx] [576544.715808] [c0000004d0ffb300] [d00000000f7a631c] .qla2x00_initialize_adapter+0x4dc/0xb00 [qla2xxx] [576544.715826] [c0000004d0ffb3e0] [d00000000f78ce28] .qla2x00_probe_one+0xf08/0x2200 [qla2xxx]
--- drivers/scsi/qla2xxx/qla_tmpl.c | 9 +++++---- drivers/scsi/qla2xxx/qla_tmpl.h | 2 +- 2 files changed, 6 insertions(+), 5 deletions(-)
drivers/scsi/qla2xxx/qla_tmpl.c +5 -4
@@ -928,7 +928,8 @@ qla27xx_template_checksum(void *p, ulong size)static inline int qla27xx_verify_template_checksum (struct qla27xx_fwdt_template *tmp) { -return qla27xx_template_checksum (tmp, tmp->template_size) ==0 ; +return qla27xx_template_checksum (tmp, +le32_to_cpu (tmp->template_size)) ==0 ; } static inline int
@@ -944,7 +945,7 @@ qla27xx_execute_fwdt_template(struct scsi_qla_host *vha,ulong len =0 ;if (qla27xx_fwdt_template_valid (tmp)) { - len = tmp->template_size; + len =le32_to_cpu (tmp->template_size); tmp =memcpy (buf, tmp, len);ql27xx_edit_template (vha, tmp);qla27xx_walk_template (vha, tmp, buf, &len);
@@ -960,7 +961,7 @@ qla27xx_fwdt_calculate_dump_size(struct scsi_qla_host *vha, void *p)ulong len =0 ;if (qla27xx_fwdt_template_valid (tmp)) { - len = tmp->template_size; + len =le32_to_cpu (tmp->template_size);qla27xx_walk_template (vha, tmp,NULL , &len); }
@@ -972,7 +973,7 @@ qla27xx_fwdt_template_size(void *p) {struct qla27xx_fwdt_template *tmp = p; -return tmp->template_size; +return le32_to_cpu (tmp->template_size); }int
drivers/scsi/qla2xxx/qla_tmpl.h +1 -1
@@ -12,7 +12,7 @@struct __packed qla27xx_fwdt_template {__le32 template_type;__le32 entry_offset; -uint32_t template_size; +__le32 template_size;uint32_t count;/* borrow field for running/residual count */ __le32 entry_count;
Signature · 1 line
2.19.0.rc0
Nilesh Javali
maintainerPATCH v2 8/15 qla2xxx: Fix FW initialization error on big endian machines
In reply to Nilesh JavaliFrom: Arun Easi <[email protected]>
Some fields are not correctly byte swapped causing failure during initialization. As probe() returns failure, HBAs will not be claimed when this happens.
qla2xxx [0007:01:00.0]-ffff:3: Secure Flash Update in FW: Supported qla2xxx [0007:01:00.0]-ffff:3: SCM in FW: Supported
qla2xxx [0007:01:00.0]-00d2:3: Init Firmware **** FAILED ****. qla2xxx [0007:01:00.0]-00d6:3: Failed to initialize adapter - Adapter flags 2. qla2xxx 0007:01:00.1: enabling device (0140 -> 0142)
qla2xxx [0007:01:00.1]-011c: : MSI-X vector count: 128.
qla2xxx [0007:01:00.1]-001d: : Found an ISP2289 irq 18 iobase 0xd000080080004000. qla2xxx 0007:01:00.1: Using 64-bit direct DMA at offset 800000000000000
BUG: Bad page state in process insmod pfn:67118 page:f00000000168bd40 count:-1 mapcount:0 mapping: (null) index:0x0 page flags: 0x3ffff800000000() page dumped because: nonzero _count Modules linked in: qla2xxx(OE+) nvme_fc nvme_fabrics nvme_core scsi_transport_fc scsi_tgt nls_utf8 isofs ip6t_rpfilter ipt_REJECT nf_reject_ipv4 ip6t_REJECT nf_reject_ipv6 xt_conntrack ip_set nfnetlink ebtable_nat ebtable_broute bridge stp llc ip6table_nat nf_conntrack_ipv6 nf_defrag_ipv6 nf_nat_ipv6 ip6table_mangle ip6table_security ip6table_raw iptable_nat nf_conntrack_ipv4 nf_defrag_ipv4 nf_nat_ipv4 nf_nat nf_conntrack iptable_mangle iptable_security iptable_raw ebtable_filter ebtables ip6table_filter ip6_tables iptable_filter nx_crypto ses enclosure scsi_transport_sas pseries_rng sg ip_tables xfs libcrc32c sr_mod cdrom sd_mod crc_t10dif crct10dif_generic crct10dif_common usb_storage ipr libata tg3 ptp pps_core dm_mirror dm_region_hash dm_log dm_mod CPU: 32 PID: 8560 Comm: insmod Kdump: loaded Tainted: G OE ------------ 3.10.0-957.el7.ppc64 #1 Call Trace: [c0000006dd7caa70] [c00000000001cca8] .show_stack+0x88/0x330 (unreliable) [c0000006dd7cab30] [c000000000ac3d88] .dump_stack+0x28/0x3c [c0000006dd7caba0] [c00000000029e48c] .bad_page+0x15c/0x1c0 [c0000006dd7cac40] [c00000000029f938] .get_page_from_freelist+0x11e8/0x1ea0 [c0000006dd7caf40] [c0000000002a1d30] .__alloc_pages_nodemask+0x1c0/0xc70 [c0000006dd7cb140] [c00000000002ba0c] .__dma_direct_alloc_coherent+0x8c/0x170 [c0000006dd7cb1e0] [d000000010a94688] .qla2x00_mem_alloc+0x10f8/0x1370 [qla2xxx] [c0000006dd7cb2d0] [d000000010a9c790] .qla2x00_probe_one+0xb60/0x22e0 [qla2xxx] [c0000006dd7cb540] [c0000000005de764] .pci_device_probe+0x204/0x300 [c0000006dd7cb600] [c0000000006ca61c] .driver_probe_device+0x2cc/0x6f0 [c0000006dd7cb6b0] [c0000000006cabec] .__driver_attach+0x10c/0x110 [c0000006dd7cb740] [c0000000006c5f04] .bus_for_each_dev+0x94/0x100 [c0000006dd7cb7e0] [c0000000006c94f4] .driver_attach+0x34/0x50 [c0000006dd7cb860] [c0000000006c8f58] .bus_add_driver+0x298/0x3b0 [c0000006dd7cb900] [c0000000006cb6e0] .driver_register+0xb0/0x1a0 [c0000006dd7cb980] [c0000000005dc474] .__pci_register_driver+0xc4/0xf0 [c0000006dd7cba10] [d000000010b94e20] .qla2x00_module_init+0x2a8/0x328 [qla2xxx] [c0000006dd7cbaa0] [c00000000000c130] .do_one_initcall+0x130/0x2e0 [c0000006dd7cbb50] [c0000000001b2e8c] .load_module+0x1afc/0x2340 [c0000006dd7cbd40] [c0000000001b3920] .SyS_finit_module+0xd0/0x130 [c0000006dd7cbe30] [c00000000000a284] system_call+0x38/0xfc
--- drivers/scsi/qla2xxx/qla_mbx.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/scsi/qla2xxx/qla_mbx.c +3 -3
@@ -1129,7 +1129,7 @@ qla2x00_get_fw_version(scsi_qla_host_t *vha)if (ha->flags.scm_supported_a && (ha->fw_attributes_ext[0 ] &FW_ATTR_EXT0_SCM_SUPPORTED )) { ha->flags.scm_supported_f =1 ; - ha->sf_init_cb->flags |=BIT_13 ; + ha->sf_init_cb->flags |=cpu_to_le16 (BIT_13 ); } ql_log(ql_log_info, vha, 0x11a3, "SCM in FW: %s\n", (ha->flags.scm_supported_f) ? "Supported" :
@@ -1137,9 +1137,9 @@ qla2x00_get_fw_version(scsi_qla_host_t *vha)if (vha->flags.nvme2_enabled) {/* set BIT_15 of special feature control block for SLER */ - ha->sf_init_cb->flags |=BIT_15 ; + ha->sf_init_cb->flags |=cpu_to_le16 (BIT_15 );/* set BIT_14 of special feature control block for PI CTRL*/ - ha->sf_init_cb->flags |=BIT_14 ; + ha->sf_init_cb->flags |=cpu_to_le16 (BIT_14 ); } }
Signature · 1 line
2.19.0.rc0
Nilesh Javali
maintainerPATCH v2 9/15 qla2xxx: fix N2N and NVME connect retry failure
In reply to Nilesh JavaliFrom: Quinn Tran <[email protected]>
FC-NVMe target discovery failed when initiator wwpn < target wwpn in an N2N (Direct Attach) config, where the driver was stuck on FCP PRLI mode and failed to retry with NVME PRLI.
--- drivers/scsi/qla2xxx/qla_init.c | 71 ++++++++++++++++++++++++--------- drivers/scsi/qla2xxx/qla_mbx.c | 3 -- 2 files changed, 52 insertions(+), 22 deletions(-)
drivers/scsi/qla2xxx/qla_init.c +52 -19
@@ -1268,9 +1268,10 @@ qla24xx_async_prli(struct scsi_qla_host *vha, fc_port_t *fcport) lio->u.logio.flags |=SRB_LOGIN_NVME_PRLI ;ql_dbg (ql_dbg_disc, vha,0x211b , -"Async-prli - %8phC hdl=%x, loopid=%x portid=%06x retries=%d %s.\n" , +"Async-prli - %8phC hdl=%x, loopid=%x portid=%06x retries=%d fc4type %x priority %x %s.\n" , fcport->port_name, sp->handle, fcport->loop_id, fcport->d_id.b24, - fcport->login_retry,NVME_TARGET (vha->hw, fcport) ?"nvme" :"fc" ); + fcport->login_retry, fcport->fc4_type, vha->hw->fc4_type_priority, +NVME_TARGET (vha->hw, fcport) ?"nvme" :"fcp" ); rval =qla2x00_start_sp (sp);if (rval !=QLA_SUCCESS ) {
@@ -1932,26 +1933,58 @@ qla24xx_handle_prli_done_event(struct scsi_qla_host *vha, struct event_arg *ea)break ; } -/* -* Retry PRLI with other FC-4 type if failure occurred on dual -* FCP/NVMe port -*/ -if (NVME_FCP_TARGET (ea->fcport)) { -ql_dbg (ql_dbg_disc, vha,0x2118 , -"%s %d %8phC post %s prli\n" , - __func__, __LINE__, ea->fcport->port_name, - (ea->fcport->fc4_type &FS_FC4TYPE_NVME ) ? -"NVMe" :"FCP" ); -if (vha->hw->fc4_type_priority ==FC4_PRIORITY_NVME ) +ql_dbg (ql_dbg_disc, vha,0x2118 , +"%s %d %8phC priority %s, fc4type %x\n" , + __func__, __LINE__, ea->fcport->port_name, + vha->hw->fc4_type_priority ==FC4_PRIORITY_FCP ? +"FCP" :"NVMe" , ea->fcport->fc4_type); + +if (N2N_TOPO (vha->hw)) { +if (vha->hw->fc4_type_priority ==FC4_PRIORITY_NVME ) { ea->fcport->fc4_type &= ~FS_FC4TYPE_NVME ; -else + ea->fcport->fc4_type |=FS_FC4TYPE_FCP ; + }else { ea->fcport->fc4_type &= ~FS_FC4TYPE_FCP ; - } + ea->fcport->fc4_type |=FS_FC4TYPE_NVME ; + } - ea->fcport->flags &= ~FCF_ASYNC_SENT ; - ea->fcport->keep_nport_handle =0 ; - ea->fcport->logout_on_delete =1 ; -qlt_schedule_sess_for_deletion (ea->fcport); +if (ea->fcport->n2n_link_reset_cnt <3 ) { + ea->fcport->n2n_link_reset_cnt++; + vha->relogin_jif = jiffies +2 *HZ ; +/* +* PRLI failed. Reset link to kick start +* state machine +*/ +set_bit (N2N_LINK_RESET , &vha->dpc_flags); + }else { +ql_log (ql_log_warn, vha,0x2119 , +"%s %d %8phC Unable to reconnect\n" , + __func__, __LINE__, + ea->fcport->port_name); + } + }else { +/* +* switch connect. login failed. Take connection down +* and allow relogin to retrigger +*/ +if (NVME_FCP_TARGET (ea->fcport)) { +ql_dbg (ql_dbg_disc, vha,0x2118 , +"%s %d %8phC post %s prli\n" , + __func__, __LINE__, + ea->fcport->port_name, + (ea->fcport->fc4_type &FS_FC4TYPE_NVME ) + ?"NVMe" :"FCP" ); +if (vha->hw->fc4_type_priority ==FC4_PRIORITY_NVME ) + ea->fcport->fc4_type &= ~FS_FC4TYPE_NVME ; +else + ea->fcport->fc4_type &= ~FS_FC4TYPE_FCP ; + } + + ea->fcport->flags &= ~FCF_ASYNC_SENT ; + ea->fcport->keep_nport_handle =0 ; + ea->fcport->logout_on_delete =1 ; +qlt_schedule_sess_for_deletion (ea->fcport); + }break ; } }
drivers/scsi/qla2xxx/qla_mbx.c +0 -3
@@ -3998,9 +3998,6 @@ qla24xx_report_id_acquisition(scsi_qla_host_t *vha, fcport->scan_state =QLA_FCPORT_FOUND ; fcport->n2n_flag =1 ; fcport->keep_nport_handle =1 ; - fcport->fc4_type =FS_FC4TYPE_FCP ; -if (vha->flags.nvme_enabled) - fcport->fc4_type |=FS_FC4TYPE_NVME ;if (wwn_to_u64 (vha->port_name) >wwn_to_u64 (fcport->port_name)) {
Signature · 1 line
2.19.0.rc0
Nilesh Javali
maintainerPATCH v2 10/15 qla2xxx: Handle aborts correctly for port undergoing deletion
In reply to Nilesh JavaliFrom: Saurav Kashyap <[email protected]>
Call trace observed while shutting down the adapter ports (LINK DOWN). Handle aborts correctly.
localhost kernel: INFO: task nvme:44209 blocked for more than 120 seconds. localhost kernel: "echo 0 >/proc/sys/kernel/hung_task_timeout_secs" disables this message.
localhost kernel: nvme D ffff88b45fb5acc0 0 44209 1 0x00000080
localhost kernel: Call Trace:
localhost kernel: [<ffffffffbd187169>] schedule+0x29/0x70
localhost kernel: [<ffffffffbd184c51>] schedule_timeout+0x221/0x2d0 localhost kernel: [<ffffffffbcad7229>] ? ttwu_do_wakeup+0x19/0xe0
localhost kernel: [<ffffffffbcad735f>] ? ttwu_do_activate+0x6f/0x80 localhost kernel: [<ffffffffbcada830>] ? try_to_wake_up+0x190/0x390 localhost kernel: [<ffffffffbd18751d>] wait_for_completion+0xfd/0x140 localhost kernel: [<ffffffffbcadaaf0>] ? wake_up_state+0x20/0x20
localhost kernel: [<ffffffffbcabe3da>] flush_work+0x10a/0x1b0
localhost kernel: [<ffffffffbcabb0f0>] ? move_linked_works+0x90/0x90 localhost kernel: [<ffffffffbcabe6cf>] flush_delayed_work+0x3f/0x50 localhost kernel: [<ffffffffc0452767>] nvme_fc_init_ctrl+0x657/0x6a0 [nvme_fc] localhost kernel: [<ffffffffc045293a>] nvme_fc_create_ctrl+0x18a/0x210 [nvme_fc] localhost kernel: [<ffffffffc028962f>] nvmf_dev_write+0x98f/0xb35 [nvme_fabrics] localhost kernel: [<ffffffffbcd08927>] ? security_file_permission+0x27/0xa0 localhost kernel: [<ffffffffbcc4db50>] vfs_write+0xc0/0x1f0
localhost kernel: [<ffffffffbcc4e92f>] SyS_write+0x7f/0xf0
localhost kernel: [<ffffffffbd193f92>] system_call_fastpath+0x25/0x2a
--- drivers/scsi/qla2xxx/qla_nvme.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/scsi/qla2xxx/qla_nvme.c +1 -1
@@ -227,7 +227,7 @@ static void qla_nvme_abort_work(struct work_struct *work)"%s called for sp=%p, hndl=%x on fcport=%p deleted=%d\n" , __func__, sp, sp->handle, fcport, fcport->deleted); -if (!ha->flags.fw_started && fcport->deleted) +if (!ha->flags.fw_started || fcport->deleted) goto out;if (ha->flags.host_shutting_down) {
Signature · 1 line
2.19.0.rc0
Nilesh Javali
maintainerPATCH v2 11/15 qla2xxx: Fix flash update in 28XX adapters on big endian machines
In reply to Nilesh JavaliFrom: Arun Easi <[email protected]>
Flash update failed due to missing endian conversion in FLT region access as well as in checksum computation.
--- drivers/scsi/qla2xxx/qla_sup.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-)
drivers/scsi/qla2xxx/qla_sup.c +5 -5
@@ -2634,14 +2634,14 @@ qla28xx_extract_sfub_and_verify(struct scsi_qla_host *vha, uint32_t *buf, sizeof(struct secure_flash_update_block));for (i =0 ; i < (sizeof (struct secure_flash_update_block ) >>2 ); i++) - check_sum += p[i]; + check_sum +=le32_to_cpu (p[i]); check_sum = (~check_sum) +1 ; -if (check_sum != p[i]) { +if (check_sum !=le32_to_cpu (p[i])) {ql_log (ql_log_warn, vha,0x7097 ,"SFUB checksum failed, 0x%x, 0x%x\n" , - check_sum, p[i]); + check_sum,le32_to_cpu (p[i]));return QLA_COMMAND_ERROR ; }
@@ -2721,7 +2721,7 @@ qla28xx_write_flash_data(scsi_qla_host_t *vha, uint32_t *dwptr, uint32_t faddr,if (ha->flags.secure_adapter && region.attribute) {ql_log (ql_log_warn + ql_dbg_verbose, vha,0xffff , -"Region %x is secure\n" , region.code); +"Region %x is secure\n" ,le16_to_cpu (region.code));switch (le16_to_cpu (region.code)) {case FLT_REG_FW :
@@ -2775,7 +2775,7 @@ qla28xx_write_flash_data(scsi_qla_host_t *vha, uint32_t *dwptr, uint32_t faddr,default :ql_log (ql_log_warn + ql_dbg_verbose, vha,0xffff ,"Secure region %x not supported\n" , - region.code); +le16_to_cpu (region.code)); rval =QLA_COMMAND_ERROR ; goto done; }
Signature · 1 line
2.19.0.rc0
Nilesh Javali
maintainerPATCH v2 12/15 qla2xxx: Fix the call trace for flush workqueue
In reply to Nilesh JavaliFrom: Saurav Kashyap <[email protected]>
The call trace was because workqueue was allocated without any flags, added WQ_MEM_RECLAIM as flag while allocation.
kernel: workqueue: WQ_MEM_RECLAIM
kblockd:blk_mq_run_work_fn is flushing !WQ_MEM_RECLAIM qla2xxx_wq:0x0
kernel: WARNING: CPU: 0 PID: 2475 atkernel/workqueue.c:2593 check_flush_dependency+0x110/0x130
kernel: CPU: 0 PID: 2475 Comm: kworker/0:1H Kdump:
loaded Tainted: G OE --------- - - 4.18.0-193.el8.x86_64 #1
kernel: Hardware name: HPE ProLiant XL170r Gen10/ProLiant XL170r Gen10, BIOS U38 05/21/2019
kernel: Workqueue: kblockd blk_mq_run_work_fn
kernel: RIP: 0010:check_flush_dependency+0x110/0x130
kernel: Code: ff ff 48 8b 50 18 48 8d 8b b0 00 00 00 49 89 e8 48 81 c6 b0 00 00 00 48 c7 c7 00 1e e9
95 c6 05 dc 9a 2f 01 01 e8 1a 42 fe ff <0f> 0b e9 0a ff ff ff 80 3d ca 9a 2f 01 0 0 75 95 e9 41 ff ff ff 90
kernel: RSP: 0018:ffffa40f48b2baf8 EFLAGS: 00010282
kernel: RAX: 0000000000000000 RBX: ffff946795282600 RCX: 0000000000000000
kernel: RDX: 000000000000005f RSI: ffffffff96a1af7f RDI: 0000000000000246
kernel: RBP: 0000000000000000 R08: ffffffff96a1af20 R09: 0000000000029480
kernel: R10: 00080c89bb3e7462 R11: 00000000000009ab R12: ffff946773628000
kernel: R13: 0000000000000282 R14: 0000000000000246 R15: ffffa40f48b2bb40
kernel: FS: 0000000000000000(0000) GS:ffff94679fa00000(0000) knlGS:0000000000000000
kernel: CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
kernel: CR2: 00005570c4b60110 CR3: 000000029140a005 CR4: 00000000007606f0
kernel: DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
kernel: DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
kernel: PKRU: 55555554
kernel: Call Trace:
kernel: flush_workqueue+0x13a/0x440
kernel: qla2x00_wait_for_sess_deletion+0x1d6/0x200 [qla2xxx]
kernel: ? finish_wait+0x80/0x80
kernel: qla2xxx_disable_port+0x2b/0x30 [qla2xxx]
kernel: qla2x00_process_vendor_specific+0x1dc9/0x2d20 [qla2xxx]
kernel: ? blk_rq_map_sg+0x195/0x570
kernel: qla24xx_bsg_request+0x1a3/0xf90 [qla2xxx]
--- drivers/scsi/qla2xxx/qla_os.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/scsi/qla2xxx/qla_os.c +1 -1
@@ -3265,7 +3265,7 @@ qla2x00_probe_one(struct pci_dev *pdev, const struct pci_device_id *id)"req->req_q_in=%p req->req_q_out=%p rsp->rsp_q_in=%p rsp->rsp_q_out=%p.\n" , req->req_q_in, req->req_q_out, rsp->rsp_q_in, rsp->rsp_q_out); - ha->wq =alloc_workqueue ("qla2xxx_wq" ,0 ,0 ); + ha->wq =alloc_workqueue ("qla2xxx_wq" ,WQ_MEM_RECLAIM ,0 );if (unlikely (!ha->wq)) { ret = -ENOMEM ; goto probe_failed;
Signature · 1 line
2.19.0.rc0
Nilesh Javali
maintainerPATCH v2 13/15 qla2xxx: If fcport is undergoing deletion return IO with retry
In reply to Nilesh JavaliFrom: Saurav Kashyap <[email protected]>
Driver unload with IOs causes server to crash. Return IO with retry if fcport undergoing deletion.
CPU: 44 PID: 35008 Comm: qla2xxx_4_dpc Kdump: loaded Tainted: G
OE X 5.3.18-22-default #1 SLE15-SP2 (unreleased)
Hardware name: HPE ProLiant DL380 Gen10/ProLiant DL380 Gen10, BIOS U30 07/16/2020
RIP: 0010:dma_direct_unmap_sg+0x24/0x60
Code: 4c 8b 04 24 eb b9 0f 1f 44 00 00 85 d2 7e 4e 41 57
4d 89 c7 41 56 41 89 ce 41 55 49 89 fd 41 54 41 89 d4 55 31 ed 53 48 89
f3 <8b> 53 18 48 8b 73 10 4d 89 f8 44 89 f1 4c 89 ef 83 c5 01 e8 44 ff
RSP: 0018:ffffc0c661037d88 EFLAGS: 00010046
RAX: 0000000000000000 RBX: 0000000000000000 RCX: 0000000000000002
RDX: 000000000000001d RSI: 0000000000000000 RDI: ffff9a51ee53b0b0
RBP: 0000000000000000 R08: 0000000000000000 R09: ffff9a51ee53b0b0
R10: ffffc0c646463dc8 R11: ffff9a4a067087c8 R12: 000000000000001d
R13: ffff9a51ee53b0b0 R14: 0000000000000002 R15: 0000000000000000
FS: 0000000000000000(0000) GS:ffff9a523f800000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 0000000000000018 CR3: 000000043740a004 CR4: 00000000007606e0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
PKRU: 55555554
Call Trace:
qla2xxx_qpair_sp_free_dma+0x20d/0x3c0 [qla2xxx]
qla2xxx_qpair_sp_compl+0x35/0x90 [qla2xxx]
__qla2x00_abort_all_cmds+0x180/0x390 [qla2xxx]
? qla24xx_process_purex_list+0x100/0x100 [qla2xxx]
qla2x00_abort_all_cmds+0x5e/0x80 [qla2xxx]
qla2x00_do_dpc+0x317/0xa30 [qla2xxx]
kthread+0x10d/0x130
? kthread_park+0xa0/0xa0
ret_from_fork+0x35/0x40--- drivers/scsi/qla2xxx/qla_os.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
drivers/scsi/qla2xxx/qla_os.c +4 -4
@@ -884,8 +884,8 @@ qla2xxx_queuecommand(struct Scsi_Host *host, struct scsi_cmnd *cmd) goto qc24_fail_command; } -if (!fcport) { - cmd->result =DID_NO_CONNECT <<16 ; +if (!fcport || fcport->deleted) { + cmd->result =DID_IMM_RETRY <<16 ; goto qc24_fail_command; }
@@ -966,8 +966,8 @@ qla2xxx_mqueuecommand(struct Scsi_Host *host, struct scsi_cmnd *cmd, goto qc24_fail_command; } -if (!fcport) { - cmd->result =DID_NO_CONNECT <<16 ; +if (!fcport || fcport->deleted) { + cmd->result =DID_IMM_RETRY <<16 ; goto qc24_fail_command; }
Signature · 1 line
2.19.0.rc0
Nilesh Javali
maintainerPATCH v2 14/15 qla2xxx: Fix device loss on 4G and older HBAs.
In reply to Nilesh JavaliFrom: Arun Easi <[email protected]>
Due to a bug in the older scan logic, when a once lost device re-appeared, it was not discovered. Fix this by resetting login_retry counter upon device discovery.
This is applicable only for 4G and older HBAs.
--- drivers/scsi/qla2xxx/qla_init.c | 3 +++ 1 file changed, 3 insertions(+)
drivers/scsi/qla2xxx/qla_init.c +3 -0
@@ -5982,6 +5982,9 @@ qla2x00_find_all_fabric_devs(scsi_qla_host_t *vha)break ; } +if (fcport->login_retry ==0 ) + fcport->login_retry = + vha->hw->login_retry_count;/* * If device was not a fabric device before. */
Signature · 1 line
2.19.0.rc0
Nilesh Javali
maintainerPATCH v2 15/15 qla2xxx: Update version to 10.02.00.104-k
In reply to Nilesh Javali--- drivers/scsi/qla2xxx/qla_version.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/scsi/qla2xxx/qla_version.h +2 -2
@@ -6,9 +6,9 @@/* * Driver version */ -#define QLA2XXX_VERSION "10.02.00.103-k" +#define QLA2XXX_VERSION "10.02.00.104-k"#define QLA_DRIVER_MAJOR_VER 10#define QLA_DRIVER_MINOR_VER 2#define QLA_DRIVER_PATCH_VER 0 -#define QLA_DRIVER_BETA_VER 103 +#define QLA_DRIVER_BETA_VER 104
Signature · 1 line
2.19.0.rc0
Martin K. Petersen
AppliedNilesh,
Quoted 2 lines
Please apply the qla2xxx bug fixes to the scsi tree at your earliest convenience.
Applied to 5.11/scsi-staging, thanks!
Signature · 1 line
Martin K. Petersen Oracle Linux Engineering
Martin K. Petersen
AppliedQuoted 11 lines · Nilesh Javali
Martin,
Please apply the qla2xxx bug fixes to the scsi tree at your earliest convenience.v1=>v2:
Incorporate review comments
Add call trace details
Add missing Fixes and stable tag
Add Reviewed-by tag[...]
Applied to 5.11/scsi-queue, thanks!
[01/15] scsi: qla2xxx: Return EBUSY on fcport deletion
https://git.kernel.org/mkp/scsi/c/305c16ce2632 [02/15] qla2xxx: Change post del message from debug level to log level https://git.kernel.org/mkp/scsi/c/c1599657d48c [03/15] qla2xxx: limit interrupt vectors to number of cpu https://git.kernel.org/mkp/scsi/c/a6dcfe08487e [04/15] qla2xxx: tear down session if FW say its down https://git.kernel.org/mkp/scsi/c/e4fc78f48d3f [05/15] qla2xxx: Don't check for fw_started while posting nvme command https://git.kernel.org/mkp/scsi/c/0ce8ab50a6ed [06/15] qla2xxx: Fix compilation issue in PPC systems https://git.kernel.org/mkp/scsi/c/aceba54ba0f9 [07/15] qla2xxx: Fix crash during driver load on big endian machines https://git.kernel.org/mkp/scsi/c/8de309e7299a [08/15] qla2xxx: Fix FW initialization error on big endian machines https://git.kernel.org/mkp/scsi/c/8a78dd6ed1af [09/15] qla2xxx: fix N2N and NVME connect retry failure https://git.kernel.org/mkp/scsi/c/07a5f69248e3 [10/15] qla2xxx: Handle aborts correctly for port undergoing deletion https://git.kernel.org/mkp/scsi/c/f795f96e725b [11/15] qla2xxx: Fix flash update in 28XX adapters on big endian machines https://git.kernel.org/mkp/scsi/c/0bc17251dff4 [12/15] qla2xxx: Fix the call trace for flush workqueue https://git.kernel.org/mkp/scsi/c/0a6f4d762c6b [13/15] qla2xxx: If fcport is undergoing deletion return IO with retry https://git.kernel.org/mkp/scsi/c/707531bc2626 [14/15] qla2xxx: Fix device loss on 4G and older HBAs. https://git.kernel.org/mkp/scsi/c/abd9cae9bbae [15/15] qla2xxx: Update version to 10.02.00.104-k https://git.kernel.org/mkp/scsi/c/afc516dcfe52
Signature · 1 line
Martin K. Petersen Oracle Linux Engineering