linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Stephen Rothwell <sfr@canb.auug.org.au>
To: "Martin K. Petersen" <martin.petersen@oracle.com>
Cc: Linux Next Mailing List <linux-next@vger.kernel.org>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	Bart Van Assche <bvanassche@acm.org>,
	Bill Kuzeja <William.Kuzeja@stratus.com>
Subject: Re: linux-next: manual merge of the scsi-mkp tree with Linus' tree
Date: Mon, 10 Dec 2018 18:09:44 +1100	[thread overview]
Message-ID: <20181210180944.0fb13ead@canb.auug.org.au> (raw)
In-Reply-To: <20181210171716.77cbf9fe@canb.auug.org.au>

[-- Attachment #1: Type: text/plain, Size: 2124 bytes --]

Hi all,

On Mon, 10 Dec 2018 17:17:16 +1100 Stephen Rothwell <sfr@canb.auug.org.au> wrote:
>
> I fixed it up (see below) and can carry the fix as necessary. This

See below :-)

Also I accidentally left the declaration of "status" in __qla2x00_abort_all_cmds().
-- 
Cheers,
Stephen Rothwell

diff --cc drivers/scsi/qla2xxx/qla_os.c
index f92196ec5489,643cd7c0efc1..000000000000
--- a/drivers/scsi/qla2xxx/qla_os.c
+++ b/drivers/scsi/qla2xxx/qla_os.c
@@@ -1742,6 -1746,41 +1742,49 @@@ qla2x00_loop_reset(scsi_qla_host_t *vha
  	return QLA_SUCCESS;
  }
  
+ static void qla2x00_abort_srb(struct qla_qpair *qp, srb_t *sp, const int res,
+ 			      unsigned long *flags)
+ 	__releases(qp->qp_lock_ptr)
+ 	__acquires(qp->qp_lock_ptr)
+ {
+ 	scsi_qla_host_t *vha = qp->vha;
+ 	struct qla_hw_data *ha = vha->hw;
+ 
+ 	if (sp->type == SRB_NVME_CMD || sp->type == SRB_NVME_LS) {
+ 		if (!sp_get(sp)) {
+ 			/* got sp */
+ 			spin_unlock_irqrestore(qp->qp_lock_ptr, *flags);
+ 			qla_nvme_abort(ha, sp, res);
+ 			spin_lock_irqsave(qp->qp_lock_ptr, *flags);
+ 		}
+ 	} else if (GET_CMD_SP(sp) && !ha->flags.eeh_busy &&
+ 		   !test_bit(ABORT_ISP_ACTIVE, &vha->dpc_flags) &&
+ 		   !qla2x00_isp_reg_stat(ha) && sp->type == SRB_SCSI_CMD) {
+ 		/*
+ 		 * Don't abort commands in adapter during EEH recovery as it's
+ 		 * not accessible/responding.
+ 		 *
+ 		 * Get a reference to the sp and drop the lock. The reference
+ 		 * ensures this sp->done() call and not the call in
+ 		 * qla2xxx_eh_abort() ends the SCSI cmd (with result 'res').
+ 		 */
+ 		if (!sp_get(sp)) {
++			int status;
++
+ 			spin_unlock_irqrestore(qp->qp_lock_ptr, *flags);
 -			qla2xxx_eh_abort(GET_CMD_SP(sp));
++			status = qla2xxx_eh_abort(GET_CMD_SP(sp));
+ 			spin_lock_irqsave(qp->qp_lock_ptr, *flags);
++			/*
++			 * Get rid of extra reference causedby early
++			 * exit from qla2xxx_eh_abort
++			 */
++			if (status == FAST_IO_FAIL)
++				atomic_dec(&sp->ref_count);
+ 		}
+ 	}
+ 	sp->done(sp, res);
+ }
+ 
  static void
  __qla2x00_abort_all_cmds(struct qla_qpair *qp, int res)
  {

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

  reply	other threads:[~2018-12-10  7:09 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-12-10  6:17 linux-next: manual merge of the scsi-mkp tree with Linus' tree Stephen Rothwell
2018-12-10  7:09 ` Stephen Rothwell [this message]
  -- strict thread matches above, loose matches on Subject: below --
2023-08-28  3:02 Stephen Rothwell
2023-09-01  0:23 ` Karan Tilak Kumar (kartilak)
2023-03-20  1:16 Stephen Rothwell
2022-02-14  3:29 Stephen Rothwell
2022-02-14  8:57 ` John Garry
2021-12-08  3:32 Stephen Rothwell
2021-10-06  4:44 Stephen Rothwell
2021-08-11  5:40 Stephen Rothwell
2021-08-11  5:53 ` Sreekanth Reddy
2021-08-12  3:25 ` Martin K. Petersen
2020-09-03  5:21 Stephen Rothwell
2020-09-02  5:15 Stephen Rothwell
2020-09-02  5:12 Stephen Rothwell
2020-09-11  4:47 ` Stephen Rothwell
2020-06-10  2:17 Stephen Rothwell
2020-06-11  2:12 ` Stephen Rothwell
2019-02-11  4:31 Stephen Rothwell
2019-02-11  9:24 ` John Garry
2019-02-07  4:44 Stephen Rothwell
2019-02-07 18:30 ` James Smart
2018-10-18  4:15 Stephen Rothwell
2018-08-03  6:22 Stephen Rothwell
2018-08-03  6:04 Stephen Rothwell
2018-07-11  4:04 Stephen Rothwell
2018-07-12  4:29 ` Stephen Rothwell
2018-03-22  5:54 Stephen Rothwell
2017-11-30  1:51 Stephen Rothwell
2017-11-30  1:55 ` Stephen Rothwell
2017-12-01  2:14   ` Martin K. Petersen
2017-12-01  3:42     ` Stephen Rothwell
2017-09-01  4:48 Stephen Rothwell

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=20181210180944.0fb13ead@canb.auug.org.au \
    --to=sfr@canb.auug.org.au \
    --cc=William.Kuzeja@stratus.com \
    --cc=bvanassche@acm.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-next@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
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;
as well as URLs for NNTP newsgroup(s).