public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
* [edk2-platform][PATCH v1 0/3] Platforms/RaspberryPi: Fix ComponentName2 SCT errors
@ 2020-08-15 20:26 Samer El-Haj-Mahmoud
  2020-08-15 20:26 ` [edk2-platform][PATCH v1 1/3] Platforms/RaspberryPi: Fix DisplayDxe ComponentName2 error checking Samer El-Haj-Mahmoud
                   ` (2 more replies)
  0 siblings, 3 replies; 9+ messages in thread
From: Samer El-Haj-Mahmoud @ 2020-08-15 20:26 UTC (permalink / raw)
  To: devel

Fix SCT errors on ComponentName2 protocol for the RPi drivers:
DisplayDxe, BcmGenetDxe, and DwUsbHostDxe.


Samer El-Haj-Mahmoud (3):
  Platforms/RaspberryPi: Fix DisplayDxe ComponentName2 error checking
  Platforms/RaspberryPi: Fix DwUsbHostDxe ComponentName2 error checking
  Platforms/RaspberryPi: Fix BcmGenetDxe ComponentName2 error checking

 .../Drivers/DisplayDxe/DisplayDxe.h           |  2 ++
 .../Drivers/DwUsbHostDxe/DwUsbHostDxe.h       |  4 +++-
 .../Drivers/Net/BcmGenetDxe/BcmGenetDxe.h     |  1 +
 .../Drivers/DisplayDxe/ComponentName.c        | 22 +++++++++++++++++++
 .../Drivers/DwUsbHostDxe/ComponentName.c      | 18 +++++++++++++++
 .../Drivers/DwUsbHostDxe/DriverBinding.c      |  2 +-
 .../Drivers/Net/BcmGenetDxe/ComponentName.c   | 22 +++++++++++++++++++
 .../Drivers/Net/BcmGenetDxe/DriverBinding.c   |  2 +-
 8 files changed, 70 insertions(+), 3 deletions(-)

-- 
2.17.1


^ permalink raw reply	[flat|nested] 9+ messages in thread

* [edk2-platform][PATCH v1 1/3] Platforms/RaspberryPi: Fix DisplayDxe ComponentName2 error checking
  2020-08-15 20:26 [edk2-platform][PATCH v1 0/3] Platforms/RaspberryPi: Fix ComponentName2 SCT errors Samer El-Haj-Mahmoud
@ 2020-08-15 20:26 ` Samer El-Haj-Mahmoud
  2020-08-17 11:17   ` Pete Batard
  2020-08-17 13:54   ` Ard Biesheuvel
  2020-08-15 20:26 ` [edk2-platform][PATCH v1 2/3] Platforms/RaspberryPi: Fix DwUsbHostDxe " Samer El-Haj-Mahmoud
  2020-08-15 20:26 ` [edk2-platform][PATCH v1 3/3] Platforms/RaspberryPi: Fix BcmGenetDxe " Samer El-Haj-Mahmoud
  2 siblings, 2 replies; 9+ messages in thread
From: Samer El-Haj-Mahmoud @ 2020-08-15 20:26 UTC (permalink / raw)
  To: devel; +Cc: Leif Lindholm, Pete Batard, Andrei Warkentin, Ard Biesheuvel

Fix input param error checking for the DisplayDxe ComponentName2
protocol.

This fixes https://github.com/pftf/RPi4/issues/84

Cc: Leif Lindholm <leif@nuviainc.com>
Cc: Pete Batard <pete@akeo.ie>
Cc: Andrei Warkentin <awarkentin@vmware.com>
Cc: Ard Biesheuvel <ard.biesheuvel@arm.com>
Signed-off-by: Samer El-Haj-Mahmoud <samer.el-haj-mahmoud@arm.com>
---
 Platform/RaspberryPi/Drivers/DisplayDxe/DisplayDxe.h    |  2 ++
 Platform/RaspberryPi/Drivers/DisplayDxe/ComponentName.c | 22 ++++++++++++++++++++
 2 files changed, 24 insertions(+)

diff --git a/Platform/RaspberryPi/Drivers/DisplayDxe/DisplayDxe.h b/Platform/RaspberryPi/Drivers/DisplayDxe/DisplayDxe.h
index bfbe9e868843..073f65111645 100644
--- a/Platform/RaspberryPi/Drivers/DisplayDxe/DisplayDxe.h
+++ b/Platform/RaspberryPi/Drivers/DisplayDxe/DisplayDxe.h
@@ -1,5 +1,6 @@
 /** @file
  *
+ *  Copyright (c) 2020, ARM Limited. All rights reserved.
  *  Copyright (c) 2017-2018, Andrei Warkentin <andrey.warkentin@gmail.com>
  *  Copyright (c) Microsoft Corporation. All rights reserved.
  *
@@ -27,6 +28,7 @@
 extern EFI_GRAPHICS_OUTPUT_PROTOCOL gDisplayProto;
 extern EFI_COMPONENT_NAME_PROTOCOL  gComponentName;
 extern EFI_COMPONENT_NAME2_PROTOCOL gComponentName2;
+extern EFI_DRIVER_BINDING_PROTOCOL  mDriverBinding;
 
 VOID
 RegisterScreenshotHandlers (
diff --git a/Platform/RaspberryPi/Drivers/DisplayDxe/ComponentName.c b/Platform/RaspberryPi/Drivers/DisplayDxe/ComponentName.c
index 092230cd7c9b..4c065b5d51bf 100644
--- a/Platform/RaspberryPi/Drivers/DisplayDxe/ComponentName.c
+++ b/Platform/RaspberryPi/Drivers/DisplayDxe/ComponentName.c
@@ -1,5 +1,6 @@
 /** @file
  *
+ *  Copyright (c) 2020, ARM Limited. All rights reserved.
  *  Copyright (c) 2018, Andrei Warkentin <andrey.warkentin@gmail.com>
  *  Copyright (c) 2006-2016, Intel Corporation. All rights reserved.
  *
@@ -206,6 +207,27 @@ ComponentNameGetControllerName (
   OUT CHAR16                      **ControllerName
   )
 {
+  EFI_STATUS  Status;
+
+  //
+  // This is a device driver, so ChildHandle must be NULL.
+  //
+  if (ChildHandle != NULL) {
+    return EFI_UNSUPPORTED;
+  }
+
+  //
+  // Make sure this driver is currently managing ControllHandle
+  //
+  Status = EfiTestManagedDevice (
+             ControllerHandle,
+             mDriverBinding.DriverBindingHandle,
+             &gEfiGraphicsOutputProtocolGuid
+             );
+  if (EFI_ERROR (Status)) {
+    return Status;
+  }
+
   return LookupUnicodeString2 (
            Language,
            This->SupportedLanguages,
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [edk2-platform][PATCH v1 2/3] Platforms/RaspberryPi: Fix DwUsbHostDxe ComponentName2 error checking
  2020-08-15 20:26 [edk2-platform][PATCH v1 0/3] Platforms/RaspberryPi: Fix ComponentName2 SCT errors Samer El-Haj-Mahmoud
  2020-08-15 20:26 ` [edk2-platform][PATCH v1 1/3] Platforms/RaspberryPi: Fix DisplayDxe ComponentName2 error checking Samer El-Haj-Mahmoud
