ufs: core: Fix single doorbell mode support
Subsystems (2)
Bart Van Assche
reviewerPATCH 1/1 ufs: core: Fix single doorbell mode support
Commit 22089c218037 ("scsi: ufs: core: Optimize the hot path") accidentally broke support for the legacy single doorbell mode. The tag_set.shared_tags pointer is only != NULL if shared tag support is enabled. The UFS driver only enables shared tag support in MCQ mode.
Fix this by handling legacy and MCQ modes differently in ufshcd_tag_to_cmd().
--- drivers/ufs/core/ufshcd-priv.h | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-)
drivers/ufs/core/ufshcd-priv.h +6 -1
@@ -368,7 +368,12 @@ static inline bool ufs_is_valid_unit_desc_lun(struct ufs_dev_info *dev_info, u8*/ static inline struct scsi_cmnd *ufshcd_tag_to_cmd (struct ufs_hba *hba,u32 tag) { -struct blk_mq_tags *tags = hba->host->tag_set.shared_tags; +/* +* Host-wide tags are enabled in MCQ mode only. See also the +* host->host_tagset assignment in ufs-mcq.c. +*/ +struct blk_mq_tags *tags = hba->host->tag_set.shared_tags ?: + hba->host->tag_set.tags[0 ];struct request *rq =blk_mq_tag_to_rq (tags, tag);if (WARN_ON_ONCE (!rq))
Quoted 15 lines · Bart Van Assche
Commit
22089c218037("scsi: ufs: core: Optimize the hot path") accidentally broke support for the legacy single doorbell mode. The tag_set.shared_tags pointer is only != NULL if shared tag support is enabled. The UFS driver only enables shared tag support in MCQ mode.Fix this by handling legacy and MCQ modes differently in
ufshcd_tag_to_cmd().Reported-by Marek Szyprowski <[email protected]>Reported-by André Draszik <[email protected]>Tested-by Marek Szyprowski <[email protected]>Fixes 22089c218037 ("scsi: ufs: core: Optimize the hot path")Signed-off-by Bart Van Assche <[email protected]>
Quoted 3 lines
---
drivers/ufs/core/ufshcd-priv.h | 7 ++++++-1 file changed, 6 insertions(+), 1 deletion(-)
This fixes it for me on Pixel 6, too.
Thanks Bart for the quick fix!
Martin K. Petersen
AppliedBart,
Quoted 7 lines
Commit
22089c218037("scsi: ufs: core: Optimize the hot path") accidentally broke support for the legacy single doorbell mode. The tag_set.shared_tags pointer is only != NULL if shared tag support is enabled. The UFS driver only enables shared tag support in MCQ mode.Fix this by handling legacy and MCQ modes differently in
ufshcd_tag_to_cmd().
Applied to 6.19/scsi-staging, thanks!
Signature · 1 line
Martin K. Petersen
Martin K. Petersen
AppliedQuoted 9 lines · Bart Van Assche
Commit
22089c218037("scsi: ufs: core: Optimize the hot path") accidentally broke support for the legacy single doorbell mode. The tag_set.shared_tags pointer is only != NULL if shared tag support is enabled. The UFS driver only enables shared tag support in MCQ mode.Fix this by handling legacy and MCQ modes differently in
ufshcd_tag_to_cmd().[...]
Applied to 6.19/scsi-queue, thanks!
[1/1] ufs: core: Fix single doorbell mode support
https://git.kernel.org/mkp/scsi/c/02b5822d2fea
Signature · 1 line
Martin K. Petersen