2022-11-21 12:23:02

by John Garry

[permalink] [raw]
Subject: [PATCH 0/2] scsi: Some minor scan improvements

The __scsi_add_device() change is from another series which I sent a while
ago.

The new change in do_scsi_scan_host() could be combined into the
__scsi_add_device() change if I have anothter RB tag (hint, hint).

John Garry (2):
scsi: core: Use SCSI_SCAN_RESCAN in __scsi_add_device()
scsi: core: Use SCSI_SCAN_INITIAL in do_scsi_scan_host()

drivers/scsi/scsi_scan.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)

--
2.35.3



2022-11-21 12:23:43

by John Garry

[permalink] [raw]
Subject: [PATCH 1/2] scsi: core: Use SCSI_SCAN_RESCAN in __scsi_add_device()

Instead of using hardcoded '1' as the __scsi_add_device() ->
scsi_probe_and_add_lun() rescan arg, use proper macro SCSI_SCAN_RESCAN.

Signed-off-by: John Garry <[email protected]>
Reviewed-by: Damien Le Moal <[email protected]>
---
drivers/scsi/scsi_scan.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/scsi/scsi_scan.c b/drivers/scsi/scsi_scan.c
index 5d27f5196de6..6cc974b382c1 100644
--- a/drivers/scsi/scsi_scan.c
+++ b/drivers/scsi/scsi_scan.c
@@ -1580,7 +1580,8 @@ struct scsi_device *__scsi_add_device(struct Scsi_Host *shost, uint channel,
scsi_complete_async_scans();

if (scsi_host_scan_allowed(shost) && scsi_autopm_get_host(shost) == 0) {
- scsi_probe_and_add_lun(starget, lun, NULL, &sdev, 1, hostdata);
+ scsi_probe_and_add_lun(starget, lun, NULL, &sdev,
+ SCSI_SCAN_RESCAN, hostdata);
scsi_autopm_put_host(shost);
}
mutex_unlock(&shost->scan_mutex);
--
2.35.3


2022-11-21 13:05:21

by John Garry

[permalink] [raw]
Subject: [PATCH 2/2] scsi: core: Use SCSI_SCAN_INITIAL in do_scsi_scan_host()

Instead of using hardcoded '0' as the do_scsi_scan_host() ->
scsi_scan_host_selected() rescan arg, use proper macro SCSI_SCAN_INITIAL.

Signed-off-by: John Garry <[email protected]>
---
drivers/scsi/scsi_scan.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/scsi/scsi_scan.c b/drivers/scsi/scsi_scan.c
index 6cc974b382c1..920b145f80b7 100644
--- a/drivers/scsi/scsi_scan.c
+++ b/drivers/scsi/scsi_scan.c
@@ -1920,7 +1920,7 @@ static void do_scsi_scan_host(struct Scsi_Host *shost)
msleep(10);
} else {
scsi_scan_host_selected(shost, SCAN_WILD_CARD, SCAN_WILD_CARD,
- SCAN_WILD_CARD, 0);
+ SCAN_WILD_CARD, SCSI_SCAN_INITIAL);
}
}

--
2.35.3


2022-11-21 13:07:20

by Damien Le Moal

[permalink] [raw]
Subject: Re: [PATCH 2/2] scsi: core: Use SCSI_SCAN_INITIAL in do_scsi_scan_host()

On 11/21/22 21:17, John Garry wrote:
> Instead of using hardcoded '0' as the do_scsi_scan_host() ->
> scsi_scan_host_selected() rescan arg, use proper macro SCSI_SCAN_INITIAL.
>
> Signed-off-by: John Garry <[email protected]>

Looks good.

Reviewed-by: Damien Le Moal <[email protected]>

> ---
> drivers/scsi/scsi_scan.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/scsi/scsi_scan.c b/drivers/scsi/scsi_scan.c
> index 6cc974b382c1..920b145f80b7 100644
> --- a/drivers/scsi/scsi_scan.c
> +++ b/drivers/scsi/scsi_scan.c
> @@ -1920,7 +1920,7 @@ static void do_scsi_scan_host(struct Scsi_Host *shost)
> msleep(10);
> } else {
> scsi_scan_host_selected(shost, SCAN_WILD_CARD, SCAN_WILD_CARD,
> - SCAN_WILD_CARD, 0);
> + SCAN_WILD_CARD, SCSI_SCAN_INITIAL);
> }
> }
>

