Bart Van Assche
f1170b83df
scsi: megaraid_mbox: Call scsi_done() directly
...
Conditional statements are faster than indirect calls. Hence call
scsi_done() directly.
Link: https://lore.kernel.org/r/20211007202923.2174984-49-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:29:14 -04:00
Bart Van Assche
c0e70ea3f7
scsi: mac53c94: Call scsi_done() directly
...
Conditional statements are faster than indirect calls. Hence call
scsi_done() directly.
Link: https://lore.kernel.org/r/20211007202923.2174984-48-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:48 -04:00
Bart Van Assche
ca068c2c6c
scsi: lpfc: Call scsi_done() directly
...
Conditional statements are faster than indirect calls. Hence call
scsi_done() directly.
Link: https://lore.kernel.org/r/20211007202923.2174984-47-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:48 -04:00
Bart Van Assche
e803bc52b0
scsi: libsas: Call scsi_done() directly
...
Conditional statements are faster than indirect calls. Hence call
scsi_done() directly.
Link: https://lore.kernel.org/r/20211007202923.2174984-46-bvanassche@acm.org
Reviewed-by: John Garry <john.garry@huawei.com >
Signed-off-by: Bart Van Assche <bvanassche@acm.org >
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com >
2021-10-16 21:28:48 -04:00
Bart Van Assche
b4b84edc5d
scsi: libiscsi: Call scsi_done() directly
...
Conditional statements are faster than indirect calls. Hence call
scsi_done() directly.
Link: https://lore.kernel.org/r/20211007202923.2174984-45-bvanassche@acm.org
Reviewed-by: Lee Duncan <lduncanb@suse.com >
Signed-off-by: Bart Van Assche <bvanassche@acm.org >
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com >
2021-10-16 21:28:48 -04:00
Bart Van Assche
e0f63b2181
scsi: libfc: Call scsi_done() directly
...
Conditional statements are faster than indirect calls. Hence call
scsi_done() directly.
Link: https://lore.kernel.org/r/20211007202923.2174984-44-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:48 -04:00
Bart Van Assche
98cc0e69ba
scsi: ips: Call scsi_done() directly
...
Conditional statements are faster than indirect calls. Hence call
scsi_done() directly.
Link: https://lore.kernel.org/r/20211007202923.2174984-43-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:47 -04:00
Bart Van Assche
acd3c42d18
scsi: ipr: Call scsi_done() directly
...
Conditional statements are faster than indirect calls. Hence call
scsi_done() directly.
Link: https://lore.kernel.org/r/20211007202923.2174984-42-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:47 -04:00
Bart Van Assche
25e1d89669
scsi: initio: Call scsi_done() directly
...
Conditional statements are faster than indirect calls. Hence call
scsi_done() directly.
Link: https://lore.kernel.org/r/20211007202923.2174984-41-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:47 -04:00
Bart Van Assche
0233196eb2
scsi: imm: Call scsi_done() directly
...
Conditional statements are faster than indirect calls. Hence call
scsi_done() directly.
Link: https://lore.kernel.org/r/20211007202923.2174984-40-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:47 -04:00
Bart Van Assche
85f6dd08c8
scsi: ibmvscsi: Call scsi_done() directly
...
Conditional statements are faster than indirect calls. Hence call
scsi_done() directly.
Link: https://lore.kernel.org/r/20211007202923.2174984-39-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:47 -04:00
Bart Van Assche
574015a837
scsi: hptiop: Call scsi_done() directly
...
Conditional statements are faster than indirect calls. Hence call
scsi_done() directly.
Link: https://lore.kernel.org/r/20211007202923.2174984-38-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:47 -04:00
Bart Van Assche
82f01edcf9
scsi: hpsa: Call scsi_done() directly
...
Conditional statements are faster than indirect calls. Hence call
scsi_done() directly.
Link: https://lore.kernel.org/r/20211007202923.2174984-37-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:47 -04:00
Bart Van Assche
a7510fbd87
scsi: fnic: Call scsi_done() directly
...
Conditional statements are faster than indirect calls. Hence call
scsi_done() directly.
Link: https://lore.kernel.org/r/20211007202923.2174984-36-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:47 -04:00
Bart Van Assche
a0c22474cb
scsi: fdomain: Call scsi_done() directly
...
Conditional statements are faster than indirect calls. Hence call
scsi_done() directly.
Link: https://lore.kernel.org/r/20211007202923.2174984-35-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:47 -04:00
Bart Van Assche
696fec18e1
scsi: fas216: Stop using scsi_cmnd.scsi_done
...
Store the completion callback pointer in struct fas216_cmd_priv instead of
in struct scsi_cmnd. This patch prepares for removal of the scsi_done
member from struct scsi_cmnd.
Link: https://lore.kernel.org/r/20211007202923.2174984-34-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:46 -04:00
Bart Van Assche
caffd3ad96
scsi: fas216: Introduce struct fas216_cmd_priv
...
Introduce a structure with driver-private data per SCSI command. This data
structure will be used by the next patch to store a function pointer.
Link: https://lore.kernel.org/r/20211007202923.2174984-33-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:46 -04:00
Bart Van Assche
f8ab27d964
scsi: esp_scsi: Call scsi_done() directly
...
Conditional statements are faster than indirect calls. Hence call
scsi_done() directly.
Link: https://lore.kernel.org/r/20211007202923.2174984-32-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:46 -04:00
Bart Van Assche
52e65d1c25
scsi: esas2r: Call scsi_done() directly
...
Conditional statements are faster than indirect calls. Hence call
scsi_done() directly.
Link: https://lore.kernel.org/r/20211007202923.2174984-31-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:46 -04:00
Bart Van Assche
e6ed928eff
scsi: dpt_i2o: Call scsi_done() directly
...
Conditional statements are faster than indirect calls. Hence call
scsi_done() directly.
Link: https://lore.kernel.org/r/20211007202923.2174984-30-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:46 -04:00
Bart Van Assche
6c365b8800
scsi: dc395x: Call scsi_done() directly
...
Conditional statements are faster than indirect calls. Hence call
scsi_done() directly.
Link: https://lore.kernel.org/r/20211007202923.2174984-29-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:46 -04:00
Bart Van Assche
e82d6b179b
scsi: cxlflash: Call scsi_done() directly
...
Conditional statements are faster than indirect calls. Hence call
scsi_done() directly.
Link: https://lore.kernel.org/r/20211007202923.2174984-28-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:46 -04:00
Bart Van Assche
0979e265e4
scsi: csiostor: Call scsi_done() directly
...
Conditional statements are faster than indirect calls. Hence call
scsi_done() directly.
Link: https://lore.kernel.org/r/20211007202923.2174984-27-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:46 -04:00
Bart Van Assche
a75af82a77
scsi: bnx2fc: Call scsi_done() directly
...
Conditional statements are faster than indirect calls. Hence call
scsi_done() directly.
Link: https://lore.kernel.org/r/20211007202923.2174984-26-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:46 -04:00
Bart Van Assche
4316b5b8b2
scsi: bfa: Call scsi_done() directly
...
Conditional statements are faster than indirect calls. Hence call
scsi_done() directly.
Link: https://lore.kernel.org/r/20211007202923.2174984-25-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
Bart Van Assche
681fa5252f
scsi: atp870u: Call scsi_done() directly
...
Conditional statements are faster than indirect calls. Hence call
scsi_done() directly.
Link: https://lore.kernel.org/r/20211007202923.2174984-24-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
Bart Van Assche
3f0b59b685
scsi: arcmsr: Call scsi_done() directly
...
Conditional statements are faster than indirect calls. Hence call
scsi_done() directly.
Link: https://lore.kernel.org/r/20211007202923.2174984-23-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
Bart Van Assche
07ebbc3a80
scsi: aic7xxx: Call scsi_done() directly
...
Conditional statements are faster than indirect calls. Hence call
scsi_done() directly.
Link: https://lore.kernel.org/r/20211007202923.2174984-22-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
Bart Van Assche
135223527c
scsi: aha1542: Call scsi_done() directly
...
Conditional statements are faster than indirect calls. Hence call
scsi_done() directly.
Link: https://lore.kernel.org/r/20211007202923.2174984-21-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
Bart Van Assche
3ab3b151ff
scsi: aha152x: Call scsi_done() directly
...
Conditional statements are faster than indirect calls. Hence call
scsi_done() and reset_done() directly. The changes in this patch are as
follows:
- Remove the 'done' argument from aha152x_internal_queue().
- Change ptr->scsi_done(ptr) into aha152x_scsi_done(ptr).
- Inside aha152x_scsi_done(), check the 'resetting' flag of SCp.phase
since aha152x_internal_queue() specifies the 'reset_done' function
pointer if and only if the third argument has the value 'resetting'.
Link: https://lore.kernel.org/r/20211007202923.2174984-20-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
Bart Van Assche
f3bc9338e0
scsi: advansys: Call scsi_done() directly
...
Conditional statements are faster than indirect calls. Hence call
scsi_done() directly.
Link: https://lore.kernel.org/r/20211007202923.2174984-19-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
Bart Van Assche
396dd2c0b7
scsi: acornscsi: Call scsi_done() directly
...
Conditional statements are faster than indirect calls. Hence call
scsi_done() directly.
Link: https://lore.kernel.org/r/20211007202923.2174984-18-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
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
Bart Van Assche
1dec65e32f
scsi: aacraid: Introduce aac_scsi_done()
...
This patch does not change any functionality but makes the next patch in
this series easier to read.
Link: https://lore.kernel.org/r/20211007202923.2174984-16-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:44 -04:00
Bart Van Assche
e42be9e75a
scsi: a100u2w: Call scsi_done() directly
...
Conditional statements are faster than indirect calls. Hence call
scsi_done() directly.
Link: https://lore.kernel.org/r/20211007202923.2174984-15-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:44 -04:00
Bart Van Assche
117cd238ad
scsi: NCR5380: Call scsi_done() directly
...
Conditional statements are faster than indirect calls. Hence call
scsi_done() directly.
Link: https://lore.kernel.org/r/20211007202923.2174984-14-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:44 -04:00
Bart Van Assche
0800a26aaa
scsi: BusLogic: Call scsi_done() directly
...
Conditional statements are faster than indirect calls. Hence call
scsi_done() directly.
Link: https://lore.kernel.org/r/20211007202923.2174984-13-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:44 -04:00
Bart Van Assche
656f26ade0
scsi: 53c700: Call scsi_done() directly
...
Conditional statements are faster than indirect calls. Hence call
scsi_done() directly.
Link: https://lore.kernel.org/r/20211007202923.2174984-12-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:44 -04:00
Bart Van Assche
9dd9b96c26
scsi: 3w-xxxx: Call scsi_done() directly
...
Conditional statements are faster than indirect calls. Hence call
scsi_done() directly.
Link: https://lore.kernel.org/r/20211007202923.2174984-11-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:44 -04:00
Bart Van Assche
2adf975e89
scsi: 3w-sas: Call scsi_done() directly
...
Conditional statements are faster than indirect calls. Hence call
scsi_done() directly.
Link: https://lore.kernel.org/r/20211007202923.2174984-10-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:44 -04:00
Bart Van Assche
3e6d3832dc
scsi: 3w-9xxx: Call scsi_done() directly
...
Conditional statements are faster than indirect calls. Hence call
scsi_done() directly.
Link: https://lore.kernel.org/r/20211007202923.2174984-9-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:44 -04:00
Bart Van Assche
68f89c50cd
scsi: zfcp_scsi: Call scsi_done() directly
...
Conditional statements are faster than indirect calls. Hence call
scsi_done() directly.
Link: https://lore.kernel.org/r/20211007202923.2174984-8-bvanassche@acm.org
Acked-by: Benjamin Block <bblock@linux.ibm.com >
Signed-off-by: Bart Van Assche <bvanassche@acm.org >
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com >
2021-10-16 21:28:44 -04:00
Bart Van Assche
1ae6d16779
scsi: message: fusion: Call scsi_done() directly
...
Conditional statements are faster than indirect calls. Hence call
scsi_done() directly.
Link: https://lore.kernel.org/r/20211007202923.2174984-7-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:43 -04:00
Bart Van Assche
5f9ae9eecb
scsi: ib_srp: Call scsi_done() directly
...
Conditional statements are faster than indirect calls. Hence call
scsi_done() directly.
Link: https://lore.kernel.org/r/20211007202923.2174984-6-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:43 -04:00
Bart Van Assche
409d337e6b
scsi: firewire: sbp2: Call scsi_done() directly
...
Conditional statements are faster than indirect calls. Hence call
scsi_done() directly.
Link: https://lore.kernel.org/r/20211007202923.2174984-5-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:43 -04:00
Bart Van Assche
58bf201dfc
scsi: ata: Call scsi_done() directly
...
Conditional statements are faster than indirect calls. Hence call
scsi_done() directly.
Link: https://lore.kernel.org/r/20211007202923.2174984-4-bvanassche@acm.org
Acked-by: Damien Le Moal <damien.lemoal@opensource.wdc.com >
Signed-off-by: Bart Van Assche <bvanassche@acm.org >
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com >
2021-10-16 21:28:43 -04:00
Bart Van Assche
a710eacb9d
scsi: core: Rename scsi_mq_done() into scsi_done() and export it
...
Since the removal of the legacy block layer there is only one completion
function left in the SCSI core, namely scsi_mq_done(). Rename it into
scsi_done(). Export that function to allow SCSI LLDs to call it directly.
Link: https://lore.kernel.org/r/20211007202923.2174984-3-bvanassche@acm.org
Reviewed-by: Benjamin Block <bblock@linux.ibm.com >
Reviewed-by: Bean Huo <beanhuo@micron.com >
Signed-off-by: Bart Van Assche <bvanassche@acm.org >
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com >
2021-10-16 21:28:43 -04:00
Bart Van Assche
bf23e61903
scsi: core: Use a structure member to track the SCSI command submitter
...
Conditional statements are faster than indirect calls. Use a structure
member to track the SCSI command submitter such that later patches can call
scsi_done(scmd) instead of scmd->scsi_done(scmd).
The asymmetric behavior that scsi_send_eh_cmnd() sets the submission
context to the SCSI error handler and that it does not restore the
submission context to the SCSI core is retained.
Link: https://lore.kernel.org/r/20211007202923.2174984-2-bvanassche@acm.org
Cc: Hannes Reinecke <hare@suse.com >
Cc: Ming Lei <ming.lei@redhat.com >
Cc: Christoph Hellwig <hch@lst.de >
Reviewed-by: Benjamin Block <bblock@linux.ibm.com >
Reviewed-by: Bean Huo <beanhuo@micron.com >
Signed-off-by: Bart Van Assche <bvanassche@acm.org >
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com >
2021-10-16 21:28:43 -04:00
Bart Van Assche
9131bff6a9
scsi: core: pm: Only runtime resume if necessary
...
The following query shows which drivers define callbacks that are called by
the power management support code in the SCSI core (scsi_pm.c):
$ git grep -nHEwA16 "$(echo $(git grep -h 'scsi_register_driver(&' |
sed 's/.*&//;s/\..*//') | sed 's/ /|/g')" |
grep '\.pm[[:blank:]]*=[[:blank:]]'
drivers/scsi/sd.c-620- .pm = &sd_pm_ops,
drivers/scsi/sr.c-100- .pm = &sr_pm_ops,
drivers/scsi/ufs/ufshcd.c-9765- .pm = &ufshcd_wl_pm_ops,
Since unconditionally runtime resuming a device during system resume is not
necessary, remove that code. Modify the SCSI disk (sd) driver such that it
follows the same approach as the UFS driver, namely to skip system suspend
and resume for devices that are runtime suspended. The CD-ROM code does not
need to be updated since its PM callbacks do not affect the device power
state.
This patch has been tested as follows:
[ shell 1 ]
cd /sys/kernel/debug/tracing
grep -E 'blk_(pre|post)_runtime|runtime_(suspend|resume)|autosuspend_delay|pm_runtime_(get|put)' available_filter_functions |
while read a b; do echo "$a"; done |
grep -v __pm_runtime_resume >set_ftrace_filter
echo function > current_tracer
echo 1 > tracing_on
cat trace_pipe
[ shell 2 ]
cd /sys/block/sr0
# Increase the event poll interval to make it easier to derive from the
# tracing output whether runtime power actions are the result of sg_inq.
echo 30000 > events_poll_msecs
cd device/power
# Enable runtime power management.
echo auto > control
echo 1000 > autosuspend_delay_ms
sleep 1
# Verify in shell 1 that sr0 has been runtime suspended
sg_inq /dev/sr0
eject /dev/sr0
sg_inq /dev/sr0
# Disable runtime power management.
echo on > control
cd /sys/block/sda/device/power
echo auto > control
echo 1000 > autosuspend_delay_ms
sleep 1
# Verify in shell 1 that sr0 has been runtime suspended
sg_inq /dev/sda
Link: https://lore.kernel.org/r/20211006215453.3318929-4-bvanassche@acm.org
Cc: Alan Stern <stern@rowland.harvard.edu >
Cc: Dan Williams <dan.j.williams@intel.com >
Cc: Hannes Reinecke <hare@suse.com >
Cc: Adrian Hunter <adrian.hunter@intel.com >
Cc: Martin Kepplinger <martin.kepplinger@puri.sm >
Tested-by: Martin Kepplinger <martin.kepplinger@puri.sm >
Signed-off-by: Bart Van Assche <bvanassche@acm.org >
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com >
2021-10-16 21:08:39 -04:00
Bart Van Assche
1c9575326a
scsi: sd: Rename sd_resume() into sd_resume_system()
...
This patch does not change any functionality but makes the next patch in
this series easier to read.
Link: https://lore.kernel.org/r/20211006215453.3318929-3-bvanassche@acm.org
Cc: Alan Stern <stern@rowland.harvard.edu >
Cc: Dan Williams <dan.j.williams@intel.com >
Cc: Hannes Reinecke <hare@suse.com >
Cc: Adrian Hunter <adrian.hunter@intel.com >
Cc: Martin Kepplinger <martin.kepplinger@puri.sm >
Signed-off-by: Bart Van Assche <bvanassche@acm.org >
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com >
2021-10-16 21:08:39 -04:00