linux-scsi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] lpfc: remove left-over BUILD_NVME defines
@ 2019-10-17 15:00 Hannes Reinecke
  2019-10-17 16:52 ` James Smart
  2019-10-18  2:01 ` Martin K. Petersen
  0 siblings, 2 replies; 5+ messages in thread
From: Hannes Reinecke @ 2019-10-17 15:00 UTC (permalink / raw)
  To: James Smart
  Cc: Martin K. Petersen, Christoph Hellwig, James Bottomley,
	linux-scsi, Martin George, Daniel Wagner, Hannes Reinecke,
	Hannes Reinecke

The BUILD_NVME define never got defined anywhere, causing
NVMe commands to be treated as SCSI commands when freeing
the buffers.
This was causing a stuck discovery and a horrible crash
in lpfc_set_rrq_active() later on.

Fixes: c00f62e6c546 ("scsi: lpfc: Merge per-protocol WQ/CQ pairs into single per-cpu pair")

Signed-off-by: Hannes Reinecke <hare@suse.com>
---
 drivers/scsi/lpfc/lpfc_init.c | 2 --
 drivers/scsi/lpfc/lpfc_scsi.c | 2 --
 2 files changed, 4 deletions(-)

diff --git a/drivers/scsi/lpfc/lpfc_init.c b/drivers/scsi/lpfc/lpfc_init.c
index a0aa7a555811..6e6bb8da97d6 100644
--- a/drivers/scsi/lpfc/lpfc_init.c
+++ b/drivers/scsi/lpfc/lpfc_init.c
@@ -9066,7 +9066,6 @@ lpfc_sli4_queue_create(struct lpfc_hba *phba)
 		}
 	}
 
-#if defined(BUILD_NVME)
 	/* Clear NVME stats */
 	if (phba->cfg_enable_fc4_type & LPFC_ENABLE_NVME) {
 		for (idx = 0; idx < phba->cfg_hdw_queue; idx++) {
@@ -9074,7 +9073,6 @@ lpfc_sli4_queue_create(struct lpfc_hba *phba)
 			       sizeof(phba->sli4_hba.hdwq[idx].nvme_cstat));
 		}
 	}
-#endif
 
 	/* Clear SCSI stats */
 	if (phba->cfg_enable_fc4_type & LPFC_ENABLE_FCP) {
diff --git a/drivers/scsi/lpfc/lpfc_scsi.c b/drivers/scsi/lpfc/lpfc_scsi.c
index f06f63e58596..67b7a1aed45c 100644
--- a/drivers/scsi/lpfc/lpfc_scsi.c
+++ b/drivers/scsi/lpfc/lpfc_scsi.c
@@ -528,7 +528,6 @@ lpfc_sli4_io_xri_aborted(struct lpfc_hba *phba,
 			list_del_init(&psb->list);
 			psb->exch_busy = 0;
 			psb->status = IOSTAT_SUCCESS;
-#ifdef BUILD_NVME
 			if (psb->cur_iocbq.iocb_flag == LPFC_IO_NVME) {
 				qp->abts_nvme_io_bufs--;
 				spin_unlock(&qp->abts_io_buf_list_lock);
@@ -536,7 +535,6 @@ lpfc_sli4_io_xri_aborted(struct lpfc_hba *phba,
 				lpfc_sli4_nvme_xri_aborted(phba, axri, psb);
 				return;
 			}
-#endif
 			qp->abts_scsi_io_bufs--;
 			spin_unlock(&qp->abts_io_buf_list_lock);
 
-- 
2.16.4


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH] lpfc: remove left-over BUILD_NVME defines
  2019-10-17 15:00 [PATCH] lpfc: remove left-over BUILD_NVME defines Hannes Reinecke
@ 2019-10-17 16:52 ` James Smart
  2019-10-18  2:01 ` Martin K. Petersen
  1 sibling, 0 replies; 5+ messages in thread
From: James Smart @ 2019-10-17 16:52 UTC (permalink / raw)
  To: Hannes Reinecke
  Cc: Martin K. Petersen, Christoph Hellwig, James Bottomley,
	linux-scsi, Martin George, Daniel Wagner, Hannes Reinecke

On 10/17/2019 8:00 AM, Hannes Reinecke wrote:
> The BUILD_NVME define never got defined anywhere, causing
> NVMe commands to be treated as SCSI commands when freeing
> the buffers.
> This was causing a stuck discovery and a horrible crash
> in lpfc_set_rrq_active() later on.
>
> Fixes: c00f62e6c546 ("scsi: lpfc: Merge per-protocol WQ/CQ pairs into single per-cpu pair")
>
> Signed-off-by: Hannes Reinecke <hare@suse.com>
> ---
>   drivers/scsi/lpfc/lpfc_init.c | 2 --
>   drivers/scsi/lpfc/lpfc_scsi.c | 2 --
>   2 files changed, 4 deletions(-)
>
>

Yep. Thanks.

Reviewed-by: James Smart <james.smart@broadcom.com>

-- james



^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] lpfc: remove left-over BUILD_NVME defines
  2019-10-17 15:00 [PATCH] lpfc: remove left-over BUILD_NVME defines Hannes Reinecke
  2019-10-17 16:52 ` James Smart
@ 2019-10-18  2:01 ` Martin K. Petersen
  2019-10-18 16:36   ` James Smart
  1 sibling, 1 reply; 5+ messages in thread
From: Martin K. Petersen @ 2019-10-18  2:01 UTC (permalink / raw)
  To: Hannes Reinecke
  Cc: James Smart, Martin K. Petersen, Christoph Hellwig,
	James Bottomley, linux-scsi, Martin George, Daniel Wagner,
	Hannes Reinecke


Hannes,

> The BUILD_NVME define never got defined anywhere, causing NVMe
> commands to be treated as SCSI commands when freeing the buffers.
> This was causing a stuck discovery and a horrible crash in
> lpfc_set_rrq_active() later on.

Applied to 5.4/scsi-fixes, thanks!

-- 
Martin K. Petersen	Oracle Linux Engineering

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] lpfc: remove left-over BUILD_NVME defines
  2019-10-18  2:01 ` Martin K. Petersen
@ 2019-10-18 16:36   ` James Smart
  2019-10-18 21:22     ` Martin K. Petersen
  0 siblings, 1 reply; 5+ messages in thread
From: James Smart @ 2019-10-18 16:36 UTC (permalink / raw)
  To: Martin K. Petersen, Hannes Reinecke
  Cc: Christoph Hellwig, James Bottomley, linux-scsi, Martin George,
	Daniel Wagner, Hannes Reinecke, James Smart, stable

On 10/17/2019 7:01 PM, Martin K. Petersen wrote:
> Hannes,
>
>> The BUILD_NVME define never got defined anywhere, causing NVMe
>> commands to be treated as SCSI commands when freeing the buffers.
>> This was causing a stuck discovery and a horrible crash in
>> lpfc_set_rrq_active() later on.
> Applied to 5.4/scsi-fixes, thanks!
>

The offending patches that introduced the define are:

 From 12.2.0.0:
scsi: lpfc: Move SCSI and NVME Stats to hardware queue structures
commit    4c47efc140fa926f00aa59c248458d95bd7b5eab
 From 12.4.0.0:
scsi: lpfc: Merge per-protocol WQ/CQ pairs into single per-cpu pair
commit    c00f62e6c5468ed0673c583f1ff284274e817410

The 12.2 patch just misses some stats - no big deal.
But the 12.4 patch introduces a logic error, and is in the head of the 
stable tree.

I assume that 5.4/scsi-fixes will get merged into 5.4 pre-release, and 
that the stable tree will rebase to pick it up ?

-- james



^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] lpfc: remove left-over BUILD_NVME defines
  2019-10-18 16:36   ` James Smart
@ 2019-10-18 21:22     ` Martin K. Petersen
  0 siblings, 0 replies; 5+ messages in thread
From: Martin K. Petersen @ 2019-10-18 21:22 UTC (permalink / raw)
  To: James Smart
  Cc: Martin K. Petersen, Hannes Reinecke, Christoph Hellwig,
	James Bottomley, linux-scsi, Martin George, Daniel Wagner,
	Hannes Reinecke, stable


James,

> I assume that 5.4/scsi-fixes will get merged into 5.4 pre-release,

Yes.

> and that the stable tree will rebase to pick it up ?

stable/master is tracking Linus until final release.

If you want the stats issue fixed in 5.3, it's best to wait for Hannes'
commit to be merged by Linus. You can then request a stable backport.

-- 
Martin K. Petersen	Oracle Linux Engineering

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2019-10-18 21:23 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-10-17 15:00 [PATCH] lpfc: remove left-over BUILD_NVME defines Hannes Reinecke
2019-10-17 16:52 ` James Smart
2019-10-18  2:01 ` Martin K. Petersen
2019-10-18 16:36   ` James Smart
2019-10-18 21:22     ` Martin K. Petersen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).