From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-ej1-f52.google.com (mail-ej1-f52.google.com [209.85.218.52]) by mx.groups.io with SMTP id smtpd.web10.31430.1675275454770810486 for ; Wed, 01 Feb 2023 10:17:35 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@google.com header.s=20210112 header.b=ZjtRIjov; spf=pass (domain: google.com, ip: 209.85.218.52, mailfrom: yuanyu@google.com) Received: by mail-ej1-f52.google.com with SMTP id m2so53507514ejb.8 for ; Wed, 01 Feb 2023 10:17:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=SWQ2cMrk2Uc9+zXhug32iRBoTTcd/yw0y9Hq+pnefIM=; b=ZjtRIjove+FTp9/s7HHMklZrHYHlYTDl6CWCwj0YM3ESzZerf89rDMLpBeF/ZPujvD im9Ujp8hGrLZ7v0Fo+HGlOo2Fs4ZfWHyDRfuXIazEMpQOKuV2IRSuHAG97GIRe+U/xWW RWA3p+WphFgLHhzUF187W4QJvIoZkdRFyFT+gH49GkRA9tOZO1JErXLFf2oNqVrs29QJ 24SDqHPAMpMPd9kYvPkkQi/I2kT1fbATVW0qeSzIwF95A7B/mV5BIy02kxxkEAxquko+ 9dGzf80wjXDlw3ZtRuAMiz5d8PPxITvJXfg9L+bFWPpK8DYG6K+cgeyzgYVmkoqmfnVh R8Vg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=SWQ2cMrk2Uc9+zXhug32iRBoTTcd/yw0y9Hq+pnefIM=; b=Nf/EPGsTNLl9gkjomaJZvFBtf9j3qiJkeDnqmUsDC7IQ5qxB/QU6/hcz942xtcFmUQ 49H8fl4bLkk7n+Sq9SMcK/SxqL+r7sys27JNgDQb/MDQjR3A7CsKI7C6HIbS1AhYkBO6 juh0EowyS0e+J5ezVhHADPWW52U0YrCzez3ZCk3Gs/uJM/eXCpsnQLnQYW75R4xgJYsV U7XzP1QQaoUNdZKiFT3RjDY4nRD9GGN87tZl0fT41p19BmBDOOn+REjBcc67i6FQEFX0 5hRiUnAdgAM62tmwYIVrDG3gzfh3W8keMxU61dOmy7O6a8hGkgXD8eZ9xmKcs/JzeJ9y gyUQ== X-Gm-Message-State: AO0yUKWd6caOJLbmBBpGO1tzHb6s4BIuCqfbNc8LTNRefE0ObABCmkw8 cajWHsl8+8dvMklR9gh4ATYyLQf1sUFYN5r4v4rEng== X-Google-Smtp-Source: AK7set/M7SbxjkmVd+lEnd/uQsFgNIvwJF3EgLFw+7ORfHEGdBBdkZLMINYKSdhcZTKThWEKhaJm+UXqufmb5GTpySw= X-Received: by 2002:a17:906:4bd9:b0:88c:f2db:e057 with SMTP id x25-20020a1709064bd900b0088cf2dbe057mr1034451ejv.216.1675275452993; Wed, 01 Feb 2023 10:17:32 -0800 (PST) MIME-Version: 1.0 References: <20230131060347.99785-1-yuanyu@google.com> <20230131060347.99785-2-yuanyu@google.com> In-Reply-To: From: "Yuan Yu" Date: Wed, 1 Feb 2023 10:16:56 -0800 Message-ID: Subject: Re: [PATCH v2 1/1] MdeModulePkg: ScsiBusDxe: Refactor DiscoverScsiDevice() To: "Wu, Hao A" Cc: "devel@edk2.groups.io" , Ard Biesheuvel , "Gao, Liming" , "Ni, Ray" , "C, sivaparvathi" Content-Type: multipart/alternative; boundary="0000000000004765e605f3a776f1" --0000000000004765e605f3a776f1 Content-Type: text/plain; charset="UTF-8" Sounds good. Thank you! Best, Yuan On Tue, Jan 31, 2023 at 10:48 PM Wu, Hao A wrote: > Reviewed-by: Hao A Wu > Will update the function comment for ScsiScanCreateDevice() in ScsiBus.c > to match the change in ScsiBus.h during merge. > > Best Regards, > Hao Wu > > > -----Original Message----- > > From: Yuan Yu > > Sent: Tuesday, January 31, 2023 2:04 PM > > To: devel@edk2.groups.io > > Cc: Ard Biesheuvel ; Gao, Liming > > ; Wu, Hao A ; Ni, Ray > > ; C, sivaparvathi > > Subject: [PATCH v2 1/1] MdeModulePkg: ScsiBusDxe: Refactor > > DiscoverScsiDevice() > > > > Currently DiscoverScsiDevice() returns a boolean which cannot > > distinguish a "not found" situation from a real problem like > > memory allocation failures. > > > > This patch changes the return value to an EFI_STATUS so that when > > memory allocation fails, it will return EFI_OUT_OF_RESOURCES. > > > > Without this change, any FALSE returned by DiscoverScsiDevice() > > will result in EFI_OUT_OF_RESOURCES being returned by > > ScsiScanCreateDevice(), which will cause a while loop in > > SCSIBusDriverBindingStart() to abort before other possible Puns in > > the SCSI channel are scanned, which means good devices may not have > > a chance to be discovered. If this good device is the boot device, > > boot will fail. > > > > Cc: Ard Biesheuvel > > Cc: Liming Gao > > Cc: Hao A Wu > > Cc: Ray Ni > > Cc: Sivaparvathi chellaiah > > > > Signed-off-by: Yuan Yu > > --- > > MdeModulePkg/Bus/Scsi/ScsiBusDxe/ScsiBus.h | 10 ++++--- > > MdeModulePkg/Bus/Scsi/ScsiBusDxe/ScsiBus.c | 30 ++++++++++---------- > > 2 files changed, 21 insertions(+), 19 deletions(-) > > > > diff --git a/MdeModulePkg/Bus/Scsi/ScsiBusDxe/ScsiBus.h > > b/MdeModulePkg/Bus/Scsi/ScsiBusDxe/ScsiBus.h > > index 68c5c02a9161..35a8a46ca7a2 100644 > > --- a/MdeModulePkg/Bus/Scsi/ScsiBusDxe/ScsiBus.h > > +++ b/MdeModulePkg/Bus/Scsi/ScsiBusDxe/ScsiBus.h > > @@ -455,7 +455,8 @@ ScsiExecuteSCSICommand ( > > > > @retval EFI_SUCCESS Successfully to discover the device and > attach > > ScsiIoProtocol to it. > > - @retval EFI_OUT_OF_RESOURCES Fail to discover the device. > > + @retval EFI_NOT_FOUND Fail to discover the device. > > + @retval EFI_OUT_OF_RESOURCES Fail to allocate memory resources. > > > > **/ > > EFI_STATUS > > @@ -473,11 +474,12 @@ ScsiScanCreateDevice ( > > > > @param ScsiIoDevice The pointer of SCSI_IO_DEV > > > > - @retval TRUE Find SCSI Device and verify it. > > - @retval FALSE Unable to find SCSI Device. > > + @retval EFI_SUCCESS Find SCSI Device and verify it. > > + @retval EFI_NOT_FOUND Unable to find SCSI Device. > > + @retval EFI_OUT_OF_RESOURCES Fail to allocate memory resources. > > > > **/ > > -BOOLEAN > > +EFI_STATUS > > DiscoverScsiDevice ( > > IN OUT SCSI_IO_DEV *ScsiIoDevice > > ); > > diff --git a/MdeModulePkg/Bus/Scsi/ScsiBusDxe/ScsiBus.c > > b/MdeModulePkg/Bus/Scsi/ScsiBusDxe/ScsiBus.c > > index fbe14c772496..4414a65eb1e6 100644 > > --- a/MdeModulePkg/Bus/Scsi/ScsiBusDxe/ScsiBus.c > > +++ b/MdeModulePkg/Bus/Scsi/ScsiBusDxe/ScsiBus.c > > @@ -1210,8 +1210,8 @@ ScsiScanCreateDevice ( > > ScsiBusDev->DevicePath > > ); > > > > - if (!DiscoverScsiDevice (ScsiIoDevice)) { > > - Status = EFI_OUT_OF_RESOURCES; > > + Status = DiscoverScsiDevice (ScsiIoDevice); > > + if (EFI_ERROR (Status)) { > > goto ErrorExit; > > } > > > > @@ -1276,11 +1276,12 @@ ErrorExit: > > > > @param ScsiIoDevice The pointer of SCSI_IO_DEV > > > > - @retval TRUE Find SCSI Device and verify it. > > - @retval FALSE Unable to find SCSI Device. > > + @retval EFI_SUCCESS Find SCSI Device and verify it. > > + @retval EFI_NOT_FOUND Unable to find SCSI Device. > > + @retval EFI_OUT_OF_RESOURCES Fail to allocate memory resources. > > > > **/ > > -BOOLEAN > > +EFI_STATUS > > DiscoverScsiDevice ( > > IN OUT SCSI_IO_DEV *ScsiIoDevice > > ) > > @@ -1294,7 +1295,6 @@ DiscoverScsiDevice ( > > EFI_SCSI_SENSE_DATA *SenseData; > > UINT8 MaxRetry; > > UINT8 Index; > > - BOOLEAN ScsiDeviceFound; > > > > HostAdapterStatus = 0; > > TargetStatus = 0; > > @@ -1302,7 +1302,7 @@ DiscoverScsiDevice ( > > > > InquiryData = AllocateAlignedBuffer (ScsiIoDevice, sizeof > > (EFI_SCSI_INQUIRY_DATA)); > > if (InquiryData == NULL) { > > - ScsiDeviceFound = FALSE; > > + Status = EFI_OUT_OF_RESOURCES; > > goto Done; > > } > > > > @@ -1311,7 +1311,7 @@ DiscoverScsiDevice ( > > sizeof (EFI_SCSI_SENSE_DATA) > > ); > > if (SenseData == NULL) { > > - ScsiDeviceFound = FALSE; > > + Status = EFI_OUT_OF_RESOURCES; > > goto Done; > > } > > > > @@ -1342,7 +1342,7 @@ DiscoverScsiDevice ( > > (SenseData->Error_Code == 0x70) && > > (SenseData->Sense_Key == EFI_SCSI_SK_ILLEGAL_REQUEST)) > > { > > - ScsiDeviceFound = FALSE; > > + Status = EFI_NOT_FOUND; > > goto Done; > > } > > > > @@ -1353,13 +1353,13 @@ DiscoverScsiDevice ( > > (Status == EFI_INVALID_PARAMETER) || > > (Status == EFI_UNSUPPORTED)) > > { > > - ScsiDeviceFound = FALSE; > > + Status = EFI_NOT_FOUND; > > goto Done; > > } > > } > > > > if (Index == MaxRetry) { > > - ScsiDeviceFound = FALSE; > > + Status = EFI_NOT_FOUND; > > goto Done; > > } > > > > @@ -1367,14 +1367,14 @@ DiscoverScsiDevice ( > > // Retrieved inquiry data successfully > > // > > if (InquiryData->Peripheral_Qualifier != 0) { > > - ScsiDeviceFound = FALSE; > > + Status = EFI_NOT_FOUND; > > goto Done; > > } > > > > if ((InquiryData->Peripheral_Type >= EFI_SCSI_TYPE_RESERVED_LOW) && > > (InquiryData->Peripheral_Type <= EFI_SCSI_TYPE_RESERVED_HIGH)) > > { > > - ScsiDeviceFound = FALSE; > > + Status = EFI_NOT_FOUND; > > goto Done; > > } > > > > @@ -1392,13 +1392,13 @@ DiscoverScsiDevice ( > > ScsiIoDevice->ScsiVersion = (UINT8)(InquiryData->Version & 0x07); > > } > > > > - ScsiDeviceFound = TRUE; > > + Status = EFI_SUCCESS; > > > > Done: > > FreeAlignedBuffer (SenseData, sizeof (EFI_SCSI_SENSE_DATA)); > > FreeAlignedBuffer (InquiryData, sizeof (EFI_SCSI_INQUIRY_DATA)); > > > > - return ScsiDeviceFound; > > + return Status; > > } > > > > /** > > -- > > 2.39.1.456.gfc5497dd1b-goog > > --0000000000004765e605f3a776f1 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Sounds=C2=A0good. Thank you!

Best,
Yuan

On Tue, Jan 31, 2023 at 10:48 PM Wu, Hao A <hao.a.wu@intel.com> wrote:
<= blockquote class=3D"gmail_quote" style=3D"margin:0px 0px 0px 0.8ex;border-l= eft:1px solid rgb(204,204,204);padding-left:1ex">Reviewed-by: Hao A Wu <= hao.a.wu@intel.com<= /a>>
Will update the function comment for ScsiScanCreateDevice() in ScsiBus.c to= match the change in ScsiBus.h during merge.

Best Regards,
Hao Wu

> -----Original Message-----
> From: Yuan Yu <
yuanyu@google.com>
> Sent: Tuesday, January 31, 2023 2:04 PM
> To: devel@ed= k2.groups.io
> Cc: Ard Biesheuvel <ardb+tianocore@kernel.org>; Gao, Liming
> <gaol= iming@byosoft.com.cn>; Wu, Hao A <hao.a.wu@intel.com>; Ni, Ray
> <ray.ni@intel= .com>; C, sivaparvathi <sivaparvathic@ami.com>
> Subject: [PATCH v2 1/1] MdeModulePkg: ScsiBusDxe: Refactor
> DiscoverScsiDevice()
>
> Currently DiscoverScsiDevice() returns a boolean which cannot
> distinguish a "not found" situation from a real problem like=
> memory allocation failures.
>
> This patch changes the return value to an EFI_STATUS so that when
> memory allocation fails, it will return EFI_OUT_OF_RESOURCES.
>
> Without this change, any FALSE returned by DiscoverScsiDevice()
> will result in EFI_OUT_OF_RESOURCES being returned by
> ScsiScanCreateDevice(), which will cause a while loop in
> SCSIBusDriverBindingStart() to abort before other possible Puns in
> the SCSI channel are scanned, which means good devices may not have > a chance to be discovered.=C2=A0 If this good device is the boot devic= e,
> boot will fail.
>
> Cc: Ard Biesheuvel <ardb+tianocore@kernel.org>
> Cc: Liming Gao <gaoliming@byosoft.com.cn>
> Cc: Hao A Wu <hao.a.wu@intel.com>
> Cc: Ray Ni <r= ay.ni@intel.com>
> Cc: Sivaparvathi chellaiah <sivaparvathic@ami.com>
>
> Signed-off-by: Yuan Yu <yuanyu@google.com>
> ---
>=C2=A0 MdeModulePkg/Bus/Scsi/ScsiBusDxe/ScsiBus.h | 10 ++++---
>=C2=A0 MdeModulePkg/Bus/Scsi/ScsiBusDxe/ScsiBus.c | 30 ++++++++++------= ----
>=C2=A0 2 files changed, 21 insertions(+), 19 deletions(-)
>
> diff --git a/MdeModulePkg/Bus/Scsi/ScsiBusDxe/ScsiBus.h
> b/MdeModulePkg/Bus/Scsi/ScsiBusDxe/ScsiBus.h
> index 68c5c02a9161..35a8a46ca7a2 100644
> --- a/MdeModulePkg/Bus/Scsi/ScsiBusDxe/ScsiBus.h
> +++ b/MdeModulePkg/Bus/Scsi/ScsiBusDxe/ScsiBus.h
> @@ -455,7 +455,8 @@ ScsiExecuteSCSICommand (
>
>=C2=A0 =C2=A0 @retval EFI_SUCCESS=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0Successfully to discover the device and attach
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 ScsiIoProtocol to it.
> -=C2=A0 @retval EFI_OUT_OF_RESOURCES=C2=A0 Fail to discover the device= .
> +=C2=A0 @retval EFI_NOT_FOUND=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0Fail to= discover the device.
> +=C2=A0 @retval EFI_OUT_OF_RESOURCES=C2=A0 Fail to allocate memory res= ources.
>
>=C2=A0 **/
>=C2=A0 EFI_STATUS
> @@ -473,11 +474,12 @@ ScsiScanCreateDevice (
>
>=C2=A0 =C2=A0 @param=C2=A0 ScsiIoDevice=C2=A0 =C2=A0 The pointer of SCS= I_IO_DEV
>
> -=C2=A0 @retval=C2=A0 TRUE=C2=A0 =C2=A0Find SCSI Device and verify it.=
> -=C2=A0 @retval=C2=A0 FALSE=C2=A0 Unable to find SCSI Device.
> +=C2=A0 @retval EFI_SUCCESS=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0Fi= nd SCSI Device and verify it.
> +=C2=A0 @retval EFI_NOT_FOUND=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0Unable = to find SCSI Device.
> +=C2=A0 @retval EFI_OUT_OF_RESOURCES=C2=A0 Fail to allocate memory res= ources.
>
>=C2=A0 **/
> -BOOLEAN
> +EFI_STATUS
>=C2=A0 DiscoverScsiDevice (
>=C2=A0 =C2=A0 IN=C2=A0 OUT=C2=A0 SCSI_IO_DEV=C2=A0 *ScsiIoDevice
>=C2=A0 =C2=A0 );
> diff --git a/MdeModulePkg/Bus/Scsi/ScsiBusDxe/ScsiBus.c
> b/MdeModulePkg/Bus/Scsi/ScsiBusDxe/ScsiBus.c
> index fbe14c772496..4414a65eb1e6 100644
> --- a/MdeModulePkg/Bus/Scsi/ScsiBusDxe/ScsiBus.c
> +++ b/MdeModulePkg/Bus/Scsi/ScsiBusDxe/ScsiBus.c
> @@ -1210,8 +1210,8 @@ ScsiScanCreateDevice (
>=C2=A0 =C2=A0 =C2=A0 ScsiBusDev->DevicePath
>=C2=A0 =C2=A0 =C2=A0 );
>
> -=C2=A0 if (!DiscoverScsiDevice (ScsiIoDevice)) {
> -=C2=A0 =C2=A0 Status =3D EFI_OUT_OF_RESOURCES;
> +=C2=A0 Status =3D DiscoverScsiDevice (ScsiIoDevice);
> +=C2=A0 if (EFI_ERROR (Status)) {
>=C2=A0 =C2=A0 =C2=A0 goto ErrorExit;
>=C2=A0 =C2=A0 }
>
> @@ -1276,11 +1276,12 @@ ErrorExit:
>
>=C2=A0 =C2=A0 @param=C2=A0 ScsiIoDevice=C2=A0 =C2=A0 The pointer of SCS= I_IO_DEV
>
> -=C2=A0 @retval=C2=A0 TRUE=C2=A0 =C2=A0Find SCSI Device and verify it.=
> -=C2=A0 @retval=C2=A0 FALSE=C2=A0 Unable to find SCSI Device.
> +=C2=A0 @retval EFI_SUCCESS=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0Fi= nd SCSI Device and verify it.
> +=C2=A0 @retval EFI_NOT_FOUND=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0Unable = to find SCSI Device.
> +=C2=A0 @retval EFI_OUT_OF_RESOURCES=C2=A0 Fail to allocate memory res= ources.
>
>=C2=A0 **/
> -BOOLEAN
> +EFI_STATUS
>=C2=A0 DiscoverScsiDevice (
>=C2=A0 =C2=A0 IN OUT=C2=A0 SCSI_IO_DEV=C2=A0 *ScsiIoDevice
>=C2=A0 =C2=A0 )
> @@ -1294,7 +1295,6 @@ DiscoverScsiDevice (
>=C2=A0 =C2=A0 EFI_SCSI_SENSE_DATA=C2=A0 =C2=A0 *SenseData;
>=C2=A0 =C2=A0 UINT8=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 MaxRetry;
>=C2=A0 =C2=A0 UINT8=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 Index;
> -=C2=A0 BOOLEAN=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0= ScsiDeviceFound;
>
>=C2=A0 =C2=A0 HostAdapterStatus =3D 0;
>=C2=A0 =C2=A0 TargetStatus=C2=A0 =C2=A0 =C2=A0 =3D 0;
> @@ -1302,7 +1302,7 @@ DiscoverScsiDevice (
>
>=C2=A0 =C2=A0 InquiryData =3D AllocateAlignedBuffer (ScsiIoDevice, size= of
> (EFI_SCSI_INQUIRY_DATA));
>=C2=A0 =C2=A0 if (InquiryData =3D=3D NULL) {
> -=C2=A0 =C2=A0 ScsiDeviceFound =3D FALSE;
> +=C2=A0 =C2=A0 Status =3D EFI_OUT_OF_RESOURCES;
>=C2=A0 =C2=A0 =C2=A0 goto Done;
>=C2=A0 =C2=A0 }
>
> @@ -1311,7 +1311,7 @@ DiscoverScsiDevice (
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 sizeof (= EFI_SCSI_SENSE_DATA)
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 );
>=C2=A0 =C2=A0 if (SenseData =3D=3D NULL) {
> -=C2=A0 =C2=A0 ScsiDeviceFound =3D FALSE;
> +=C2=A0 =C2=A0 Status =3D EFI_OUT_OF_RESOURCES;
>=C2=A0 =C2=A0 =C2=A0 goto Done;
>=C2=A0 =C2=A0 }
>
> @@ -1342,7 +1342,7 @@ DiscoverScsiDevice (
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (SenseData->Error_Code =3D= =3D 0x70) &&
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (SenseData->Sense_Key =3D= =3D EFI_SCSI_SK_ILLEGAL_REQUEST))
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 {
> -=C2=A0 =C2=A0 =C2=A0 =C2=A0 ScsiDeviceFound =3D FALSE;
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 Status =3D EFI_NOT_FOUND;
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 goto Done;
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 }
>
> @@ -1353,13 +1353,13 @@ DiscoverScsiDevice (
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (Status =3D=3D EFI_INVALID_PARAMETER= ) ||
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (Status =3D=3D EFI_UNSUPPORTED))
>=C2=A0 =C2=A0 =C2=A0 {
> -=C2=A0 =C2=A0 =C2=A0 ScsiDeviceFound =3D FALSE;
> +=C2=A0 =C2=A0 =C2=A0 Status =3D EFI_NOT_FOUND;
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 goto Done;
>=C2=A0 =C2=A0 =C2=A0 }
>=C2=A0 =C2=A0 }
>
>=C2=A0 =C2=A0 if (Index =3D=3D MaxRetry) {
> -=C2=A0 =C2=A0 ScsiDeviceFound =3D FALSE;
> +=C2=A0 =C2=A0 Status =3D EFI_NOT_FOUND;
>=C2=A0 =C2=A0 =C2=A0 goto Done;
>=C2=A0 =C2=A0 }
>
> @@ -1367,14 +1367,14 @@ DiscoverScsiDevice (
>=C2=A0 =C2=A0 // Retrieved inquiry data successfully
>=C2=A0 =C2=A0 //
>=C2=A0 =C2=A0 if (InquiryData->Peripheral_Qualifier !=3D 0) {
> -=C2=A0 =C2=A0 ScsiDeviceFound =3D FALSE;
> +=C2=A0 =C2=A0 Status =3D EFI_NOT_FOUND;
>=C2=A0 =C2=A0 =C2=A0 goto Done;
>=C2=A0 =C2=A0 }
>
>=C2=A0 =C2=A0 if ((InquiryData->Peripheral_Type >=3D EFI_SCSI_TYP= E_RESERVED_LOW) &&
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 (InquiryData->Peripheral_Type <=3D EF= I_SCSI_TYPE_RESERVED_HIGH))
>=C2=A0 =C2=A0 {
> -=C2=A0 =C2=A0 ScsiDeviceFound =3D FALSE;
> +=C2=A0 =C2=A0 Status =3D EFI_NOT_FOUND;
>=C2=A0 =C2=A0 =C2=A0 goto Done;
>=C2=A0 =C2=A0 }
>
> @@ -1392,13 +1392,13 @@ DiscoverScsiDevice (
>=C2=A0 =C2=A0 =C2=A0 ScsiIoDevice->ScsiVersion =3D (UINT8)(InquiryDa= ta->Version & 0x07);
>=C2=A0 =C2=A0 }
>
> -=C2=A0 ScsiDeviceFound =3D TRUE;
> +=C2=A0 Status =3D EFI_SUCCESS;
>
>=C2=A0 Done:
>=C2=A0 =C2=A0 FreeAlignedBuffer (SenseData, sizeof (EFI_SCSI_SENSE_DATA= ));
>=C2=A0 =C2=A0 FreeAlignedBuffer (InquiryData, sizeof (EFI_SCSI_INQUIRY_= DATA));
>
> -=C2=A0 return ScsiDeviceFound;
> +=C2=A0 return Status;
>=C2=A0 }
>
>=C2=A0 /**
> --
> 2.39.1.456.gfc5497dd1b-goog

--0000000000004765e605f3a776f1--