Files
erofs-linux/drivers/scsi
Bart Van Assche 785538bfdd scsi: sd: Revert "Rework asynchronous resume support"
Although commit 88f1669019 ("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: 88f1669019 ("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]>
2022-08-22 22:45:25 -04:00
..
…
…
…
2022-05-23 23:24:10 -04:00
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
2022-07-26 22:13:29 -04:00
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
2022-06-27 22:56:21 -04:00
…
…
2022-06-27 22:56:21 -04:00
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
2022-06-28 06:30:26 -06:00
…
…
…
…
…
…
…
…
…