Commit f5ef336
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 37f4a24
("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: 1235fc5 ("scsi: ufs: core: Fix task management request completion timeout")
Fixes: 69a6c26 ("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>1 parent c533640 commit f5ef336
2 files changed
Lines changed: 23 additions & 30 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6377 | 6377 | | |
6378 | 6378 | | |
6379 | 6379 | | |
6380 | | - | |
6381 | | - | |
6382 | | - | |
6383 | | - | |
6384 | | - | |
6385 | | - | |
6386 | | - | |
6387 | | - | |
6388 | | - | |
6389 | | - | |
6390 | | - | |
6391 | | - | |
6392 | | - | |
6393 | | - | |
6394 | | - | |
6395 | | - | |
6396 | | - | |
6397 | | - | |
6398 | | - | |
6399 | | - | |
6400 | | - | |
6401 | 6380 | | |
6402 | 6381 | | |
6403 | 6382 | | |
| |||
6408 | 6387 | | |
6409 | 6388 | | |
6410 | 6389 | | |
6411 | | - | |
6412 | | - | |
6413 | | - | |
6414 | | - | |
6415 | | - | |
| 6390 | + | |
| 6391 | + | |
| 6392 | + | |
| 6393 | + | |
| 6394 | + | |
6416 | 6395 | | |
6417 | 6396 | | |
6418 | | - | |
6419 | | - | |
| 6397 | + | |
| 6398 | + | |
| 6399 | + | |
| 6400 | + | |
| 6401 | + | |
| 6402 | + | |
| 6403 | + | |
| 6404 | + | |
6420 | 6405 | | |
6421 | 6406 | | |
6422 | | - | |
| 6407 | + | |
6423 | 6408 | | |
6424 | 6409 | | |
6425 | 6410 | | |
| |||
6542 | 6527 | | |
6543 | 6528 | | |
6544 | 6529 | | |
6545 | | - | |
6546 | 6530 | | |
6547 | 6531 | | |
| 6532 | + | |
6548 | 6533 | | |
6549 | 6534 | | |
6550 | 6535 | | |
| |||
6585 | 6570 | | |
6586 | 6571 | | |
6587 | 6572 | | |
| 6573 | + | |
6588 | 6574 | | |
6589 | 6575 | | |
6590 | 6576 | | |
| |||
9635 | 9621 | | |
9636 | 9622 | | |
9637 | 9623 | | |
| 9624 | + | |
| 9625 | + | |
| 9626 | + | |
| 9627 | + | |
| 9628 | + | |
| 9629 | + | |
9638 | 9630 | | |
9639 | 9631 | | |
9640 | 9632 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
828 | 828 | | |
829 | 829 | | |
830 | 830 | | |
| 831 | + | |
831 | 832 | | |
832 | 833 | | |
833 | 834 | | |
| |||
0 commit comments