Please enable JavaScript.
Coggle requires JavaScript to display documents.
SCSI async scan - Coggle Diagram
SCSI async scan
ideas
two hosts co-work for making progress?
one host is async-scan in one single context
concurrent async scan
why hang?
scsi doesn't support concurrent async scan
shost->async_scan
mechanism
global scan list (scanning_hosts)
scan data is added to the list in FIFO
design
prepare async scan
complete async scans
Wait for asynchronous scans to complete
checked in
__scsi_add_device
in case !shost->async_scan
scsi_scan_target
in case !shost->async_scan
scsi_scan_host_selected
in case !shost->async_scan
scsi_bus_prepare
steps
return if 'scanning_hosts' is empty
allocate one new scan data
add data into scanning_hosts
hold the lock, check if there is item in 'scanning_host', return if not; otherwise add this data to the list
wait_for_completion(&data->prev_finished);
scsi: waiting for bus probes to complete ...
finish async scan
actual scan action
scsi_scan_host_selected
steps
entry
scsi_scan_host
scsi_prep_async_scan
return cookie data
add the cookie data into global list of 'scanning_hosts'
checking if the list is empty before adding me, if yes, complete(&data->prev_finished) before adding me.
async_schedule(do_scan_async,data);
do_scan_async
do_scsi_scan_host(shost)
scsi_scan_host_selected
scsi_finish_async_scan(data)
wait_for_completion(&data->prev_finished)
complete the next completion