mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Bart Van Assche <bvanassche@acm.org>
To: Ziqi Chen <quic_ziqichen@quicinc.com>,
	quic_asutoshd@quicinc.com, quic_cang@quicinc.com,
	quic_nguyenb@quicinc.com, mani@kernel.org,
	stanley.chu@mediatek.com, adrian.hunter@intel.com,
	beanhuo@micron.com, avri.altman@wdc.com,
	junwoo80.lee@samsung.com, martin.petersen@oracle.com
Cc: linux-scsi@vger.kernel.org, Alim Akhtar <alim.akhtar@samsung.com>,
	"James E.J. Bottomley" <jejb@linux.ibm.com>,
	open list <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH v1] scsi: ufs: core: print trs for pending requests in MCQ mode
Date: Thu, 9 Mar 2023 09:28:53 -0800	[thread overview]
Message-ID: <3d858407-481b-a55b-4aa9-513e4a4ca44e@acm.org> (raw)
In-Reply-To: <1678338122-88611-1-git-send-email-quic_ziqichen@quicinc.com>

On 3/8/23 21:01, Ziqi Chen wrote:
> +static void ufshcd_print_trs_all(struct ufs_hba *hba, bool pr_prdt)
> +{
> +	const struct ufshcd_lrb *lrbp;
> +	int tag;
> +
> +	for (tag = 0; tag < hba->nutrs; tag++) {
> +		lrbp = &hba->lrb[tag];
> +
> +		if (lrbp->cmd)
> +			ufshcd_print_tr(hba, tag, pr_prdt);
>   	}
>   }

There is a race in this code: lrbp->cmd may be cleared after it has been 
read and before or while ufshcd_print_tr() is in progress. How about 
preventing that race by blk_mq_tagset_busy_iter() to iterate over 
pending SCSI commands?

Thanks,

Bart.

  reply	other threads:[~2023-03-09 17:29 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-09  5:01 Ziqi Chen
2023-03-09 17:28 ` Bart Van Assche [this message]
2023-03-13 11:29   ` Ziqi Chen

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=3d858407-481b-a55b-4aa9-513e4a4ca44e@acm.org \
    --to=bvanassche@acm.org \
    --cc=adrian.hunter@intel.com \
    --cc=alim.akhtar@samsung.com \
    --cc=avri.altman@wdc.com \
    --cc=beanhuo@micron.com \
    --cc=jejb@linux.ibm.com \
    --cc=junwoo80.lee@samsung.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-scsi@vger.kernel.org \
    --cc=mani@kernel.org \
    --cc=martin.petersen@oracle.com \
    --cc=quic_asutoshd@quicinc.com \
    --cc=quic_cang@quicinc.com \
    --cc=quic_nguyenb@quicinc.com \
    --cc=quic_ziqichen@quicinc.com \
    --cc=stanley.chu@mediatek.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

all inboxes | Powered by JetHome®