--
Damien Le Moal
Western Digital Research


2022-11-21 13:56:38

by John Garry

[permalink] [raw]
Subject: Re: [External] : Re: [PATCH 2/2] scsi: core: Use SCSI_SCAN_INITIAL in do_scsi_scan_host()

On 21/11/2022 12:33, Damien Le Moal wrote:
> On 11/21/22 21:17, John Garry wrote:
>> Instead of using hardcoded '0' as the do_scsi_scan_host() ->
>> scsi_scan_host_selected() rescan arg, use proper macro SCSI_SCAN_INITIAL.
>>
>> Signed-off-by: John Garry<[email protected]>
> Looks good.
>
> Reviewed-by: Damien Le Moal<[email protected]>
>

cheers. As mentioned, I can combine these patches if people prefer.

John

2022-11-21 14:33:25

by Jason Yan

[permalink] [raw]
Subject: Re: [PATCH 1/2] scsi: core: Use SCSI_SCAN_RESCAN in __scsi_add_device()

On 2022/11/21 20:17, John Garry wrote:
> Instead of using hardcoded '1' as the __scsi_add_device() ->
> scsi_probe_and_add_lun() rescan arg, use proper macro SCSI_SCAN_RESCAN.
>
> Signed-off-by: John Garry <[email protected]>
> Reviewed-by: Damien Le Moal <[email protected]>
> ---
> drivers/scsi/scsi_scan.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>

Looks good,
Reviewed-by: Jason Yan <[email protected]>

2022-11-21 14:33:46

by Jason Yan

[permalink] [raw]
Subject: Re: [PATCH 2/2] scsi: core: Use SCSI_SCAN_INITIAL in do_scsi_scan_host()

On 2022/11/21 20:17, John Garry wrote:
> Instead of using hardcoded '0' as the do_scsi_scan_host() ->
> scsi_scan_host_selected() rescan arg, use proper macro SCSI_SCAN_INITIAL.
>
> Signed-off-by: John Garry<[email protected]>
> ---
> drivers/scsi/scsi_scan.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)

Looks good,
Reviewed-by: Jason Yan <[email protected]>

2022-11-26 00:36:55

by Bart Van Assche

[permalink] [raw]
Subject: Re: [External] : Re: [PATCH 2/2] scsi: core: Use SCSI_SCAN_INITIAL in do_scsi_scan_host()

On 11/21/22 05:48, John Garry wrote:
> cheers. As mentioned, I can combine these patches if people prefer.

I'm in favor of combining both patches.

Whether or not these patches get combined, feel free to add:

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

2022-11-26 03:15:14

by Martin K. Petersen

[permalink] [raw]
Subject: Re: [PATCH 0/2] scsi: Some minor scan improvements


John,

> The __scsi_add_device() change is from another series which I sent a while
> ago.
>
> The new change in do_scsi_scan_host() could be combined into the
> __scsi_add_device() change if I have anothter RB tag (hint, hint).

Applied to 6.2/scsi-staging, thanks!

--
Martin K. Petersen Oracle Linux Engineering

2022-12-01 04:02:40

by Martin K. Petersen

[permalink] [raw]
Subject: Re: [PATCH 0/2] scsi: Some minor scan improvements

On Mon, 21 Nov 2022 12:17:23 +0000, John Garry wrote:

> The __scsi_add_device() change is from another series which I sent a while
> ago.
>
> The new change in do_scsi_scan_host() could be combined into the
> __scsi_add_device() change if I have anothter RB tag (hint, hint).
>
> John Garry (2):
> scsi: core: Use SCSI_SCAN_RESCAN in __scsi_add_device()
> scsi: core: Use SCSI_SCAN_INITIAL in do_scsi_scan_host()
>
> [...]

Applied to 6.2/scsi-queue, thanks!

[1/2] scsi: core: Use SCSI_SCAN_RESCAN in __scsi_add_device()
https://git.kernel.org/mkp/scsi/c/35bd6f9fd33b
[2/2] scsi: core: Use SCSI_SCAN_INITIAL in do_scsi_scan_host()
https://git.kernel.org/mkp/scsi/c/425b27a04dd8

--
Martin K. Petersen Oracle Linux Engineering