2023-10-18 11:38:39

by Wenchao Hao

[permalink] [raw]
Subject: [PATCH v3 0/2] cleanup patch

This is a cleanup patchset, no logic changed.

The first patch cleanup scsi_dev_queue_ready();
The second patch add comment to tell callback target_destroy of
scsi_host_template must not sleep.

V3:
- Update comments suggested by Bart

V2:
- Tell which spinlock is held in comment of target_destroy

Wenchao Hao (2):
scsi: core: cleanup scsi_dev_queue_ready()
scsi: Add comment of target_destroy in scsi_host_template

drivers/scsi/scsi_lib.c | 32 +++++++++++++++-----------------
include/scsi/scsi_host.h | 3 +++
2 files changed, 18 insertions(+), 17 deletions(-)

--
2.32.0


2023-10-18 11:38:52

by Wenchao Hao

[permalink] [raw]
Subject: [PATCH v3 2/2] scsi: Add comment of target_destroy in scsi_host_template

Add comment to tell callback function target_destroy of
scsi_host_template must not sleep.

Signed-off-by: Wenchao Hao <[email protected]>
---
include/scsi/scsi_host.h | 3 +++
1 file changed, 3 insertions(+)

diff --git a/include/scsi/scsi_host.h b/include/scsi/scsi_host.h
index 49f768d0ff37..2c61dd30d766 100644
--- a/include/scsi/scsi_host.h
+++ b/include/scsi/scsi_host.h
@@ -245,6 +245,9 @@ struct scsi_host_template {
* midlayer calls this point so that the driver may deallocate
* and terminate any references to the target.
*
+ * Note: This callback is called with the host lock held and hence
+ * must not sleep.
+ *
* Status: OPTIONAL
*/
void (* target_destroy)(struct scsi_target *);
--
2.32.0

2023-10-18 18:04:18

by Bart Van Assche

[permalink] [raw]
Subject: Re: [PATCH v3 2/2] scsi: Add comment of target_destroy in scsi_host_template

On 10/18/23 04:37, Wenchao Hao wrote:
> Add comment to tell callback function target_destroy of
> scsi_host_template must not sleep.
>
> Signed-off-by: Wenchao Hao <[email protected]>
> ---
> include/scsi/scsi_host.h | 3 +++
> 1 file changed, 3 insertions(+)
>
> diff --git a/include/scsi/scsi_host.h b/include/scsi/scsi_host.h
> index 49f768d0ff37..2c61dd30d766 100644
> --- a/include/scsi/scsi_host.h
> +++ b/include/scsi/scsi_host.h
> @@ -245,6 +245,9 @@ struct scsi_host_template {
> * midlayer calls this point so that the driver may deallocate
> * and terminate any references to the target.
> *
> + * Note: This callback is called with the host lock held and hence
> + * must not sleep.
> + *
> * Status: OPTIONAL
> */
> void (* target_destroy)(struct scsi_target *);

Reviewed-by: Bart Van Assche <[email protected]>

2023-10-25 02:31:58

by Martin K. Petersen

[permalink] [raw]
Subject: Re: [PATCH v3 0/2] cleanup patch


Wenchao,

> This is a cleanup patchset, no logic changed.
>
> The first patch cleanup scsi_dev_queue_ready();
> The second patch add comment to tell callback target_destroy of
> scsi_host_template must not sleep.

Applied to 6.7/scsi-staging, thanks!

--
Martin K. Petersen Oracle Linux Engineering

2023-10-30 15:36:24

by Martin K. Petersen

[permalink] [raw]
Subject: Re: [PATCH v3 0/2] cleanup patch

On Wed, 18 Oct 2023 19:37:44 +0800, Wenchao Hao wrote:

> This is a cleanup patchset, no logic changed.
>
> The first patch cleanup scsi_dev_queue_ready();
> The second patch add comment to tell callback target_destroy of
> scsi_host_template must not sleep.
>
> V3:
> - Update comments suggested by Bart
>
> [...]

Applied to 6.7/scsi-queue, thanks!

[1/2] scsi: core: cleanup scsi_dev_queue_ready()
https://git.kernel.org/mkp/scsi/c/3dc985bfbd00
[2/2] scsi: Add comment of target_destroy in scsi_host_template
https://git.kernel.org/mkp/scsi/c/82f52b2cd5fc

--
Martin K. Petersen Oracle Linux Engineering