All of lore.kernel.org
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Praneeth Balasubramanian" <praneethb2002@gmail.com>
Cc: linux-scsi@vger.kernel.org
Subject: Re: [PATCH 8/9] scsi: qla2xxx: Hold qp_lock when completing command in abort timeout
Date: Sat, 05 Dec 2026 06:58:41 +0000	[thread overview]
Message-ID: <sashiko-outbox-251171@kernel.org> (raw)
In-Reply-To: <20261205063229.2518424-9-praneethb2002@gmail.com>

Thank you for your contribution! Sashiko AI review found 1 potential
issue to consider:
- [Low] scsi: qla2xxx: inaccurate EDIF-only scope in commit log and
  comment
--

commit da3577a69cb0da6d84ce149ab6bf41f706152379
Author: Praneeth Balasubramanian <praneethb2002@gmail.com>

scsi: qla2xxx: Hold qp_lock when completing command in abort timeout

This commit moves sp->cmd_sp->done() inside the qpair->qp_lock_ptr critical
section in qla24xx_abort_iocb_timeout().

> The unlocked qla_put_buf() can race qla_get_buf() on the same qpair. The
> pool accounting is then updated non-atomically, and qla_trim_buf() can
> dma_pool_free() a buffer that qla_get_buf() has just handed to a new
> EDIF command, which is then submitted using the freed buffer. This
> affects the EDIF buffer pool only and needs a firmware abort timeout to
> trigger.

[ ... ]

> diff --git a/drivers/scsi/qla2xxx/qla_init.c b/drivers/scsi/qla2xxx/qla_init.c
> index ccb039d97353b..3d80ead06aa1e 100644
> --- a/drivers/scsi/qla2xxx/qla_init.c
> +++ b/drivers/scsi/qla2xxx/qla_init.c
> @@ -139,15 +139,17 @@ static void qla24xx_abort_iocb_timeout(void *data)
>  			break;
>  		}
>  	}
> -	spin_unlock_irqrestore(qpair->qp_lock_ptr, flags);
> -
>  	if (cmdsp_found && sp->cmd_sp) {
>  		/*
>  		 * This done function should take care of
>  		 * original command ref: INIT
> +		 *
> +		 * The completion path ends in qla_put_buf(), which
> +		 * must run under qp_lock.
>  		 */
>  		sp->cmd_sp->done(sp->cmd_sp, QLA_OS_TIMER_EXPIRED);
>  	}
> +	spin_unlock_irqrestore(qpair->qp_lock_ptr, flags);

[Severity: Low]
Are the commit message and new comment accurate in stating that qp_lock_ptr
is only needed for EDIF's qla_put_buf()?

qla_put_buf() was introduced three years after 71c80b75ce8f ("scsi: qla2xxx:
Do command completion on abort timeout") in 82d8dfd2a238 ("scsi: qla2xxx:
edif: Fix performance dip due to lock contention").

Non-EDIF completions also depend on qp_lock_ptr: qla2x00_sp_free_dma() and
qla2xxx_qpair_sp_free_dma() update sp->qpair->dsd_list, dsd_inuse, and
dsd_avail when SRB_FCP_CMND_DMA_VALID is set, and qla_nvme_sp_done() expects
the qpair lock to be held.

The Fixes: tag fits the underlying unlocked sp->cmd_sp->done() call, so
updating the changelog and comment to reflect the broader qpair-locked
completion contract would keep them consistent.

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261205063229.2518424-1-praneethb2002@gmail.com?part=8

  reply	other threads:[~2026-12-05  6:58 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-12-05  6:32 [PATCH 0/9] scsi: fix missing locking and dump length checks in several drivers Praneeth Balasubramanian
2026-12-05  6:32 ` [PATCH 1/9] scsi: bnx2i: Hold the session back_lock around iscsi_itt_to_task() Praneeth Balasubramanian
2026-12-05  6:32 ` [PATCH 2/9] scsi: mpt3sas: do not keep an enclosure pointer across a host reset Praneeth Balasubramanian
2026-12-05  6:46   ` sashiko-bot
2026-12-05  6:32 ` [PATCH 3/9] scsi: pmcraid: Take host_lock around scsi_report_bus_reset() Praneeth Balasubramanian
2026-12-05  6:43   ` sashiko-bot
2026-12-05  8:20     ` Praneeth Balasubramanian
2026-12-05  6:32 ` [PATCH 4/9] scsi: ipr: Skip dump entries whose length is not a 4 byte multiple Praneeth Balasubramanian
2026-12-05  6:32 ` [PATCH 5/9] scsi: arm: Fix eh_abort race against the interrupt handler Praneeth Balasubramanian
2026-12-05  6:50   ` sashiko-bot
2026-12-05  8:20     ` Praneeth Balasubramanian
2026-12-05  6:32 ` [PATCH 6/9] scsi: csiostor: hold hw lock when issuing port stats mailbox command Praneeth Balasubramanian
2026-12-05  6:47   ` sashiko-bot
2026-12-05  8:20     ` Praneeth Balasubramanian
2026-12-05  6:32 ` [PATCH 7/9] scsi: fnic: Hold fnic_lock for the oxid calls in the FIP timer work Praneeth Balasubramanian
2026-12-05  6:32 ` [PATCH 8/9] scsi: qla2xxx: Hold qp_lock when completing command in abort timeout Praneeth Balasubramanian
2026-12-05  6:58   ` sashiko-bot [this message]
2026-12-05  6:32 ` [PATCH 9/9] scsi: target: core: Fix PRgeneration race in REGISTER AND MOVE Praneeth Balasubramanian
2026-12-05  6:56   ` sashiko-bot

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=sashiko-outbox-251171@kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=linux-scsi@vger.kernel.org \
    --cc=praneethb2002@gmail.com \
    --cc=sashiko-reviews@lists.linux.dev \
    /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 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.