* [PATCH v2] lpfc: remove duplicate unloading checks
@ 2020-04-21 20:33 James Smart
2020-04-21 21:40 ` himanshu.madhani
2020-04-22 4:12 ` Martin K. Petersen
0 siblings, 2 replies; 3+ messages in thread
From: James Smart @ 2020-04-21 20:33 UTC (permalink / raw)
To: linux-scsi; +Cc: James Smart
During code reviews several instances of duplicate module unloading checks
were found.
Remove the duplicate checks.
Signed-off-by: James Smart <jsmart2021@gmail.com>
---
v2: reworked lpfc_els.c mod to keep check prior to locks
---
drivers/scsi/lpfc/lpfc_els.c | 10 ++--------
drivers/scsi/lpfc/lpfc_nvme.c | 5 -----
drivers/scsi/lpfc/lpfc_nvmet.c | 11 -----------
3 files changed, 2 insertions(+), 24 deletions(-)
diff --git a/drivers/scsi/lpfc/lpfc_els.c b/drivers/scsi/lpfc/lpfc_els.c
index 80d1e661b0d4..565a21401660 100644
--- a/drivers/scsi/lpfc/lpfc_els.c
+++ b/drivers/scsi/lpfc/lpfc_els.c
@@ -7936,19 +7936,13 @@ lpfc_els_timeout_handler(struct lpfc_vport *vport)
if (unlikely(!pring))
return;
- if ((phba->pport->load_flag & FC_UNLOADING))
+ if (phba->pport->load_flag & FC_UNLOADING)
return;
+
spin_lock_irq(&phba->hbalock);
if (phba->sli_rev == LPFC_SLI_REV4)
spin_lock(&pring->ring_lock);
- if ((phba->pport->load_flag & FC_UNLOADING)) {
- if (phba->sli_rev == LPFC_SLI_REV4)
- spin_unlock(&pring->ring_lock);
- spin_unlock_irq(&phba->hbalock);
- return;
- }
-
list_for_each_entry_safe(piocb, tmp_iocb, &pring->txcmplq, list) {
cmd = &piocb->iocb;
diff --git a/drivers/scsi/lpfc/lpfc_nvme.c b/drivers/scsi/lpfc/lpfc_nvme.c
index a45936e08031..12d2b2775773 100644
--- a/drivers/scsi/lpfc/lpfc_nvme.c
+++ b/drivers/scsi/lpfc/lpfc_nvme.c
@@ -1491,11 +1491,6 @@ lpfc_nvme_fcp_io_submit(struct nvme_fc_local_port *pnvme_lport,
phba = vport->phba;
- if (vport->load_flag & FC_UNLOADING) {
- ret = -ENODEV;
- goto out_fail;
- }
-
if (unlikely(vport->load_flag & FC_UNLOADING)) {
lpfc_printf_vlog(vport, KERN_INFO, LOG_NVME_IOERR,
"6124 Fail IO, Driver unload\n");
diff --git a/drivers/scsi/lpfc/lpfc_nvmet.c b/drivers/scsi/lpfc/lpfc_nvmet.c
index 565419bf8d74..5f5aecea5b55 100644
--- a/drivers/scsi/lpfc/lpfc_nvmet.c
+++ b/drivers/scsi/lpfc/lpfc_nvmet.c
@@ -841,9 +841,6 @@ lpfc_nvmet_xmt_ls_rsp(struct nvmet_fc_target_port *tgtport,
struct ulp_bde64 bpl;
int rc;
- if (phba->pport->load_flag & FC_UNLOADING)
- return -ENODEV;
-
if (phba->pport->load_flag & FC_UNLOADING)
return -ENODEV;
@@ -938,11 +935,6 @@ lpfc_nvmet_xmt_fcp_op(struct nvmet_fc_target_port *tgtport,
goto aerr;
}
- if (phba->pport->load_flag & FC_UNLOADING) {
- rc = -ENODEV;
- goto aerr;
- }
-
#ifdef CONFIG_SCSI_LPFC_DEBUG_FS
if (ctxp->ts_cmd_nvme) {
if (rsp->op == NVMET_FCOP_RSP)
@@ -1062,9 +1054,6 @@ lpfc_nvmet_xmt_fcp_abort(struct nvmet_fc_target_port *tgtport,
struct lpfc_queue *wq;
unsigned long flags;
- if (phba->pport->load_flag & FC_UNLOADING)
- return;
-
if (phba->pport->load_flag & FC_UNLOADING)
return;
--
2.16.4
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH v2] lpfc: remove duplicate unloading checks
2020-04-21 20:33 [PATCH v2] lpfc: remove duplicate unloading checks James Smart
@ 2020-04-21 21:40 ` himanshu.madhani
2020-04-22 4:12 ` Martin K. Petersen
1 sibling, 0 replies; 3+ messages in thread
From: himanshu.madhani @ 2020-04-21 21:40 UTC (permalink / raw)
To: James Smart, linux-scsi
On 4/21/20 3:33 PM, James Smart wrote:
> During code reviews several instances of duplicate module unloading checks
> were found.
>
> Remove the duplicate checks.
>
> Signed-off-by: James Smart <jsmart2021@gmail.com>
>
> ---
> v2: reworked lpfc_els.c mod to keep check prior to locks
> ---
> drivers/scsi/lpfc/lpfc_els.c | 10 ++--------
> drivers/scsi/lpfc/lpfc_nvme.c | 5 -----
> drivers/scsi/lpfc/lpfc_nvmet.c | 11 -----------
> 3 files changed, 2 insertions(+), 24 deletions(-)
>
> diff --git a/drivers/scsi/lpfc/lpfc_els.c b/drivers/scsi/lpfc/lpfc_els.c
> index 80d1e661b0d4..565a21401660 100644
> --- a/drivers/scsi/lpfc/lpfc_els.c
> +++ b/drivers/scsi/lpfc/lpfc_els.c
> @@ -7936,19 +7936,13 @@ lpfc_els_timeout_handler(struct lpfc_vport *vport)
> if (unlikely(!pring))
> return;
>
> - if ((phba->pport->load_flag & FC_UNLOADING))
> + if (phba->pport->load_flag & FC_UNLOADING)
> return;
> +
> spin_lock_irq(&phba->hbalock);
> if (phba->sli_rev == LPFC_SLI_REV4)
> spin_lock(&pring->ring_lock);
>
> - if ((phba->pport->load_flag & FC_UNLOADING)) {
> - if (phba->sli_rev == LPFC_SLI_REV4)
> - spin_unlock(&pring->ring_lock);
> - spin_unlock_irq(&phba->hbalock);
> - return;
> - }
> -
> list_for_each_entry_safe(piocb, tmp_iocb, &pring->txcmplq, list) {
> cmd = &piocb->iocb;
>
> diff --git a/drivers/scsi/lpfc/lpfc_nvme.c b/drivers/scsi/lpfc/lpfc_nvme.c
> index a45936e08031..12d2b2775773 100644
> --- a/drivers/scsi/lpfc/lpfc_nvme.c
> +++ b/drivers/scsi/lpfc/lpfc_nvme.c
> @@ -1491,11 +1491,6 @@ lpfc_nvme_fcp_io_submit(struct nvme_fc_local_port *pnvme_lport,
>
> phba = vport->phba;
>
> - if (vport->load_flag & FC_UNLOADING) {
> - ret = -ENODEV;
> - goto out_fail;
> - }
> -
> if (unlikely(vport->load_flag & FC_UNLOADING)) {
> lpfc_printf_vlog(vport, KERN_INFO, LOG_NVME_IOERR,
> "6124 Fail IO, Driver unload\n");
> diff --git a/drivers/scsi/lpfc/lpfc_nvmet.c b/drivers/scsi/lpfc/lpfc_nvmet.c
> index 565419bf8d74..5f5aecea5b55 100644
> --- a/drivers/scsi/lpfc/lpfc_nvmet.c
> +++ b/drivers/scsi/lpfc/lpfc_nvmet.c
> @@ -841,9 +841,6 @@ lpfc_nvmet_xmt_ls_rsp(struct nvmet_fc_target_port *tgtport,
> struct ulp_bde64 bpl;
> int rc;
>
> - if (phba->pport->load_flag & FC_UNLOADING)
> - return -ENODEV;
> -
> if (phba->pport->load_flag & FC_UNLOADING)
> return -ENODEV;
>
> @@ -938,11 +935,6 @@ lpfc_nvmet_xmt_fcp_op(struct nvmet_fc_target_port *tgtport,
> goto aerr;
> }
>
> - if (phba->pport->load_flag & FC_UNLOADING) {
> - rc = -ENODEV;
> - goto aerr;
> - }
> -
> #ifdef CONFIG_SCSI_LPFC_DEBUG_FS
> if (ctxp->ts_cmd_nvme) {
> if (rsp->op == NVMET_FCOP_RSP)
> @@ -1062,9 +1054,6 @@ lpfc_nvmet_xmt_fcp_abort(struct nvmet_fc_target_port *tgtport,
> struct lpfc_queue *wq;
> unsigned long flags;
>
> - if (phba->pport->load_flag & FC_UNLOADING)
> - return;
> -
> if (phba->pport->load_flag & FC_UNLOADING)
> return;
>
>
Reviewed-by: Himanshu Madhani <himanshu.madhani@oracle.com>
--
Himanshu Madhani
Oracle Linux Engineering
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH v2] lpfc: remove duplicate unloading checks
2020-04-21 20:33 [PATCH v2] lpfc: remove duplicate unloading checks James Smart
2020-04-21 21:40 ` himanshu.madhani
@ 2020-04-22 4:12 ` Martin K. Petersen
1 sibling, 0 replies; 3+ messages in thread
From: Martin K. Petersen @ 2020-04-22 4:12 UTC (permalink / raw)
To: James Smart; +Cc: linux-scsi
James,
> During code reviews several instances of duplicate module unloading checks
> were found.
>
> Remove the duplicate checks.
Applied to 5.8/scsi-queue. Thanks!
--
Martin K. Petersen Oracle Linux Engineering
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2020-04-22 4:14 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-04-21 20:33 [PATCH v2] lpfc: remove duplicate unloading checks James Smart
2020-04-21 21:40 ` himanshu.madhani
2020-04-22 4:12 ` Martin K. Petersen
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.