diff mbox series

[3/4] dfu: scsi: don't call scsi_scan()

Message ID 20250326-b4-qcom-capsule-update-improvements-v1-3-afe2e3696675@linaro.org
State New
Headers show
Series Qualcomm: expand capsule update support | expand

Commit Message

Caleb Connolly March 26, 2025, 5:40 p.m. UTC
Calling scsi_scan() results in all the block devices (and EFI block
devices) being destroyed and re-created. This breaks the EFI filesystem
drivers during capsule update.

Remove the call, since boards really should be calling scsi_scan()
themselves during board_init().

Signed-off-by: Caleb Connolly <caleb.connolly@linaro.org>
---
 drivers/dfu/dfu_scsi.c | 5 -----
 1 file changed, 5 deletions(-)

Comments

Neil Armstrong March 31, 2025, 1:52 p.m. UTC | #1
On 26/03/2025 18:40, Caleb Connolly wrote:
> Calling scsi_scan() results in all the block devices (and EFI block
> devices) being destroyed and re-created. This breaks the EFI filesystem
> drivers during capsule update.
> 
> Remove the call, since boards really should be calling scsi_scan()
> themselves during board_init().
> 
> Signed-off-by: Caleb Connolly <caleb.connolly@linaro.org>
> ---
>   drivers/dfu/dfu_scsi.c | 5 -----
>   1 file changed, 5 deletions(-)
> 
> diff --git a/drivers/dfu/dfu_scsi.c b/drivers/dfu/dfu_scsi.c
> index 9f95194784c1de00458843276872b1d23d023444..a234548ae46dc2a6ae1ca5770accb58f43782239 100644
> --- a/drivers/dfu/dfu_scsi.c
> +++ b/drivers/dfu/dfu_scsi.c
> @@ -341,13 +341,8 @@ int dfu_fill_entity_scsi(struct dfu_entity *dfu, char *devstr, char **argv, int
>   		if (*s)
>   			return -EINVAL;
>   	}
>   
> -	if (scsi_scan(false)) {
> -		pr_err("Couldn't init scsi device.\n");
> -		return -ENODEV;
> -	}
> -
>   	ret = find_scsi_device(dfu->data.scsi.lun, &scsi);
>   	if (ret < 0) {
>   		pr_err("Couldn't find scsi device no. %d.\n", dfu->data.scsi.lun);
>   		return -ENODEV;
> 

Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org>
Ilias Apalodimas March 31, 2025, 1:53 p.m. UTC | #2
On Wed, 26 Mar 2025 at 19:41, Caleb Connolly <caleb.connolly@linaro.org> wrote:
>
> Calling scsi_scan() results in all the block devices (and EFI block
> devices) being destroyed and re-created. This breaks the EFI filesystem
> drivers during capsule update.
>
> Remove the call, since boards really should be calling scsi_scan()
> themselves during board_init().
>
> Signed-off-by: Caleb Connolly <caleb.connolly@linaro.org>
> ---
>  drivers/dfu/dfu_scsi.c | 5 -----
>  1 file changed, 5 deletions(-)
>
> diff --git a/drivers/dfu/dfu_scsi.c b/drivers/dfu/dfu_scsi.c
> index 9f95194784c1de00458843276872b1d23d023444..a234548ae46dc2a6ae1ca5770accb58f43782239 100644
> --- a/drivers/dfu/dfu_scsi.c
> +++ b/drivers/dfu/dfu_scsi.c
> @@ -341,13 +341,8 @@ int dfu_fill_entity_scsi(struct dfu_entity *dfu, char *devstr, char **argv, int
>                 if (*s)
>                         return -EINVAL;
>         }
>
> -       if (scsi_scan(false)) {
> -               pr_err("Couldn't init scsi device.\n");
> -               return -ENODEV;
> -       }
> -
>         ret = find_scsi_device(dfu->data.scsi.lun, &scsi);
>         if (ret < 0) {
>                 pr_err("Couldn't find scsi device no. %d.\n", dfu->data.scsi.lun);
>                 return -ENODEV;
>
> --
> 2.49.0
>

Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
diff mbox series

Patch

diff --git a/drivers/dfu/dfu_scsi.c b/drivers/dfu/dfu_scsi.c
index 9f95194784c1de00458843276872b1d23d023444..a234548ae46dc2a6ae1ca5770accb58f43782239 100644
--- a/drivers/dfu/dfu_scsi.c
+++ b/drivers/dfu/dfu_scsi.c
@@ -341,13 +341,8 @@  int dfu_fill_entity_scsi(struct dfu_entity *dfu, char *devstr, char **argv, int
 		if (*s)
 			return -EINVAL;
 	}
 
-	if (scsi_scan(false)) {
-		pr_err("Couldn't init scsi device.\n");
-		return -ENODEV;
-	}
-
 	ret = find_scsi_device(dfu->data.scsi.lun, &scsi);
 	if (ret < 0) {
 		pr_err("Couldn't find scsi device no. %d.\n", dfu->data.scsi.lun);
 		return -ENODEV;