Commit 785538b
scsi: sd: Revert "Rework asynchronous resume support"
Although commit 88f1669 ("scsi: sd: Rework asynchronous resume support")
eliminates a delay for some ATA disks after resume, it causes resume of ATA
disks to fail on other setups. See also:
* "Resume process hangs for 5-6 seconds starting sometime in 5.16"
(https://bugzilla.kernel.org/show_bug.cgi?id=215880).
* Geert's regression report
(https://lore.kernel.org/linux-scsi/[email protected]/).
This is what I understand about this issue:
* During resume, ata_port_pm_resume() starts the SCSI error handler. This
changes the SCSI host state into SHOST_RECOVERY and causes
scsi_queue_rq() to return BLK_STS_RESOURCE.
* sd_resume() calls sd_start_stop_device() for ATA devices. That function
in turn calls sd_submit_start() which tries to submit a START STOP UNIT
command. That command can only be submitted after the SCSI error handler
has changed the SCSI host state back to SHOST_RUNNING.
* The SCSI error handler runs on its own thread and calls
schedule_work(&(ap->scsi_rescan_task)). That causes
ata_scsi_dev_rescan() to be called from the context of a kernel
workqueue. That call hangs in blk_mq_get_tag(). I'm not sure why - maybe
because all available tags have been allocated by sd_submit_start()
calls (this is a guess).
Link: https://lore.kernel.org/r/[email protected]
Fixes: 88f1669 ("scsi: sd: Rework asynchronous resume support")
Cc: Damien Le Moal <[email protected]>
Cc: Hannes Reinecke <[email protected]>
Cc: Geert Uytterhoeven <[email protected]>
Cc: [email protected]
Reported-by: Geert Uytterhoeven <[email protected]>
Reported-by: [email protected]
Reported-and-tested-by: Vlastimil Babka <[email protected]>
Tested-by: John Garry <[email protected]>
Tested-by: Hans de Goede <[email protected]>
Signed-off-by: Bart Van Assche <[email protected]>
Signed-off-by: Martin K. Petersen <[email protected]>1 parent fac8e55 commit 785538b
2 files changed
+18
-71
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
103 | 103 | | |
104 | 104 | | |
105 | 105 | | |
106 | | - | |
107 | 106 | | |
108 | 107 | | |
109 | 108 | | |
| |||
3471 | 3470 | | |
3472 | 3471 | | |
3473 | 3472 | | |
3474 | | - | |
3475 | 3473 | | |
3476 | 3474 | | |
3477 | 3475 | | |
| |||
3594 | 3592 | | |
3595 | 3593 | | |
3596 | 3594 | | |
3597 | | - | |
3598 | | - | |
3599 | | - | |
3600 | | - | |
3601 | | - | |
3602 | | - | |
3603 | | - | |
3604 | | - | |
3605 | | - | |
3606 | | - | |
3607 | | - | |
3608 | | - | |
3609 | | - | |
3610 | | - | |
3611 | | - | |
3612 | | - | |
3613 | | - | |
3614 | | - | |
3615 | | - | |
3616 | | - | |
3617 | | - | |
3618 | | - | |
3619 | | - | |
3620 | | - | |
3621 | | - | |
3622 | | - | |
3623 | | - | |
3624 | | - | |
3625 | | - | |
3626 | | - | |
3627 | | - | |
3628 | | - | |
3629 | | - | |
3630 | | - | |
3631 | | - | |
3632 | | - | |
3633 | | - | |
3634 | | - | |
3635 | | - | |
3636 | | - | |
3637 | | - | |
3638 | | - | |
3639 | | - | |
3640 | | - | |
3641 | | - | |
3642 | | - | |
3643 | | - | |
3644 | | - | |
3645 | | - | |
3646 | | - | |
3647 | | - | |
3648 | | - | |
3649 | | - | |
3650 | | - | |
3651 | | - | |
3652 | | - | |
3653 | | - | |
3654 | | - | |
3655 | | - | |
3656 | 3595 | | |
3657 | 3596 | | |
3658 | 3597 | | |
| 3598 | + | |
3659 | 3599 | | |
| 3600 | + | |
3660 | 3601 | | |
3661 | 3602 | | |
3662 | 3603 | | |
| |||
3667 | 3608 | | |
3668 | 3609 | | |
3669 | 3610 | | |
3670 | | - | |
3671 | | - | |
| 3611 | + | |
| 3612 | + | |
| 3613 | + | |
| 3614 | + | |
| 3615 | + | |
| 3616 | + | |
| 3617 | + | |
| 3618 | + | |
| 3619 | + | |
| 3620 | + | |
| 3621 | + | |
3672 | 3622 | | |
3673 | | - | |
| 3623 | + | |
| 3624 | + | |
| 3625 | + | |
| 3626 | + | |
| 3627 | + | |
3674 | 3628 | | |
3675 | 3629 | | |
3676 | 3630 | | |
| |||
3697 | 3651 | | |
3698 | 3652 | | |
3699 | 3653 | | |
3700 | | - | |
3701 | | - | |
3702 | 3654 | | |
3703 | 3655 | | |
3704 | 3656 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
150 | 150 | | |
151 | 151 | | |
152 | 152 | | |
153 | | - | |
154 | | - | |
155 | | - | |
156 | | - | |
157 | | - | |
158 | 153 | | |
159 | 154 | | |
160 | 155 | | |
| |||
0 commit comments