Re: [PATCH] ufs: core: Disable queue depth tracking support

Leon Romanovsky <[email protected]>
Newsgroups org.kernel.vger.linux-scsi
Message-ID <20260816121050.GB66924@unreal>
On Fri, Aug 14, 2026 at 02:49:47PM -0700, Bart Van Assche wrote:
> Disable queue depth tracking support because:
>  - UFS devices shouldn't need queue tracking support. If the host sends
>    less than or equal to bQueueDepth commands to the UFS device, no TASK
>    SET FULL condition should be reported. If a TASK SET FULL condition
>    is reported anyway, the host->host_blocked variable will be set and
>    the SCSI command will be requeued. Submission of the SCSI command
>    will be retried after another SCSI command has completed.
>  - The queue depth tracking code is not thread-safe. With MCQ enabled,
>    scsi_track_queue_full() may be called from multiple CPU cores
>    concurrently. This is not safe because individual
>    scsi_track_queue_full() calls are not serialized.
>  - scsi_track_queue_full() is called from interrupt context but not all
>    code called by scsi_track_queue_full() is IRQ-safe. Here is an
>    example of a call chain that may cause interrupts to be enabled,
>    something that is not allowed from interrupt context:
> 
>    ufshcd_mcq_poll_cqe_lock()
>      ufshcd_compl_one_cqe()
>        scsi_done()
>          blk_mq_complete_request()
>            scsi_complete()
>              scsi_decide_disposition()
>                scsi_handle_queue_full()
>                  scsi_track_queue_full()
>                    scsi_change_queue_depth()
>                      blk_set_queue_depth()
>                        rq_qos_queue_depth_changed()
>                          ioc_rqos_queue_depth_changed()
>                            spin_lock_irq()
>                            spin_unlock_irq() <- enables interrupts
> 
> Signed-off-by: Bart Van Assche <[email protected]>
> ---
>  drivers/infiniband/ulp/srp/ib_srp.c |  4 ++++
>  drivers/ufs/core/ufshcd.c           | 16 ----------------
>  2 files changed, 4 insertions(+), 16 deletions(-)
> 
> diff --git a/drivers/infiniband/ulp/srp/ib_srp.c b/drivers/infiniband/ulp/srp/ib_srp.c
> index acbd787de265..19a6400d1ec4 100644
> --- a/drivers/infiniband/ulp/srp/ib_srp.c
> +++ b/drivers/infiniband/ulp/srp/ib_srp.c
> @@ -1044,6 +1044,10 @@ static void srp_remove_target(struct srp_target_port *target)
>  	WARN_ON_ONCE(target->state != SRP_TARGET_REMOVED);
>  
>  	srp_del_scsi_host_attr(target->scsi_host);
> +	/*
> +	 * The srp_remove_host() call decrements the rport reference count.
> +	 * Keep the rport as long as its needed.
> +	 */

I believe we can drop this comment and keep the patch limited
to drivers/ufs/core/ufshcd.c only.

Thanks
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.