Re: [PATCH v2 2/2] scsi: sd: Rework asynchronous resume support

From: Bart Van Assche
Date: Fri Jul 22 2022 - 13:56:19 EST


On 7/22/22 01:53, Geert Uytterhoeven wrote:
During s2idle, the following trace data is generated:

kworker/u16:9-325 [000] ...2. 230.478731: block_rq_issue: 8,0
N 0 () 0 + 0 [kworker/u16:9]
kworker/u16:9-325 [000] ...2. 230.478745:
scsi_dispatch_cmd_start: host_no=0 channel=0 id=0 lun=0 data_sgl=0
prot_sgl=0 prot_op=SCSI_PROT_NORMAL driver_tag=0 scheduler_tag=0
cmnd=(SYNCHRONIZE_CACHE - raw=35 00 00 00 00 00 00 00 00 00)
<idle>-0 [007] d.h3. 230.478832:
scsi_dispatch_cmd_done: host_no=0 channel=0 id=0 lun=0 data_sgl=0
prot_sgl=0 prot_op=SCSI_PROT_NORMAL driver_tag=0 scheduler_tag=0
cmnd=(SYNCHRONIZE_CACHE - raw=35 00 00 00 00 00 00 00 00 00)
result=(driver=DRIVER_OK host=DID_OK message=COMMAND_COMPLETE
status=SAM_STAT_GOOD)
<idle>-0 [000] ..s2. 230.478851: block_rq_complete:
8,0 N () 18446744073709551615 + 0 [0]
kworker/u16:9-325 [000] ...2. 230.483134: block_rq_issue: 8,0
N 0 () 0 + 0 [kworker/u16:9]
kworker/u16:9-325 [000] ...2. 230.483136:
scsi_dispatch_cmd_start: host_no=0 channel=0 id=0 lun=0 data_sgl=0
prot_sgl=0 prot_op=SCSI_PROT_NORMAL driver_tag=0 scheduler_tag=1
cmnd=(START_STOP - raw=1b 00 00 00 00 00)
<idle>-0 [007] d.h3. 230.624530:
scsi_dispatch_cmd_done: host_no=0 channel=0 id=0 lun=0 data_sgl=0
prot_sgl=0 prot_op=SCSI_PROT_NORMAL driver_tag=0 scheduler_tag=1
cmnd=(START_STOP - raw=1b 00 00 00 00 00) result=(driver=DRIVER_OK
host=DID_OK message=COMMAND_COMPLETE status=SAM_STAT_GOOD)
<idle>-0 [000] d.s4. 230.624634: scsi_eh_wakeup: host_no=0
<idle>-0 [000] ..s2. 230.624642: block_rq_complete:
8,0 N () 18446744073709551615 + 0 [0]
kworker/u16:14-1027 [007] d..3. 231.393642: scsi_eh_wakeup: host_no=0

When reading from hard drive after s2idle, no more trace data
is generated.

I think the above commands come from the suspend sequence. '1b 00 00 00 00 00' stops a block device. The lowest bit in byte 4 needs to be set to start a block device.

Something that is not yet clear is whether or not sd_submit_start() hangs during the resume process. How about verifying whether or not sd_submit_start() hangs by either issuing SysRq-t or by adding pr_info() statements in that function?

Thanks,

Bart.