linux/drivers/scsi/ufs
Adrian Hunter f5ef336fd2 scsi: ufs: core: Fix task management completion
The UFS driver uses blk_mq_tagset_busy_iter() when identifying task
management requests to complete, however blk_mq_tagset_busy_iter() doesn't
work.

blk_mq_tagset_busy_iter() only iterates requests dispatched by the block
layer. That appears as if it might have started since commit 37f4a24c24
("blk-mq: centralise related handling into blk_mq_get_driver_tag") which
removed 'data->hctx->tags->rqs[rq->tag] = rq' from blk_mq_rq_ctx_init()
which gets called:

	blk_get_request
		blk_mq_alloc_request
			__blk_mq_alloc_request
				blk_mq_rq_ctx_init

Since UFS task management requests are not dispatched by the block layer,
hctx->tags->rqs[rq->tag] remains NULL, and since blk_mq_tagset_busy_iter()
relies on finding requests using hctx->tags->rqs[rq->tag], UFS task
management requests are never found by blk_mq_tagset_busy_iter().

By using blk_mq_tagset_busy_iter(), the UFS driver was relying on internal
details of the block layer, which was fragile and subsequently got
broken. Fix by removing the use of blk_mq_tagset_busy_iter() and having the
driver keep track of task management requests.

Link: https://lore.kernel.org/r/20210922091059.4040-1-adrian.hunter@intel.com
Fixes: 1235fc569e ("scsi: ufs: core: Fix task management request completion timeout")
Fixes: 69a6c269c0 ("scsi: ufs: Use blk_{get,put}_request() to allocate and free TMFs")
Cc: stable@vger.kernel.org
Tested-by: Bart Van Assche <bvanassche@acm.org>
Reviewed-by: Bart Van Assche <bvanassche@acm.org>
Signed-off-by: Adrian Hunter <adrian.hunter@intel.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2021-10-04 22:03:17 -04:00
..
cdns-pltfrm.c scsi: ufs: Reduce power management code duplication 2021-08-02 21:43:57 -04:00
Kconfig scsi: ufs: Add fault injection support 2021-08-03 07:27:42 -04:00
Makefile scsi: ufs: Add fault injection support 2021-08-03 07:27:42 -04:00
tc-dwc-g210-pci.c scsi: ufs: Reduce power management code duplication 2021-08-02 21:43:57 -04:00
tc-dwc-g210-pltfrm.c scsi: ufs: Reduce power management code duplication 2021-08-02 21:43:57 -04:00
tc-dwc-g210.c
tc-dwc-g210.h
ti-j721e-ufs.c
ufs-debugfs.c scsi: ufs: core: Enable power management for wlun 2021-05-10 22:28:20 -04:00
ufs-debugfs.h scsi: ufs: core: Enable power management for wlun 2021-05-10 22:28:20 -04:00
ufs-exynos.c scsi: ufs: ufs-exynos: Fix static checker warning 2021-08-24 23:10:14 -04:00
ufs-exynos.h scsi: ufs: ufs-exynos: Fix static checker warning 2021-08-24 23:10:14 -04:00
ufs-fault-injection.c scsi: ufs: Add fault injection support 2021-08-03 07:27:42 -04:00
ufs-fault-injection.h scsi: ufs: Add fault injection support 2021-08-03 07:27:42 -04:00
ufs-hisi.c scsi: ufs: Reduce power management code duplication 2021-08-02 21:43:57 -04:00
ufs-hisi.h scsi: ufs: ufs-hisi: Use device parameter initialization function 2020-11-17 01:03:18 -05:00
ufs-mediatek-trace.h scsi: ufs-mediatek: Use correct path to fix compile error 2020-12-09 12:00:26 -05:00
ufs-mediatek.c scsi: ufs: Reduce power management code duplication 2021-08-02 21:43:57 -04:00
ufs-mediatek.h scsi: ufs-mediatek: Keep VCC always-on for specific devices 2020-12-09 11:34:20 -05:00
ufs-qcom-ice.c
ufs-qcom.c scsi: ufs: Reduce power management code duplication 2021-08-02 21:43:57 -04:00
ufs-qcom.h scsi: ufs: ufs-qcom: Use device parameter initialization function 2020-11-17 01:03:18 -05:00
ufs-sysfs.c scsi: ufs: core: Add lu_enable sysfs node 2021-08-05 23:21:13 -04:00
ufs-sysfs.h
ufs.h scsi: ufs: ufshpb: Add HPB 2.0 support 2021-08-01 16:05:07 -04:00
ufs_bsg.c scsi: ufs: core: Enable power management for wlun 2021-05-10 22:28:20 -04:00
ufs_bsg.h
ufs_quirks.h scsi: ufs: core: Add L2P entry swap quirk for Micron UFS 2021-08-05 23:21:08 -04:00
ufshcd-crypto.c SCSI misc on 20210219 2021-02-22 10:24:58 -08:00
ufshcd-crypto.h scsi: ufs: use devm_blk_ksm_init() 2021-02-01 12:01:56 +01:00
ufshcd-dwc.c scsi: ufs-dwc: Use phy_initialization helper 2020-12-07 18:00:06 -05:00
ufshcd-dwc.h
ufshcd-pci.c scsi: ufs: ufs-pci: Fix Intel LKF link stability 2021-09-13 22:15:51 -04:00
ufshcd-pltfrm.c scsi: ufs: Reduce power management code duplication 2021-08-02 21:43:57 -04:00
ufshcd-pltfrm.h scsi: ufs: Reduce power management code duplication 2021-08-02 21:43:57 -04:00
ufshcd.c scsi: ufs: core: Fix task management completion 2021-10-04 22:03:17 -04:00
ufshcd.h scsi: ufs: core: Fix task management completion 2021-10-04 22:03:17 -04:00
ufshci-dwc.h
ufshci.h scsi: ufs: Revert "Utilize Transfer Request List Completion Notification Register" 2021-08-02 21:43:58 -04:00
ufshpb.c scsi: ufs: ufshpb: Remove unused parameters 2021-09-13 22:15:42 -04:00
ufshpb.h scsi: ufs: ufshpb: Verify that 'num_inflight_map_req' is non-negative 2021-08-11 22:25:36 -04:00
unipro.h scsi: ufs: Add enums for UniPro version higher than 1.6 2020-11-10 23:03:18 -05:00