All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] phy: meson-g12a-usb2: fix ret check on power_domain_get
@ 2023-10-17 18:57 Guillaume La Roque
  2023-10-18  6:57 ` Mattijs Korpershoek
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Guillaume La Roque @ 2023-10-17 18:57 UTC (permalink / raw)
  To: neil.armstrong; +Cc: u-boot-amlogic, u-boot, avromanov

Patch which add A1 SoC support create a regression on khadas vim3/vim3l
boards when we try to use fastboot command:

  => fastboot usb 0
  failed to get power domain
  failed to get power domain
  No USB device found
  USB init failed: -19

Add ENOENT check on ret in probe function.

Fixes: 5533c883ce10 ("phy: support Amlogic A1 family")

Signed-off-by: Guillaume La Roque <glaroque@baylibre.com>
---
 drivers/phy/meson-g12a-usb2.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/phy/meson-g12a-usb2.c b/drivers/phy/meson-g12a-usb2.c
index 4ba3992bda70..3958d2404b85 100644
--- a/drivers/phy/meson-g12a-usb2.c
+++ b/drivers/phy/meson-g12a-usb2.c
@@ -328,12 +328,12 @@ int meson_g12a_usb2_phy_probe(struct udevice *dev)
 
 #if CONFIG_IS_ENABLED(POWER_DOMAIN)
 	ret = power_domain_get(dev, &priv->pwrdm);
-	if (ret < 0 && ret != -ENODEV) {
-		pr_err("failed to get power domain\n");
+	if (ret < 0 && ret != -ENODEV && ret != -ENOENT) {
+		pr_err("failed to get power domain : %d\n", ret);
 		return ret;
 	}
 
-	if (ret != -ENODEV) {
+	if (ret != -ENODEV && ret != -ENOENT) {
 		ret = power_domain_on(&priv->pwrdm);
 		if (ret < 0) {
 			pr_err("failed to enable power domain\n");
-- 
2.34.1



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

* Re: [PATCH] phy: meson-g12a-usb2: fix ret check on power_domain_get
  2023-10-17 18:57 [PATCH] phy: meson-g12a-usb2: fix ret check on power_domain_get Guillaume La Roque
@ 2023-10-18  6:57 ` Mattijs Korpershoek
  2023-10-18  7:44 ` neil.armstrong
  2023-10-18  7:46 ` Neil Armstrong
  2 siblings, 0 replies; 4+ messages in thread
From: Mattijs Korpershoek @ 2023-10-18  6:57 UTC (permalink / raw)
  To: u-boot-amlogic, glaroque, neil.armstrong
  Cc: u-boot-amlogic, u-boot, avromanov

On mar., oct. 17, 2023 at 20:57, "Guillaume La Roque" <glaroque@baylibre.com> wrote:

> Patch which add A1 SoC support create a regression on khadas vim3/vim3l
> boards when we try to use fastboot command:
>
>   => fastboot usb 0
>   failed to get power domain
>   failed to get power domain
>   No USB device found
>   USB init failed: -19
>
> Add ENOENT check on ret in probe function.
>
> Fixes: 5533c883ce10 ("phy: support Amlogic A1 family")
>
> Signed-off-by: Guillaume La Roque <glaroque@baylibre.com>

Tested on vim3 with:

=> fastboot usb 0

Tested-by: Mattijs Korpershoek <mkorpershoek@baylibre.com> # on vim3

