From: James Smart <jsmart2021@gmail.com>
To: linux-scsi@vger.kernel.org
Cc: James Smart <jsmart2021@gmail.com>,
Dick Kennedy <dick.kennedy@broadcom.com>
Subject: [PATCH 4/8] lpfc: Fix oops when unloading driver while running mds diags
Date: Mon, 3 Aug 2020 14:02:25 -0700 [thread overview]
Message-ID: <20200803210229.23063-5-jsmart2021@gmail.com> (raw)
In-Reply-To: <20200803210229.23063-1-jsmart2021@gmail.com>
While mds diagnostic tests are running, if the driver is requested to be
unloaded, oops or hangs are observed. The driver doesn't terminate the
processing of diag frames when the unload is started. As such: oops may
be seen for __lpfc_sli_release_iocbq_s4 because ring memory is referenced
that was already freed; or hangs see in lpfc_nvme_wait_for_io_drain as
ios no longer complete.
If unloading, don't process diag frames. Just clean them up.
Signed-off-by: Dick Kennedy <dick.kennedy@broadcom.com>
Signed-off-by: James Smart <jsmart2021@gmail.com>
---
drivers/scsi/lpfc/lpfc_sli.c | 11 +++++++++--
1 file changed, 9 insertions(+), 2 deletions(-)
diff --git a/drivers/scsi/lpfc/lpfc_sli.c b/drivers/scsi/lpfc/lpfc_sli.c
index 8582b51b0613..4cd7ded656b7 100644
--- a/drivers/scsi/lpfc/lpfc_sli.c
+++ b/drivers/scsi/lpfc/lpfc_sli.c
@@ -13650,7 +13650,11 @@ lpfc_sli4_sp_handle_rcqe(struct lpfc_hba *phba, struct lpfc_rcqe *rcqe)
fc_hdr->fh_r_ctl == FC_RCTL_DD_UNSOL_DATA) {
spin_unlock_irqrestore(&phba->hbalock, iflags);
/* Handle MDS Loopback frames */
- lpfc_sli4_handle_mds_loopback(phba->pport, dma_buf);
+ if (!(phba->pport->load_flag & FC_UNLOADING))
+ lpfc_sli4_handle_mds_loopback(phba->pport,
+ dma_buf);
+ else
+ lpfc_in_buf_free(phba, &dma_buf->dbuf);
break;
}
@@ -18363,7 +18367,10 @@ lpfc_sli4_handle_received_buffer(struct lpfc_hba *phba,
fc_hdr->fh_r_ctl == FC_RCTL_DD_UNSOL_DATA) {
vport = phba->pport;
/* Handle MDS Loopback frames */
- lpfc_sli4_handle_mds_loopback(vport, dmabuf);
+ if (!(phba->pport->load_flag & FC_UNLOADING))
+ lpfc_sli4_handle_mds_loopback(vport, dmabuf);
+ else
+ lpfc_in_buf_free(phba, &dmabuf->dbuf);
return;
}
--
2.26.2
next prev parent reply other threads:[~2020-08-03 21:02 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-08-03 21:02 [PATCH 0/8] lpfc: Update lpfc to revision 12.8.0.3 James Smart
2020-08-03 21:02 ` [PATCH 1/8] lpfc: Fix FCoE speed reporting James Smart
2020-08-03 21:02 ` [PATCH 2/8] lpfc: Fix no message shown for lpfc_hdw_queue out of range value James Smart
2020-08-03 21:02 ` [PATCH 3/8] lpfc: Fix RSCN timeout due to incorrect gidft counter James Smart
2020-08-03 21:02 ` James Smart [this message]
2020-08-03 21:02 ` [PATCH 5/8] lpfc: Fix retry of PRLI when status indicates its unsupported James Smart
2020-08-03 21:02 ` [PATCH 6/8] lpfc: Fix validation of bsg reply lengths James Smart
2020-08-03 21:02 ` [PATCH 7/8] lpfc: Fix lun loss after cable pull James Smart
2020-08-03 21:02 ` [PATCH 8/8] lpfc: Update lpfc version to 12.8.0.3 James Smart
2020-08-05 1:17 ` [PATCH 0/8] lpfc: Update lpfc to revision 12.8.0.3 Martin K. Petersen
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20200803210229.23063-5-jsmart2021@gmail.com \
--to=jsmart2021@gmail.com \
--cc=dick.kennedy@broadcom.com \
--cc=linux-scsi@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox