Linux-SCSI Archive on lore.kernel.org
 help / color / Atom feed
From: Saurav Kashyap <skashyap@marvell.com>
To: <martin.petersen@oracle.com>
Cc: <GR-QLogic-Storage-Upstream@marvell.com>, <linux-scsi@vger.kernel.org>
Subject: [PATCH 2/3] bnx2fc: Fix scsi command completion after cleanup is posted.
Date: Thu, 26 Mar 2020 22:48:48 -0700
Message-ID: <20200327054849.15947-3-skashyap@marvell.com> (raw)
In-Reply-To: <20200327054849.15947-1-skashyap@marvell.com>

Driver received a scsi completion after it posted the cleanup
request. This leads to a problem that one of the ref count wasn't
released leading to flush_active_ios to struck. The callback from
libfc never returned and other ports were not processed leading to
APD.

- The patch will decrease the refcnt as well try to complete if
something is waiting for completion.

Signed-off-by: Saurav Kashyap <skashyap@marvell.com>
---
 drivers/scsi/bnx2fc/bnx2fc_io.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/drivers/scsi/bnx2fc/bnx2fc_io.c b/drivers/scsi/bnx2fc/bnx2fc_io.c
index 9ab9152..2b070f0 100644
--- a/drivers/scsi/bnx2fc/bnx2fc_io.c
+++ b/drivers/scsi/bnx2fc/bnx2fc_io.c
@@ -1917,6 +1917,12 @@ void bnx2fc_process_scsi_cmd_compl(struct bnx2fc_cmd *io_req,
 		/* we will not receive ABTS response for this IO */
 		BNX2FC_IO_DBG(io_req, "Timer context finished processing "
 			   "this scsi cmd\n");
+		if (test_and_clear_bit(BNX2FC_FLAG_IO_CLEANUP,
+				       &io_req->req_flags)) {
+			BNX2FC_IO_DBG(io_req,
+				      "Actual completion after cleanup request cleaning up\n");
+			bnx2fc_process_cleanup_compl(io_req, task, num_rq);
+		}
 		return;
 	}
 
-- 
1.8.3.1


  parent reply index

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-03-27  5:48 [PATCH 0/3] bnx2fc: General updates Saurav Kashyap
2020-03-27  5:48 ` [PATCH 1/3] bnx2fc: Process the RQE with CQE in interrupt context Saurav Kashyap
2020-03-27  5:48 ` Saurav Kashyap [this message]
2020-03-27  5:48 ` [PATCH 3/3] bnx2fc: Update the driver version to 2.12.13 Saurav Kashyap
2020-03-27 18:18 ` [PATCH 0/3] bnx2fc: General updates Martin K. Petersen
2020-03-30  4:03   ` [EXT] " Saurav Kashyap

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=20200327054849.15947-3-skashyap@marvell.com \
    --to=skashyap@marvell.com \
    --cc=GR-QLogic-Storage-Upstream@marvell.com \
    --cc=linux-scsi@vger.kernel.org \
    --cc=martin.petersen@oracle.com \
    /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

Linux-SCSI Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-scsi/0 linux-scsi/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-scsi linux-scsi/ https://lore.kernel.org/linux-scsi \
		linux-scsi@vger.kernel.org
	public-inbox-index linux-scsi

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-scsi


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git