@ 2020-08-15 20:26 ` Samer El-Haj-Mahmoud
  2020-08-17 11:17   ` Pete Batard
  2020-08-15 20:26 ` [edk2-platform][PATCH v1 3/3] Platforms/RaspberryPi: Fix BcmGenetDxe " Samer El-Haj-Mahmoud
  2 siblings, 1 reply; 9+ messages in thread
From: Samer El-Haj-Mahmoud @ 2020-08-15 20:26 UTC (permalink / raw)
  To: devel; +Cc: Leif Lindholm, Pete Batard, Andrei Warkentin, Ard Biesheuvel

Fix input param error checking for the DwUsbHostDxe ComponentName2
protocol.

This fixes https://github.com/pftf/RPi4/issues/86

Cc: Leif Lindholm <leif@nuviainc.com>
Cc: Pete Batard <pete@akeo.ie>
Cc: Andrei Warkentin <awarkentin@vmware.com>
Cc: Ard Biesheuvel <ard.biesheuvel@arm.com>
Signed-off-by: Samer El-Haj-Mahmoud <samer.el-haj-mahmoud@arm.com>
---
 Platform/RaspberryPi/Drivers/DwUsbHostDxe/DwUsbHostDxe.h  |  4 +++-
 Platform/RaspberryPi/Drivers/DwUsbHostDxe/ComponentName.c | 18 ++++++++++++++++++
 Platform/RaspberryPi/Drivers/DwUsbHostDxe/DriverBinding.c |  2 +-
 3 files changed, 22 insertions(+), 2 deletions(-)

diff --git a/Platform/RaspberryPi/Drivers/DwUsbHostDxe/DwUsbHostDxe.h b/Platform/RaspberryPi/Drivers/DwUsbHostDxe/DwUsbHostDxe.h
index 106e5425355e..cf6c81b64ab5 100644
--- a/Platform/RaspberryPi/Drivers/DwUsbHostDxe/DwUsbHostDxe.h
+++ b/Platform/RaspberryPi/Drivers/DwUsbHostDxe/DwUsbHostDxe.h
@@ -1,5 +1,6 @@
 /** @file
  *
+ *  Copyright (c) 2020, ARM Limited. All rights reserved.
  *  Copyright (c) 2017-2018, Andrey Warkentin <andrey.warkentin@gmail.com>
  *  Copyright (c) 2015-2016, Linaro Limited. All rights reserved.
  *
@@ -121,8 +122,9 @@ typedef struct _DWUSB_OTGHC_DEV {
   UINT16                          LastMicroFrame;
 } DWUSB_OTGHC_DEV;
 
-extern EFI_COMPONENT_NAME_PROTOCOL gComponentName;
+extern EFI_COMPONENT_NAME_PROTOCOL  gComponentName;
 extern EFI_COMPONENT_NAME2_PROTOCOL gComponentName2;
+extern EFI_DRIVER_BINDING_PROTOCOL  mDriverBinding;
 
 EFI_STATUS
 CreateDwUsbHc (
diff --git a/Platform/RaspberryPi/Drivers/DwUsbHostDxe/ComponentName.c b/Platform/RaspberryPi/Drivers/DwUsbHostDxe/ComponentName.c
index 2f3c53323bf1..8639ab7d39c5 100644
--- a/Platform/RaspberryPi/Drivers/DwUsbHostDxe/ComponentName.c
+++ b/Platform/RaspberryPi/Drivers/DwUsbHostDxe/ComponentName.c
@@ -1,5 +1,6 @@
 /** @file
  *
+ *  Copyright (c) 2020, ARM Limited. All rights reserved.
  *  Copyright (c) 2018, Andrey Warkentin <andrey.warkentin@gmail.com>
  *
  *  SPDX-License-Identifier: BSD-2-Clause-Patent
@@ -205,10 +206,27 @@ ComponentNameGetControllerName (
   OUT CHAR16                      **ControllerName
   )
 {
+  EFI_STATUS  Status;
+
+  //
+  // This is a device driver, so ChildHandle must be NULL.
+  //
   if (ChildHandle != NULL) {
     return EFI_UNSUPPORTED;
   }
 
+  //
+  // Make sure this driver is currently managing ControllHandle
+  //
+  Status = EfiTestManagedDevice (
+             ControllerHandle,
+             mDriverBinding.DriverBindingHandle,
+             &gEfiUsb2HcProtocolGuid
+             );
+  if (EFI_ERROR (Status)) {
+    return Status;
+  }
+
   return LookupUnicodeString2 (
            Language,
            This->SupportedLanguages,
diff --git a/Platform/RaspberryPi/Drivers/DwUsbHostDxe/DriverBinding.c b/Platform/RaspberryPi/Drivers/DwUsbHostDxe/DriverBinding.c
index 7f78179d4c06..bada13a6cd7c 100644
--- a/Platform/RaspberryPi/Drivers/DwUsbHostDxe/DriverBinding.c
+++ b/Platform/RaspberryPi/Drivers/DwUsbHostDxe/DriverBinding.c
@@ -36,7 +36,7 @@ DriverStop (
   IN  EFI_HANDLE                  *ChildHandleBuffer
   );
 
-STATIC EFI_DRIVER_BINDING_PROTOCOL mDriverBinding = {
+EFI_DRIVER_BINDING_PROTOCOL mDriverBinding = {
   DriverSupported,
   DriverStart,
   DriverStop,
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [edk2-platform][PATCH v1 3/3] Platforms/RaspberryPi: Fix BcmGenetDxe ComponentName2 error checking
  2020-08-15 20:26 [edk2-platform][PATCH v1 0/3] Platforms/RaspberryPi: Fix ComponentName2 SCT errors Samer El-Haj-Mahmoud
  2020-08-15 20:26 ` [edk2-platform][PATCH v1 1/3] Platforms/RaspberryPi: Fix DisplayDxe ComponentName2 error checking Samer El-Haj-Mahmoud
  2020-08-15 20:26 ` [edk2-platform][PATCH v1 2/3] Platforms/RaspberryPi: Fix DwUsbHostDxe " Samer El-Haj-Mahmoud
@ 2020-08-15 20:26 ` Samer El-Haj-Mahmoud
  2020-08-17 11:17   ` Pete Batard
  2 siblings, 1 reply; 9+ messages in thread
From: Samer El-Haj-Mahmoud @ 2020-08-15 20:26 UTC (permalink / raw)
  To: devel; +Cc: Leif Lindholm, Pete Batard, Andrei Warkentin, Ard Biesheuvel

Fix input param error checking for the BcmGenetDxe ComponentName2
protocol.

This fixes https://github.com/pftf/RPi4/issues/85

Cc: Leif Lindholm <leif@nuviainc.com>
Cc: Pete Batard <pete@akeo.ie>
Cc: Andrei Warkentin <awarkentin@vmware.com>
Cc: Ard Biesheuvel <ard.biesheuvel@arm.com>
Signed-off-by: Samer El-Haj-Mahmoud <samer.el-haj-mahmoud@arm.com>
---
 Silicon/Broadcom/Drivers/Net/BcmGenetDxe/BcmGenetDxe.h   |  1 +
 Silicon/Broadcom/Drivers/Net/BcmGenetDxe/ComponentName.c | 22 ++++++++++++++++++++
 Silicon/Broadcom/Drivers/Net/BcmGenetDxe/DriverBinding.c |  2 +-
 3 files changed, 24 insertions(+), 1 deletion(-)

diff --git a/Silicon/Broadcom/Drivers/Net/BcmGenetDxe/BcmGenetDxe.h b/Silicon/Broadcom/Drivers/Net/BcmGenetDxe/BcmGenetDxe.h
index b39a1326335a..26016330fb3b 100644
--- a/Silicon/Broadcom/Drivers/Net/BcmGenetDxe/BcmGenetDxe.h
+++ b/Silicon/Broadcom/Drivers/Net/BcmGenetDxe/BcmGenetDxe.h
@@ -235,6 +235,7 @@ typedef struct {
 
 extern EFI_COMPONENT_NAME_PROTOCOL            gGenetComponentName;
 extern EFI_COMPONENT_NAME2_PROTOCOL           gGenetComponentName2;
+extern EFI_DRIVER_BINDING_PROTOCOL            mGenetDriverBinding;
 
 extern CONST EFI_SIMPLE_NETWORK_PROTOCOL      gGenetSimpleNetworkTemplate;
 extern CONST EFI_ADAPTER_INFORMATION_PROTOCOL gGenetAdapterInfoTemplate;
diff --git a/Silicon/Broadcom/Drivers/Net/BcmGenetDxe/ComponentName.c b/Silicon/Broadcom/Drivers/Net/BcmGenetDxe/ComponentName.c
index 860e30b4da6b..abc5b7db16c2 100644
--- a/Silicon/Broadcom/Drivers/Net/BcmGenetDxe/ComponentName.c
+++ b/Silicon/Broadcom/Drivers/Net/BcmGenetDxe/ComponentName.c
@@ -2,6 +2,7 @@
   UEFI Component Name(2) protocol implementation for GENET UEFI driver.
 
   Copyright (c) 2020 Jared McNeill. All rights reserved.
+  Copyright (c) 2020, ARM Limited. All rights reserved.
 
   SPDX-License-Identifier: BSD-2-Clause-Patent
 **/
@@ -169,6 +170,27 @@ GenetComponentNameGetControllerName (
   OUT CHAR16                                          **ControllerName
   )
 {
+  EFI_STATUS  Status;
+
+  //
+  // This is a device driver, so ChildHandle must be NULL.
+  //
+  if (ChildHandle != NULL) {
+    return EFI_UNSUPPORTED;
+  }
+
+  //
+  // Make sure this driver is currently managing ControllHandle
+  //
+  Status = EfiTestManagedDevice (
+             ControllerHandle,
+             mGenetDriverBinding.DriverBindingHandle,
+             &gEfiSimpleNetworkProtocolGuid
+             );
+  if (EFI_ERROR (Status)) {
+    return Status;
+  }
+
   if (ChildHandle != NULL) {
     return EFI_UNSUPPORTED;
   }
diff --git a/Silicon/Broadcom/Drivers/Net/BcmGenetDxe/DriverBinding.c b/Silicon/Broadcom/Drivers/Net/BcmGenetDxe/DriverBinding.c
index f9aa006dc799..435ef493564c 100644
--- a/Silicon/Broadcom/Drivers/Net/BcmGenetDxe/DriverBinding.c
+++ b/Silicon/Broadcom/Drivers/Net/BcmGenetDxe/DriverBinding.c
@@ -302,7 +302,7 @@ GenetDriverBindingStop (
   return EFI_SUCCESS;
 }
 
-STATIC EFI_DRIVER_BINDING_PROTOCOL mGenetDriverBinding = {
+EFI_DRIVER_BINDING_PROTOCOL mGenetDriverBinding = {
   GenetDriverBindingSupported,
   GenetDriverBindingStart,
   GenetDriverBindingStop,
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 9+ messages in thread

* Re: [edk2-platform][PATCH v1 1/3] Platforms/RaspberryPi: Fix DisplayDxe ComponentName2 error checking
  2020-08-15 20:26 ` [edk2-platform][PATCH v1 1/3] Platforms/RaspberryPi: Fix DisplayDxe ComponentName2 error checking Samer El-Haj-Mahmoud
