[PATCH V2 5/5] blk-mq: Replace tags->lock with SRCU for tag iterators - Rockchip UFS regression
Jens Axboe
axboe at kernel.dk
Mon Oct 6 16:03:19 PDT 2025
On 10/6/25 12:02 PM, Bart Van Assche wrote:
> On 10/4/25 7:42 AM, Ming Lei wrote:
>> One possible fix is to check hba->scsi_host_added before calling
>> scsi_host_busy():
>>
>> dev_err(hba->dev, "%d outstanding reqs, tasks=0x%lx\n",
>> hba->scsi_host_added ? scsi_host_busy(hba->host) : 0,
>> hba->outstanding_tasks);
>
> My preference is to add a check inside scsi_host_busy(), e.g. as follows
> (entirely untested):
>
> diff --git a/drivers/scsi/hosts.c b/drivers/scsi/hosts.c
> index cc5d05dc395c..17173239301e 100644
> --- a/drivers/scsi/hosts.c
> +++ b/drivers/scsi/hosts.c
> @@ -611,8 +611,9 @@ int scsi_host_busy(struct Scsi_Host *shost)
> {
> int cnt = 0;
>
> - blk_mq_tagset_busy_iter(&shost->tag_set,
> - scsi_host_check_in_flight, &cnt);
> + if (shost->tag_set.ops)
> + blk_mq_tagset_busy_iter(&shost->tag_set,
> + scsi_host_check_in_flight, &cnt);
> return cnt;
> }
> EXPORT_SYMBOL(scsi_host_busy);
Agree, that's a nicer way to solve it, putting that stuff outside
of actual drivers.
--
Jens Axboe
More information about the Linux-rockchip
mailing list