linux/drivers/scsi/aacraid
Bart Van Assche 7afdb86379 scsi: aacraid: Call scsi_done() directly
The aacraid driver invokes scmd->scsi_done(scmd) for two types of SCSI
commands:

 - SCSI commands initialized by the SCSI mid-layer.

 - SCSI commands initialized by aac_probe_container().

The processing sequence for SCSI commands allocated by
aac_probe_container() is as follows:

aac_probe_container()
-> _aac_probe_container(scmd, aac_probe_container_callback1)
  -> scmd->SCp.ptr = aac_probe_container_callback1
  -> aac_fib_send(..., _aac_probe_container1, scmd)
    -> fibptr->callback = _aac_probe_container1
    -> fibptr->callback_data = scmd

fibptr->callback(scmd)
-> _aac_probe_container1(scmd, fibptr)
   [ ... ]
   -> _aac_probe_container2(scmd, fibptr)
     -> Call scmd->SCp.ptr == aac_probe_container_callback1
       -> scmd->device = NULL;

The processing sequence for SCSI commands allocated by the SCSI mid-layer
if _aac_probe_container() is called is as follows:

aac_queuecommand()
-> aac_scsi_cmd()
  -> _aac_probe_container(scmd, aac_probe_container_callback2)
    -> scmd->SCp.ptr = aac_probe_container_callback2
    -> aac_fib_send(..., _aac_probe_container1, scmd)

fibptr->callback(scmd)
-> _aac_probe_container1(scmd, fibptr)
   [ ... ]
   -> _aac_probe_container2(scmd, fibptr)
     -> Call scmd->SCp.ptr == aac_probe_container_callback2

Preserve the existing call sequences by calling scsi_done() for commands
submitted by the mid-layer or aac_probe_container_scsi_done() for commands
submitted by aac_probe_container().

Link: https://lore.kernel.org/r/20211007202923.2174984-17-bvanassche@acm.org
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2021-10-16 21:28:45 -04:00
..
aachba.c scsi: aacraid: Call scsi_done() directly 2021-10-16 21:28:45 -04:00
aacraid.h scsi: aacraid: Replace one-element array with flexible-array member 2021-05-10 22:28:31 -04:00
commctrl.c scsi: aacraid: Fix incorrect spelling of aac_send_raw_srb() 2021-03-15 22:14:51 -04:00
comminit.c scsi: aacraid: use scsi_host_busy_iter() to wait for outstanding commands 2020-02-28 20:54:52 -05:00
commsup.c scsi: aacraid: Use scsi_cmd_to_rq() instead of scsi_cmnd.request 2021-08-11 22:25:38 -04:00
dpcsup.c scsi: aacraid: Demote partially documented function header 2020-07-15 17:25:10 -04:00
linit.c scsi: aacraid: Use generic power management 2020-11-25 23:14:30 -05:00
Makefile treewide: Add SPDX license identifier - Makefile/Kconfig 2019-05-21 10:50:46 +02:00
nark.c scsi: aacraid: Add missing description for 'dev' 2020-07-24 22:09:58 -04:00
rkt.c scsi: aacraid: Add missing description for 'dev' 2020-07-24 22:09:57 -04:00
rx.c scsi: aacraid: Fix misspelling of _aac_rx_init() 2021-03-15 22:14:53 -04:00
sa.c scsi: aacraid: Add descriptions for missing parameters 2020-07-24 22:09:57 -04:00
src.c scsi: aacraid: Add descriptions for missing parameters 2020-07-24 22:09:58 -04:00