mbox series

[0/2] Add scsi_done_direct() to complete request directly.

Message ID 20220201210954.570896-1-sebastian@breakpoint.cc
Headers show
Series Add scsi_done_direct() to complete request directly. | expand

Message

Sebastian Andrzej Siewior Feb. 1, 2022, 9:09 p.m. UTC
This mini series adds scsi_done_direct() in order to complete scsi
requests directly via blk_mq_complete_request_direct(). This used by the
usb-storage driver.

Sebastian

Comments

Bart Van Assche Feb. 2, 2022, 8:49 p.m. UTC | #1
On 2/1/22 13:09, Sebastian Andrzej Siewior wrote:
> -void scsi_done(struct scsi_cmnd *cmd)
> +static bool scsi_done_need_blk_compl(struct scsi_cmnd *cmd)

I'm not happy about the name of this function. The word "need" in the 
function name suggests that this function does not modify any state. 
However, the body of the function shows that it may complete a SCSI 
command. How about renaming the existing scsi_done() function into 
scsi_done_internal() or so and adding a "bool complete_directly" 
argument to that function?

BTW, I only received patch 1/2 but not patch 2/2. Please Cc the 
linux-scsi mailing list for the entire patch series when reposting the 
patch series.

Thanks,

Bart.
Sebastian Andrzej Siewior Feb. 3, 2022, 7:46 p.m. UTC | #2
On 2022-02-02 12:49:16 [-0800], Bart Van Assche wrote:
> On 2/1/22 13:09, Sebastian Andrzej Siewior wrote:
> > -void scsi_done(struct scsi_cmnd *cmd)
> > +static bool scsi_done_need_blk_compl(struct scsi_cmnd *cmd)
> 
> I'm not happy about the name of this function. The word "need" in the
> function name suggests that this function does not modify any state.
> However, the body of the function shows that it may complete a SCSI command.
> How about renaming the existing scsi_done() function into
> scsi_done_internal() or so and adding a "bool complete_directly" argument to
> that function?

Let me see what I can do.

> BTW, I only received patch 1/2 but not patch 2/2. Please Cc the linux-scsi
> mailing list for the entire patch series when reposting the patch series.

I did and based on lore's archive it made it to the list:
	https://lore.kernel.org/linux-scsi/20220201210954.570896-1-sebastian@breakpoint.cc/

> Thanks,
> 
> Bart.

Sebastian
Bart Van Assche Feb. 3, 2022, 10:27 p.m. UTC | #3
On 2/3/22 11:46, Sebastian Andrzej Siewior wrote:
> On 2022-02-02 12:49:16 [-0800], Bart Van Assche wrote:
>> On 2/1/22 13:09, Sebastian Andrzej Siewior wrote:
>>> -void scsi_done(struct scsi_cmnd *cmd)
>>> +static bool scsi_done_need_blk_compl(struct scsi_cmnd *cmd)
>>
>> I'm not happy about the name of this function. The word "need" in the
>> function name suggests that this function does not modify any state.
>> However, the body of the function shows that it may complete a SCSI command.
>> How about renaming the existing scsi_done() function into
>> scsi_done_internal() or so and adding a "bool complete_directly" argument to
>> that function?
> 
> Let me see what I can do.
> 
>> BTW, I only received patch 1/2 but not patch 2/2. Please Cc the linux-scsi
>> mailing list for the entire patch series when reposting the patch series.
> 
> I did and based on lore's archive it made it to the list:
> 	https://lore.kernel.org/linux-scsi/20220201210954.570896-1-sebastian@breakpoint.cc/

I agree that patch 2/2 seems to have made it to the linux-scsi list. 
However, I can't find that patch in my mailbox nor in my spam folder. I 
think this is the first time that I did not receive a patch sent to the 
linux-scsi mailing list. Weird ...

Bart.
Bart Van Assche Feb. 3, 2022, 10:30 p.m. UTC | #4
On 2/3/22 12:29, Sebastian Andrzej Siewior wrote:
> Let me see what I can do.
> 
> Something like this perhaps? The compiler not inline
> scsi_done_internal() so we maybe provide scsi_done() / _direct() as
> static inlines?

In general declaring a static function inline in a .c file is frowned 
upon but I think in this case we should do that. With that change 
applied, feel free to add:

Reviewed-by: Bart Van Assche <bvanassche@acm.org>
Martin K. Petersen Feb. 8, 2022, 4:14 a.m. UTC | #5
Sebastian,

> This mini series adds scsi_done_direct() in order to complete scsi
> requests directly via blk_mq_complete_request_direct(). This used by
> the usb-storage driver.

Applied to 5.18/scsi-staging, thanks!
Martin K. Petersen Feb. 11, 2022, 11:25 p.m. UTC | #6
On Tue, 1 Feb 2022 22:09:52 +0100, Sebastian Andrzej Siewior wrote:

> This mini series adds scsi_done_direct() in order to complete scsi
> requests directly via blk_mq_complete_request_direct(). This used by the
> usb-storage driver.
> 
> Sebastian
> 

Applied to 5.18/scsi-queue, thanks!

[1/2] scsi: Add scsi_done_direct() for immediate completion.
      https://git.kernel.org/mkp/scsi/c/b84b6ec0f976
[2/2] usb: storage: Complete the scsi request directly.
      https://git.kernel.org/mkp/scsi/c/23fe075519c6