mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Bart Van Assche <bvanassche@acm.org>
To: "Peter Wang (王信友)" <peter.wang@mediatek.com>,
	"quic_rampraka@quicinc.com" <quic_rampraka@quicinc.com>,
	"quic_nguyenb@quicinc.com" <quic_nguyenb@quicinc.com>,
	"quic_ziqichen@quicinc.com" <quic_ziqichen@quicinc.com>,
	"quic_nitirawa@quicinc.com" <quic_nitirawa@quicinc.com>,
	"beanhuo@micron.com" <beanhuo@micron.com>,
	"avri.altman@wdc.com" <avri.altman@wdc.com>,
	"martin.petersen@oracle.com" <martin.petersen@oracle.com>,
	"junwoo80.lee@samsung.com" <junwoo80.lee@samsung.com>,
	"mani@kernel.org" <mani@kernel.org>,
	"quic_cang@quicinc.com" <quic_cang@quicinc.com>
Cc: "linux-scsi@vger.kernel.org" <linux-scsi@vger.kernel.org>,
	"alim.akhtar@samsung.com" <alim.akhtar@samsung.com>,
	"jejb@linux.ibm.com" <jejb@linux.ibm.com>,
	"quic_asutoshd@quicinc.com" <quic_asutoshd@quicinc.com>,
	"quic_mnaresh@quicinc.com" <quic_mnaresh@quicinc.com>,
	"manivannan.sadhasivam@linaro.org"
	<manivannan.sadhasivam@linaro.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] scsi: ufs: core: quiesce request queues before check pending cmds
Date: Tue, 25 Jun 2024 09:13:23 -0700	[thread overview]
Message-ID: <3c7e776e-df2e-4718-995f-5e5dfa3cc916@acm.org> (raw)
In-Reply-To: <ee45ce9429b1f69147c1a01e07b050275b4009bf.camel@mediatek.com>

On 6/24/24 8:38 PM, Peter Wang (王信友) wrote:
> But ufshcd_scsi_block_requests usage is correct in SDR mode.

ufshcd_scsi_block_requests() uses scsi_block_requests(). It is almost
never correct to use scsi_block_requests() in a blk-mq driver because
scsi_block_requests() does not wait for ongoing request submission
calls to complete. scsi_block_requests() is a legacy from the time when
all request dispatching and queueing was protected by the SCSI host
lock, a change that was made in 2010 or about 14 years ago. See also
https://lore.kernel.org/linux-scsi/20101105002409.GA21714@havoc.gtf.org/

> So, I think ufshcd_wait_for_doorbell_clr should be revise.
> Check tr_doorbell in SDR mode. (before 8d077ede48c1 do)
> Check each HWQ's are all empty in MCQ mode. (need think how to do)
> Make sure all requests is complete, and finish this function' job
> correctly.
> Or there still have a gap in ufshcd_wait_for_doorbell_clr.

ufshcd_wait_for_doorbell_clr() should be removed and 
ufshcd_clock_scaling_prepare() should use blk_mq_freeze_*().
See also my patch "ufs: Simplify the clock scaling mechanism
implementation" from 5 years ago 
(https://lore.kernel.org/linux-scsi/20191112173743.141503-5-bvanassche@acm.org/).

Best regards,

Bart.

  reply	other threads:[~2024-06-25 16:13 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-06-07 10:06 Ziqi Chen
2024-06-07 12:33 ` Bart Van Assche
2024-06-11 11:02   ` Ziqi Chen
2024-06-11 13:51     ` Bart Van Assche
2024-06-12  6:07       ` Ziqi Chen
2024-06-11 13:54 ` Bart Van Assche
2024-06-20 20:57 ` Bart Van Assche
2024-06-24  9:56   ` Ziqi Chen
2024-06-24 16:29     ` Bart Van Assche
2024-06-25  3:38       ` Peter Wang (王信友)
2024-06-25 16:13         ` Bart Van Assche [this message]
2024-06-26  3:52           ` Peter Wang (王信友)
2024-06-26 13:18           ` Ziqi Chen
2024-06-26 16:33             ` Bart Van Assche

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=3c7e776e-df2e-4718-995f-5e5dfa3cc916@acm.org \
    --to=bvanassche@acm.org \
    --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=manivannan.sadhasivam@linaro.org \
    --cc=martin.petersen@oracle.com \
    --cc=peter.wang@mediatek.com \
    --cc=quic_asutoshd@quicinc.com \
    --cc=quic_cang@quicinc.com \
    --cc=quic_mnaresh@quicinc.com \
    --cc=quic_nguyenb@quicinc.com \
    --cc=quic_nitirawa@quicinc.com \
    --cc=quic_rampraka@quicinc.com \
    --cc=quic_ziqichen@quicinc.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®