Re: [PATCH] scsi: ufs: ufs-mediatek: configure individual LU queue flags
From: Ed Tsai (蔡宗軒)
Date: Tue Oct 08 2024 - 19:47:55 EST
On Tue, 2024-10-08 at 10:38 -0700, Bart Van Assche wrote:
> On 10/7/24 11:59 PM, ed.tsai@xxxxxxxxxxxx wrote:
> > +static void ufs_mtk_config_scsi_dev(struct scsi_device *sdev)
> > +{
> > +struct ufs_hba *hba = shost_priv(sdev->host);
> > +
> > +dev_dbg(hba->dev, "lu %llu scsi device configured", sdev->lun);
> > +if (sdev->lun == 2)
> > +blk_queue_flag_set(QUEUE_FLAG_SAME_FORCE, sdev->reqeust_queue);
> > +}
>
> There are no block drivers in the upstream kernel that set
> QUEUE_FLAG_SAME_FORCE. An explanation is missing from the patch
> description why this flag is set from the UFS driver instead of by
> writing the value "2" into /sys/class/block/$bdev/queue/rq_affinity.
The LU probing is completed asynchronously by another thread, which
means that "sdc" cannot be guaranteed to be LU2. We do not need to
change the queue settings at runtime. Therefore, a simpler and more
intuitive approach is to set its flag once the SCSI device is confirmed
to be ready.
> Additionally, an explanation is missing why QUEUE_FLAG_SAME_FORCE is
> set but QUEUE_FLAG_SAME_COMP not.
QUEUE_FLAG_SAME_COMP is the default flag for blk mq queue. As this
stage, it should be set by default.
>
> Bart.