> ---
>  drivers/phy/meson-g12a-usb2.c | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/phy/meson-g12a-usb2.c b/drivers/phy/meson-g12a-usb2.c
> index 4ba3992bda70..3958d2404b85 100644
> --- a/drivers/phy/meson-g12a-usb2.c
> +++ b/drivers/phy/meson-g12a-usb2.c
> @@ -328,12 +328,12 @@ int meson_g12a_usb2_phy_probe(struct udevice *dev)
>  
>  #if CONFIG_IS_ENABLED(POWER_DOMAIN)
>  	ret = power_domain_get(dev, &priv->pwrdm);
> -	if (ret < 0 && ret != -ENODEV) {
> -		pr_err("failed to get power domain\n");
> +	if (ret < 0 && ret != -ENODEV && ret != -ENOENT) {
> +		pr_err("failed to get power domain : %d\n", ret);
>  		return ret;
>  	}
>  
> -	if (ret != -ENODEV) {
> +	if (ret != -ENODEV && ret != -ENOENT) {
>  		ret = power_domain_on(&priv->pwrdm);
>  		if (ret < 0) {
>  			pr_err("failed to enable power domain\n");
> -- 
> 2.34.1
>
>
>
> -=-=-=-=-=-=-=-=-=-=-=-
> Groups.io Links: You receive all messages sent to this group.
> View/Reply Online (#1773): https://groups.io/g/u-boot-amlogic/message/1773
> Mute This Topic: https://groups.io/mt/102024645/1991006
> Group Owner: u-boot-amlogic+owner@groups.io
> Unsubscribe: https://groups.io/g/u-boot-amlogic/unsub [mkorpershoek@baylibre.com]
> -=-=-=-=-=-=-=-=-=-=-=-


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

* Re: [PATCH] phy: meson-g12a-usb2: fix ret check on power_domain_get
  2023-10-17 18:57 [PATCH] phy: meson-g12a-usb2: fix ret check on power_domain_get Guillaume La Roque
  2023-10-18  6:57 ` Mattijs Korpershoek
@ 2023-10-18  7:44 ` neil.armstrong
  2023-10-18  7:46 ` Neil Armstrong
  2 siblings, 0 replies; 4+ messages in thread
From: neil.armstrong @ 2023-10-18  7:44 UTC (permalink / raw)
  To: Guillaume La Roque; +Cc: u-boot-amlogic, u-boot, avromanov

On 17/10/2023 20:57, Guillaume La Roque wrote:
> Patch which add A1 SoC support create a regression on khadas vim3/vim3l
> boards when we try to use fastboot command:
> 
>    => fastboot usb 0
>    failed to get power domain
>    failed to get power domain
>    No USB device found
>    USB init failed: -19
> 
> Add ENOENT check on ret in probe function.
> 
> Fixes: 5533c883ce10 ("phy: support Amlogic A1 family")
> 
> Signed-off-by: Guillaume La Roque <glaroque@baylibre.com>
> ---
>   drivers/phy/meson-g12a-usb2.c | 6 +++---
>   1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/phy/meson-g12a-usb2.c b/drivers/phy/meson-g12a-usb2.c
> index 4ba3992bda70..3958d2404b85 100644
> --- a/drivers/phy/meson-g12a-usb2.c
> +++ b/drivers/phy/meson-g12a-usb2.c
> @@ -328,12 +328,12 @@ int meson_g12a_usb2_phy_probe(struct udevice *dev)
>   
>   #if CONFIG_IS_ENABLED(POWER_DOMAIN)
>   	ret = power_domain_get(dev, &priv->pwrdm);
> -	if (ret < 0 && ret != -ENODEV) {
> -		pr_err("failed to get power domain\n");
> +	if (ret < 0 && ret != -ENODEV && ret != -ENOENT) {
> +		pr_err("failed to get power domain : %d\n", ret);
>   		return ret;
>   	}
>   
> -	if (ret != -ENODEV) {
> +	if (ret != -ENODEV && ret != -ENOENT) {
>   		ret = power_domain_on(&priv->pwrdm);
>   		if (ret < 0) {
>   			pr_err("failed to enable power domain\n");

Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org>


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

* Re: [PATCH] phy: meson-g12a-usb2: fix ret check on power_domain_get
  2023-10-17 18:57 [PATCH] phy: meson-g12a-usb2: fix ret check on power_domain_get Guillaume La Roque
  2023-10-18  6:57 ` Mattijs Korpershoek
  2023-10-18  7:44 ` neil.armstrong
@ 2023-10-18  7:46 ` Neil Armstrong
  2 siblings, 0 replies; 4+ messages in thread
From: Neil Armstrong @ 2023-10-18  7:46 UTC (permalink / raw)
  To: Guillaume La Roque; +Cc: u-boot-amlogic, u-boot, avromanov

Hi,

On Tue, 17 Oct 2023 20:57:25 +0200, Guillaume La Roque wrote:
> Patch which add A1 SoC support create a regression on khadas vim3/vim3l
> boards when we try to use fastboot command:
> 
>   => fastboot usb 0
>   failed to get power domain
>   failed to get power domain
>   No USB device found
>   USB init failed: -19
> 
> [...]

Thanks, Applied to https://source.denx.de/u-boot/custodians/u-boot-amlogic (u-boot-amlogic)

[1/1] phy: meson-g12a-usb2: fix ret check on power_domain_get
      https://source.denx.de/u-boot/custodians/u-boot-amlogic/-/commit/f699cb1dd5f4c55aa3f593c226ec797730d02f10

-- 
Neil



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

end of thread, other threads:[~2023-10-18  7:46 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-10-17 18:57 [PATCH] phy: meson-g12a-usb2: fix ret check on power_domain_get Guillaume La Roque
2023-10-18  6:57 ` Mattijs Korpershoek
2023-10-18  7:44 ` neil.armstrong
2023-10-18  7:46 ` Neil Armstrong

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.