Skip to content

Commit 7670e74

Browse files
Ed Tsaimartinkpetersen
authored andcommitted
scsi: ufs: ufs-mediatek: Configure individual LU queue flags
Previously, ufs vops config_scsi_dev was removed because there were no users. ufs-mediatek needs it to configure the queue flags for each LU individually. Therefore, bring it back and customize the queue flag as required. [mkp: fixed typo] Signed-off-by: Ed Tsai <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Martin K. Petersen <[email protected]>
1 parent 4b3b581 commit 7670e74

File tree

3 files changed

+14
-0
lines changed

3 files changed

+14
-0
lines changed

drivers/ufs/core/ufshcd.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5235,6 +5235,9 @@ static int ufshcd_device_configure(struct scsi_device *sdev,
52355235
*/
52365236
sdev->silence_suspend = 1;
52375237

5238+
if (hba->vops && hba->vops->config_scsi_dev)
5239+
hba->vops->config_scsi_dev(sdev);
5240+
52385241
ufshcd_crypto_register(hba, q);
52395242

52405243
return 0;

drivers/ufs/host/ufs-mediatek.c

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1780,6 +1780,15 @@ static int ufs_mtk_config_esi(struct ufs_hba *hba)
17801780
return ufs_mtk_config_mcq(hba, true);
17811781
}
17821782

1783+
static void ufs_mtk_config_scsi_dev(struct scsi_device *sdev)
1784+
{
1785+
struct ufs_hba *hba = shost_priv(sdev->host);
1786+
1787+
dev_dbg(hba->dev, "lu %llu scsi device configured", sdev->lun);
1788+
if (sdev->lun == 2)
1789+
blk_queue_flag_set(QUEUE_FLAG_SAME_FORCE, sdev->request_queue);
1790+
}
1791+
17831792
/*
17841793
* struct ufs_hba_mtk_vops - UFS MTK specific variant operations
17851794
*
@@ -1809,6 +1818,7 @@ static const struct ufs_hba_variant_ops ufs_hba_mtk_vops = {
18091818
.op_runtime_config = ufs_mtk_op_runtime_config,
18101819
.mcq_config_resource = ufs_mtk_mcq_config_resource,
18111820
.config_esi = ufs_mtk_config_esi,
1821+
.config_scsi_dev = ufs_mtk_config_scsi_dev,
18121822
};
18131823

18141824
/**

include/ufs/ufshcd.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -386,6 +386,7 @@ struct ufs_hba_variant_ops {
386386
int (*get_outstanding_cqs)(struct ufs_hba *hba,
387387
unsigned long *ocqs);
388388
int (*config_esi)(struct ufs_hba *hba);
389+
void (*config_scsi_dev)(struct scsi_device *sdev);
389390
};
390391

391392
/* clock gating state */

0 commit comments

Comments
 (0)