diff --git a/patches.suse/scsi-lpfc-Copyright-updates-for-14.4.0.1-patches.patch b/patches.suse/scsi-lpfc-Copyright-updates-for-14.4.0.1-patches.patch new file mode 100644 index 0000000..5abcf1c --- /dev/null +++ b/patches.suse/scsi-lpfc-Copyright-updates-for-14.4.0.1-patches.patch @@ -0,0 +1,41 @@ +From: Justin Tee +Date: Tue, 5 Mar 2024 12:05:03 -0800 +Subject: scsi: lpfc: Copyright updates for 14.4.0.1 patches +Patch-mainline: Queued in subsystem maintainer repository +Git-repo: git://git.kernel.org/pub/scm/linux/kernel/git/mkp/scsi.git +Git-commit: 0fa215e5326b49fc7870e2f576bc4316017a23dd +References: bsc#1221777 + +Update copyrights to 2024 for files modified in the 14.4.0.1 patch set. + +Signed-off-by: Justin Tee +Link: https://lore.kernel.org/r/20240305200503.57317-13-justintee8345@gmail.com +Signed-off-by: Martin K. Petersen +Acked-by: Daniel Wagner +--- + drivers/scsi/lpfc/lpfc_sli.h | 2 +- + drivers/scsi/lpfc/lpfc_sli4.h | 2 +- + 2 files changed, 2 insertions(+), 2 deletions(-) + +--- a/drivers/scsi/lpfc/lpfc_sli.h ++++ b/drivers/scsi/lpfc/lpfc_sli.h +@@ -1,7 +1,7 @@ + /******************************************************************* + * This file is part of the Emulex Linux Device Driver for * + * Fibre Channel Host Bus Adapters. * +- * Copyright (C) 2017-2023 Broadcom. All Rights Reserved. The term * ++ * Copyright (C) 2017-2024 Broadcom. All Rights Reserved. The term * + * “Broadcom” refers to Broadcom Inc. and/or its subsidiaries. * + * Copyright (C) 2004-2016 Emulex. All rights reserved. * + * EMULEX and SLI are trademarks of Emulex. * +--- a/drivers/scsi/lpfc/lpfc_sli4.h ++++ b/drivers/scsi/lpfc/lpfc_sli4.h +@@ -1,7 +1,7 @@ + /******************************************************************* + * This file is part of the Emulex Linux Device Driver for * + * Fibre Channel Host Bus Adapters. * +- * Copyright (C) 2017-2023 Broadcom. All Rights Reserved. The term * ++ * Copyright (C) 2017-2024 Broadcom. All Rights Reserved. The term * + * “Broadcom” refers to Broadcom Inc. and/or its subsidiaries. * + * Copyright (C) 2009-2016 Emulex. All rights reserved. * + * EMULEX and SLI are trademarks of Emulex. * diff --git a/patches.suse/scsi-lpfc-Correct-size-for-cmdwqe-rspwqe-for-memset.patch b/patches.suse/scsi-lpfc-Correct-size-for-cmdwqe-rspwqe-for-memset.patch new file mode 100644 index 0000000..5202ac0 --- /dev/null +++ b/patches.suse/scsi-lpfc-Correct-size-for-cmdwqe-rspwqe-for-memset.patch @@ -0,0 +1,36 @@ +From: Muhammad Usama Anjum +Date: Mon, 4 Mar 2024 14:11:19 +0500 +Subject: scsi: lpfc: Correct size for cmdwqe/rspwqe for memset() +Patch-mainline: Queued in subsystem maintainer repository +Git-repo: git://git.kernel.org/pub/scm/linux/kernel/git/mkp/scsi.git +Git-commit: 16cc2ba71b9f6440805aef7f92ba0f031f79b765 +References: bsc#1221777 + +The cmdwqe and rspwqe are of type lpfc_wqe128. They should be memset() with +the same type. + +Fixes: 61910d6a5243 ("scsi: lpfc: SLI path split: Refactor CT paths") +Signed-off-by: Muhammad Usama Anjum +Link: https://lore.kernel.org/r/20240304091119.847060-1-usama.anjum@collabora.com +Reviewed-by: Justin Tee +Signed-off-by: Martin K. Petersen +Acked-by: Daniel Wagner +--- + drivers/scsi/lpfc/lpfc_bsg.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +--- a/drivers/scsi/lpfc/lpfc_bsg.c ++++ b/drivers/scsi/lpfc/lpfc_bsg.c +@@ -3169,10 +3169,10 @@ lpfc_bsg_diag_loopback_run(struct bsg_jo + } + + cmdwqe = &cmdiocbq->wqe; +- memset(cmdwqe, 0, sizeof(union lpfc_wqe)); ++ memset(cmdwqe, 0, sizeof(*cmdwqe)); + if (phba->sli_rev < LPFC_SLI_REV4) { + rspwqe = &rspiocbq->wqe; +- memset(rspwqe, 0, sizeof(union lpfc_wqe)); ++ memset(rspwqe, 0, sizeof(*rspwqe)); + } + + INIT_LIST_HEAD(&head); diff --git a/patches.suse/scsi-lpfc-Correct-size-for-wqe-for-memset.patch b/patches.suse/scsi-lpfc-Correct-size-for-wqe-for-memset.patch new file mode 100644 index 0000000..6a6f4e4 --- /dev/null +++ b/patches.suse/scsi-lpfc-Correct-size-for-wqe-for-memset.patch @@ -0,0 +1,32 @@ +From: Muhammad Usama Anjum +Date: Mon, 4 Mar 2024 14:06:48 +0500 +Subject: scsi: lpfc: Correct size for wqe for memset() +Patch-mainline: Queued in subsystem maintainer repository +Git-repo: git://git.kernel.org/pub/scm/linux/kernel/git/mkp/scsi.git +Git-commit: 28d41991182c210ec1654f8af2e140ef4cc73f20 +References: bsc#1221777 + +The wqe is of type lpfc_wqe128. It should be memset with the same type. + +Fixes: 6c621a2229b0 ("scsi: lpfc: Separate NVMET RQ buffer posting from IO resources SGL/iocbq/context") +Signed-off-by: Muhammad Usama Anjum +Link: https://lore.kernel.org/r/20240304090649.833953-1-usama.anjum@collabora.com +Reviewed-by: AngeloGioacchino Del Regno +Reviewed-by: Justin Tee +Signed-off-by: Martin K. Petersen +Acked-by: Daniel Wagner +--- + drivers/scsi/lpfc/lpfc_nvmet.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/drivers/scsi/lpfc/lpfc_nvmet.c ++++ b/drivers/scsi/lpfc/lpfc_nvmet.c +@@ -1586,7 +1586,7 @@ lpfc_nvmet_setup_io_context(struct lpfc_ + wqe = &nvmewqe->wqe; + + /* Initialize WQE */ +- memset(wqe, 0, sizeof(union lpfc_wqe)); ++ memset(wqe, 0, sizeof(*wqe)); + + ctx_buf->iocbq->cmd_dmabuf = NULL; + spin_lock(&phba->sli4_hba.sgl_list_lock); diff --git a/patches.suse/scsi-lpfc-Define-lpfc_dmabuf-type-for-ctx_buf-ptr.patch b/patches.suse/scsi-lpfc-Define-lpfc_dmabuf-type-for-ctx_buf-ptr.patch new file mode 100644 index 0000000..1f78ce4 --- /dev/null +++ b/patches.suse/scsi-lpfc-Define-lpfc_dmabuf-type-for-ctx_buf-ptr.patch @@ -0,0 +1,470 @@ +From: Justin Tee +Date: Tue, 5 Mar 2024 12:05:00 -0800 +Subject: scsi: lpfc: Define lpfc_dmabuf type for ctx_buf ptr +Patch-mainline: Queued in subsystem maintainer repository +Git-repo: git://git.kernel.org/pub/scm/linux/kernel/git/mkp/scsi.git +Git-commit: 115d137aa918d879e3cca9605bbf59e0482aa734 +References: bsc#1221777 + +In LPFC_MBOXQ_t, the ctx_buf ptr shouldn't be defined as a generic void +*ptr. It is named ctx_buf and it should only be used as an lpfc_dmabuf +*ptr. Due to the void* declaration, there have been abuses of ctx_buf for +things not related to lpfc_dmabuf. + +So, set the ptr type for *ctx_buf as lpfc_dmabuf. Remove all type casts on +ctx_buf because it is no longer a void *ptr. Convert the abuse of ctx_buf +for something not related to lpfc_dmabuf to use the void *context3 ptr. + +A particular abuse of the ctx_buf warranted a new void *ext_buf ptr. +However, the usage of this new void *ext_buf is not generic. It is +intended to only hold virtual addresses for extended mailbox commands. + +Signed-off-by: Justin Tee +Link: https://lore.kernel.org/r/20240305200503.57317-10-justintee8345@gmail.com +Signed-off-by: Martin K. Petersen +Acked-by: Daniel Wagner +--- + drivers/scsi/lpfc/lpfc_bsg.c | 12 ++++++------ + drivers/scsi/lpfc/lpfc_els.c | 14 +++++++------- + drivers/scsi/lpfc/lpfc_hbadisc.c | 10 +++++----- + drivers/scsi/lpfc/lpfc_init.c | 8 ++++---- + drivers/scsi/lpfc/lpfc_mbox.c | 15 ++++----------- + drivers/scsi/lpfc/lpfc_nportdisc.c | 2 +- + drivers/scsi/lpfc/lpfc_sli.c | 35 +++++++++++++++++------------------ + drivers/scsi/lpfc/lpfc_sli.h | 6 +++++- + drivers/scsi/lpfc/lpfc_vport.c | 2 +- + 9 files changed, 50 insertions(+), 54 deletions(-) + +--- a/drivers/scsi/lpfc/lpfc_bsg.c ++++ b/drivers/scsi/lpfc/lpfc_bsg.c +@@ -2513,7 +2513,7 @@ static int lpfcdiag_loop_self_reg(struct + return -ENOMEM; + } + +- dmabuff = (struct lpfc_dmabuf *)mbox->ctx_buf; ++ dmabuff = mbox->ctx_buf; + mbox->ctx_buf = NULL; + mbox->ctx_ndlp = NULL; + status = lpfc_sli_issue_mbox_wait(phba, mbox, LPFC_MBOX_TMO); +@@ -3553,7 +3553,7 @@ lpfc_bsg_issue_mbox_ext_handle_job(struc + struct lpfc_sli_config_mbox *sli_cfg_mbx; + uint8_t *pmbx; + +- dd_data = pmboxq->ctx_buf; ++ dd_data = pmboxq->context3; + + /* Determine if job has been aborted */ + spin_lock_irqsave(&phba->ct_ev_lock, flags); +@@ -3940,7 +3940,7 @@ lpfc_bsg_sli_cfg_read_cmd_ext(struct lpf + pmboxq->mbox_cmpl = lpfc_bsg_issue_read_mbox_ext_cmpl; + + /* context fields to callback function */ +- pmboxq->ctx_buf = dd_data; ++ pmboxq->context3 = dd_data; + dd_data->type = TYPE_MBOX; + dd_data->set_job = job; + dd_data->context_un.mbox.pmboxq = pmboxq; +@@ -4112,7 +4112,7 @@ lpfc_bsg_sli_cfg_write_cmd_ext(struct lp + pmboxq->mbox_cmpl = lpfc_bsg_issue_write_mbox_ext_cmpl; + + /* context fields to callback function */ +- pmboxq->ctx_buf = dd_data; ++ pmboxq->context3 = dd_data; + dd_data->type = TYPE_MBOX; + dd_data->set_job = job; + dd_data->context_un.mbox.pmboxq = pmboxq; +@@ -4460,7 +4460,7 @@ lpfc_bsg_write_ebuf_set(struct lpfc_hba + pmboxq->mbox_cmpl = lpfc_bsg_issue_write_mbox_ext_cmpl; + + /* context fields to callback function */ +- pmboxq->ctx_buf = dd_data; ++ pmboxq->context3 = dd_data; + dd_data->type = TYPE_MBOX; + dd_data->set_job = job; + dd_data->context_un.mbox.pmboxq = pmboxq; +@@ -4747,7 +4747,7 @@ lpfc_bsg_issue_mbox(struct lpfc_hba *phb + if (mbox_req->inExtWLen || mbox_req->outExtWLen) { + from = pmbx; + ext = from + sizeof(MAILBOX_t); +- pmboxq->ctx_buf = ext; ++ pmboxq->ext_buf = ext; + pmboxq->in_ext_byte_len = + mbox_req->inExtWLen * sizeof(uint32_t); + pmboxq->out_ext_byte_len = +--- a/drivers/scsi/lpfc/lpfc_els.c ++++ b/drivers/scsi/lpfc/lpfc_els.c +@@ -7290,7 +7290,7 @@ int lpfc_get_sfp_info_wait(struct lpfc_h + mbox->in_ext_byte_len = DMP_SFF_PAGE_A0_SIZE; + mbox->out_ext_byte_len = DMP_SFF_PAGE_A0_SIZE; + mbox->mbox_offset_word = 5; +- mbox->ctx_buf = virt; ++ mbox->ext_buf = virt; + } else { + bf_set(lpfc_mbx_memory_dump_type3_length, + &mbox->u.mqe.un.mem_dump_type3, DMP_SFF_PAGE_A0_SIZE); +@@ -7306,7 +7306,7 @@ int lpfc_get_sfp_info_wait(struct lpfc_h + } + + if (phba->sli_rev == LPFC_SLI_REV4) +- mp = (struct lpfc_dmabuf *)(mbox->ctx_buf); ++ mp = mbox->ctx_buf; + else + mp = mpsave; + +@@ -7349,7 +7349,7 @@ int lpfc_get_sfp_info_wait(struct lpfc_h + mbox->in_ext_byte_len = DMP_SFF_PAGE_A2_SIZE; + mbox->out_ext_byte_len = DMP_SFF_PAGE_A2_SIZE; + mbox->mbox_offset_word = 5; +- mbox->ctx_buf = virt; ++ mbox->ext_buf = virt; + } else { + bf_set(lpfc_mbx_memory_dump_type3_length, + &mbox->u.mqe.un.mem_dump_type3, DMP_SFF_PAGE_A2_SIZE); +@@ -8637,9 +8637,9 @@ lpfc_els_rsp_rls_acc(struct lpfc_hba *ph + mb = &pmb->u.mb; + + ndlp = pmb->ctx_ndlp; +- rxid = (uint16_t)((unsigned long)(pmb->ctx_buf) & 0xffff); +- oxid = (uint16_t)(((unsigned long)(pmb->ctx_buf) >> 16) & 0xffff); +- pmb->ctx_buf = NULL; ++ rxid = (uint16_t)((unsigned long)(pmb->context3) & 0xffff); ++ oxid = (uint16_t)(((unsigned long)(pmb->context3) >> 16) & 0xffff); ++ pmb->context3 = NULL; + pmb->ctx_ndlp = NULL; + + if (mb->mbxStatus) { +@@ -8743,7 +8743,7 @@ lpfc_els_rcv_rls(struct lpfc_vport *vpor + mbox = mempool_alloc(phba->mbox_mem_pool, GFP_ATOMIC); + if (mbox) { + lpfc_read_lnk_stat(phba, mbox); +- mbox->ctx_buf = (void *)((unsigned long) ++ mbox->context3 = (void *)((unsigned long) + (ox_id << 16 | ctx)); + mbox->ctx_ndlp = lpfc_nlp_get(ndlp); + if (!mbox->ctx_ndlp) +--- a/drivers/scsi/lpfc/lpfc_hbadisc.c ++++ b/drivers/scsi/lpfc/lpfc_hbadisc.c +@@ -3428,7 +3428,7 @@ static void + lpfc_mbx_cmpl_read_sparam(struct lpfc_hba *phba, LPFC_MBOXQ_t *pmb) + { + MAILBOX_t *mb = &pmb->u.mb; +- struct lpfc_dmabuf *mp = (struct lpfc_dmabuf *)pmb->ctx_buf; ++ struct lpfc_dmabuf *mp = pmb->ctx_buf; + struct lpfc_vport *vport = pmb->vport; + struct Scsi_Host *shost = lpfc_shost_from_vport(vport); + struct serv_parm *sp = &vport->fc_sparam; +@@ -3736,7 +3736,7 @@ lpfc_mbx_cmpl_read_topology(struct lpfc_ + struct lpfc_mbx_read_top *la; + struct lpfc_sli_ring *pring; + MAILBOX_t *mb = &pmb->u.mb; +- struct lpfc_dmabuf *mp = (struct lpfc_dmabuf *)(pmb->ctx_buf); ++ struct lpfc_dmabuf *mp = pmb->ctx_buf; + uint8_t attn_type; + + /* Unblock ELS traffic */ +@@ -3850,7 +3850,7 @@ void + lpfc_mbx_cmpl_reg_login(struct lpfc_hba *phba, LPFC_MBOXQ_t *pmb) + { + struct lpfc_vport *vport = pmb->vport; +- struct lpfc_dmabuf *mp = (struct lpfc_dmabuf *)pmb->ctx_buf; ++ struct lpfc_dmabuf *mp = pmb->ctx_buf; + struct lpfc_nodelist *ndlp = pmb->ctx_ndlp; + + /* The driver calls the state machine with the pmb pointer +@@ -4065,7 +4065,7 @@ lpfc_create_static_vport(struct lpfc_hba + * the dump routine is a single-use construct. + */ + if (pmb->ctx_buf) { +- mp = (struct lpfc_dmabuf *)pmb->ctx_buf; ++ mp = pmb->ctx_buf; + lpfc_mbuf_free(phba, mp->virt, mp->phys); + kfree(mp); + pmb->ctx_buf = NULL; +@@ -4088,7 +4088,7 @@ lpfc_create_static_vport(struct lpfc_hba + + if (phba->sli_rev == LPFC_SLI_REV4) { + byte_count = pmb->u.mqe.un.mb_words[5]; +- mp = (struct lpfc_dmabuf *)pmb->ctx_buf; ++ mp = pmb->ctx_buf; + if (byte_count > sizeof(struct static_vport_info) - + offset) + byte_count = sizeof(struct static_vport_info) +--- a/drivers/scsi/lpfc/lpfc_init.c ++++ b/drivers/scsi/lpfc/lpfc_init.c +@@ -460,7 +460,7 @@ lpfc_config_port_post(struct lpfc_hba *p + return -EIO; + } + +- mp = (struct lpfc_dmabuf *)pmb->ctx_buf; ++ mp = pmb->ctx_buf; + + /* This dmabuf was allocated by lpfc_read_sparam. The dmabuf is no + * longer needed. Prevent unintended ctx_buf access as the mbox is +@@ -2217,7 +2217,7 @@ lpfc_handle_latt(struct lpfc_hba *phba) + /* Cleanup any outstanding ELS commands */ + lpfc_els_flush_all_cmd(phba); + psli->slistat.link_event++; +- lpfc_read_topology(phba, pmb, (struct lpfc_dmabuf *)pmb->ctx_buf); ++ lpfc_read_topology(phba, pmb, pmb->ctx_buf); + pmb->mbox_cmpl = lpfc_mbx_cmpl_read_topology; + pmb->vport = vport; + /* Block ELS IOCBs until we have processed this mbox command */ +@@ -5454,7 +5454,7 @@ lpfc_sli4_async_link_evt(struct lpfc_hba + phba->sli.slistat.link_event++; + + /* Create lpfc_handle_latt mailbox command from link ACQE */ +- lpfc_read_topology(phba, pmb, (struct lpfc_dmabuf *)pmb->ctx_buf); ++ lpfc_read_topology(phba, pmb, pmb->ctx_buf); + pmb->mbox_cmpl = lpfc_mbx_cmpl_read_topology; + pmb->vport = phba->pport; + +@@ -6347,7 +6347,7 @@ lpfc_sli4_async_fc_evt(struct lpfc_hba * + phba->sli.slistat.link_event++; + + /* Create lpfc_handle_latt mailbox command from link ACQE */ +- lpfc_read_topology(phba, pmb, (struct lpfc_dmabuf *)pmb->ctx_buf); ++ lpfc_read_topology(phba, pmb, pmb->ctx_buf); + pmb->mbox_cmpl = lpfc_mbx_cmpl_read_topology; + pmb->vport = phba->pport; + +--- a/drivers/scsi/lpfc/lpfc_mbox.c ++++ b/drivers/scsi/lpfc/lpfc_mbox.c +@@ -102,7 +102,7 @@ lpfc_mbox_rsrc_cleanup(struct lpfc_hba * + { + struct lpfc_dmabuf *mp; + +- mp = (struct lpfc_dmabuf *)mbox->ctx_buf; ++ mp = mbox->ctx_buf; + mbox->ctx_buf = NULL; + + /* Release the generic BPL buffer memory. */ +@@ -204,10 +204,8 @@ lpfc_dump_mem(struct lpfc_hba *phba, LPF + uint16_t region_id) + { + MAILBOX_t *mb; +- void *ctx; + + mb = &pmb->u.mb; +- ctx = pmb->ctx_buf; + + /* Setup to dump VPD region */ + memset(pmb, 0, sizeof (LPFC_MBOXQ_t)); +@@ -219,7 +217,6 @@ lpfc_dump_mem(struct lpfc_hba *phba, LPF + mb->un.varDmp.word_cnt = (DMP_RSP_SIZE / sizeof (uint32_t)); + mb->un.varDmp.co = 0; + mb->un.varDmp.resp_offset = 0; +- pmb->ctx_buf = ctx; + mb->mbxOwner = OWN_HOST; + return; + } +@@ -236,11 +233,8 @@ void + lpfc_dump_wakeup_param(struct lpfc_hba *phba, LPFC_MBOXQ_t *pmb) + { + MAILBOX_t *mb; +- void *ctx; + + mb = &pmb->u.mb; +- /* Save context so that we can restore after memset */ +- ctx = pmb->ctx_buf; + + /* Setup to dump VPD region */ + memset(pmb, 0, sizeof(LPFC_MBOXQ_t)); +@@ -254,7 +248,6 @@ lpfc_dump_wakeup_param(struct lpfc_hba * + mb->un.varDmp.word_cnt = WAKE_UP_PARMS_WORD_SIZE; + mb->un.varDmp.co = 0; + mb->un.varDmp.resp_offset = 0; +- pmb->ctx_buf = ctx; + return; + } + +@@ -372,7 +365,7 @@ lpfc_read_topology(struct lpfc_hba *phba + /* Save address for later completion and set the owner to host so that + * the FW knows this mailbox is available for processing. + */ +- pmb->ctx_buf = (uint8_t *)mp; ++ pmb->ctx_buf = mp; + mb->mbxOwner = OWN_HOST; + return (0); + } +@@ -2385,7 +2378,7 @@ lpfc_mbx_cmpl_rdp_link_stat(struct lpfc_ + static void + lpfc_mbx_cmpl_rdp_page_a2(struct lpfc_hba *phba, LPFC_MBOXQ_t *mbox) + { +- struct lpfc_dmabuf *mp = (struct lpfc_dmabuf *)mbox->ctx_buf; ++ struct lpfc_dmabuf *mp = mbox->ctx_buf; + struct lpfc_rdp_context *rdp_context = + (struct lpfc_rdp_context *)(mbox->context3); + +@@ -2416,7 +2409,7 @@ void + lpfc_mbx_cmpl_rdp_page_a0(struct lpfc_hba *phba, LPFC_MBOXQ_t *mbox) + { + int rc; +- struct lpfc_dmabuf *mp = (struct lpfc_dmabuf *)(mbox->ctx_buf); ++ struct lpfc_dmabuf *mp = mbox->ctx_buf; + struct lpfc_rdp_context *rdp_context = + (struct lpfc_rdp_context *)(mbox->context3); + +--- a/drivers/scsi/lpfc/lpfc_nportdisc.c ++++ b/drivers/scsi/lpfc/lpfc_nportdisc.c +@@ -682,7 +682,7 @@ lpfc_mbx_cmpl_resume_rpi(struct lpfc_hba + struct lpfc_nodelist *ndlp; + uint32_t cmd; + +- elsiocb = (struct lpfc_iocbq *)mboxq->ctx_buf; ++ elsiocb = mboxq->context3; + ndlp = mboxq->ctx_ndlp; + vport = mboxq->vport; + cmd = elsiocb->drvrTimeout; +--- a/drivers/scsi/lpfc/lpfc_sli.c ++++ b/drivers/scsi/lpfc/lpfc_sli.c +@@ -2885,7 +2885,7 @@ lpfc_sli_def_mbox_cmpl(struct lpfc_hba * + if (!test_bit(FC_UNLOADING, &phba->pport->load_flag) && + pmb->u.mb.mbxCommand == MBX_REG_LOGIN64 && + !pmb->u.mb.mbxStatus) { +- mp = (struct lpfc_dmabuf *)pmb->ctx_buf; ++ mp = pmb->ctx_buf; + if (mp) { + pmb->ctx_buf = NULL; + lpfc_mbuf_free(phba, mp->virt, mp->phys); +@@ -5819,7 +5819,7 @@ lpfc_sli4_read_fcoe_params(struct lpfc_h + goto out_free_mboxq; + } + +- mp = (struct lpfc_dmabuf *)mboxq->ctx_buf; ++ mp = mboxq->ctx_buf; + rc = lpfc_sli_issue_mbox(phba, mboxq, MBX_POLL); + + lpfc_printf_log(phba, KERN_INFO, LOG_MBOX | LOG_SLI, +@@ -8766,7 +8766,7 @@ lpfc_sli4_hba_setup(struct lpfc_hba *phb + + mboxq->vport = vport; + rc = lpfc_sli_issue_mbox(phba, mboxq, MBX_POLL); +- mp = (struct lpfc_dmabuf *)mboxq->ctx_buf; ++ mp = mboxq->ctx_buf; + if (rc == MBX_SUCCESS) { + memcpy(&vport->fc_sparam, mp->virt, sizeof(struct serv_parm)); + rc = 0; +@@ -9548,8 +9548,8 @@ lpfc_sli_issue_mbox_s3(struct lpfc_hba * + } + + /* Copy the mailbox extension data */ +- if (pmbox->in_ext_byte_len && pmbox->ctx_buf) { +- lpfc_sli_pcimem_bcopy(pmbox->ctx_buf, ++ if (pmbox->in_ext_byte_len && pmbox->ext_buf) { ++ lpfc_sli_pcimem_bcopy(pmbox->ext_buf, + (uint8_t *)phba->mbox_ext, + pmbox->in_ext_byte_len); + } +@@ -9562,10 +9562,10 @@ lpfc_sli_issue_mbox_s3(struct lpfc_hba * + = MAILBOX_HBA_EXT_OFFSET; + + /* Copy the mailbox extension data */ +- if (pmbox->in_ext_byte_len && pmbox->ctx_buf) ++ if (pmbox->in_ext_byte_len && pmbox->ext_buf) + lpfc_memcpy_to_slim(phba->MBslimaddr + + MAILBOX_HBA_EXT_OFFSET, +- pmbox->ctx_buf, pmbox->in_ext_byte_len); ++ pmbox->ext_buf, pmbox->in_ext_byte_len); + + if (mbx->mbxCommand == MBX_CONFIG_PORT) + /* copy command data into host mbox for cmpl */ +@@ -9688,9 +9688,9 @@ lpfc_sli_issue_mbox_s3(struct lpfc_hba * + lpfc_sli_pcimem_bcopy(phba->mbox, mbx, + MAILBOX_CMD_SIZE); + /* Copy the mailbox extension data */ +- if (pmbox->out_ext_byte_len && pmbox->ctx_buf) { ++ if (pmbox->out_ext_byte_len && pmbox->ext_buf) { + lpfc_sli_pcimem_bcopy(phba->mbox_ext, +- pmbox->ctx_buf, ++ pmbox->ext_buf, + pmbox->out_ext_byte_len); + } + } else { +@@ -9698,9 +9698,9 @@ lpfc_sli_issue_mbox_s3(struct lpfc_hba * + lpfc_memcpy_from_slim(mbx, phba->MBslimaddr, + MAILBOX_CMD_SIZE); + /* Copy the mailbox extension data */ +- if (pmbox->out_ext_byte_len && pmbox->ctx_buf) { ++ if (pmbox->out_ext_byte_len && pmbox->ext_buf) { + lpfc_memcpy_from_slim( +- pmbox->ctx_buf, ++ pmbox->ext_buf, + phba->MBslimaddr + + MAILBOX_HBA_EXT_OFFSET, + pmbox->out_ext_byte_len); +@@ -13813,10 +13813,10 @@ lpfc_sli_sp_intr_handler(int irq, void * + lpfc_sli_pcimem_bcopy(mbox, pmbox, + MAILBOX_CMD_SIZE); + if (pmb->out_ext_byte_len && +- pmb->ctx_buf) ++ pmb->ext_buf) + lpfc_sli_pcimem_bcopy( + phba->mbox_ext, +- pmb->ctx_buf, ++ pmb->ext_buf, + pmb->out_ext_byte_len); + } + if (pmb->mbox_flag & LPFC_MBX_IMED_UNREG) { +@@ -13830,8 +13830,7 @@ lpfc_sli_sp_intr_handler(int irq, void * + pmbox->un.varWords[0], 0); + + if (!pmbox->mbxStatus) { +- mp = (struct lpfc_dmabuf *) +- (pmb->ctx_buf); ++ mp = pmb->ctx_buf; + ndlp = pmb->ctx_ndlp; + + /* Reg_LOGIN of dflt RPI was +@@ -14339,7 +14338,7 @@ lpfc_sli4_sp_handle_mbox_event(struct lp + mcqe_status, + pmbox->un.varWords[0], 0); + if (mcqe_status == MB_CQE_STATUS_SUCCESS) { +- mp = (struct lpfc_dmabuf *)(pmb->ctx_buf); ++ mp = pmb->ctx_buf; + ndlp = pmb->ctx_ndlp; + + /* Reg_LOGIN of dflt RPI was successful. Mark the +@@ -19858,7 +19857,7 @@ lpfc_sli4_resume_rpi(struct lpfc_nodelis + lpfc_resume_rpi(mboxq, ndlp); + if (cmpl) { + mboxq->mbox_cmpl = cmpl; +- mboxq->ctx_buf = arg; ++ mboxq->context3 = arg; + } else + mboxq->mbox_cmpl = lpfc_sli_def_mbox_cmpl; + mboxq->ctx_ndlp = ndlp; +@@ -20675,7 +20674,7 @@ lpfc_sli4_get_config_region23(struct lpf + if (lpfc_sli4_dump_cfg_rg23(phba, mboxq)) + goto out; + mqe = &mboxq->u.mqe; +- mp = (struct lpfc_dmabuf *)mboxq->ctx_buf; ++ mp = mboxq->ctx_buf; + rc = lpfc_sli_issue_mbox(phba, mboxq, MBX_POLL); + if (rc) + goto out; +--- a/drivers/scsi/lpfc/lpfc_sli.h ++++ b/drivers/scsi/lpfc/lpfc_sli.h +@@ -183,7 +183,11 @@ typedef struct lpfcMboxq { + } u; + struct lpfc_vport *vport; /* virtual port pointer */ + struct lpfc_nodelist *ctx_ndlp; /* caller ndlp pointer */ +- void *ctx_buf; /* caller buffer information */ ++ struct lpfc_dmabuf *ctx_buf; /* caller buffer information */ ++ void *ext_buf; /* extended buffer for extended mbox ++ * cmds. Not a generic pointer. ++ * Use for storing virtual address. ++ */ + void *context3; /* a generic pointer. Code must + * accommodate the actual datatype. + */ +--- a/drivers/scsi/lpfc/lpfc_vport.c ++++ b/drivers/scsi/lpfc/lpfc_vport.c +@@ -166,7 +166,7 @@ lpfc_vport_sparm(struct lpfc_hba *phba, + } + } + +- mp = (struct lpfc_dmabuf *)pmb->ctx_buf; ++ mp = pmb->ctx_buf; + memcpy(&vport->fc_sparam, mp->virt, sizeof (struct serv_parm)); + memcpy(&vport->fc_nodename, &vport->fc_sparam.nodeName, + sizeof (struct lpfc_name)); diff --git a/patches.suse/scsi-lpfc-Define-lpfc_nodelist-type-for-ctx_ndlp-ptr.patch b/patches.suse/scsi-lpfc-Define-lpfc_nodelist-type-for-ctx_ndlp-ptr.patch new file mode 100644 index 0000000..211f92a --- /dev/null +++ b/patches.suse/scsi-lpfc-Define-lpfc_nodelist-type-for-ctx_ndlp-ptr.patch @@ -0,0 +1,349 @@ +From: Justin Tee +Date: Tue, 5 Mar 2024 12:04:59 -0800 +Subject: scsi: lpfc: Define lpfc_nodelist type for ctx_ndlp ptr +Patch-mainline: Queued in subsystem maintainer repository +Git-repo: git://git.kernel.org/pub/scm/linux/kernel/git/mkp/scsi.git +Git-commit: 18f7fe44bc79e67eccd4c118f10aa16647d446f8 +References: bsc#1221777 + +In LPFC_MBOXQ_t data structure, the ctx_ndlp ptr shouldn't be defined as a +generic void *ptr. It is named ctx_ndlp and it should only be used as an +lpfc_nodelist *ptr. Due to the void* declaration, there have been abuses +of ctx_ndlp for things not related to ndlp. + +So, set the ptr type for *ctx_ndlp as lpfc_nodelist. Remove all type casts +on ctx_ndlp because it is no longer a void *ptr. Convert the abuse of +ctx_ndlp for things not related to ndlps to use the void *context3 ptr. + +Signed-off-by: Justin Tee +Link: https://lore.kernel.org/r/20240305200503.57317-9-justintee8345@gmail.com +Signed-off-by: Martin K. Petersen +Acked-by: Daniel Wagner +--- + drivers/scsi/lpfc/lpfc_bsg.c | 4 ++-- + drivers/scsi/lpfc/lpfc_els.c | 10 ++++------ + drivers/scsi/lpfc/lpfc_hbadisc.c | 18 +++++++++--------- + drivers/scsi/lpfc/lpfc_mbox.c | 10 +++++----- + drivers/scsi/lpfc/lpfc_nportdisc.c | 6 +++--- + drivers/scsi/lpfc/lpfc_sli.c | 17 ++++++++--------- + drivers/scsi/lpfc/lpfc_sli.h | 10 +++++----- + 7 files changed, 36 insertions(+), 39 deletions(-) + +--- a/drivers/scsi/lpfc/lpfc_bsg.c ++++ b/drivers/scsi/lpfc/lpfc_bsg.c +@@ -3376,7 +3376,7 @@ lpfc_bsg_issue_mbox_cmpl(struct lpfc_hba + unsigned long flags; + uint8_t *pmb, *pmb_buf; + +- dd_data = pmboxq->ctx_ndlp; ++ dd_data = pmboxq->context3; + + /* + * The outgoing buffer is readily referred from the dma buffer, +@@ -4875,7 +4875,7 @@ lpfc_bsg_issue_mbox(struct lpfc_hba *phb + pmboxq->mbox_cmpl = lpfc_bsg_issue_mbox_cmpl; + + /* setup context field to pass wait_queue pointer to wake function */ +- pmboxq->ctx_ndlp = dd_data; ++ pmboxq->context3 = dd_data; + dd_data->type = TYPE_MBOX; + dd_data->set_job = job; + dd_data->context_un.mbox.pmboxq = pmboxq; +--- a/drivers/scsi/lpfc/lpfc_els.c ++++ b/drivers/scsi/lpfc/lpfc_els.c +@@ -7238,7 +7238,7 @@ lpfc_get_rdp_info(struct lpfc_hba *phba, + goto rdp_fail; + mbox->vport = rdp_context->ndlp->vport; + mbox->mbox_cmpl = lpfc_mbx_cmpl_rdp_page_a0; +- mbox->ctx_ndlp = (struct lpfc_rdp_context *)rdp_context; ++ mbox->context3 = (struct lpfc_rdp_context *)rdp_context; + rc = lpfc_sli_issue_mbox(phba, mbox, MBX_NOWAIT); + if (rc == MBX_NOT_FINISHED) { + lpfc_mbox_rsrc_cleanup(phba, mbox, MBOX_THD_UNLOCKED); +@@ -7298,7 +7298,6 @@ int lpfc_get_sfp_info_wait(struct lpfc_h + mbox->u.mqe.un.mem_dump_type3.addr_hi = putPaddrHigh(mp->phys); + } + mbox->vport = phba->pport; +- mbox->ctx_ndlp = (struct lpfc_rdp_context *)rdp_context; + + rc = lpfc_sli_issue_mbox_wait(phba, mbox, 30); + if (rc == MBX_NOT_FINISHED) { +@@ -7358,7 +7357,6 @@ int lpfc_get_sfp_info_wait(struct lpfc_h + mbox->u.mqe.un.mem_dump_type3.addr_hi = putPaddrHigh(mp->phys); + } + +- mbox->ctx_ndlp = (struct lpfc_rdp_context *)rdp_context; + rc = lpfc_sli_issue_mbox_wait(phba, mbox, 30); + if (bf_get(lpfc_mqe_status, &mbox->u.mqe)) { + rc = 1; +@@ -7500,9 +7498,9 @@ lpfc_els_lcb_rsp(struct lpfc_hba *phba, + int rc; + + mb = &pmb->u.mb; +- lcb_context = (struct lpfc_lcb_context *)pmb->ctx_ndlp; ++ lcb_context = (struct lpfc_lcb_context *)pmb->context3; + ndlp = lcb_context->ndlp; +- pmb->ctx_ndlp = NULL; ++ pmb->context3 = NULL; + pmb->ctx_buf = NULL; + + shdr = (union lpfc_sli4_cfg_shdr *) +@@ -7642,7 +7640,7 @@ lpfc_sli4_set_beacon(struct lpfc_vport * + lpfc_sli4_config(phba, mbox, LPFC_MBOX_SUBSYSTEM_COMMON, + LPFC_MBOX_OPCODE_SET_BEACON_CONFIG, len, + LPFC_SLI4_MBX_EMBED); +- mbox->ctx_ndlp = (void *)lcb_context; ++ mbox->context3 = (void *)lcb_context; + mbox->vport = phba->pport; + mbox->mbox_cmpl = lpfc_els_lcb_rsp; + bf_set(lpfc_mbx_set_beacon_port_num, &mbox->u.mqe.un.beacon_config, +--- a/drivers/scsi/lpfc/lpfc_hbadisc.c ++++ b/drivers/scsi/lpfc/lpfc_hbadisc.c +@@ -3851,7 +3851,7 @@ lpfc_mbx_cmpl_reg_login(struct lpfc_hba + { + struct lpfc_vport *vport = pmb->vport; + struct lpfc_dmabuf *mp = (struct lpfc_dmabuf *)pmb->ctx_buf; +- struct lpfc_nodelist *ndlp = (struct lpfc_nodelist *)pmb->ctx_ndlp; ++ struct lpfc_nodelist *ndlp = pmb->ctx_ndlp; + + /* The driver calls the state machine with the pmb pointer + * but wants to make sure a stale ctx_buf isn't acted on. +@@ -4168,7 +4168,7 @@ lpfc_mbx_cmpl_fabric_reg_login(struct lp + { + struct lpfc_vport *vport = pmb->vport; + MAILBOX_t *mb = &pmb->u.mb; +- struct lpfc_nodelist *ndlp = (struct lpfc_nodelist *)pmb->ctx_ndlp; ++ struct lpfc_nodelist *ndlp = pmb->ctx_ndlp; + + pmb->ctx_ndlp = NULL; + +@@ -4306,7 +4306,7 @@ void + lpfc_mbx_cmpl_ns_reg_login(struct lpfc_hba *phba, LPFC_MBOXQ_t *pmb) + { + MAILBOX_t *mb = &pmb->u.mb; +- struct lpfc_nodelist *ndlp = (struct lpfc_nodelist *)pmb->ctx_ndlp; ++ struct lpfc_nodelist *ndlp = pmb->ctx_ndlp; + struct lpfc_vport *vport = pmb->vport; + int rc; + +@@ -4430,7 +4430,7 @@ lpfc_mbx_cmpl_fc_reg_login(struct lpfc_h + { + struct lpfc_vport *vport = pmb->vport; + MAILBOX_t *mb = &pmb->u.mb; +- struct lpfc_nodelist *ndlp = (struct lpfc_nodelist *)pmb->ctx_ndlp; ++ struct lpfc_nodelist *ndlp = pmb->ctx_ndlp; + + pmb->ctx_ndlp = NULL; + if (mb->mbxStatus) { +@@ -5173,7 +5173,7 @@ lpfc_nlp_logo_unreg(struct lpfc_hba *phb + struct lpfc_vport *vport = pmb->vport; + struct lpfc_nodelist *ndlp; + +- ndlp = (struct lpfc_nodelist *)(pmb->ctx_ndlp); ++ ndlp = pmb->ctx_ndlp; + if (!ndlp) + return; + lpfc_issue_els_logo(vport, ndlp, 0); +@@ -5495,7 +5495,7 @@ lpfc_cleanup_node(struct lpfc_vport *vpo + if ((mb = phba->sli.mbox_active)) { + if ((mb->u.mb.mbxCommand == MBX_REG_LOGIN64) && + !(mb->mbox_flag & LPFC_MBX_IMED_UNREG) && +- (ndlp == (struct lpfc_nodelist *)mb->ctx_ndlp)) { ++ (ndlp == mb->ctx_ndlp)) { + mb->ctx_ndlp = NULL; + mb->mbox_cmpl = lpfc_sli_def_mbox_cmpl; + } +@@ -5506,7 +5506,7 @@ lpfc_cleanup_node(struct lpfc_vport *vpo + list_for_each_entry(mb, &phba->sli.mboxq_cmpl, list) { + if ((mb->u.mb.mbxCommand != MBX_REG_LOGIN64) || + (mb->mbox_flag & LPFC_MBX_IMED_UNREG) || +- (ndlp != (struct lpfc_nodelist *)mb->ctx_ndlp)) ++ (ndlp != mb->ctx_ndlp)) + continue; + + mb->ctx_ndlp = NULL; +@@ -5516,7 +5516,7 @@ lpfc_cleanup_node(struct lpfc_vport *vpo + list_for_each_entry_safe(mb, nextmb, &phba->sli.mboxq, list) { + if ((mb->u.mb.mbxCommand == MBX_REG_LOGIN64) && + !(mb->mbox_flag & LPFC_MBX_IMED_UNREG) && +- (ndlp == (struct lpfc_nodelist *)mb->ctx_ndlp)) { ++ (ndlp == mb->ctx_ndlp)) { + list_del(&mb->list); + lpfc_mbox_rsrc_cleanup(phba, mb, MBOX_THD_LOCKED); + +@@ -6356,7 +6356,7 @@ void + lpfc_mbx_cmpl_fdmi_reg_login(struct lpfc_hba *phba, LPFC_MBOXQ_t *pmb) + { + MAILBOX_t *mb = &pmb->u.mb; +- struct lpfc_nodelist *ndlp = (struct lpfc_nodelist *)pmb->ctx_ndlp; ++ struct lpfc_nodelist *ndlp = pmb->ctx_ndlp; + struct lpfc_vport *vport = pmb->vport; + + pmb->ctx_ndlp = NULL; +--- a/drivers/scsi/lpfc/lpfc_mbox.c ++++ b/drivers/scsi/lpfc/lpfc_mbox.c +@@ -2367,7 +2367,7 @@ lpfc_mbx_cmpl_rdp_link_stat(struct lpfc_ + MAILBOX_t *mb; + int rc = FAILURE; + struct lpfc_rdp_context *rdp_context = +- (struct lpfc_rdp_context *)(mboxq->ctx_ndlp); ++ (struct lpfc_rdp_context *)(mboxq->context3); + + mb = &mboxq->u.mb; + if (mb->mbxStatus) +@@ -2387,7 +2387,7 @@ lpfc_mbx_cmpl_rdp_page_a2(struct lpfc_hb + { + struct lpfc_dmabuf *mp = (struct lpfc_dmabuf *)mbox->ctx_buf; + struct lpfc_rdp_context *rdp_context = +- (struct lpfc_rdp_context *)(mbox->ctx_ndlp); ++ (struct lpfc_rdp_context *)(mbox->context3); + + if (bf_get(lpfc_mqe_status, &mbox->u.mqe)) + goto error_mbox_free; +@@ -2401,7 +2401,7 @@ lpfc_mbx_cmpl_rdp_page_a2(struct lpfc_hb + /* Save the dma buffer for cleanup in the final completion. */ + mbox->ctx_buf = mp; + mbox->mbox_cmpl = lpfc_mbx_cmpl_rdp_link_stat; +- mbox->ctx_ndlp = (struct lpfc_rdp_context *)rdp_context; ++ mbox->context3 = (struct lpfc_rdp_context *)rdp_context; + if (lpfc_sli_issue_mbox(phba, mbox, MBX_NOWAIT) == MBX_NOT_FINISHED) + goto error_mbox_free; + +@@ -2418,7 +2418,7 @@ lpfc_mbx_cmpl_rdp_page_a0(struct lpfc_hb + int rc; + struct lpfc_dmabuf *mp = (struct lpfc_dmabuf *)(mbox->ctx_buf); + struct lpfc_rdp_context *rdp_context = +- (struct lpfc_rdp_context *)(mbox->ctx_ndlp); ++ (struct lpfc_rdp_context *)(mbox->context3); + + if (bf_get(lpfc_mqe_status, &mbox->u.mqe)) + goto error; +@@ -2448,7 +2448,7 @@ lpfc_mbx_cmpl_rdp_page_a0(struct lpfc_hb + mbox->u.mqe.un.mem_dump_type3.addr_hi = putPaddrHigh(mp->phys); + + mbox->mbox_cmpl = lpfc_mbx_cmpl_rdp_page_a2; +- mbox->ctx_ndlp = (struct lpfc_rdp_context *)rdp_context; ++ mbox->context3 = (struct lpfc_rdp_context *)rdp_context; + rc = lpfc_sli_issue_mbox(phba, mbox, MBX_NOWAIT); + if (rc == MBX_NOT_FINISHED) + goto error; +--- a/drivers/scsi/lpfc/lpfc_nportdisc.c ++++ b/drivers/scsi/lpfc/lpfc_nportdisc.c +@@ -683,7 +683,7 @@ lpfc_mbx_cmpl_resume_rpi(struct lpfc_hba + uint32_t cmd; + + elsiocb = (struct lpfc_iocbq *)mboxq->ctx_buf; +- ndlp = (struct lpfc_nodelist *)mboxq->ctx_ndlp; ++ ndlp = mboxq->ctx_ndlp; + vport = mboxq->vport; + cmd = elsiocb->drvrTimeout; + +@@ -1875,7 +1875,7 @@ lpfc_rcv_logo_reglogin_issue(struct lpfc + /* cleanup any ndlp on mbox q waiting for reglogin cmpl */ + if ((mb = phba->sli.mbox_active)) { + if ((mb->u.mb.mbxCommand == MBX_REG_LOGIN64) && +- (ndlp == (struct lpfc_nodelist *)mb->ctx_ndlp)) { ++ (ndlp == mb->ctx_ndlp)) { + ndlp->nlp_flag &= ~NLP_REG_LOGIN_SEND; + lpfc_nlp_put(ndlp); + mb->ctx_ndlp = NULL; +@@ -1886,7 +1886,7 @@ lpfc_rcv_logo_reglogin_issue(struct lpfc + spin_lock_irq(&phba->hbalock); + list_for_each_entry_safe(mb, nextmb, &phba->sli.mboxq, list) { + if ((mb->u.mb.mbxCommand == MBX_REG_LOGIN64) && +- (ndlp == (struct lpfc_nodelist *)mb->ctx_ndlp)) { ++ (ndlp == mb->ctx_ndlp)) { + ndlp->nlp_flag &= ~NLP_REG_LOGIN_SEND; + lpfc_nlp_put(ndlp); + list_del(&mb->list); +--- a/drivers/scsi/lpfc/lpfc_sli.c ++++ b/drivers/scsi/lpfc/lpfc_sli.c +@@ -2914,12 +2914,12 @@ lpfc_sli_def_mbox_cmpl(struct lpfc_hba * + } + + if (pmb->u.mb.mbxCommand == MBX_REG_LOGIN64) { +- ndlp = (struct lpfc_nodelist *)pmb->ctx_ndlp; ++ ndlp = pmb->ctx_ndlp; + lpfc_nlp_put(ndlp); + } + + if (pmb->u.mb.mbxCommand == MBX_UNREG_LOGIN) { +- ndlp = (struct lpfc_nodelist *)pmb->ctx_ndlp; ++ ndlp = pmb->ctx_ndlp; + + /* Check to see if there are any deferred events to process */ + if (ndlp) { +@@ -2952,7 +2952,7 @@ lpfc_sli_def_mbox_cmpl(struct lpfc_hba * + + /* This nlp_put pairs with lpfc_sli4_resume_rpi */ + if (pmb->u.mb.mbxCommand == MBX_RESUME_RPI) { +- ndlp = (struct lpfc_nodelist *)pmb->ctx_ndlp; ++ ndlp = pmb->ctx_ndlp; + lpfc_nlp_put(ndlp); + } + +@@ -13832,8 +13832,7 @@ lpfc_sli_sp_intr_handler(int irq, void * + if (!pmbox->mbxStatus) { + mp = (struct lpfc_dmabuf *) + (pmb->ctx_buf); +- ndlp = (struct lpfc_nodelist *) +- pmb->ctx_ndlp; ++ ndlp = pmb->ctx_ndlp; + + /* Reg_LOGIN of dflt RPI was + * successful. new lets get +@@ -14341,7 +14340,7 @@ lpfc_sli4_sp_handle_mbox_event(struct lp + pmbox->un.varWords[0], 0); + if (mcqe_status == MB_CQE_STATUS_SUCCESS) { + mp = (struct lpfc_dmabuf *)(pmb->ctx_buf); +- ndlp = (struct lpfc_nodelist *)pmb->ctx_ndlp; ++ ndlp = pmb->ctx_ndlp; + + /* Reg_LOGIN of dflt RPI was successful. Mark the + * node as having an UNREG_LOGIN in progress to stop +@@ -21035,7 +21034,7 @@ lpfc_cleanup_pending_mbox(struct lpfc_vp + (mb->u.mb.mbxCommand == MBX_REG_VPI)) + mb->mbox_cmpl = lpfc_sli_def_mbox_cmpl; + if (mb->u.mb.mbxCommand == MBX_REG_LOGIN64) { +- act_mbx_ndlp = (struct lpfc_nodelist *)mb->ctx_ndlp; ++ act_mbx_ndlp = mb->ctx_ndlp; + + /* This reference is local to this routine. The + * reference is removed at routine exit. +@@ -21064,7 +21063,7 @@ lpfc_cleanup_pending_mbox(struct lpfc_vp + + mb->mbox_cmpl = lpfc_sli_def_mbox_cmpl; + if (mb->u.mb.mbxCommand == MBX_REG_LOGIN64) { +- ndlp = (struct lpfc_nodelist *)mb->ctx_ndlp; ++ ndlp = mb->ctx_ndlp; + /* Unregister the RPI when mailbox complete */ + mb->mbox_flag |= LPFC_MBX_IMED_UNREG; + restart_loop = 1; +@@ -21084,7 +21083,7 @@ lpfc_cleanup_pending_mbox(struct lpfc_vp + while (!list_empty(&mbox_cmd_list)) { + list_remove_head(&mbox_cmd_list, mb, LPFC_MBOXQ_t, list); + if (mb->u.mb.mbxCommand == MBX_REG_LOGIN64) { +- ndlp = (struct lpfc_nodelist *)mb->ctx_ndlp; ++ ndlp = mb->ctx_ndlp; + mb->ctx_ndlp = NULL; + if (ndlp) { + spin_lock(&ndlp->lock); +--- a/drivers/scsi/lpfc/lpfc_sli.h ++++ b/drivers/scsi/lpfc/lpfc_sli.h +@@ -182,11 +182,11 @@ typedef struct lpfcMboxq { + struct lpfc_mqe mqe; + } u; + struct lpfc_vport *vport; /* virtual port pointer */ +- void *ctx_ndlp; /* an lpfc_nodelist pointer */ +- void *ctx_buf; /* an lpfc_dmabuf pointer */ +- void *context3; /* a generic pointer. Code must +- * accommodate the actual datatype. +- */ ++ struct lpfc_nodelist *ctx_ndlp; /* caller ndlp pointer */ ++ void *ctx_buf; /* caller buffer information */ ++ void *context3; /* a generic pointer. Code must ++ * accommodate the actual datatype. ++ */ + + void (*mbox_cmpl) (struct lpfc_hba *, struct lpfcMboxq *); + uint8_t mbox_flag; diff --git a/patches.suse/scsi-lpfc-Define-types-in-a-union-for-generic-void-c.patch b/patches.suse/scsi-lpfc-Define-types-in-a-union-for-generic-void-c.patch new file mode 100644 index 0000000..3388130 --- /dev/null +++ b/patches.suse/scsi-lpfc-Define-types-in-a-union-for-generic-void-c.patch @@ -0,0 +1,334 @@ +From: Justin Tee +Date: Tue, 5 Mar 2024 12:05:01 -0800 +Subject: scsi: lpfc: Define types in a union for generic void *context3 ptr +Patch-mainline: Queued in subsystem maintainer repository +Git-repo: git://git.kernel.org/pub/scm/linux/kernel/git/mkp/scsi.git +Git-commit: 85d77f917a3b86872d3d52d5cea945a661858d20 +References: bsc#1221777 + +In LPFC_MBOXQ_t, the void *context3 ptr is used for various paths. It is +treated as a generic pointer, and is type casted during its usage. + +The issue with this is that it can sometimes get confusing when reading +code as to what the context3 ptr is being used for and mistakenly be reused +in a different context. + +Rename context3 to ctx_u, and declare it as a union of defined ptr types. +From now on, the ctx_u ptr may be used only if users define the use case +type. + +Signed-off-by: Justin Tee +Link: https://lore.kernel.org/r/20240305200503.57317-11-justintee8345@gmail.com +Signed-off-by: Martin K. Petersen +Acked-by: Daniel Wagner +--- + drivers/scsi/lpfc/lpfc_bsg.c | 12 ++++++------ + drivers/scsi/lpfc/lpfc_els.c | 17 ++++++++--------- + drivers/scsi/lpfc/lpfc_mbox.c | 15 ++++++--------- + drivers/scsi/lpfc/lpfc_nportdisc.c | 6 +++--- + drivers/scsi/lpfc/lpfc_sli.c | 15 ++++++++------- + drivers/scsi/lpfc/lpfc_sli.h | 20 +++++++++++++++++--- + drivers/scsi/lpfc/lpfc_sli4.h | 5 +++-- + 7 files changed, 51 insertions(+), 39 deletions(-) + +--- a/drivers/scsi/lpfc/lpfc_bsg.c ++++ b/drivers/scsi/lpfc/lpfc_bsg.c +@@ -3376,7 +3376,7 @@ lpfc_bsg_issue_mbox_cmpl(struct lpfc_hba + unsigned long flags; + uint8_t *pmb, *pmb_buf; + +- dd_data = pmboxq->context3; ++ dd_data = pmboxq->ctx_u.dd_data; + + /* + * The outgoing buffer is readily referred from the dma buffer, +@@ -3553,7 +3553,7 @@ lpfc_bsg_issue_mbox_ext_handle_job(struc + struct lpfc_sli_config_mbox *sli_cfg_mbx; + uint8_t *pmbx; + +- dd_data = pmboxq->context3; ++ dd_data = pmboxq->ctx_u.dd_data; + + /* Determine if job has been aborted */ + spin_lock_irqsave(&phba->ct_ev_lock, flags); +@@ -3940,7 +3940,7 @@ lpfc_bsg_sli_cfg_read_cmd_ext(struct lpf + pmboxq->mbox_cmpl = lpfc_bsg_issue_read_mbox_ext_cmpl; + + /* context fields to callback function */ +- pmboxq->context3 = dd_data; ++ pmboxq->ctx_u.dd_data = dd_data; + dd_data->type = TYPE_MBOX; + dd_data->set_job = job; + dd_data->context_un.mbox.pmboxq = pmboxq; +@@ -4112,7 +4112,7 @@ lpfc_bsg_sli_cfg_write_cmd_ext(struct lp + pmboxq->mbox_cmpl = lpfc_bsg_issue_write_mbox_ext_cmpl; + + /* context fields to callback function */ +- pmboxq->context3 = dd_data; ++ pmboxq->ctx_u.dd_data = dd_data; + dd_data->type = TYPE_MBOX; + dd_data->set_job = job; + dd_data->context_un.mbox.pmboxq = pmboxq; +@@ -4460,7 +4460,7 @@ lpfc_bsg_write_ebuf_set(struct lpfc_hba + pmboxq->mbox_cmpl = lpfc_bsg_issue_write_mbox_ext_cmpl; + + /* context fields to callback function */ +- pmboxq->context3 = dd_data; ++ pmboxq->ctx_u.dd_data = dd_data; + dd_data->type = TYPE_MBOX; + dd_data->set_job = job; + dd_data->context_un.mbox.pmboxq = pmboxq; +@@ -4875,7 +4875,7 @@ lpfc_bsg_issue_mbox(struct lpfc_hba *phb + pmboxq->mbox_cmpl = lpfc_bsg_issue_mbox_cmpl; + + /* setup context field to pass wait_queue pointer to wake function */ +- pmboxq->context3 = dd_data; ++ pmboxq->ctx_u.dd_data = dd_data; + dd_data->type = TYPE_MBOX; + dd_data->set_job = job; + dd_data->context_un.mbox.pmboxq = pmboxq; +--- a/drivers/scsi/lpfc/lpfc_els.c ++++ b/drivers/scsi/lpfc/lpfc_els.c +@@ -7238,7 +7238,7 @@ lpfc_get_rdp_info(struct lpfc_hba *phba, + goto rdp_fail; + mbox->vport = rdp_context->ndlp->vport; + mbox->mbox_cmpl = lpfc_mbx_cmpl_rdp_page_a0; +- mbox->context3 = (struct lpfc_rdp_context *)rdp_context; ++ mbox->ctx_u.rdp = rdp_context; + rc = lpfc_sli_issue_mbox(phba, mbox, MBX_NOWAIT); + if (rc == MBX_NOT_FINISHED) { + lpfc_mbox_rsrc_cleanup(phba, mbox, MBOX_THD_UNLOCKED); +@@ -7498,9 +7498,9 @@ lpfc_els_lcb_rsp(struct lpfc_hba *phba, + int rc; + + mb = &pmb->u.mb; +- lcb_context = (struct lpfc_lcb_context *)pmb->context3; ++ lcb_context = pmb->ctx_u.lcb; + ndlp = lcb_context->ndlp; +- pmb->context3 = NULL; ++ memset(&pmb->ctx_u, 0, sizeof(pmb->ctx_u)); + pmb->ctx_buf = NULL; + + shdr = (union lpfc_sli4_cfg_shdr *) +@@ -7640,7 +7640,7 @@ lpfc_sli4_set_beacon(struct lpfc_vport * + lpfc_sli4_config(phba, mbox, LPFC_MBOX_SUBSYSTEM_COMMON, + LPFC_MBOX_OPCODE_SET_BEACON_CONFIG, len, + LPFC_SLI4_MBX_EMBED); +- mbox->context3 = (void *)lcb_context; ++ mbox->ctx_u.lcb = lcb_context; + mbox->vport = phba->pport; + mbox->mbox_cmpl = lpfc_els_lcb_rsp; + bf_set(lpfc_mbx_set_beacon_port_num, &mbox->u.mqe.un.beacon_config, +@@ -8637,9 +8637,9 @@ lpfc_els_rsp_rls_acc(struct lpfc_hba *ph + mb = &pmb->u.mb; + + ndlp = pmb->ctx_ndlp; +- rxid = (uint16_t)((unsigned long)(pmb->context3) & 0xffff); +- oxid = (uint16_t)(((unsigned long)(pmb->context3) >> 16) & 0xffff); +- pmb->context3 = NULL; ++ rxid = (uint16_t)(pmb->ctx_u.ox_rx_id & 0xffff); ++ oxid = (uint16_t)((pmb->ctx_u.ox_rx_id >> 16) & 0xffff); ++ memset(&pmb->ctx_u, 0, sizeof(pmb->ctx_u)); + pmb->ctx_ndlp = NULL; + + if (mb->mbxStatus) { +@@ -8743,8 +8743,7 @@ lpfc_els_rcv_rls(struct lpfc_vport *vpor + mbox = mempool_alloc(phba->mbox_mem_pool, GFP_ATOMIC); + if (mbox) { + lpfc_read_lnk_stat(phba, mbox); +- mbox->context3 = (void *)((unsigned long) +- (ox_id << 16 | ctx)); ++ mbox->ctx_u.ox_rx_id = ox_id << 16 | ctx; + mbox->ctx_ndlp = lpfc_nlp_get(ndlp); + if (!mbox->ctx_ndlp) + goto node_err; +--- a/drivers/scsi/lpfc/lpfc_mbox.c ++++ b/drivers/scsi/lpfc/lpfc_mbox.c +@@ -1809,7 +1809,7 @@ lpfc_sli4_mbox_cmd_free(struct lpfc_hba + } + /* Reinitialize the context pointers to avoid stale usage. */ + mbox->ctx_buf = NULL; +- mbox->context3 = NULL; ++ memset(&mbox->ctx_u, 0, sizeof(mbox->ctx_u)); + kfree(mbox->sge_array); + /* Finally, free the mailbox command itself */ + mempool_free(mbox, phba->mbox_mem_pool); +@@ -2359,8 +2359,7 @@ lpfc_mbx_cmpl_rdp_link_stat(struct lpfc_ + { + MAILBOX_t *mb; + int rc = FAILURE; +- struct lpfc_rdp_context *rdp_context = +- (struct lpfc_rdp_context *)(mboxq->context3); ++ struct lpfc_rdp_context *rdp_context = mboxq->ctx_u.rdp; + + mb = &mboxq->u.mb; + if (mb->mbxStatus) +@@ -2379,8 +2378,7 @@ static void + lpfc_mbx_cmpl_rdp_page_a2(struct lpfc_hba *phba, LPFC_MBOXQ_t *mbox) + { + struct lpfc_dmabuf *mp = mbox->ctx_buf; +- struct lpfc_rdp_context *rdp_context = +- (struct lpfc_rdp_context *)(mbox->context3); ++ struct lpfc_rdp_context *rdp_context = mbox->ctx_u.rdp; + + if (bf_get(lpfc_mqe_status, &mbox->u.mqe)) + goto error_mbox_free; +@@ -2394,7 +2392,7 @@ lpfc_mbx_cmpl_rdp_page_a2(struct lpfc_hb + /* Save the dma buffer for cleanup in the final completion. */ + mbox->ctx_buf = mp; + mbox->mbox_cmpl = lpfc_mbx_cmpl_rdp_link_stat; +- mbox->context3 = (struct lpfc_rdp_context *)rdp_context; ++ mbox->ctx_u.rdp = rdp_context; + if (lpfc_sli_issue_mbox(phba, mbox, MBX_NOWAIT) == MBX_NOT_FINISHED) + goto error_mbox_free; + +@@ -2410,8 +2408,7 @@ lpfc_mbx_cmpl_rdp_page_a0(struct lpfc_hb + { + int rc; + struct lpfc_dmabuf *mp = mbox->ctx_buf; +- struct lpfc_rdp_context *rdp_context = +- (struct lpfc_rdp_context *)(mbox->context3); ++ struct lpfc_rdp_context *rdp_context = mbox->ctx_u.rdp; + + if (bf_get(lpfc_mqe_status, &mbox->u.mqe)) + goto error; +@@ -2441,7 +2438,7 @@ lpfc_mbx_cmpl_rdp_page_a0(struct lpfc_hb + mbox->u.mqe.un.mem_dump_type3.addr_hi = putPaddrHigh(mp->phys); + + mbox->mbox_cmpl = lpfc_mbx_cmpl_rdp_page_a2; +- mbox->context3 = (struct lpfc_rdp_context *)rdp_context; ++ mbox->ctx_u.rdp = rdp_context; + rc = lpfc_sli_issue_mbox(phba, mbox, MBX_NOWAIT); + if (rc == MBX_NOT_FINISHED) + goto error; +--- a/drivers/scsi/lpfc/lpfc_nportdisc.c ++++ b/drivers/scsi/lpfc/lpfc_nportdisc.c +@@ -300,7 +300,7 @@ lpfc_defer_plogi_acc(struct lpfc_hba *ph + int rc; + + ndlp = login_mbox->ctx_ndlp; +- save_iocb = login_mbox->context3; ++ save_iocb = login_mbox->ctx_u.save_iocb; + + if (mb->mbxStatus == MBX_SUCCESS) { + /* Now that REG_RPI completed successfully, +@@ -640,7 +640,7 @@ lpfc_rcv_plogi(struct lpfc_vport *vport, + if (!login_mbox->ctx_ndlp) + goto out; + +- login_mbox->context3 = save_iocb; /* For PLOGI ACC */ ++ login_mbox->ctx_u.save_iocb = save_iocb; /* For PLOGI ACC */ + + spin_lock_irq(&ndlp->lock); + ndlp->nlp_flag |= (NLP_ACC_REGLOGIN | NLP_RCV_PLOGI); +@@ -682,7 +682,7 @@ lpfc_mbx_cmpl_resume_rpi(struct lpfc_hba + struct lpfc_nodelist *ndlp; + uint32_t cmd; + +- elsiocb = mboxq->context3; ++ elsiocb = mboxq->ctx_u.save_iocb; + ndlp = mboxq->ctx_ndlp; + vport = mboxq->vport; + cmd = elsiocb->drvrTimeout; +--- a/drivers/scsi/lpfc/lpfc_sli.c ++++ b/drivers/scsi/lpfc/lpfc_sli.c +@@ -2830,7 +2830,7 @@ lpfc_sli_wake_mbox_wait(struct lpfc_hba + */ + pmboxq->mbox_flag |= LPFC_MBX_WAKE; + spin_lock_irqsave(&phba->hbalock, drvr_flag); +- pmbox_done = (struct completion *)pmboxq->context3; ++ pmbox_done = pmboxq->ctx_u.mbox_wait; + if (pmbox_done) + complete(pmbox_done); + spin_unlock_irqrestore(&phba->hbalock, drvr_flag); +@@ -13262,9 +13262,9 @@ lpfc_sli_issue_mbox_wait(struct lpfc_hba + /* setup wake call as IOCB callback */ + pmboxq->mbox_cmpl = lpfc_sli_wake_mbox_wait; + +- /* setup context3 field to pass wait_queue pointer to wake function */ ++ /* setup ctx_u field to pass wait_queue pointer to wake function */ + init_completion(&mbox_done); +- pmboxq->context3 = &mbox_done; ++ pmboxq->ctx_u.mbox_wait = &mbox_done; + /* now issue the command */ + retval = lpfc_sli_issue_mbox(phba, pmboxq, MBX_NOWAIT); + if (retval == MBX_BUSY || retval == MBX_SUCCESS) { +@@ -13272,7 +13272,7 @@ lpfc_sli_issue_mbox_wait(struct lpfc_hba + msecs_to_jiffies(timeout * 1000)); + + spin_lock_irqsave(&phba->hbalock, flag); +- pmboxq->context3 = NULL; ++ pmboxq->ctx_u.mbox_wait = NULL; + /* + * if LPFC_MBX_WAKE flag is set the mailbox is completed + * else do not free the resources. +@@ -19821,14 +19821,15 @@ lpfc_sli4_remove_rpis(struct lpfc_hba *p + * lpfc_sli4_resume_rpi - Remove the rpi bitmask region + * @ndlp: pointer to lpfc nodelist data structure. + * @cmpl: completion call-back. +- * @arg: data to load as MBox 'caller buffer information' ++ * @iocbq: data to load as mbox ctx_u information + * + * This routine is invoked to remove the memory region that + * provided rpi via a bitmask. + **/ + int + lpfc_sli4_resume_rpi(struct lpfc_nodelist *ndlp, +- void (*cmpl)(struct lpfc_hba *, LPFC_MBOXQ_t *), void *arg) ++ void (*cmpl)(struct lpfc_hba *, LPFC_MBOXQ_t *), ++ struct lpfc_iocbq *iocbq) + { + LPFC_MBOXQ_t *mboxq; + struct lpfc_hba *phba = ndlp->phba; +@@ -19857,7 +19858,7 @@ lpfc_sli4_resume_rpi(struct lpfc_nodelis + lpfc_resume_rpi(mboxq, ndlp); + if (cmpl) { + mboxq->mbox_cmpl = cmpl; +- mboxq->context3 = arg; ++ mboxq->ctx_u.save_iocb = iocbq; + } else + mboxq->mbox_cmpl = lpfc_sli_def_mbox_cmpl; + mboxq->ctx_ndlp = ndlp; +--- a/drivers/scsi/lpfc/lpfc_sli.h ++++ b/drivers/scsi/lpfc/lpfc_sli.h +@@ -188,9 +188,23 @@ typedef struct lpfcMboxq { + * cmds. Not a generic pointer. + * Use for storing virtual address. + */ +- void *context3; /* a generic pointer. Code must +- * accommodate the actual datatype. +- */ ++ ++ /* Pointers that are seldom used during mbox execution, but require ++ * a saved context. ++ */ ++ union { ++ unsigned long ox_rx_id; /* Used in els_rsp_rls_acc */ ++ struct lpfc_rdp_context *rdp; /* Used in get_rdp_info */ ++ struct lpfc_lcb_context *lcb; /* Used in set_beacon */ ++ struct completion *mbox_wait; /* Used in issue_mbox_wait */ ++ struct bsg_job_data *dd_data; /* Used in bsg_issue_mbox_cmpl ++ * and ++ * bsg_issue_mbox_ext_handle_job ++ */ ++ struct lpfc_iocbq *save_iocb; /* Used in defer_plogi_acc and ++ * lpfc_mbx_cmpl_resume_rpi ++ */ ++ } ctx_u; + + void (*mbox_cmpl) (struct lpfc_hba *, struct lpfcMboxq *); + uint8_t mbox_flag; +--- a/drivers/scsi/lpfc/lpfc_sli4.h ++++ b/drivers/scsi/lpfc/lpfc_sli4.h +@@ -1118,8 +1118,9 @@ void lpfc_sli4_free_rpi(struct lpfc_hba + void lpfc_sli4_remove_rpis(struct lpfc_hba *); + void lpfc_sli4_async_event_proc(struct lpfc_hba *); + void lpfc_sli4_fcf_redisc_event_proc(struct lpfc_hba *); +-int lpfc_sli4_resume_rpi(struct lpfc_nodelist *, +- void (*)(struct lpfc_hba *, LPFC_MBOXQ_t *), void *); ++int lpfc_sli4_resume_rpi(struct lpfc_nodelist *ndlp, ++ void (*cmpl)(struct lpfc_hba *, LPFC_MBOXQ_t *), ++ struct lpfc_iocbq *iocbq); + void lpfc_sli4_els_xri_abort_event_proc(struct lpfc_hba *phba); + void lpfc_sli4_nvme_pci_offline_aborted(struct lpfc_hba *phba, + struct lpfc_io_buf *lpfc_ncmd); diff --git a/patches.suse/scsi-lpfc-Move-NPIV-s-transport-unregistration-to-af.patch b/patches.suse/scsi-lpfc-Move-NPIV-s-transport-unregistration-to-af.patch new file mode 100644 index 0000000..7135ed2 --- /dev/null +++ b/patches.suse/scsi-lpfc-Move-NPIV-s-transport-unregistration-to-af.patch @@ -0,0 +1,54 @@ +From: Justin Tee +Date: Tue, 5 Mar 2024 12:04:53 -0800 +Subject: scsi: lpfc: Move NPIV's transport unregistration to after resource + clean up +Patch-mainline: Queued in subsystem maintainer repository +Git-repo: git://git.kernel.org/pub/scm/linux/kernel/git/mkp/scsi.git +Git-commit: 4ddf01f2f1504fa08b766e8cfeec558e9f8eef6c +References: bsc#1221777 + +There are cases after NPIV deletion where the fabric switch still believes +the NPIV is logged into the fabric. This occurs when a vport is +unregistered before the Remove All DA_ID CT and LOGO ELS are sent to the +fabric. + +Currently fc_remove_host(), which calls dev_loss_tmo for all D_IDs including +the fabric D_ID, removes the last ndlp reference and frees the ndlp rport +object. This sometimes causes the race condition where the final DA_ID and +LOGO are skipped from being sent to the fabric switch. + +Fix by moving the fc_remove_host() and scsi_remove_host() calls after DA_ID +and LOGO are sent. + +Signed-off-by: Justin Tee +Link: https://lore.kernel.org/r/20240305200503.57317-3-justintee8345@gmail.com +Signed-off-by: Martin K. Petersen +Acked-by: Daniel Wagner +--- + drivers/scsi/lpfc/lpfc_vport.c | 8 ++++---- + 1 file changed, 4 insertions(+), 4 deletions(-) + +--- a/drivers/scsi/lpfc/lpfc_vport.c ++++ b/drivers/scsi/lpfc/lpfc_vport.c +@@ -674,10 +674,6 @@ lpfc_vport_delete(struct fc_vport *fc_vp + lpfc_free_sysfs_attr(vport); + lpfc_debugfs_terminate(vport); + +- /* Remove FC host to break driver binding. */ +- fc_remove_host(shost); +- scsi_remove_host(shost); +- + /* Send the DA_ID and Fabric LOGO to cleanup Nameserver entries. */ + ndlp = lpfc_findnode_did(vport, Fabric_DID); + if (!ndlp) +@@ -721,6 +717,10 @@ lpfc_vport_delete(struct fc_vport *fc_vp + + skip_logo: + ++ /* Remove FC host to break driver binding. */ ++ fc_remove_host(shost); ++ scsi_remove_host(shost); ++ + lpfc_cleanup(vport); + + /* Remove scsi host now. The nodes are cleaned up. */ diff --git a/patches.suse/scsi-lpfc-Release-hbalock-before-calling-lpfc_worker.patch b/patches.suse/scsi-lpfc-Release-hbalock-before-calling-lpfc_worker.patch new file mode 100644 index 0000000..def4af4 --- /dev/null +++ b/patches.suse/scsi-lpfc-Release-hbalock-before-calling-lpfc_worker.patch @@ -0,0 +1,119 @@ +From: Justin Tee +Date: Tue, 5 Mar 2024 12:04:57 -0800 +Subject: scsi: lpfc: Release hbalock before calling lpfc_worker_wake_up() +Patch-mainline: Queued in subsystem maintainer repository +Git-repo: git://git.kernel.org/pub/scm/linux/kernel/git/mkp/scsi.git +Git-commit: ded20192dff31c91cef2a04f7e20e60e9bb887d3 +References: bsc#1221777 + +lpfc_worker_wake_up() calls the lpfc_work_done() routine, which takes the +hbalock. Thus, lpfc_worker_wake_up() should not be called while holding the +hbalock to avoid potential deadlock. + +Signed-off-by: Justin Tee +Link: https://lore.kernel.org/r/20240305200503.57317-7-justintee8345@gmail.com +Signed-off-by: Martin K. Petersen +Acked-by: Daniel Wagner +--- + drivers/scsi/lpfc/lpfc_els.c | 20 ++++++++++---------- + drivers/scsi/lpfc/lpfc_hbadisc.c | 5 ++--- + drivers/scsi/lpfc/lpfc_sli.c | 14 +++++++------- + 3 files changed, 19 insertions(+), 20 deletions(-) + +--- a/drivers/scsi/lpfc/lpfc_els.c ++++ b/drivers/scsi/lpfc/lpfc_els.c +@@ -4437,23 +4437,23 @@ lpfc_els_retry_delay(struct timer_list * + unsigned long flags; + struct lpfc_work_evt *evtp = &ndlp->els_retry_evt; + ++ /* Hold a node reference for outstanding queued work */ ++ if (!lpfc_nlp_get(ndlp)) ++ return; ++ + spin_lock_irqsave(&phba->hbalock, flags); + if (!list_empty(&evtp->evt_listp)) { + spin_unlock_irqrestore(&phba->hbalock, flags); ++ lpfc_nlp_put(ndlp); + return; + } + +- /* We need to hold the node by incrementing the reference +- * count until the queued work is done +- */ +- evtp->evt_arg1 = lpfc_nlp_get(ndlp); +- if (evtp->evt_arg1) { +- evtp->evt = LPFC_EVT_ELS_RETRY; +- list_add_tail(&evtp->evt_listp, &phba->work_list); +- lpfc_worker_wake_up(phba); +- } ++ evtp->evt_arg1 = ndlp; ++ evtp->evt = LPFC_EVT_ELS_RETRY; ++ list_add_tail(&evtp->evt_listp, &phba->work_list); + spin_unlock_irqrestore(&phba->hbalock, flags); +- return; ++ ++ lpfc_worker_wake_up(phba); + } + + /** +--- a/drivers/scsi/lpfc/lpfc_hbadisc.c ++++ b/drivers/scsi/lpfc/lpfc_hbadisc.c +@@ -257,7 +257,9 @@ lpfc_dev_loss_tmo_callbk(struct fc_rport + if (evtp->evt_arg1) { + evtp->evt = LPFC_EVT_DEV_LOSS; + list_add_tail(&evtp->evt_listp, &phba->work_list); ++ spin_unlock_irqrestore(&phba->hbalock, iflags); + lpfc_worker_wake_up(phba); ++ return; + } + spin_unlock_irqrestore(&phba->hbalock, iflags); + } else { +@@ -275,10 +277,7 @@ lpfc_dev_loss_tmo_callbk(struct fc_rport + lpfc_disc_state_machine(vport, ndlp, NULL, + NLP_EVT_DEVICE_RM); + } +- + } +- +- return; + } + + /** +--- a/drivers/scsi/lpfc/lpfc_sli.c ++++ b/drivers/scsi/lpfc/lpfc_sli.c +@@ -1217,9 +1217,9 @@ lpfc_set_rrq_active(struct lpfc_hba *phb + empty = list_empty(&phba->active_rrq_list); + list_add_tail(&rrq->list, &phba->active_rrq_list); + phba->hba_flag |= HBA_RRQ_ACTIVE; ++ spin_unlock_irqrestore(&phba->hbalock, iflags); + if (empty) + lpfc_worker_wake_up(phba); +- spin_unlock_irqrestore(&phba->hbalock, iflags); + return 0; + out: + spin_unlock_irqrestore(&phba->hbalock, iflags); +@@ -11373,18 +11373,18 @@ lpfc_sli_post_recovery_event(struct lpfc + unsigned long iflags; + struct lpfc_work_evt *evtp = &ndlp->recovery_evt; + ++ /* Hold a node reference for outstanding queued work */ ++ if (!lpfc_nlp_get(ndlp)) ++ return; ++ + spin_lock_irqsave(&phba->hbalock, iflags); + if (!list_empty(&evtp->evt_listp)) { + spin_unlock_irqrestore(&phba->hbalock, iflags); ++ lpfc_nlp_put(ndlp); + return; + } + +- /* Incrementing the reference count until the queued work is done. */ +- evtp->evt_arg1 = lpfc_nlp_get(ndlp); +- if (!evtp->evt_arg1) { +- spin_unlock_irqrestore(&phba->hbalock, iflags); +- return; +- } ++ evtp->evt_arg1 = ndlp; + evtp->evt = LPFC_EVT_RECOVER_PORT; + list_add_tail(&evtp->evt_listp, &phba->work_list); + spin_unlock_irqrestore(&phba->hbalock, iflags); diff --git a/patches.suse/scsi-lpfc-Remove-IRQF_ONESHOT-flag-from-threaded-IRQ.patch b/patches.suse/scsi-lpfc-Remove-IRQF_ONESHOT-flag-from-threaded-IRQ.patch new file mode 100644 index 0000000..31f4075 --- /dev/null +++ b/patches.suse/scsi-lpfc-Remove-IRQF_ONESHOT-flag-from-threaded-IRQ.patch @@ -0,0 +1,37 @@ +From: Justin Tee +Date: Tue, 5 Mar 2024 12:04:54 -0800 +Subject: scsi: lpfc: Remove IRQF_ONESHOT flag from threaded IRQ handling +Patch-mainline: Queued in subsystem maintainer repository +Git-repo: git://git.kernel.org/pub/scm/linux/kernel/git/mkp/scsi.git +Git-commit: 4623713e7ade46bfc63a3eade836f566ccbcd771 +References: bsc#1221777 bsc#1217958 + +IRQF_ONESHOT is found to mask HBA generated interrupts when thread_fn is +running. As a result, some EQEs/CQEs miss timely processing resulting in +SCSI layer attempts to abort commands due to io_timeout. Abort CQEs are +also not processed leading to the observations of hangs and spam of "0748 +abort handler timed out waiting for aborting I/O" log messages. + +Remove the IRQF_ONESHOT flag. The cmpxchg and xchg atomic operations on +lpfc_queue->queue_claimed already protect potential parallel access to an +EQ/CQ should the thread_fn get interrupted by the primary irq handler. + +Signed-off-by: Justin Tee +Link: https://lore.kernel.org/r/20240305200503.57317-4-justintee8345@gmail.com +Signed-off-by: Martin K. Petersen +Acked-by: Daniel Wagner +--- + drivers/scsi/lpfc/lpfc_init.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/drivers/scsi/lpfc/lpfc_init.c ++++ b/drivers/scsi/lpfc/lpfc_init.c +@@ -13059,7 +13059,7 @@ lpfc_sli4_enable_msix(struct lpfc_hba *p + rc = request_threaded_irq(eqhdl->irq, + &lpfc_sli4_hba_intr_handler, + &lpfc_sli4_hba_intr_handler_th, +- IRQF_ONESHOT, name, eqhdl); ++ 0, name, eqhdl); + if (rc) { + lpfc_printf_log(phba, KERN_WARNING, LOG_INIT, + "0486 MSI-X fast-path (%d) " diff --git a/patches.suse/scsi-lpfc-Remove-unnecessary-log-message-in-queuecom.patch b/patches.suse/scsi-lpfc-Remove-unnecessary-log-message-in-queuecom.patch new file mode 100644 index 0000000..a5336c3 --- /dev/null +++ b/patches.suse/scsi-lpfc-Remove-unnecessary-log-message-in-queuecom.patch @@ -0,0 +1,39 @@ +From: Justin Tee +Date: Tue, 5 Mar 2024 12:04:52 -0800 +Subject: scsi: lpfc: Remove unnecessary log message in queuecommand path +Patch-mainline: Queued in subsystem maintainer repository +Git-repo: git://git.kernel.org/pub/scm/linux/kernel/git/mkp/scsi.git +Git-commit: 91ddb6d0c3159bcc505bfa564d0573ae500cc2c7 +References: bsc#1221777 + +Message 9038 logs when LLDD receives SCSI_PROT_NORMAL when T10 DIF +protection is configured. The event is not wrong, but the log message has +not proven useful in debugging so it is removed. + +Signed-off-by: Justin Tee +Link: https://lore.kernel.org/r/20240305200503.57317-2-justintee8345@gmail.com +Signed-off-by: Martin K. Petersen +Acked-by: Daniel Wagner +--- + drivers/scsi/lpfc/lpfc_scsi.c | 10 ---------- + 1 file changed, 10 deletions(-) + +--- a/drivers/scsi/lpfc/lpfc_scsi.c ++++ b/drivers/scsi/lpfc/lpfc_scsi.c +@@ -5336,16 +5336,6 @@ lpfc_queuecommand(struct Scsi_Host *shos + } + err = lpfc_bg_scsi_prep_dma_buf(phba, lpfc_cmd); + } else { +- if (vport->phba->cfg_enable_bg) { +- lpfc_printf_vlog(vport, +- KERN_INFO, LOG_SCSI_CMD, +- "9038 BLKGRD: rcvd PROT_NORMAL cmd: " +- "x%x reftag x%x cnt %u pt %x\n", +- cmnd->cmnd[0], +- scsi_prot_ref_tag(cmnd), +- scsi_logical_block_count(cmnd), +- (cmnd->cmnd[1]>>5)); +- } + err = lpfc_scsi_prep_dma_buf(phba, lpfc_cmd); + } + diff --git a/patches.suse/scsi-lpfc-Replace-hbalock-with-ndlp-lock-in-lpfc_nvm.patch b/patches.suse/scsi-lpfc-Replace-hbalock-with-ndlp-lock-in-lpfc_nvm.patch new file mode 100644 index 0000000..18b2988 --- /dev/null +++ b/patches.suse/scsi-lpfc-Replace-hbalock-with-ndlp-lock-in-lpfc_nvm.patch @@ -0,0 +1,34 @@ +From: Justin Tee +Date: Tue, 5 Mar 2024 12:04:56 -0800 +Subject: scsi: lpfc: Replace hbalock with ndlp lock in + lpfc_nvme_unregister_port() +Patch-mainline: Queued in subsystem maintainer repository +Git-repo: git://git.kernel.org/pub/scm/linux/kernel/git/mkp/scsi.git +Git-commit: d11272be497e48a8e8f980470eb6b70e92eed0ce +References: bsc#1221777 + +The ndlp object update in lpfc_nvme_unregister_port() should be protected +by the ndlp lock rather than hbalock. + +Signed-off-by: Justin Tee +Link: https://lore.kernel.org/r/20240305200503.57317-6-justintee8345@gmail.com +Signed-off-by: Martin K. Petersen +Acked-by: Daniel Wagner +--- + drivers/scsi/lpfc/lpfc_nvme.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +--- a/drivers/scsi/lpfc/lpfc_nvme.c ++++ b/drivers/scsi/lpfc/lpfc_nvme.c +@@ -2616,9 +2616,9 @@ lpfc_nvme_unregister_port(struct lpfc_vp + /* No concern about the role change on the nvme remoteport. + * The transport will update it. + */ +- spin_lock_irq(&vport->phba->hbalock); ++ spin_lock_irq(&ndlp->lock); + ndlp->fc4_xpt_flags |= NVME_XPT_UNREG_WAIT; +- spin_unlock_irq(&vport->phba->hbalock); ++ spin_unlock_irq(&ndlp->lock); + + /* Don't let the host nvme transport keep sending keep-alives + * on this remoteport. Vport is unloading, no recovery. The diff --git a/patches.suse/scsi-lpfc-Update-lpfc-version-to-14.4.0.1.patch b/patches.suse/scsi-lpfc-Update-lpfc-version-to-14.4.0.1.patch new file mode 100644 index 0000000..6210aa5 --- /dev/null +++ b/patches.suse/scsi-lpfc-Update-lpfc-version-to-14.4.0.1.patch @@ -0,0 +1,29 @@ +From: Justin Tee +Date: Tue, 5 Mar 2024 12:05:02 -0800 +Subject: scsi: lpfc: Update lpfc version to 14.4.0.1 +Patch-mainline: Queued in subsystem maintainer repository +Git-repo: git://git.kernel.org/pub/scm/linux/kernel/git/mkp/scsi.git +Git-commit: 01b6b70d98f2e0c9c7b8b5d962b5e22f74f60056 +References: bsc#1221777 + +Update lpfc version to 14.4.0.1 + +Signed-off-by: Justin Tee +Link: https://lore.kernel.org/r/20240305200503.57317-12-justintee8345@gmail.com +Signed-off-by: Martin K. Petersen +Acked-by: Daniel Wagner +--- + drivers/scsi/lpfc/lpfc_version.h | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/drivers/scsi/lpfc/lpfc_version.h ++++ b/drivers/scsi/lpfc/lpfc_version.h +@@ -20,7 +20,7 @@ + * included with this package. * + *******************************************************************/ + +-#define LPFC_DRIVER_VERSION "14.4.0.0" ++#define LPFC_DRIVER_VERSION "14.4.0.1" + #define LPFC_DRIVER_NAME "lpfc" + + /* Used for SLI 2/3 */ diff --git a/patches.suse/scsi-lpfc-Update-lpfc_ramp_down_queue_handler-logic.patch b/patches.suse/scsi-lpfc-Update-lpfc_ramp_down_queue_handler-logic.patch new file mode 100644 index 0000000..ab8a738 --- /dev/null +++ b/patches.suse/scsi-lpfc-Update-lpfc_ramp_down_queue_handler-logic.patch @@ -0,0 +1,84 @@ +From: Justin Tee +Date: Tue, 5 Mar 2024 12:04:55 -0800 +Subject: scsi: lpfc: Update lpfc_ramp_down_queue_handler() logic +Patch-mainline: Queued in subsystem maintainer repository +Git-repo: git://git.kernel.org/pub/scm/linux/kernel/git/mkp/scsi.git +Git-commit: bb011631435c705cdeddca68d5c85fd40a4320f9 +References: bsc#1221777 + +Typically when an out of resource CQE status is detected, the +lpfc_ramp_down_queue_handler() logic is called to help reduce I/O load by +reducing an sdev's queue_depth. + +However, the current lpfc_rampdown_queue_depth() logic does not help reduce +queue_depth. num_cmd_success is never updated and is always zero, which +means new_queue_depth will always be set to sdev->queue_depth. So, +new_queue_depth = sdev->queue_depth - new_queue_depth always sets +new_queue_depth to zero. And, scsi_change_queue_depth(sdev, 0) is +essentially a no-op. + +Change the lpfc_ramp_down_queue_handler() logic to set new_queue_depth +equal to sdev->queue_depth subtracted from number of times num_rsrc_err was +incremented. If num_rsrc_err is >= sdev->queue_depth, then set +new_queue_depth equal to 1. Eventually, the frequency of Good_Status +frames will signal SCSI upper layer to auto increase the queue_depth back +to the driver default of 64 via scsi_handle_queue_ramp_up(). + +Signed-off-by: Justin Tee +Link: https://lore.kernel.org/r/20240305200503.57317-5-justintee8345@gmail.com +Signed-off-by: Martin K. Petersen +Acked-by: Daniel Wagner +--- + drivers/scsi/lpfc/lpfc.h | 1 - + drivers/scsi/lpfc/lpfc_scsi.c | 13 ++++--------- + 2 files changed, 4 insertions(+), 10 deletions(-) + +--- a/drivers/scsi/lpfc/lpfc.h ++++ b/drivers/scsi/lpfc/lpfc.h +@@ -1333,7 +1333,6 @@ struct lpfc_hba { + struct timer_list fabric_block_timer; + unsigned long bit_flags; + atomic_t num_rsrc_err; +- atomic_t num_cmd_success; + unsigned long last_rsrc_error_time; + unsigned long last_ramp_down_time; + #ifdef CONFIG_SCSI_LPFC_DEBUG_FS +--- a/drivers/scsi/lpfc/lpfc_scsi.c ++++ b/drivers/scsi/lpfc/lpfc_scsi.c +@@ -167,11 +167,10 @@ lpfc_ramp_down_queue_handler(struct lpfc + struct Scsi_Host *shost; + struct scsi_device *sdev; + unsigned long new_queue_depth; +- unsigned long num_rsrc_err, num_cmd_success; ++ unsigned long num_rsrc_err; + int i; + + num_rsrc_err = atomic_read(&phba->num_rsrc_err); +- num_cmd_success = atomic_read(&phba->num_cmd_success); + + /* + * The error and success command counters are global per +@@ -186,20 +185,16 @@ lpfc_ramp_down_queue_handler(struct lpfc + for (i = 0; i <= phba->max_vports && vports[i] != NULL; i++) { + shost = lpfc_shost_from_vport(vports[i]); + shost_for_each_device(sdev, shost) { +- new_queue_depth = +- sdev->queue_depth * num_rsrc_err / +- (num_rsrc_err + num_cmd_success); +- if (!new_queue_depth) +- new_queue_depth = sdev->queue_depth - 1; ++ if (num_rsrc_err >= sdev->queue_depth) ++ new_queue_depth = 1; + else + new_queue_depth = sdev->queue_depth - +- new_queue_depth; ++ num_rsrc_err; + scsi_change_queue_depth(sdev, new_queue_depth); + } + } + lpfc_destroy_vport_work_array(phba, vports); + atomic_set(&phba->num_rsrc_err, 0); +- atomic_set(&phba->num_cmd_success, 0); + } + + /** diff --git a/patches.suse/scsi-lpfc-Use-a-dedicated-lock-for-ras_fwlog-state.patch b/patches.suse/scsi-lpfc-Use-a-dedicated-lock-for-ras_fwlog-state.patch new file mode 100644 index 0000000..a24f81e --- /dev/null +++ b/patches.suse/scsi-lpfc-Use-a-dedicated-lock-for-ras_fwlog-state.patch @@ -0,0 +1,221 @@ +From: Justin Tee +Date: Tue, 5 Mar 2024 12:04:58 -0800 +Subject: scsi: lpfc: Use a dedicated lock for ras_fwlog state +Patch-mainline: Queued in subsystem maintainer repository +Git-repo: git://git.kernel.org/pub/scm/linux/kernel/git/mkp/scsi.git +Git-commit: f733a76ea0a9a84aee4ac41b81fad4d610ecbd8e +References: bsc#1221777 + +To reduce usage of and contention for hbalock, a separate dedicated lock is +used to protect ras_fwlog state. + +Signed-off-by: Justin Tee +Link: https://lore.kernel.org/r/20240305200503.57317-8-justintee8345@gmail.com +Signed-off-by: Martin K. Petersen +Acked-by: Daniel Wagner +--- + drivers/scsi/lpfc/lpfc.h | 1 + + drivers/scsi/lpfc/lpfc_attr.c | 4 ++-- + drivers/scsi/lpfc/lpfc_bsg.c | 20 ++++++++++---------- + drivers/scsi/lpfc/lpfc_debugfs.c | 12 ++++++------ + drivers/scsi/lpfc/lpfc_init.c | 3 +++ + drivers/scsi/lpfc/lpfc_sli.c | 20 ++++++++++---------- + 6 files changed, 32 insertions(+), 28 deletions(-) + +--- a/drivers/scsi/lpfc/lpfc_attr.c ++++ b/drivers/scsi/lpfc/lpfc_attr.c +@@ -5865,9 +5865,9 @@ lpfc_ras_fwlog_buffsize_set(struct lpfc_ + if (phba->cfg_ras_fwlog_func != PCI_FUNC(phba->pcidev->devfn)) + return -EINVAL; + +- spin_lock_irq(&phba->hbalock); ++ spin_lock_irq(&phba->ras_fwlog_lock); + state = phba->ras_fwlog.state; +- spin_unlock_irq(&phba->hbalock); ++ spin_unlock_irq(&phba->ras_fwlog_lock); + + if (state == REG_INPROGRESS) { + lpfc_printf_log(phba, KERN_ERR, LOG_SLI, "6147 RAS Logging " +--- a/drivers/scsi/lpfc/lpfc_bsg.c ++++ b/drivers/scsi/lpfc/lpfc_bsg.c +@@ -5070,12 +5070,12 @@ lpfc_bsg_get_ras_config(struct bsg_job * + bsg_reply->reply_data.vendor_reply.vendor_rsp; + + /* Current logging state */ +- spin_lock_irq(&phba->hbalock); ++ spin_lock_irq(&phba->ras_fwlog_lock); + if (ras_fwlog->state == ACTIVE) + ras_reply->state = LPFC_RASLOG_STATE_RUNNING; + else + ras_reply->state = LPFC_RASLOG_STATE_STOPPED; +- spin_unlock_irq(&phba->hbalock); ++ spin_unlock_irq(&phba->ras_fwlog_lock); + + ras_reply->log_level = phba->ras_fwlog.fw_loglevel; + ras_reply->log_buff_sz = phba->cfg_ras_fwlog_buffsize; +@@ -5132,13 +5132,13 @@ lpfc_bsg_set_ras_config(struct bsg_job * + + if (action == LPFC_RASACTION_STOP_LOGGING) { + /* Check if already disabled */ +- spin_lock_irq(&phba->hbalock); ++ spin_lock_irq(&phba->ras_fwlog_lock); + if (ras_fwlog->state != ACTIVE) { +- spin_unlock_irq(&phba->hbalock); ++ spin_unlock_irq(&phba->ras_fwlog_lock); + rc = -ESRCH; + goto ras_job_error; + } +- spin_unlock_irq(&phba->hbalock); ++ spin_unlock_irq(&phba->ras_fwlog_lock); + + /* Disable logging */ + lpfc_ras_stop_fwlog(phba); +@@ -5149,10 +5149,10 @@ lpfc_bsg_set_ras_config(struct bsg_job * + * FW-logging with new log-level. Return status + * "Logging already Running" to caller. + **/ +- spin_lock_irq(&phba->hbalock); ++ spin_lock_irq(&phba->ras_fwlog_lock); + if (ras_fwlog->state != INACTIVE) + action_status = -EINPROGRESS; +- spin_unlock_irq(&phba->hbalock); ++ spin_unlock_irq(&phba->ras_fwlog_lock); + + /* Enable logging */ + rc = lpfc_sli4_ras_fwlog_init(phba, log_level, +@@ -5268,13 +5268,13 @@ lpfc_bsg_get_ras_fwlog(struct bsg_job *j + goto ras_job_error; + + /* Logging to be stopped before reading */ +- spin_lock_irq(&phba->hbalock); ++ spin_lock_irq(&phba->ras_fwlog_lock); + if (ras_fwlog->state == ACTIVE) { +- spin_unlock_irq(&phba->hbalock); ++ spin_unlock_irq(&phba->ras_fwlog_lock); + rc = -EINPROGRESS; + goto ras_job_error; + } +- spin_unlock_irq(&phba->hbalock); ++ spin_unlock_irq(&phba->ras_fwlog_lock); + + if (job->request_len < + sizeof(struct fc_bsg_request) + +--- a/drivers/scsi/lpfc/lpfc_debugfs.c ++++ b/drivers/scsi/lpfc/lpfc_debugfs.c +@@ -2194,12 +2194,12 @@ static int lpfc_debugfs_ras_log_data(str + + memset(buffer, 0, size); + +- spin_lock_irq(&phba->hbalock); ++ spin_lock_irq(&phba->ras_fwlog_lock); + if (phba->ras_fwlog.state != ACTIVE) { +- spin_unlock_irq(&phba->hbalock); ++ spin_unlock_irq(&phba->ras_fwlog_lock); + return -EINVAL; + } +- spin_unlock_irq(&phba->hbalock); ++ spin_unlock_irq(&phba->ras_fwlog_lock); + + list_for_each_entry_safe(dmabuf, next, + &phba->ras_fwlog.fwlog_buff_list, list) { +@@ -2250,13 +2250,13 @@ lpfc_debugfs_ras_log_open(struct inode * + int size; + int rc = -ENOMEM; + +- spin_lock_irq(&phba->hbalock); ++ spin_lock_irq(&phba->ras_fwlog_lock); + if (phba->ras_fwlog.state != ACTIVE) { +- spin_unlock_irq(&phba->hbalock); ++ spin_unlock_irq(&phba->ras_fwlog_lock); + rc = -EINVAL; + goto out; + } +- spin_unlock_irq(&phba->hbalock); ++ spin_unlock_irq(&phba->ras_fwlog_lock); + + if (check_mul_overflow(LPFC_RAS_MIN_BUFF_POST_SIZE, + (int)phba->cfg_ras_fwlog_buffsize, &size)) +--- a/drivers/scsi/lpfc/lpfc.h ++++ b/drivers/scsi/lpfc/lpfc.h +@@ -1437,6 +1437,7 @@ struct lpfc_hba { + struct timer_list inactive_vmid_poll; + + /* RAS Support */ ++ spinlock_t ras_fwlog_lock; /* do not take while holding another lock */ + struct lpfc_ras_fwlog ras_fwlog; + + uint32_t iocb_cnt; +--- a/drivers/scsi/lpfc/lpfc_init.c ++++ b/drivers/scsi/lpfc/lpfc_init.c +@@ -7705,6 +7705,9 @@ lpfc_setup_driver_resource_phase1(struct + "NVME" : " "), + (phba->nvmet_support ? "NVMET" : " ")); + ++ /* ras_fwlog state */ ++ spin_lock_init(&phba->ras_fwlog_lock); ++ + /* Initialize the IO buffer list used by driver for SLI3 SCSI */ + spin_lock_init(&phba->scsi_buf_list_get_lock); + INIT_LIST_HEAD(&phba->lpfc_scsi_buf_list_get); +--- a/drivers/scsi/lpfc/lpfc_sli.c ++++ b/drivers/scsi/lpfc/lpfc_sli.c +@@ -6849,9 +6849,9 @@ lpfc_ras_stop_fwlog(struct lpfc_hba *phb + { + struct lpfc_ras_fwlog *ras_fwlog = &phba->ras_fwlog; + +- spin_lock_irq(&phba->hbalock); ++ spin_lock_irq(&phba->ras_fwlog_lock); + ras_fwlog->state = INACTIVE; +- spin_unlock_irq(&phba->hbalock); ++ spin_unlock_irq(&phba->ras_fwlog_lock); + + /* Disable FW logging to host memory */ + writel(LPFC_CTL_PDEV_CTL_DDL_RAS, +@@ -6894,9 +6894,9 @@ lpfc_sli4_ras_dma_free(struct lpfc_hba * + ras_fwlog->lwpd.virt = NULL; + } + +- spin_lock_irq(&phba->hbalock); ++ spin_lock_irq(&phba->ras_fwlog_lock); + ras_fwlog->state = INACTIVE; +- spin_unlock_irq(&phba->hbalock); ++ spin_unlock_irq(&phba->ras_fwlog_lock); + } + + /** +@@ -6998,9 +6998,9 @@ lpfc_sli4_ras_mbox_cmpl(struct lpfc_hba + goto disable_ras; + } + +- spin_lock_irq(&phba->hbalock); ++ spin_lock_irq(&phba->ras_fwlog_lock); + ras_fwlog->state = ACTIVE; +- spin_unlock_irq(&phba->hbalock); ++ spin_unlock_irq(&phba->ras_fwlog_lock); + mempool_free(pmb, phba->mbox_mem_pool); + + return; +@@ -7032,9 +7032,9 @@ lpfc_sli4_ras_fwlog_init(struct lpfc_hba + uint32_t len = 0, fwlog_buffsize, fwlog_entry_count; + int rc = 0; + +- spin_lock_irq(&phba->hbalock); ++ spin_lock_irq(&phba->ras_fwlog_lock); + ras_fwlog->state = INACTIVE; +- spin_unlock_irq(&phba->hbalock); ++ spin_unlock_irq(&phba->ras_fwlog_lock); + + fwlog_buffsize = (LPFC_RAS_MIN_BUFF_POST_SIZE * + phba->cfg_ras_fwlog_buffsize); +@@ -7095,9 +7095,9 @@ lpfc_sli4_ras_fwlog_init(struct lpfc_hba + mbx_fwlog->u.request.lwpd.addr_lo = putPaddrLow(ras_fwlog->lwpd.phys); + mbx_fwlog->u.request.lwpd.addr_hi = putPaddrHigh(ras_fwlog->lwpd.phys); + +- spin_lock_irq(&phba->hbalock); ++ spin_lock_irq(&phba->ras_fwlog_lock); + ras_fwlog->state = REG_INPROGRESS; +- spin_unlock_irq(&phba->hbalock); ++ spin_unlock_irq(&phba->ras_fwlog_lock); + mbox->vport = phba->pport; + mbox->mbox_cmpl = lpfc_sli4_ras_mbox_cmpl; + diff --git a/patches.suse/scsi-qla2xxx-Change-debug-message-during-driver-unlo.patch b/patches.suse/scsi-qla2xxx-Change-debug-message-during-driver-unlo.patch new file mode 100644 index 0000000..187082f --- /dev/null +++ b/patches.suse/scsi-qla2xxx-Change-debug-message-during-driver-unlo.patch @@ -0,0 +1,35 @@ +From: Saurav Kashyap +Date: Tue, 27 Feb 2024 22:11:25 +0530 +Subject: scsi: qla2xxx: Change debug message during driver unload +Patch-mainline: Queued in subsystem maintainer repository +Git-repo: git://git.kernel.org/pub/scm/linux/kernel/git/mkp/scsi.git +Git-commit: b5a30840727a3e41d12a336d19f6c0716b299161 +References: bsc#1221816 + +Upon driver unload, purge_mbox flag is set and the heartbeat monitor thread +detects this flag and does not send the mailbox command down to FW with a +debug message "Error detected: purge[1] eeh[0] cmd=0x0, Exiting". This +being not a real error, change the debug message. + +Cc: stable@vger.kernel.org +Signed-off-by: Saurav Kashyap +Signed-off-by: Nilesh Javali +Link: https://lore.kernel.org/r/20240227164127.36465-10-njavali@marvell.com +Reviewed-by: Himanshu Madhani +Signed-off-by: Martin K. Petersen +Acked-by: Daniel Wagner +--- + drivers/scsi/qla2xxx/qla_mbx.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/drivers/scsi/qla2xxx/qla_mbx.c ++++ b/drivers/scsi/qla2xxx/qla_mbx.c +@@ -194,7 +194,7 @@ qla2x00_mailbox_command(scsi_qla_host_t + if (ha->flags.purge_mbox || chip_reset != ha->chip_reset || + ha->flags.eeh_busy) { + ql_log(ql_log_warn, vha, 0xd035, +- "Error detected: purge[%d] eeh[%d] cmd=0x%x, Exiting.\n", ++ "Purge mbox: purge[%d] eeh[%d] cmd=0x%x, Exiting.\n", + ha->flags.purge_mbox, ha->flags.eeh_busy, mcp->mb[0]); + rval = QLA_ABORTED; + goto premature_exit; diff --git a/patches.suse/scsi-qla2xxx-Delay-I-O-Abort-on-PCI-error.patch b/patches.suse/scsi-qla2xxx-Delay-I-O-Abort-on-PCI-error.patch new file mode 100644 index 0000000..60b44cf --- /dev/null +++ b/patches.suse/scsi-qla2xxx-Delay-I-O-Abort-on-PCI-error.patch @@ -0,0 +1,56 @@ +From: Quinn Tran +Date: Tue, 27 Feb 2024 22:11:26 +0530 +Subject: scsi: qla2xxx: Delay I/O Abort on PCI error +Patch-mainline: Queued in subsystem maintainer repository +Git-repo: git://git.kernel.org/pub/scm/linux/kernel/git/mkp/scsi.git +Git-commit: 591c1fdf2016d118b8fbde427b796fac13f3f070 +References: bsc#1221816 + +Currently when PCI error is detected, I/O is aborted manually through the +ABORT IOCB mechanism which is not guaranteed to succeed. + +Instead, wait for the OS or system to notify driver to wind down I/O +through the pci_error_handlers api. Set eeh_busy flag to pause all traffic +and wait for I/O to drain. + +Cc: stable@vger.kernel.org +Signed-off-by: Quinn Tran +Signed-off-by: Nilesh Javali +Link: https://lore.kernel.org/r/20240227164127.36465-11-njavali@marvell.com +Reviewed-by: Himanshu Madhani +Signed-off-by: Martin K. Petersen +Acked-by: Daniel Wagner +--- + drivers/scsi/qla2xxx/qla_attr.c | 14 ++++++++++++-- + 1 file changed, 12 insertions(+), 2 deletions(-) + +--- a/drivers/scsi/qla2xxx/qla_attr.c ++++ b/drivers/scsi/qla2xxx/qla_attr.c +@@ -2741,7 +2741,13 @@ qla2x00_dev_loss_tmo_callbk(struct fc_rp + return; + + if (unlikely(pci_channel_offline(fcport->vha->hw->pdev))) { +- qla2x00_abort_all_cmds(fcport->vha, DID_NO_CONNECT << 16); ++ /* Will wait for wind down of adapter */ ++ ql_dbg(ql_dbg_aer, fcport->vha, 0x900c, ++ "%s pci offline detected (id %06x)\n", __func__, ++ fcport->d_id.b24); ++ qla_pci_set_eeh_busy(fcport->vha); ++ qla2x00_eh_wait_for_pending_commands(fcport->vha, fcport->d_id.b24, ++ 0, WAIT_TARGET); + return; + } + } +@@ -2763,7 +2769,11 @@ qla2x00_terminate_rport_io(struct fc_rpo + vha = fcport->vha; + + if (unlikely(pci_channel_offline(fcport->vha->hw->pdev))) { +- qla2x00_abort_all_cmds(fcport->vha, DID_NO_CONNECT << 16); ++ /* Will wait for wind down of adapter */ ++ ql_dbg(ql_dbg_aer, fcport->vha, 0x900b, ++ "%s pci offline detected (id %06x)\n", __func__, ++ fcport->d_id.b24); ++ qla_pci_set_eeh_busy(vha); + qla2x00_eh_wait_for_pending_commands(fcport->vha, fcport->d_id.b24, + 0, WAIT_TARGET); + return; diff --git a/patches.suse/scsi-qla2xxx-Fix-N2N-stuck-connection.patch b/patches.suse/scsi-qla2xxx-Fix-N2N-stuck-connection.patch new file mode 100644 index 0000000..1926bb3 --- /dev/null +++ b/patches.suse/scsi-qla2xxx-Fix-N2N-stuck-connection.patch @@ -0,0 +1,144 @@ +From: Quinn Tran +Date: Tue, 27 Feb 2024 22:11:18 +0530 +Subject: scsi: qla2xxx: Fix N2N stuck connection +Patch-mainline: Queued in subsystem maintainer repository +Git-repo: git://git.kernel.org/pub/scm/linux/kernel/git/mkp/scsi.git +Git-commit: 881eb861ca3877300570db10abbf11494e48548d +References: bsc#1221816 + +Disk failed to rediscover after chip reset error injection. The chip reset +happens at the time when a PLOGI is being sent. This causes a flag to be +left on which blocks the retry. Clear the blocking flag. + +Cc: stable@vger.kernel.org +Signed-off-by: Quinn Tran +Signed-off-by: Nilesh Javali +Link: https://lore.kernel.org/r/20240227164127.36465-3-njavali@marvell.com +Reviewed-by: Himanshu Madhani +Signed-off-by: Martin K. Petersen +Acked-by: Daniel Wagner +--- + drivers/scsi/qla2xxx/qla_gbl.h | 2 +- + drivers/scsi/qla2xxx/qla_iocb.c | 32 +++++++++++--------------------- + drivers/scsi/qla2xxx/qla_os.c | 2 +- + 3 files changed, 13 insertions(+), 23 deletions(-) + +--- a/drivers/scsi/qla2xxx/qla_gbl.h ++++ b/drivers/scsi/qla2xxx/qla_gbl.h +@@ -44,7 +44,7 @@ extern int qla2x00_fabric_login(scsi_qla + extern int qla2x00_local_device_login(scsi_qla_host_t *, fc_port_t *); + + extern int qla24xx_els_dcmd_iocb(scsi_qla_host_t *, int, port_id_t); +-extern int qla24xx_els_dcmd2_iocb(scsi_qla_host_t *, int, fc_port_t *, bool); ++extern int qla24xx_els_dcmd2_iocb(scsi_qla_host_t *, int, fc_port_t *); + extern void qla2x00_els_dcmd2_free(scsi_qla_host_t *vha, + struct els_plogi *els_plogi); + +--- a/drivers/scsi/qla2xxx/qla_iocb.c ++++ b/drivers/scsi/qla2xxx/qla_iocb.c +@@ -3041,7 +3041,7 @@ static void qla2x00_els_dcmd2_sp_done(sr + + int + qla24xx_els_dcmd2_iocb(scsi_qla_host_t *vha, int els_opcode, +- fc_port_t *fcport, bool wait) ++ fc_port_t *fcport) + { + srb_t *sp; + struct srb_iocb *elsio = NULL; +@@ -3056,8 +3056,7 @@ qla24xx_els_dcmd2_iocb(scsi_qla_host_t * + if (!sp) { + ql_log(ql_log_info, vha, 0x70e6, + "SRB allocation failed\n"); +- fcport->flags &= ~FCF_ASYNC_ACTIVE; +- return -ENOMEM; ++ goto done; + } + + fcport->flags |= FCF_ASYNC_SENT; +@@ -3066,9 +3065,6 @@ qla24xx_els_dcmd2_iocb(scsi_qla_host_t * + ql_dbg(ql_dbg_io, vha, 0x3073, + "%s Enter: PLOGI portid=%06x\n", __func__, fcport->d_id.b24); + +- if (wait) +- sp->flags = SRB_WAKEUP_ON_COMP; +- + sp->type = SRB_ELS_DCMD; + sp->name = "ELS_DCMD"; + sp->fcport = fcport; +@@ -3084,7 +3080,7 @@ qla24xx_els_dcmd2_iocb(scsi_qla_host_t * + + if (!elsio->u.els_plogi.els_plogi_pyld) { + rval = QLA_FUNCTION_FAILED; +- goto out; ++ goto done_free_sp; + } + + resp_ptr = elsio->u.els_plogi.els_resp_pyld = +@@ -3093,7 +3089,7 @@ qla24xx_els_dcmd2_iocb(scsi_qla_host_t * + + if (!elsio->u.els_plogi.els_resp_pyld) { + rval = QLA_FUNCTION_FAILED; +- goto out; ++ goto done_free_sp; + } + + ql_dbg(ql_dbg_io, vha, 0x3073, "PLOGI %p %p\n", ptr, resp_ptr); +@@ -3109,7 +3105,6 @@ qla24xx_els_dcmd2_iocb(scsi_qla_host_t * + + if (els_opcode == ELS_DCMD_PLOGI && DBELL_ACTIVE(vha)) { + struct fc_els_flogi *p = ptr; +- + p->fl_csp.sp_features |= cpu_to_be16(FC_SP_FT_SEC); + } + +@@ -3118,10 +3113,11 @@ qla24xx_els_dcmd2_iocb(scsi_qla_host_t * + (uint8_t *)elsio->u.els_plogi.els_plogi_pyld, + sizeof(*elsio->u.els_plogi.els_plogi_pyld)); + +- init_completion(&elsio->u.els_plogi.comp); + rval = qla2x00_start_sp(sp); + if (rval != QLA_SUCCESS) { +- rval = QLA_FUNCTION_FAILED; ++ fcport->flags |= FCF_LOGIN_NEEDED; ++ set_bit(RELOGIN_NEEDED, &vha->dpc_flags); ++ goto done_free_sp; + } else { + ql_dbg(ql_dbg_disc, vha, 0x3074, + "%s PLOGI sent, hdl=%x, loopid=%x, to port_id %06x from port_id %06x\n", +@@ -3129,21 +3125,15 @@ qla24xx_els_dcmd2_iocb(scsi_qla_host_t * + fcport->d_id.b24, vha->d_id.b24); + } + +- if (wait) { +- wait_for_completion(&elsio->u.els_plogi.comp); +- +- if (elsio->u.els_plogi.comp_status != CS_COMPLETE) +- rval = QLA_FUNCTION_FAILED; +- } else { +- goto done; +- } ++ return rval; + +-out: +- fcport->flags &= ~(FCF_ASYNC_SENT | FCF_ASYNC_ACTIVE); ++done_free_sp: + qla2x00_els_dcmd2_free(vha, &elsio->u.els_plogi); + /* ref: INIT */ + kref_put(&sp->cmd_kref, qla2x00_sp_release); + done: ++ fcport->flags &= ~(FCF_ASYNC_SENT | FCF_ASYNC_ACTIVE); ++ qla2x00_set_fcport_disc_state(fcport, DSC_DELETED); + return rval; + } + +--- a/drivers/scsi/qla2xxx/qla_os.c ++++ b/drivers/scsi/qla2xxx/qla_os.c +@@ -5582,7 +5582,7 @@ qla2x00_do_work(struct scsi_qla_host *vh + break; + case QLA_EVT_ELS_PLOGI: + qla24xx_els_dcmd2_iocb(vha, ELS_DCMD_PLOGI, +- e->u.fcport.fcport, false); ++ e->u.fcport.fcport); + break; + case QLA_EVT_SA_REPLACE: + rc = qla24xx_issue_sa_replace_iocb(vha, e); diff --git a/patches.suse/scsi-qla2xxx-Fix-command-flush-on-cable-pull.patch b/patches.suse/scsi-qla2xxx-Fix-command-flush-on-cable-pull.patch new file mode 100644 index 0000000..4604ce9 --- /dev/null +++ b/patches.suse/scsi-qla2xxx-Fix-command-flush-on-cable-pull.patch @@ -0,0 +1,93 @@ +From: Quinn Tran +Date: Tue, 27 Feb 2024 22:11:22 +0530 +Subject: scsi: qla2xxx: Fix command flush on cable pull +Patch-mainline: Queued in subsystem maintainer repository +Git-repo: git://git.kernel.org/pub/scm/linux/kernel/git/mkp/scsi.git +Git-commit: a27d4d0e7de305def8a5098a614053be208d1aa1 +References: bsc#1221816 + +System crash due to command failed to flush back to SCSI layer. + + BUG: unable to handle kernel NULL pointer dereference at 0000000000000000 + PGD 0 P4D 0 + Oops: 0000 [#1] SMP NOPTI + CPU: 27 PID: 793455 Comm: kworker/u130:6 Kdump: loaded Tainted: G OE --------- - - 4.18.0-372.9.1.el8.x86_64 #1 + Hardware name: HPE ProLiant DL360 Gen10/ProLiant DL360 Gen10, BIOS U32 09/03/2021 + Workqueue: nvme-wq nvme_fc_connect_ctrl_work [nvme_fc] + RIP: 0010:__wake_up_common+0x4c/0x190 + Code: 24 10 4d 85 c9 74 0a 41 f6 01 04 0f 85 9d 00 00 00 48 8b 43 08 48 83 c3 08 4c 8d 48 e8 49 8d 41 18 48 39 c3 0f 84 f0 00 00 00 <49> 8b 41 18 89 54 24 08 31 ed 4c 8d 70 e8 45 8b 29 41 f6 c5 04 75 + RSP: 0018:ffff95f3e0cb7cd0 EFLAGS: 00010086 + RAX: 0000000000000000 RBX: ffff8b08d3b26328 RCX: 0000000000000000 + RDX: 0000000000000001 RSI: 0000000000000003 RDI: ffff8b08d3b26320 + RBP: 0000000000000001 R08: 0000000000000000 R09: ffffffffffffffe8 + R10: 0000000000000000 R11: ffff95f3e0cb7a60 R12: ffff95f3e0cb7d20 + R13: 0000000000000003 R14: 0000000000000000 R15: 0000000000000000 + FS: 0000000000000000(0000) GS:ffff8b2fdf6c0000(0000) knlGS:0000000000000000 + CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 + CR2: 0000000000000000 CR3: 0000002f1e410002 CR4: 00000000007706e0 + DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 + DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 + PKRU: 55555554 + Call Trace: + __wake_up_common_lock+0x7c/0xc0 + qla_nvme_ls_req+0x355/0x4c0 [qla2xxx] + qla2xxx [0000:12:00.1]-f084:3: qlt_free_session_done: se_sess 0000000000000000 / sess ffff8ae1407ca000 from port 21:32:00:02:ac:07:ee:b8 loop_id 0x02 s_id 01:02:00 logout 1 keep 0 els_logo 0 + ? __nvme_fc_send_ls_req+0x260/0x380 [nvme_fc] + qla2xxx [0000:12:00.1]-207d:3: FCPort 21:32:00:02:ac:07:ee:b8 state transitioned from ONLINE to LOST - portid=010200. + ? nvme_fc_send_ls_req.constprop.42+0x1a/0x45 [nvme_fc] + qla2xxx [0000:12:00.1]-2109:3: qla2x00_schedule_rport_del 21320002ac07eeb8. rport ffff8ae598122000 roles 1 + ? nvme_fc_connect_ctrl_work.cold.63+0x1e3/0xa7d [nvme_fc] + qla2xxx [0000:12:00.1]-f084:3: qlt_free_session_done: se_sess 0000000000000000 / sess ffff8ae14801e000 from port 21:32:01:02:ad:f7:ee:b8 loop_id 0x04 s_id 01:02:01 logout 1 keep 0 els_logo 0 + ? __switch_to+0x10c/0x450 + ? process_one_work+0x1a7/0x360 + qla2xxx [0000:12:00.1]-207d:3: FCPort 21:32:01:02:ad:f7:ee:b8 state transitioned from ONLINE to LOST - portid=010201. + ? worker_thread+0x1ce/0x390 + ? create_worker+0x1a0/0x1a0 + qla2xxx [0000:12:00.1]-2109:3: qla2x00_schedule_rport_del 21320102adf7eeb8. rport ffff8ae3b2312800 roles 70 + ? kthread+0x10a/0x120 + qla2xxx [0000:12:00.1]-2112:3: qla_nvme_unregister_remote_port: unregister remoteport on ffff8ae14801e000 21320102adf7eeb8 + ? set_kthread_struct+0x40/0x40 + qla2xxx [0000:12:00.1]-2110:3: remoteport_delete of ffff8ae14801e000 21320102adf7eeb8 completed. + ? ret_from_fork+0x1f/0x40 + qla2xxx [0000:12:00.1]-f086:3: qlt_free_session_done: waiting for sess ffff8ae14801e000 logout + +The system was under memory stress where driver was not able to allocate an +SRB to carry out error recovery of cable pull. The failure to flush causes +upper layer to start modifying scsi_cmnd. When the system frees up some +memory, the subsequent cable pull trigger another command flush. At this +point the driver access a null pointer when attempting to DMA unmap the +SGL. + +Add a check to make sure commands are flush back on session tear down to +prevent the null pointer access. + +Cc: stable@vger.kernel.org +Signed-off-by: Quinn Tran +Signed-off-by: Nilesh Javali +Link: https://lore.kernel.org/r/20240227164127.36465-7-njavali@marvell.com +Reviewed-by: Himanshu Madhani +Signed-off-by: Martin K. Petersen +Acked-by: Daniel Wagner +--- + drivers/scsi/qla2xxx/qla_target.c | 10 ++++++++++ + 1 file changed, 10 insertions(+) + +--- a/drivers/scsi/qla2xxx/qla_target.c ++++ b/drivers/scsi/qla2xxx/qla_target.c +@@ -1062,6 +1062,16 @@ void qlt_free_session_done(struct work_s + "%s: sess %p logout completed\n", __func__, sess); + } + ++ /* check for any straggling io left behind */ ++ if (!(sess->flags & FCF_FCP2_DEVICE) && ++ qla2x00_eh_wait_for_pending_commands(sess->vha, sess->d_id.b24, 0, WAIT_TARGET)) { ++ ql_log(ql_log_warn, vha, 0x3027, ++ "IO not return. Resetting.\n"); ++ set_bit(ISP_ABORT_NEEDED, &vha->dpc_flags); ++ qla2xxx_wake_dpc(vha); ++ qla2x00_wait_for_chip_reset(vha); ++ } ++ + if (sess->logo_ack_needed) { + sess->logo_ack_needed = 0; + qla24xx_async_notify_ack(vha, sess, diff --git a/patches.suse/scsi-qla2xxx-Fix-double-free-of-fcport.patch b/patches.suse/scsi-qla2xxx-Fix-double-free-of-fcport.patch new file mode 100644 index 0000000..96387fe --- /dev/null +++ b/patches.suse/scsi-qla2xxx-Fix-double-free-of-fcport.patch @@ -0,0 +1,78 @@ +From: Saurav Kashyap +Date: Tue, 27 Feb 2024 22:11:24 +0530 +Subject: scsi: qla2xxx: Fix double free of fcport +Patch-mainline: Queued in subsystem maintainer repository +Git-repo: git://git.kernel.org/pub/scm/linux/kernel/git/mkp/scsi.git +Git-commit: 82f522ae0d97119a43da53e0f729275691b9c525 +References: bsc#1221816 + +The server was crashing after LOGO because fcport was getting freed twice. + + -----------[ cut here ]----------- + kernel BUG at mm/slub.c:371! + invalid opcode: 0000 1 SMP PTI + CPU: 35 PID: 4610 Comm: bash Kdump: loaded Tainted: G OE --------- - - 4.18.0-425.3.1.el8.x86_64 #1 + Hardware name: HPE ProLiant DL360 Gen10/ProLiant DL360 Gen10, BIOS U32 09/03/2021 + RIP: 0010:set_freepointer.part.57+0x0/0x10 + RSP: 0018:ffffb07107027d90 EFLAGS: 00010246 + RAX: ffff9cb7e3150000 RBX: ffff9cb7e332b9c0 RCX: ffff9cb7e3150400 + RDX: 0000000000001f37 RSI: 0000000000000000 RDI: ffff9cb7c0005500 + RBP: fffff693448c5400 R08: 0000000080000000 R09: 0000000000000009 + R10: 0000000000000000 R11: 0000000000132af0 R12: ffff9cb7c0005500 + R13: ffff9cb7e3150000 R14: ffffffffc06990e0 R15: ffff9cb7ea85ea58 + FS: 00007ff6b79c2740(0000) GS:ffff9cb8f7ec0000(0000) knlGS:0000000000000000 + CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 + CR2: 000055b426b7d700 CR3: 0000000169c18002 CR4: 00000000007706e0 + DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 + DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 + PKRU: 55555554 + Call Trace: + kfree+0x238/0x250 + qla2x00_els_dcmd_sp_free+0x20/0x230 [qla2xxx] + ? qla24xx_els_dcmd_iocb+0x607/0x690 [qla2xxx] + qla2x00_issue_logo+0x28c/0x2a0 [qla2xxx] + ? qla2x00_issue_logo+0x28c/0x2a0 [qla2xxx] + ? kernfs_fop_write+0x11e/0x1a0 + +Remove one of the free calls and add check for valid fcport. Also use +function qla2x00_free_fcport() instead of kfree(). + +Cc: stable@vger.kernel.org +Signed-off-by: Saurav Kashyap +Signed-off-by: Nilesh Javali +Link: https://lore.kernel.org/r/20240227164127.36465-9-njavali@marvell.com +Reviewed-by: Himanshu Madhani +Signed-off-by: Martin K. Petersen +Acked-by: Daniel Wagner +--- + drivers/scsi/qla2xxx/qla_iocb.c | 5 +++-- + 1 file changed, 3 insertions(+), 2 deletions(-) + +--- a/drivers/scsi/qla2xxx/qla_iocb.c ++++ b/drivers/scsi/qla2xxx/qla_iocb.c +@@ -2637,7 +2637,8 @@ static void qla2x00_els_dcmd_sp_free(srb + { + struct srb_iocb *elsio = &sp->u.iocb_cmd; + +- kfree(sp->fcport); ++ if (sp->fcport) ++ qla2x00_free_fcport(sp->fcport); + + if (elsio->u.els_logo.els_logo_pyld) + dma_free_coherent(&sp->vha->hw->pdev->dev, DMA_POOL_SIZE, +@@ -2750,6 +2751,7 @@ qla24xx_els_dcmd_iocb(scsi_qla_host_t *v + if (!elsio->u.els_logo.els_logo_pyld) { + /* ref: INIT */ + kref_put(&sp->cmd_kref, qla2x00_sp_release); ++ qla2x00_free_fcport(fcport); + return QLA_FUNCTION_FAILED; + } + +@@ -2784,7 +2786,6 @@ qla24xx_els_dcmd_iocb(scsi_qla_host_t *v + fcport->d_id.b.area, fcport->d_id.b.al_pa); + + wait_for_completion(&elsio->u.els_logo.comp); +- qla2x00_free_fcport(fcport); + + /* ref: INIT */ + kref_put(&sp->cmd_kref, qla2x00_sp_release); diff --git a/patches.suse/scsi-qla2xxx-Fix-double-free-of-the-ha-vp_map-pointe.patch b/patches.suse/scsi-qla2xxx-Fix-double-free-of-the-ha-vp_map-pointe.patch new file mode 100644 index 0000000..0c69871 --- /dev/null +++ b/patches.suse/scsi-qla2xxx-Fix-double-free-of-the-ha-vp_map-pointe.patch @@ -0,0 +1,35 @@ +From: Saurav Kashyap +Date: Tue, 27 Feb 2024 22:11:23 +0530 +Subject: scsi: qla2xxx: Fix double free of the ha->vp_map pointer +Patch-mainline: Queued in subsystem maintainer repository +Git-repo: git://git.kernel.org/pub/scm/linux/kernel/git/mkp/scsi.git +Git-commit: e288285d47784fdcf7c81be56df7d65c6f10c58b +References: bsc#1221816 + +Coverity scan reported potential risk of double free of the pointer +ha->vp_map. ha->vp_map was freed in qla2x00_mem_alloc(), and again freed +in function qla2x00_mem_free(ha). + +Assign NULL to vp_map and kfree take care of NULL. + +Cc: stable@vger.kernel.org +Signed-off-by: Saurav Kashyap +Signed-off-by: Nilesh Javali +Link: https://lore.kernel.org/r/20240227164127.36465-8-njavali@marvell.com +Reviewed-by: Himanshu Madhani +Signed-off-by: Martin K. Petersen +Acked-by: Daniel Wagner +--- + drivers/scsi/qla2xxx/qla_os.c | 1 + + 1 file changed, 1 insertion(+) + +--- a/drivers/scsi/qla2xxx/qla_os.c ++++ b/drivers/scsi/qla2xxx/qla_os.c +@@ -4601,6 +4601,7 @@ qla2x00_mem_alloc(struct qla_hw_data *ha + ha->init_cb_dma = 0; + fail_free_vp_map: + kfree(ha->vp_map); ++ ha->vp_map = NULL; + fail: + ql_log(ql_log_fatal, NULL, 0x0030, + "Memory allocation failure.\n"); diff --git a/patches.suse/scsi-qla2xxx-NVME-FCP-prefer-flag-not-being-honored.patch b/patches.suse/scsi-qla2xxx-NVME-FCP-prefer-flag-not-being-honored.patch new file mode 100644 index 0000000..ab64702 --- /dev/null +++ b/patches.suse/scsi-qla2xxx-NVME-FCP-prefer-flag-not-being-honored.patch @@ -0,0 +1,68 @@ +From: Quinn Tran +Date: Tue, 27 Feb 2024 22:11:21 +0530 +Subject: scsi: qla2xxx: NVME|FCP prefer flag not being honored +Patch-mainline: Queued in subsystem maintainer repository +Git-repo: git://git.kernel.org/pub/scm/linux/kernel/git/mkp/scsi.git +Git-commit: 69aecdd410106dc3a8f543a4f7ec6379b995b8d0 +References: bsc#1221816 + +Changing of [FCP|NVME] prefer flag in flash has no effect on driver. For +device that supports both FCP + NVMe over the same connection, driver +continues to connect to this device using the previous successful login +mode. + +On completion of flash update, adapter will be reset. Driver will +reset the prefer flag based on setting from flash. + +Cc: stable@vger.kernel.org +Signed-off-by: Quinn Tran +Signed-off-by: Nilesh Javali +Link: https://lore.kernel.org/r/20240227164127.36465-6-njavali@marvell.com +Reviewed-by: Himanshu Madhani +Signed-off-by: Martin K. Petersen +Acked-by: Daniel Wagner +--- + drivers/scsi/qla2xxx/qla_init.c | 18 ++++++++++++++++++ + 1 file changed, 18 insertions(+) + +--- a/drivers/scsi/qla2xxx/qla_init.c ++++ b/drivers/scsi/qla2xxx/qla_init.c +@@ -7501,6 +7501,7 @@ qla2x00_abort_isp(scsi_qla_host_t *vha) + struct scsi_qla_host *vp, *tvp; + struct req_que *req = ha->req_q_map[0]; + unsigned long flags; ++ fc_port_t *fcport; + + if (vha->flags.online) { + qla2x00_abort_isp_cleanup(vha); +@@ -7569,6 +7570,15 @@ qla2x00_abort_isp(scsi_qla_host_t *vha) + "ISP Abort - ISP reg disconnect post nvmram config, exiting.\n"); + return status; + } ++ ++ /* User may have updated [fcp|nvme] prefer in flash */ ++ list_for_each_entry(fcport, &vha->vp_fcports, list) { ++ if (NVME_PRIORITY(ha, fcport)) ++ fcport->do_prli_nvme = 1; ++ else ++ fcport->do_prli_nvme = 0; ++ } ++ + if (!qla2x00_restart_isp(vha)) { + clear_bit(RESET_MARKER_NEEDED, &vha->dpc_flags); + +@@ -7639,6 +7649,14 @@ qla2x00_abort_isp(scsi_qla_host_t *vha) + atomic_inc(&vp->vref_count); + spin_unlock_irqrestore(&ha->vport_slock, flags); + ++ /* User may have updated [fcp|nvme] prefer in flash */ ++ list_for_each_entry(fcport, &vp->vp_fcports, list) { ++ if (NVME_PRIORITY(ha, fcport)) ++ fcport->do_prli_nvme = 1; ++ else ++ fcport->do_prli_nvme = 0; ++ } ++ + qla2x00_vp_abort_isp(vp); + + spin_lock_irqsave(&ha->vport_slock, flags); diff --git a/patches.suse/scsi-qla2xxx-Prevent-command-send-on-chip-reset.patch b/patches.suse/scsi-qla2xxx-Prevent-command-send-on-chip-reset.patch new file mode 100644 index 0000000..2ae4cbd --- /dev/null +++ b/patches.suse/scsi-qla2xxx-Prevent-command-send-on-chip-reset.patch @@ -0,0 +1,114 @@ +From: Quinn Tran +Date: Tue, 27 Feb 2024 22:11:17 +0530 +Subject: scsi: qla2xxx: Prevent command send on chip reset +Patch-mainline: Queued in subsystem maintainer repository +Git-repo: git://git.kernel.org/pub/scm/linux/kernel/git/mkp/scsi.git +Git-commit: 4895009c4bb72f71f2e682f1e7d2c2d96e482087 +References: bsc#1221816 + +Currently IOCBs are allowed to push through while chip reset could be in +progress. During chip reset the outstanding_cmds array is cleared +twice. Once when any command on this array is returned as failed and +secondly when the array is initialize to zero. If a command is inserted on +to the array between these intervals, then the command will be lost. Check +for chip reset before sending IOCB. + +Cc: stable@vger.kernel.org +Signed-off-by: Quinn Tran +Signed-off-by: Nilesh Javali +Link: https://lore.kernel.org/r/20240227164127.36465-2-njavali@marvell.com +Reviewed-by: Himanshu Madhani +Signed-off-by: Martin K. Petersen +Acked-by: Daniel Wagner +--- + drivers/scsi/qla2xxx/qla_init.c | 8 ++++++-- + drivers/scsi/qla2xxx/qla_iocb.c | 33 +++++++++++++++++++++++++++++++-- + 2 files changed, 37 insertions(+), 4 deletions(-) + +--- a/drivers/scsi/qla2xxx/qla_init.c ++++ b/drivers/scsi/qla2xxx/qla_init.c +@@ -1193,8 +1193,12 @@ int qla24xx_async_gnl(struct scsi_qla_ho + return rval; + + done_free_sp: +- /* ref: INIT */ +- kref_put(&sp->cmd_kref, qla2x00_sp_release); ++ /* ++ * use qla24xx_async_gnl_sp_done to purge all pending gnl request. ++ * kref_put is call behind the scene. ++ */ ++ sp->u.iocb_cmd.u.mbx.in_mb[0] = MBS_COMMAND_ERROR; ++ qla24xx_async_gnl_sp_done(sp, QLA_COMMAND_ERROR); + fcport->flags &= ~(FCF_ASYNC_SENT); + done: + fcport->flags &= ~(FCF_ASYNC_ACTIVE); +--- a/drivers/scsi/qla2xxx/qla_iocb.c ++++ b/drivers/scsi/qla2xxx/qla_iocb.c +@@ -2587,6 +2587,33 @@ void + qla2x00_sp_release(struct kref *kref) + { + struct srb *sp = container_of(kref, struct srb, cmd_kref); ++ struct scsi_qla_host *vha = sp->vha; ++ ++ switch (sp->type) { ++ case SRB_CT_PTHRU_CMD: ++ /* GPSC & GFPNID use fcport->ct_desc.ct_sns for both req & rsp */ ++ if (sp->u.iocb_cmd.u.ctarg.req && ++ (!sp->fcport || ++ sp->u.iocb_cmd.u.ctarg.req != sp->fcport->ct_desc.ct_sns)) { ++ dma_free_coherent(&vha->hw->pdev->dev, ++ sp->u.iocb_cmd.u.ctarg.req_allocated_size, ++ sp->u.iocb_cmd.u.ctarg.req, ++ sp->u.iocb_cmd.u.ctarg.req_dma); ++ sp->u.iocb_cmd.u.ctarg.req = NULL; ++ } ++ if (sp->u.iocb_cmd.u.ctarg.rsp && ++ (!sp->fcport || ++ sp->u.iocb_cmd.u.ctarg.rsp != sp->fcport->ct_desc.ct_sns)) { ++ dma_free_coherent(&vha->hw->pdev->dev, ++ sp->u.iocb_cmd.u.ctarg.rsp_allocated_size, ++ sp->u.iocb_cmd.u.ctarg.rsp, ++ sp->u.iocb_cmd.u.ctarg.rsp_dma); ++ sp->u.iocb_cmd.u.ctarg.rsp = NULL; ++ } ++ break; ++ default: ++ break; ++ } + + sp->free(sp); + } +@@ -2692,7 +2719,7 @@ qla24xx_els_dcmd_iocb(scsi_qla_host_t *v + */ + sp = qla2x00_get_sp(vha, fcport, GFP_KERNEL); + if (!sp) { +- kfree(fcport); ++ qla2x00_free_fcport(fcport); + ql_log(ql_log_info, vha, 0x70e6, + "SRB allocation failed\n"); + return -ENOMEM; +@@ -2747,6 +2774,7 @@ qla24xx_els_dcmd_iocb(scsi_qla_host_t *v + if (rval != QLA_SUCCESS) { + /* ref: INIT */ + kref_put(&sp->cmd_kref, qla2x00_sp_release); ++ qla2x00_free_fcport(fcport); + return QLA_FUNCTION_FAILED; + } + +@@ -2756,6 +2784,7 @@ qla24xx_els_dcmd_iocb(scsi_qla_host_t *v + fcport->d_id.b.area, fcport->d_id.b.al_pa); + + wait_for_completion(&elsio->u.els_logo.comp); ++ qla2x00_free_fcport(fcport); + + /* ref: INIT */ + kref_put(&sp->cmd_kref, qla2x00_sp_release); +@@ -3918,7 +3947,7 @@ qla2x00_start_sp(srb_t *sp) + return -EAGAIN; + } + +- pkt = __qla2x00_alloc_iocbs(sp->qpair, sp); ++ pkt = qla2x00_alloc_iocbs_ready(sp->qpair, sp); + if (!pkt) { + rval = -EAGAIN; + ql_log(ql_log_warn, vha, 0x700c, diff --git a/patches.suse/scsi-qla2xxx-Split-FCE-EFT-trace-control.patch b/patches.suse/scsi-qla2xxx-Split-FCE-EFT-trace-control.patch new file mode 100644 index 0000000..253b247 --- /dev/null +++ b/patches.suse/scsi-qla2xxx-Split-FCE-EFT-trace-control.patch @@ -0,0 +1,223 @@ +From: Quinn Tran +Date: Tue, 27 Feb 2024 22:11:19 +0530 +Subject: scsi: qla2xxx: Split FCE|EFT trace control +Patch-mainline: Queued in subsystem maintainer repository +Git-repo: git://git.kernel.org/pub/scm/linux/kernel/git/mkp/scsi.git +Git-commit: 76a192e1a566e15365704b9f8fb3b70825f85064 +References: bsc#1221816 + +Current code combines the allocation of FCE|EFT trace buffers and enables +the features all in 1 step. + +Split this step into separate steps in preparation for follow-on patch to +allow user to have a choice to enable / disable FCE trace feature. + +Cc: stable@vger.kernel.org +Reported-by: kernel test robot +Signed-off-by: Quinn Tran +Signed-off-by: Nilesh Javali +Link: https://lore.kernel.org/r/20240227164127.36465-4-njavali@marvell.com +Reviewed-by: Himanshu Madhani +Signed-off-by: Martin K. Petersen +Acked-by: Daniel Wagner +--- + drivers/scsi/qla2xxx/qla_init.c | 102 ++++++++++++++++------------------------ + 1 file changed, 41 insertions(+), 61 deletions(-) + +--- a/drivers/scsi/qla2xxx/qla_init.c ++++ b/drivers/scsi/qla2xxx/qla_init.c +@@ -2669,6 +2669,40 @@ qla83xx_nic_core_fw_load(scsi_qla_host_t + return rval; + } + ++static void qla_enable_fce_trace(scsi_qla_host_t *vha) ++{ ++ int rval; ++ struct qla_hw_data *ha = vha->hw; ++ ++ if (ha->fce) { ++ ha->flags.fce_enabled = 1; ++ memset(ha->fce, 0, fce_calc_size(ha->fce_bufs)); ++ rval = qla2x00_enable_fce_trace(vha, ++ ha->fce_dma, ha->fce_bufs, ha->fce_mb, &ha->fce_bufs); ++ ++ if (rval) { ++ ql_log(ql_log_warn, vha, 0x8033, ++ "Unable to reinitialize FCE (%d).\n", rval); ++ ha->flags.fce_enabled = 0; ++ } ++ } ++} ++ ++static void qla_enable_eft_trace(scsi_qla_host_t *vha) ++{ ++ int rval; ++ struct qla_hw_data *ha = vha->hw; ++ ++ if (ha->eft) { ++ memset(ha->eft, 0, EFT_SIZE); ++ rval = qla2x00_enable_eft_trace(vha, ha->eft_dma, EFT_NUM_BUFFERS); ++ ++ if (rval) { ++ ql_log(ql_log_warn, vha, 0x8034, ++ "Unable to reinitialize EFT (%d).\n", rval); ++ } ++ } ++} + /* + * qla2x00_initialize_adapter + * Initialize board. +@@ -3672,9 +3706,8 @@ qla24xx_chip_diag(scsi_qla_host_t *vha) + } + + static void +-qla2x00_init_fce_trace(scsi_qla_host_t *vha) ++qla2x00_alloc_fce_trace(scsi_qla_host_t *vha) + { +- int rval; + dma_addr_t tc_dma; + void *tc; + struct qla_hw_data *ha = vha->hw; +@@ -3703,27 +3736,17 @@ qla2x00_init_fce_trace(scsi_qla_host_t * + return; + } + +- rval = qla2x00_enable_fce_trace(vha, tc_dma, FCE_NUM_BUFFERS, +- ha->fce_mb, &ha->fce_bufs); +- if (rval) { +- ql_log(ql_log_warn, vha, 0x00bf, +- "Unable to initialize FCE (%d).\n", rval); +- dma_free_coherent(&ha->pdev->dev, FCE_SIZE, tc, tc_dma); +- return; +- } +- + ql_dbg(ql_dbg_init, vha, 0x00c0, + "Allocated (%d KB) for FCE...\n", FCE_SIZE / 1024); + +- ha->flags.fce_enabled = 1; + ha->fce_dma = tc_dma; + ha->fce = tc; ++ ha->fce_bufs = FCE_NUM_BUFFERS; + } + + static void +-qla2x00_init_eft_trace(scsi_qla_host_t *vha) ++qla2x00_alloc_eft_trace(scsi_qla_host_t *vha) + { +- int rval; + dma_addr_t tc_dma; + void *tc; + struct qla_hw_data *ha = vha->hw; +@@ -3748,14 +3771,6 @@ qla2x00_init_eft_trace(scsi_qla_host_t * + return; + } + +- rval = qla2x00_enable_eft_trace(vha, tc_dma, EFT_NUM_BUFFERS); +- if (rval) { +- ql_log(ql_log_warn, vha, 0x00c2, +- "Unable to initialize EFT (%d).\n", rval); +- dma_free_coherent(&ha->pdev->dev, EFT_SIZE, tc, tc_dma); +- return; +- } +- + ql_dbg(ql_dbg_init, vha, 0x00c3, + "Allocated (%d KB) EFT ...\n", EFT_SIZE / 1024); + +@@ -3763,13 +3778,6 @@ qla2x00_init_eft_trace(scsi_qla_host_t * + ha->eft = tc; + } + +-static void +-qla2x00_alloc_offload_mem(scsi_qla_host_t *vha) +-{ +- qla2x00_init_fce_trace(vha); +- qla2x00_init_eft_trace(vha); +-} +- + void + qla2x00_alloc_fw_dump(scsi_qla_host_t *vha) + { +@@ -3824,10 +3832,10 @@ qla2x00_alloc_fw_dump(scsi_qla_host_t *v + if (ha->tgt.atio_ring) + mq_size += ha->tgt.atio_q_length * sizeof(request_t); + +- qla2x00_init_fce_trace(vha); ++ qla2x00_alloc_fce_trace(vha); + if (ha->fce) + fce_size = sizeof(struct qla2xxx_fce_chain) + FCE_SIZE; +- qla2x00_init_eft_trace(vha); ++ qla2x00_alloc_eft_trace(vha); + if (ha->eft) + eft_size = EFT_SIZE; + } +@@ -4257,7 +4265,6 @@ qla2x00_setup_chip(scsi_qla_host_t *vha) + struct qla_hw_data *ha = vha->hw; + struct device_reg_2xxx __iomem *reg = &ha->iobase->isp; + unsigned long flags; +- uint16_t fw_major_version; + int done_once = 0; + + if (IS_P3P_TYPE(ha)) { +@@ -4324,7 +4331,6 @@ qla2x00_setup_chip(scsi_qla_host_t *vha) + goto failed; + + enable_82xx_npiv: +- fw_major_version = ha->fw_major_version; + if (IS_P3P_TYPE(ha)) + qla82xx_check_md_needed(vha); + else +@@ -4353,12 +4359,11 @@ qla2x00_setup_chip(scsi_qla_host_t *vha) + if (rval != QLA_SUCCESS) + goto failed; + +- if (!fw_major_version && !(IS_P3P_TYPE(ha))) +- qla2x00_alloc_offload_mem(vha); +- + if (ql2xallocfwdump && !(IS_P3P_TYPE(ha))) + qla2x00_alloc_fw_dump(vha); + ++ qla_enable_fce_trace(vha); ++ qla_enable_eft_trace(vha); + } else { + goto failed; + } +@@ -7491,7 +7496,6 @@ qla2x00_abort_isp_cleanup(scsi_qla_host_ + int + qla2x00_abort_isp(scsi_qla_host_t *vha) + { +- int rval; + uint8_t status = 0; + struct qla_hw_data *ha = vha->hw; + struct scsi_qla_host *vp, *tvp; +@@ -7585,31 +7589,7 @@ qla2x00_abort_isp(scsi_qla_host_t *vha) + + if (IS_QLA81XX(ha) || IS_QLA8031(ha)) + qla2x00_get_fw_version(vha); +- if (ha->fce) { +- ha->flags.fce_enabled = 1; +- memset(ha->fce, 0, +- fce_calc_size(ha->fce_bufs)); +- rval = qla2x00_enable_fce_trace(vha, +- ha->fce_dma, ha->fce_bufs, ha->fce_mb, +- &ha->fce_bufs); +- if (rval) { +- ql_log(ql_log_warn, vha, 0x8033, +- "Unable to reinitialize FCE " +- "(%d).\n", rval); +- ha->flags.fce_enabled = 0; +- } +- } + +- if (ha->eft) { +- memset(ha->eft, 0, EFT_SIZE); +- rval = qla2x00_enable_eft_trace(vha, +- ha->eft_dma, EFT_NUM_BUFFERS); +- if (rval) { +- ql_log(ql_log_warn, vha, 0x8034, +- "Unable to reinitialize EFT " +- "(%d).\n", rval); +- } +- } + } else { /* failed the ISP abort */ + vha->flags.online = 1; + if (test_bit(ISP_ABORT_RETRY, &vha->dpc_flags)) { diff --git a/patches.suse/scsi-qla2xxx-Update-manufacturer-detail.patch b/patches.suse/scsi-qla2xxx-Update-manufacturer-detail.patch new file mode 100644 index 0000000..5ad62d1 --- /dev/null +++ b/patches.suse/scsi-qla2xxx-Update-manufacturer-detail.patch @@ -0,0 +1,33 @@ +From: Bikash Hazarika +Date: Tue, 27 Feb 2024 22:11:20 +0530 +Subject: scsi: qla2xxx: Update manufacturer detail +Patch-mainline: Queued in subsystem maintainer repository +Git-repo: git://git.kernel.org/pub/scm/linux/kernel/git/mkp/scsi.git +Git-commit: 688fa069fda6fce24d243cddfe0c7024428acb74 +References: bsc#1221816 + +Update manufacturer detail from "Marvell Semiconductor, Inc." to +"Marvell". + +Cc: stable@vger.kernel.org +Signed-off-by: Bikash Hazarika +Signed-off-by: Nilesh Javali +Link: https://lore.kernel.org/r/20240227164127.36465-5-njavali@marvell.com +Reviewed-by: Himanshu Madhani +Signed-off-by: Martin K. Petersen +Acked-by: Daniel Wagner +--- + drivers/scsi/qla2xxx/qla_def.h | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/drivers/scsi/qla2xxx/qla_def.h ++++ b/drivers/scsi/qla2xxx/qla_def.h +@@ -82,7 +82,7 @@ typedef union { + #include "qla_nvme.h" + #define QLA2XXX_DRIVER_NAME "qla2xxx" + #define QLA2XXX_APIDEV "ql2xapidev" +-#define QLA2XXX_MANUFACTURER "Marvell Semiconductor, Inc." ++#define QLA2XXX_MANUFACTURER "Marvell" + + /* + * We have MAILBOX_REGISTER_COUNT sized arrays in a few places, diff --git a/patches.suse/scsi-qla2xxx-Update-version-to-10.02.09.200-k.patch b/patches.suse/scsi-qla2xxx-Update-version-to-10.02.09.200-k.patch new file mode 100644 index 0000000..c2460b1 --- /dev/null +++ b/patches.suse/scsi-qla2xxx-Update-version-to-10.02.09.200-k.patch @@ -0,0 +1,31 @@ +From: Nilesh Javali +Date: Tue, 27 Feb 2024 22:11:27 +0530 +Subject: scsi: qla2xxx: Update version to 10.02.09.200-k +Patch-mainline: Queued in subsystem maintainer repository +Git-repo: git://git.kernel.org/pub/scm/linux/kernel/git/mkp/scsi.git +Git-commit: b8260ca37930a4b007f7b662d4b501a030a4935f +References: bsc#1221816 + +Signed-off-by: Nilesh Javali +Link: https://lore.kernel.org/r/20240227164127.36465-12-njavali@marvell.com +Reviewed-by: Himanshu Madhani +Signed-off-by: Martin K. Petersen +Acked-by: Daniel Wagner +--- + drivers/scsi/qla2xxx/qla_version.h | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +--- a/drivers/scsi/qla2xxx/qla_version.h ++++ b/drivers/scsi/qla2xxx/qla_version.h +@@ -6,9 +6,9 @@ + /* + * Driver version + */ +-#define QLA2XXX_VERSION "10.02.09.100-k" ++#define QLA2XXX_VERSION "10.02.09.200-k" + + #define QLA_DRIVER_MAJOR_VER 10 + #define QLA_DRIVER_MINOR_VER 2 + #define QLA_DRIVER_PATCH_VER 9 +-#define QLA_DRIVER_BETA_VER 100 ++#define QLA_DRIVER_BETA_VER 200 diff --git a/series.conf b/series.conf index 41b82c1..457696a 100644 --- a/series.conf +++ b/series.conf @@ -20055,6 +20055,33 @@ patches.suse/net-sched-Add-module-alias-for-sch_fq_pie.patch patches.suse/net-bnx2x-Prevent-access-to-a-freed-page-in-page_poo.patch + # mkp/scsi queue + patches.suse/scsi-lpfc-Correct-size-for-wqe-for-memset.patch + patches.suse/scsi-lpfc-Correct-size-for-cmdwqe-rspwqe-for-memset.patch + patches.suse/scsi-qla2xxx-Prevent-command-send-on-chip-reset.patch + patches.suse/scsi-qla2xxx-Fix-N2N-stuck-connection.patch + patches.suse/scsi-qla2xxx-Split-FCE-EFT-trace-control.patch + patches.suse/scsi-qla2xxx-Update-manufacturer-detail.patch + patches.suse/scsi-qla2xxx-NVME-FCP-prefer-flag-not-being-honored.patch + patches.suse/scsi-qla2xxx-Fix-command-flush-on-cable-pull.patch + patches.suse/scsi-qla2xxx-Fix-double-free-of-the-ha-vp_map-pointe.patch + patches.suse/scsi-qla2xxx-Fix-double-free-of-fcport.patch + patches.suse/scsi-qla2xxx-Change-debug-message-during-driver-unlo.patch + patches.suse/scsi-qla2xxx-Delay-I-O-Abort-on-PCI-error.patch + patches.suse/scsi-qla2xxx-Update-version-to-10.02.09.200-k.patch + patches.suse/scsi-lpfc-Remove-unnecessary-log-message-in-queuecom.patch + patches.suse/scsi-lpfc-Move-NPIV-s-transport-unregistration-to-af.patch + patches.suse/scsi-lpfc-Remove-IRQF_ONESHOT-flag-from-threaded-IRQ.patch + patches.suse/scsi-lpfc-Update-lpfc_ramp_down_queue_handler-logic.patch + patches.suse/scsi-lpfc-Replace-hbalock-with-ndlp-lock-in-lpfc_nvm.patch + patches.suse/scsi-lpfc-Release-hbalock-before-calling-lpfc_worker.patch + patches.suse/scsi-lpfc-Use-a-dedicated-lock-for-ras_fwlog-state.patch + patches.suse/scsi-lpfc-Define-lpfc_nodelist-type-for-ctx_ndlp-ptr.patch + patches.suse/scsi-lpfc-Define-lpfc_dmabuf-type-for-ctx_buf-ptr.patch + patches.suse/scsi-lpfc-Define-types-in-a-union-for-generic-void-c.patch + patches.suse/scsi-lpfc-Update-lpfc-version-to-14.4.0.1.patch + patches.suse/scsi-lpfc-Copyright-updates-for-14.4.0.1-patches.patch + ######################################################## # end of sorted patches ########################################################