@ 2020-08-17 11:17   ` Pete Batard
  2020-08-17 13:54   ` Ard Biesheuvel
  1 sibling, 0 replies; 9+ messages in thread
From: Pete Batard @ 2020-08-17 11:17 UTC (permalink / raw)
  To: Samer El-Haj-Mahmoud, devel
  Cc: Leif Lindholm, Andrei Warkentin, Ard Biesheuvel

One typo:

On 2020.08.15 21:26, Samer El-Haj-Mahmoud wrote:
> Fix input param error checking for the DisplayDxe ComponentName2
> protocol.
> 
> This fixes https://github.com/pftf/RPi4/issues/84
> 
> Cc: Leif Lindholm <leif@nuviainc.com>
> Cc: Pete Batard <pete@akeo.ie>
> Cc: Andrei Warkentin <awarkentin@vmware.com>
> Cc: Ard Biesheuvel <ard.biesheuvel@arm.com>
> Signed-off-by: Samer El-Haj-Mahmoud <samer.el-haj-mahmoud@arm.com>
> ---
>   Platform/RaspberryPi/Drivers/DisplayDxe/DisplayDxe.h    |  2 ++
>   Platform/RaspberryPi/Drivers/DisplayDxe/ComponentName.c | 22 ++++++++++++++++++++
>   2 files changed, 24 insertions(+)
> 
> diff --git a/Platform/RaspberryPi/Drivers/DisplayDxe/DisplayDxe.h b/Platform/RaspberryPi/Drivers/DisplayDxe/DisplayDxe.h
> index bfbe9e868843..073f65111645 100644
> --- a/Platform/RaspberryPi/Drivers/DisplayDxe/DisplayDxe.h
> +++ b/Platform/RaspberryPi/Drivers/DisplayDxe/DisplayDxe.h
> @@ -1,5 +1,6 @@
>   /** @file
>    *
> + *  Copyright (c) 2020, ARM Limited. All rights reserved.
>    *  Copyright (c) 2017-2018, Andrei Warkentin <andrey.warkentin@gmail.com>
>    *  Copyright (c) Microsoft Corporation. All rights reserved.
>    *
> @@ -27,6 +28,7 @@
>   extern EFI_GRAPHICS_OUTPUT_PROTOCOL gDisplayProto;
>   extern EFI_COMPONENT_NAME_PROTOCOL  gComponentName;
>   extern EFI_COMPONENT_NAME2_PROTOCOL gComponentName2;
> +extern EFI_DRIVER_BINDING_PROTOCOL  mDriverBinding;
>   
>   VOID
>   RegisterScreenshotHandlers (
> diff --git a/Platform/RaspberryPi/Drivers/DisplayDxe/ComponentName.c b/Platform/RaspberryPi/Drivers/DisplayDxe/ComponentName.c
> index 092230cd7c9b..4c065b5d51bf 100644
> --- a/Platform/RaspberryPi/Drivers/DisplayDxe/ComponentName.c
> +++ b/Platform/RaspberryPi/Drivers/DisplayDxe/ComponentName.c
> @@ -1,5 +1,6 @@
>   /** @file
>    *
> + *  Copyright (c) 2020, ARM Limited. All rights reserved.
>    *  Copyright (c) 2018, Andrei Warkentin <andrey.warkentin@gmail.com>
>    *  Copyright (c) 2006-2016, Intel Corporation. All rights reserved.
>    *
> @@ -206,6 +207,27 @@ ComponentNameGetControllerName (
>     OUT CHAR16                      **ControllerName
>     )
>   {
> +  EFI_STATUS  Status;
> +
> +  //
> +  // This is a device driver, so ChildHandle must be NULL.
> +  //
> +  if (ChildHandle != NULL) {
> +    return EFI_UNSUPPORTED;
> +  }
> +
> +  //
> +  // Make sure this driver is currently managing ControllHandle

Shouldn't it be 'ControllerHandle' rather than 'ControllHandle'?

> +  //
> +  Status = EfiTestManagedDevice (
> +             ControllerHandle,
> +             mDriverBinding.DriverBindingHandle,
> +             &gEfiGraphicsOutputProtocolGuid
> +             );
> +  if (EFI_ERROR (Status)) {
> +    return Status;
> +  }
> +
>     return LookupUnicodeString2 (
>              Language,
>              This->SupportedLanguages,
> 

Reviewed-by: Pete Batard <pete@akeo.ie>

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [edk2-platform][PATCH v1 2/3] Platforms/RaspberryPi: Fix DwUsbHostDxe ComponentName2 error checking
  2020-08-15 20:26 ` [edk2-platform][PATCH v1 2/3] Platforms/RaspberryPi: Fix DwUsbHostDxe " Samer El-Haj-Mahmoud
@ 2020-08-17 11:17   ` Pete Batard
  0 siblings, 0 replies; 9+ messages in thread
From: Pete Batard @ 2020-08-17 11:17 UTC (permalink / raw)
  To: Samer El-Haj-Mahmoud, devel
  Cc: Leif Lindholm, Andrei Warkentin, Ard Biesheuvel

Same typo as previous patch:

On 2020.08.15 21:26, Samer El-Haj-Mahmoud wrote:
> Fix input param error checking for the DwUsbHostDxe ComponentName2
> protocol.
> 
> This fixes https://github.com/pftf/RPi4/issues/86
> 
> Cc: Leif Lindholm <leif@nuviainc.com>
> Cc: Pete Batard <pete@akeo.ie>
> Cc: Andrei Warkentin <awarkentin@vmware.com>
> Cc: Ard Biesheuvel <ard.biesheuvel@arm.com>
> Signed-off-by: Samer El-Haj-Mahmoud <samer.el-haj-mahmoud@arm.com>
> ---
>   Platform/RaspberryPi/Drivers/DwUsbHostDxe/DwUsbHostDxe.h  |  4 +++-
>   Platform/RaspberryPi/Drivers/DwUsbHostDxe/ComponentName.c | 18 ++++++++++++++++++
>   Platform/RaspberryPi/Drivers/DwUsbHostDxe/DriverBinding.c |  2 +-
>   3 files changed, 22 insertions(+), 2 deletions(-)
> 
> diff --git a/Platform/RaspberryPi/Drivers/DwUsbHostDxe/DwUsbHostDxe.h b/Platform/RaspberryPi/Drivers/DwUsbHostDxe/DwUsbHostDxe.h
> index 106e5425355e..cf6c81b64ab5 100644
> --- a/Platform/RaspberryPi/Drivers/DwUsbHostDxe/DwUsbHostDxe.h
> +++ b/Platform/RaspberryPi/Drivers/DwUsbHostDxe/DwUsbHostDxe.h
> @@ -1,5 +1,6 @@
>   /** @file
>    *
> + *  Copyright (c) 2020, ARM Limited. All rights reserved.
>    *  Copyright (c) 2017-2018, Andrey Warkentin <andrey.warkentin@gmail.com>
>    *  Copyright (c) 2015-2016, Linaro Limited. All rights reserved.
>    *
> @@ -121,8 +122,9 @@ typedef struct _DWUSB_OTGHC_DEV {
>     UINT16                          LastMicroFrame;
>   } DWUSB_OTGHC_DEV;
>   
> -extern EFI_COMPONENT_NAME_PROTOCOL gComponentName;
> +extern EFI_COMPONENT_NAME_PROTOCOL  gComponentName;
>   extern EFI_COMPONENT_NAME2_PROTOCOL gComponentName2;
> +extern EFI_DRIVER_BINDING_PROTOCOL  mDriverBinding;
>   
>   EFI_STATUS
>   CreateDwUsbHc (
> diff --git a/Platform/RaspberryPi/Drivers/DwUsbHostDxe/ComponentName.c b/Platform/RaspberryPi/Drivers/DwUsbHostDxe/ComponentName.c
> index 2f3c53323bf1..8639ab7d39c5 100644
> --- a/Platform/RaspberryPi/Drivers/DwUsbHostDxe/ComponentName.c
> +++ b/Platform/RaspberryPi/Drivers/DwUsbHostDxe/ComponentName.c
> @@ -1,5 +1,6 @@
>   /** @file
>    *
> + *  Copyright (c) 2020, ARM Limited. All rights reserved.
>    *  Copyright (c) 2018, Andrey Warkentin <andrey.warkentin@gmail.com>
>    *
>    *  SPDX-License-Identifier: BSD-2-Clause-Patent
> @@ -205,10 +206,27 @@ ComponentNameGetControllerName (
>     OUT CHAR16                      **ControllerName
>     )
>   {
> +  EFI_STATUS  Status;
> +
> +  //
> +  // This is a device driver, so ChildHandle must be NULL.
> +  //
>     if (ChildHandle != NULL) {
>       return EFI_UNSUPPORTED;
>     }
>   
> +  //
> +  // Make sure this driver is currently managing ControllHandle

Shouldn't it be 'ControllerHandle' rather than 'ControllHandle'?

> +  //
> +  Status = EfiTestManagedDevice (
> +             ControllerHandle,
> +             mDriverBinding.DriverBindingHandle,
> +             &gEfiUsb2HcProtocolGuid
> +             );
> +  if (EFI_ERROR (Status)) {
> +    return Status;
> +  }
> +
>     return LookupUnicodeString2 (
>              Language,
>              This->SupportedLanguages,
> diff --git a/Platform/RaspberryPi/Drivers/DwUsbHostDxe/DriverBinding.c b/Platform/RaspberryPi/Drivers/DwUsbHostDxe/DriverBinding.c
> index 7f78179d4c06..bada13a6cd7c 100644
> --- a/Platform/RaspberryPi/Drivers/DwUsbHostDxe/DriverBinding.c
> +++ b/Platform/RaspberryPi/Drivers/DwUsbHostDxe/DriverBinding.c
> @@ -36,7 +36,7 @@ DriverStop (
>     IN  EFI_HANDLE                  *ChildHandleBuffer
>     );
>   
> -STATIC EFI_DRIVER_BINDING_PROTOCOL mDriverBinding = {
> +EFI_DRIVER_BINDING_PROTOCOL mDriverBinding = {
>     DriverSupported,
>     DriverStart,
>     DriverStop,
> 

Reviewed-by: Pete Batard <pete@akeo.ie>

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [edk2-platform][PATCH v1 3/3] Platforms/RaspberryPi: Fix BcmGenetDxe ComponentName2 error checking
  2020-08-15 20:26 ` [edk2-platform][PATCH v1 3/3] Platforms/RaspberryPi: Fix BcmGenetDxe " Samer El-Haj-Mahmoud
@ 2020-08-17 11:17   ` Pete Batard
  0 siblings, 0 replies; 9+ messages in thread
From: Pete Batard @ 2020-08-17 11:17 UTC (permalink / raw)
  To: Samer El-Haj-Mahmoud, devel
  Cc: Leif Lindholm, Andrei Warkentin, Ard Biesheuvel

Same typo as previous patch:

On 2020.08.15 21:26, Samer El-Haj-Mahmoud wrote:
> Fix input param error checking for the BcmGenetDxe ComponentName2
> protocol.
> 
> This fixes https://github.com/pftf/RPi4/issues/85
> 
> Cc: Leif Lindholm <leif@nuviainc.com>
> Cc: Pete Batard <pete@akeo.ie>
> Cc: Andrei Warkentin <awarkentin@vmware.com>
> Cc: Ard Biesheuvel <ard.biesheuvel@arm.com>
> Signed-off-by: Samer El-Haj-Mahmoud <samer.el-haj-mahmoud@arm.com>
> ---
>   Silicon/Broadcom/Drivers/Net/BcmGenetDxe/BcmGenetDxe.h   |  1 +
>   Silicon/Broadcom/Drivers/Net/BcmGenetDxe/ComponentName.c | 22 ++++++++++++++++++++
>   Silicon/Broadcom/Drivers/Net/BcmGenetDxe/DriverBinding.c |  2 +-
>   3 files changed, 24 insertions(+), 1 deletion(-)
> 
> diff --git a/Silicon/Broadcom/Drivers/Net/BcmGenetDxe/BcmGenetDxe.h b/Silicon/Broadcom/Drivers/Net/BcmGenetDxe/BcmGenetDxe.h
> index b39a1326335a..26016330fb3b 100644
> --- a/Silicon/Broadcom/Drivers/Net/BcmGenetDxe/BcmGenetDxe.h
> +++ b/Silicon/Broadcom/Drivers/Net/BcmGenetDxe/BcmGenetDxe.h
> @@ -235,6 +235,7 @@ typedef struct {
>   
>   extern EFI_COMPONENT_NAME_PROTOCOL            gGenetComponentName;
>   extern EFI_COMPONENT_NAME2_PROTOCOL           gGenetComponentName2;
> +extern EFI_DRIVER_BINDING_PROTOCOL            mGenetDriverBinding;
>   
>   extern CONST EFI_SIMPLE_NETWORK_PROTOCOL      gGenetSimpleNetworkTemplate;
>   extern CONST EFI_ADAPTER_INFORMATION_PROTOCOL gGenetAdapterInfoTemplate;
> diff --git a/Silicon/Broadcom/Drivers/Net/BcmGenetDxe/ComponentName.c b/Silicon/Broadcom/Drivers/Net/BcmGenetDxe/ComponentName.c
> index 860e30b4da6b..abc5b7db16c2 100644
> --- a/Silicon/Broadcom/Drivers/Net/BcmGenetDxe/ComponentName.c
> +++ b/Silicon/Broadcom/Drivers/Net/BcmGenetDxe/ComponentName.c
> @@ -2,6 +2,7 @@
>     UEFI Component Name(2) protocol implementation for GENET UEFI driver.
>   
>     Copyright (c) 2020 Jared McNeill. All rights reserved.
> +  Copyright (c) 2020, ARM Limited. All rights reserved.
>   
>     SPDX-License-Identifier: BSD-2-Clause-Patent
>   **/
> @@ -169,6 +170,27 @@ GenetComponentNameGetControllerName (
>     OUT CHAR16                                          **ControllerName
>     )
>   {
> +  EFI_STATUS  Status;
> +
> +  //
> +  // This is a device driver, so ChildHandle must be NULL.
> +  //
> +  if (ChildHandle != NULL) {
> +    return EFI_UNSUPPORTED;
> +  }
> +
> +  //
> +  // Make sure this driver is currently managing ControllHandle

Shouldn't it be 'ControllerHandle' rather than 'ControllHandle'?

> +  //
> +  Status = EfiTestManagedDevice (
> +             ControllerHandle,
> +             mGenetDriverBinding.DriverBindingHandle,
> +             &gEfiSimpleNetworkProtocolGuid
> +             );
> +  if (EFI_ERROR (Status)) {
> +    return Status;
> +  }
> +
>     if (ChildHandle != NULL) {
>       return EFI_UNSUPPORTED;
>     }
> diff --git a/Silicon/Broadcom/Drivers/Net/BcmGenetDxe/DriverBinding.c b/Silicon/Broadcom/Drivers/Net/BcmGenetDxe/DriverBinding.c
> index f9aa006dc799..435ef493564c 100644
> --- a/Silicon/Broadcom/Drivers/Net/BcmGenetDxe/DriverBinding.c
> +++ b/Silicon/Broadcom/Drivers/Net/BcmGenetDxe/DriverBinding.c
> @@ -302,7 +302,7 @@ GenetDriverBindingStop (
>     return EFI_SUCCESS;
>   }
>   
> -STATIC EFI_DRIVER_BINDING_PROTOCOL mGenetDriverBinding = {
> +EFI_DRIVER_BINDING_PROTOCOL mGenetDriverBinding = {
>     GenetDriverBindingSupported,
>     GenetDriverBindingStart,
>     GenetDriverBindingStop,
> 

Reviewed-by: Pete Batard <pete@akeo.ie>

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [edk2-platform][PATCH v1 1/3] Platforms/RaspberryPi: Fix DisplayDxe ComponentName2 error checking
  2020-08-15 20:26 ` [edk2-platform][PATCH v1 1/3] Platforms/RaspberryPi: Fix DisplayDxe ComponentName2 error checking Samer El-Haj-Mahmoud
  2020-08-17 11:17   ` Pete Batard
@ 2020-08-17 13:54   ` Ard Biesheuvel
  2020-08-17 13:58     ` [edk2-devel] " Samer El-Haj-Mahmoud
  1 sibling, 1 reply; 9+ messages in thread
From: Ard Biesheuvel @ 2020-08-17 13:54 UTC (permalink / raw)
  To: Samer El-Haj-Mahmoud, devel; +Cc: Leif Lindholm, Pete Batard, Andrei Warkentin

On 8/15/20 10:26 PM, Samer El-Haj-Mahmoud wrote:
> Fix input param error checking for the DisplayDxe ComponentName2
> protocol.
> 
> This fixes https://github.com/pftf/RPi4/issues/84
> 
> Cc: Leif Lindholm <leif@nuviainc.com>
> Cc: Pete Batard <pete@akeo.ie>
> Cc: Andrei Warkentin <awarkentin@vmware.com>
> Cc: Ard Biesheuvel <ard.biesheuvel@arm.com>
> Signed-off-by: Samer El-Haj-Mahmoud <samer.el-haj-mahmoud@arm.com>
> ---
>   Platform/RaspberryPi/Drivers/DisplayDxe/DisplayDxe.h    |  2 ++
>   Platform/RaspberryPi/Drivers/DisplayDxe/ComponentName.c | 22 ++++++++++++++++++++
>   2 files changed, 24 insertions(+)
> 

Please use a cover letter for multipatch series.

Series pushed as c475b1bbda25..69009e5b91a7 (with Pete's comments addressed)

Thanks,

> diff --git a/Platform/RaspberryPi/Drivers/DisplayDxe/DisplayDxe.h b/Platform/RaspberryPi/Drivers/DisplayDxe/DisplayDxe.h
> index bfbe9e868843..073f65111645 100644
> --- a/Platform/RaspberryPi/Drivers/DisplayDxe/DisplayDxe.h
> +++ b/Platform/RaspberryPi/Drivers/DisplayDxe/DisplayDxe.h
> @@ -1,5 +1,6 @@
>   /** @file
>    *
> + *  Copyright (c) 2020, ARM Limited. All rights reserved.
>    *  Copyright (c) 2017-2018, Andrei Warkentin <andrey.warkentin@gmail.com>
>    *  Copyright (c) Microsoft Corporation. All rights reserved.
>    *
> @@ -27,6 +28,7 @@
>   extern EFI_GRAPHICS_OUTPUT_PROTOCOL gDisplayProto;
>   extern EFI_COMPONENT_NAME_PROTOCOL  gComponentName;
>   extern EFI_COMPONENT_NAME2_PROTOCOL gComponentName2;
> +extern EFI_DRIVER_BINDING_PROTOCOL  mDriverBinding;
>   
>   VOID
>   RegisterScreenshotHandlers (
> diff --git a/Platform/RaspberryPi/Drivers/DisplayDxe/ComponentName.c b/Platform/RaspberryPi/Drivers/DisplayDxe/ComponentName.c
> index 092230cd7c9b..4c065b5d51bf 100644
> --- a/Platform/RaspberryPi/Drivers/DisplayDxe/ComponentName.c
> +++ b/Platform/RaspberryPi/Drivers/DisplayDxe/ComponentName.c
> @@ -1,5 +1,6 @@
>   /** @file
>    *
> + *  Copyright (c) 2020, ARM Limited. All rights reserved.
>    *  Copyright (c) 2018, Andrei Warkentin <andrey.warkentin@gmail.com>
>    *  Copyright (c) 2006-2016, Intel Corporation. All rights reserved.
>    *
> @@ -206,6 +207,27 @@ ComponentNameGetControllerName (
>     OUT CHAR16                      **ControllerName
>     )
>   {
> +  EFI_STATUS  Status;
> +
> +  //
> +  // This is a device driver, so ChildHandle must be NULL.
> +  //
> +  if (ChildHandle != NULL) {
> +    return EFI_UNSUPPORTED;
> +  }
> +
> +  //
> +  // Make sure this driver is currently managing ControllHandle
> +  //
> +  Status = EfiTestManagedDevice (
> +             ControllerHandle,
> +             mDriverBinding.DriverBindingHandle,
> +             &gEfiGraphicsOutputProtocolGuid
> +             );
> +  if (EFI_ERROR (Status)) {
> +    return Status;
> +  }
> +
>     return LookupUnicodeString2 (
>              Language,
>              This->SupportedLanguages,
> 


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [edk2-devel] [edk2-platform][PATCH v1 1/3] Platforms/RaspberryPi: Fix DisplayDxe ComponentName2 error checking
  2020-08-17 13:54   ` Ard Biesheuvel
@ 2020-08-17 13:58     ` Samer El-Haj-Mahmoud
  0 siblings, 0 replies; 9+ messages in thread
From: Samer El-Haj-Mahmoud @ 2020-08-17 13:58 UTC (permalink / raw)
  To: devel@edk2.groups.io, Ard Biesheuvel
  Cc: Leif Lindholm, Pete Batard,
	Andrei Warkentin (awarkentin@vmware.com)

Thanks Ard and Pete.

I did use the cover letter, but forgot to add the CC https://edk2.groups.io/g/devel/message/64301

> -----Original Message-----
> From: devel@edk2.groups.io <devel@edk2.groups.io> On Behalf Of Ard
> Biesheuvel via groups.io
> Sent: Monday, August 17, 2020 9:55 AM
> To: Samer El-Haj-Mahmoud <Samer.El-Haj-Mahmoud@arm.com>;
> devel@edk2.groups.io
> Cc: Leif Lindholm <leif@nuviainc.com>; Pete Batard <pete@akeo.ie>; Andrei
> Warkentin (awarkentin@vmware.com) <awarkentin@vmware.com>
> Subject: Re: [edk2-devel] [edk2-platform][PATCH v1 1/3]
> Platforms/RaspberryPi: Fix DisplayDxe ComponentName2 error checking
>
> On 8/15/20 10:26 PM, Samer El-Haj-Mahmoud wrote:
> > Fix input param error checking for the DisplayDxe ComponentName2
> > protocol.
> >
> > This fixes https://github.com/pftf/RPi4/issues/84
> >
> > Cc: Leif Lindholm <leif@nuviainc.com>
> > Cc: Pete Batard <pete@akeo.ie>
> > Cc: Andrei Warkentin <awarkentin@vmware.com>
> > Cc: Ard Biesheuvel <ard.biesheuvel@arm.com>
> > Signed-off-by: Samer El-Haj-Mahmoud <samer.el-haj-mahmoud@arm.com>
> > ---
> >   Platform/RaspberryPi/Drivers/DisplayDxe/DisplayDxe.h    |  2 ++
> >   Platform/RaspberryPi/Drivers/DisplayDxe/ComponentName.c | 22
> ++++++++++++++++++++
> >   2 files changed, 24 insertions(+)
> >
>
> Please use a cover letter for multipatch series.
>
> Series pushed as c475b1bbda25..69009e5b91a7 (with Pete's comments
> addressed)
>
> Thanks,
>
> > diff --git a/Platform/RaspberryPi/Drivers/DisplayDxe/DisplayDxe.h
> > b/Platform/RaspberryPi/Drivers/DisplayDxe/DisplayDxe.h
> > index bfbe9e868843..073f65111645 100644
> > --- a/Platform/RaspberryPi/Drivers/DisplayDxe/DisplayDxe.h
> > +++ b/Platform/RaspberryPi/Drivers/DisplayDxe/DisplayDxe.h
> > @@ -1,5 +1,6 @@
> >   /** @file
> >    *
> > + *  Copyright (c) 2020, ARM Limited. All rights reserved.
> >    *  Copyright (c) 2017-2018, Andrei Warkentin
> <andrey.warkentin@gmail.com>
> >    *  Copyright (c) Microsoft Corporation. All rights reserved.
> >    *
> > @@ -27,6 +28,7 @@
> >   extern EFI_GRAPHICS_OUTPUT_PROTOCOL gDisplayProto;
> >   extern EFI_COMPONENT_NAME_PROTOCOL  gComponentName;
> >   extern EFI_COMPONENT_NAME2_PROTOCOL gComponentName2;
> > +extern EFI_DRIVER_BINDING_PROTOCOL  mDriverBinding;
> >
> >   VOID
> >   RegisterScreenshotHandlers (
> > diff --git a/Platform/RaspberryPi/Drivers/DisplayDxe/ComponentName.c
> > b/Platform/RaspberryPi/Drivers/DisplayDxe/ComponentName.c
> > index 092230cd7c9b..4c065b5d51bf 100644
> > --- a/Platform/RaspberryPi/Drivers/DisplayDxe/ComponentName.c
> > +++ b/Platform/RaspberryPi/Drivers/DisplayDxe/ComponentName.c
> > @@ -1,5 +1,6 @@
> >   /** @file
> >    *
> > + *  Copyright (c) 2020, ARM Limited. All rights reserved.
> >    *  Copyright (c) 2018, Andrei Warkentin <andrey.warkentin@gmail.com>
> >    *  Copyright (c) 2006-2016, Intel Corporation. All rights reserved.
> >    *
> > @@ -206,6 +207,27 @@ ComponentNameGetControllerName (
> >     OUT CHAR16                      **ControllerName
> >     )
> >   {
> > +  EFI_STATUS  Status;
> > +
> > +  //
> > +  // This is a device driver, so ChildHandle must be NULL.
> > +  //
> > +  if (ChildHandle != NULL) {
> > +    return EFI_UNSUPPORTED;
> > +  }
> > +
> > +  //
> > +  // Make sure this driver is currently managing ControllHandle  //
> > + Status = EfiTestManagedDevice (
> > +             ControllerHandle,
> > +             mDriverBinding.DriverBindingHandle,
> > +             &gEfiGraphicsOutputProtocolGuid
> > +             );
> > +  if (EFI_ERROR (Status)) {
> > +    return Status;
> > +  }
> > +
> >     return LookupUnicodeString2 (
> >              Language,
> >              This->SupportedLanguages,
> >
>
>
> 

IMPORTANT NOTICE: The contents of this email and any attachments are confidential and may also be privileged. If you are not the intended recipient, please notify the sender immediately and do not disclose the contents to any other person, use it for any purpose, or store or copy the information in any medium. Thank you.

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2020-08-17 13:59 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-08-15 20:26 [edk2-platform][PATCH v1 0/3] Platforms/RaspberryPi: Fix ComponentName2 SCT errors Samer El-Haj-Mahmoud
2020-08-15 20:26 ` [edk2-platform][PATCH v1 1/3] Platforms/RaspberryPi: Fix DisplayDxe ComponentName2 error checking Samer El-Haj-Mahmoud
2020-08-17 11:17   ` Pete Batard
2020-08-17 13:54   ` Ard Biesheuvel
2020-08-17 13:58     ` [edk2-devel] " Samer El-Haj-Mahmoud
2020-08-15 20:26 ` [edk2-platform][PATCH v1 2/3] Platforms/RaspberryPi: Fix DwUsbHostDxe " Samer El-Haj-Mahmoud
2020-08-17 11:17   ` Pete Batard
2020-08-15 20:26 ` [edk2-platform][PATCH v1 3/3] Platforms/RaspberryPi: Fix BcmGenetDxe " Samer El-Haj-Mahmoud
2020-08-17 11:17   ` Pete Batard

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox