[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <3c7e776e-df2e-4718-995f-5e5dfa3cc916@acm.org>
Date: Tue, 25 Jun 2024 09:13:23 -0700
From: Bart Van Assche <bvanassche@....org>
To: Peter Wang (王信友) <peter.wang@...iatek.com>,
"quic_rampraka@...cinc.com" <quic_rampraka@...cinc.com>,
"quic_nguyenb@...cinc.com" <quic_nguyenb@...cinc.com>,
"quic_ziqichen@...cinc.com" <quic_ziqichen@...cinc.com>,
"quic_nitirawa@...cinc.com" <quic_nitirawa@...cinc.com>,
"beanhuo@...ron.com" <beanhuo@...ron.com>,
"avri.altman@....com" <avri.altman@....com>,
"martin.petersen@...cle.com" <martin.petersen@...cle.com>,
"junwoo80.lee@...sung.com" <junwoo80.lee@...sung.com>,
"mani@...nel.org" <mani@...nel.org>,
"quic_cang@...cinc.com" <quic_cang@...cinc.com>
Cc: "linux-scsi@...r.kernel.org" <linux-scsi@...r.kernel.org>,
"alim.akhtar@...sung.com" <alim.akhtar@...sung.com>,
"jejb@...ux.ibm.com" <jejb@...ux.ibm.com>,
"quic_asutoshd@...cinc.com" <quic_asutoshd@...cinc.com>,
"quic_mnaresh@...cinc.com" <quic_mnaresh@...cinc.com>,
"manivannan.sadhasivam@...aro.org" <manivannan.sadhasivam@...aro.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] scsi: ufs: core: quiesce request queues before check
pending cmds
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.
Powered by blists - more mailing lists