All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] wdt: dw: Fix passing NULL pointer to reset functions
@ 2021-09-11 19:11 Sean Anderson
  2021-09-19 23:07 ` Sean Anderson
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Sean Anderson @ 2021-09-11 19:11 UTC (permalink / raw)
  To: Simon Glass, u-boot; +Cc: Stefan Roese, Leo Liang, Meng Li, Sean Anderson

reset_*_bulk expects a real pointer.

Fixes: 4f7abafe1c ("driver: watchdog: reset watchdog in designware_wdt_stop() function")
Signed-off-by: Sean Anderson <seanga2@gmail.com>
---

 drivers/watchdog/designware_wdt.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/watchdog/designware_wdt.c b/drivers/watchdog/designware_wdt.c
index afed81e6c6..cfec29bd15 100644
--- a/drivers/watchdog/designware_wdt.c
+++ b/drivers/watchdog/designware_wdt.c
@@ -22,7 +22,7 @@
 struct designware_wdt_priv {
 	void __iomem	*base;
 	unsigned int	clk_khz;
-	struct reset_ctl_bulk *resets;
+	struct reset_ctl_bulk resets;
 };
 
 /*
@@ -99,11 +99,11 @@ static int designware_wdt_stop(struct udevice *dev)
         if (CONFIG_IS_ENABLED(DM_RESET)) {
 		int ret;
 
-		ret = reset_assert_bulk(priv->resets);
+		ret = reset_assert_bulk(&priv->resets);
 		if (ret)
 			return ret;
 
-		ret = reset_deassert_bulk(priv->resets);
+		ret = reset_deassert_bulk(&priv->resets);
 		if (ret)
 			return ret;
 	}
@@ -156,11 +156,11 @@ static int designware_wdt_probe(struct udevice *dev)
 #endif
 
 	if (CONFIG_IS_ENABLED(DM_RESET)) {
-		ret = reset_get_bulk(dev, priv->resets);
+		ret = reset_get_bulk(dev, &priv->resets);
 		if (ret)
 			goto err;
 
-		ret = reset_deassert_bulk(priv->resets);
+		ret = reset_deassert_bulk(&priv->resets);
 		if (ret)
 			goto err;
 	}
-- 
2.33.0


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

* Re: [PATCH] wdt: dw: Fix passing NULL pointer to reset functions
  2021-09-11 19:11 [PATCH] wdt: dw: Fix passing NULL pointer to reset functions Sean Anderson
@ 2021-09-19 23:07 ` Sean Anderson
  2021-09-20  5:31   ` Stefan Roese
  2021-09-20  5:32 ` Stefan Roese
  2021-09-20  8:26 ` Stefan Roese
  2 siblings, 1 reply; 5+ messages in thread
From: Sean Anderson @ 2021-09-19 23:07 UTC (permalink / raw)
  To: Simon Glass, u-boot; +Cc: Stefan Roese, Leo Liang, Meng Li, Tom Rini

Is it possible to get this in 2020.10? Meng's patch breaks boards which use this watchdog.

--Sean

On 9/11/21 3:11 PM, Sean Anderson wrote:
> reset_*_bulk expects a real pointer.
> 
> Fixes: 4f7abafe1c ("driver: watchdog: reset watchdog in designware_wdt_stop() function")
> Signed-off-by: Sean Anderson <seanga2@gmail.com>
> ---
> 
>   drivers/watchdog/designware_wdt.c | 10 +++++-----
>   1 file changed, 5 insertions(+), 5 deletions(-)
> 
> diff --git a/drivers/watchdog/designware_wdt.c b/drivers/watchdog/designware_wdt.c
> index afed81e6c6..cfec29bd15 100644
> --- a/drivers/watchdog/designware_wdt.c
> +++ b/drivers/watchdog/designware_wdt.c
> @@ -22,7 +22,7 @@
>   struct designware_wdt_priv {
>   	void __iomem	*base;
>   	unsigned int	clk_khz;
> -	struct reset_ctl_bulk *resets;
> +	struct reset_ctl_bulk resets;
>   };
>   
>   /*
> @@ -99,11 +99,11 @@ static int designware_wdt_stop(struct udevice *dev)
>           if (CONFIG_IS_ENABLED(DM_RESET)) {
>   		int ret;
>   
> -		ret = reset_assert_bulk(priv->resets);
> +		ret = reset_assert_bulk(&priv->resets);
>   		if (ret)
>   			return ret;
>   
> -		ret = reset_deassert_bulk(priv->resets);
> +		ret = reset_deassert_bulk(&priv->resets);
>   		if (ret)
>   			return ret;
>   	}
> @@ -156,11 +156,11 @@ static int designware_wdt_probe(struct udevice *dev)
>   #endif
>   
>   	if (CONFIG_IS_ENABLED(DM_RESET)) {
> -		ret = reset_get_bulk(dev, priv->resets);
> +		ret = reset_get_bulk(dev, &priv->resets);
>   		if (ret)
>   			goto err;
>   
> -		ret = reset_deassert_bulk(priv->resets);
> +		ret = reset_deassert_bulk(&priv->resets);
>   		if (ret)
>   			goto err;
>   	}
> 

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

* Re: [PATCH] wdt: dw: Fix passing NULL pointer to reset functions
  2021-09-19 23:07 ` Sean Anderson
@ 2021-09-20  5:31   ` Stefan Roese
  0 siblings, 0 replies; 5+ messages in thread
From: Stefan Roese @ 2021-09-20  5:31 UTC (permalink / raw)
  To: Sean Anderson, Simon Glass, u-boot; +Cc: Leo Liang, Meng Li, Tom Rini

On 20.09.21 01:07, Sean Anderson wrote:
> Is it possible to get this in 2020.10?

Let me check, if I can find my time machine somewhere. ;)

But yes, v2021.10 should be possible. I'm just back from vacation and
will look into the new patches very soon.

Thanks,
Stefan

> Meng's patch breaks boards which 
> use this watchdog.
> 
> --Sean
> 
> On 9/11/21 3:11 PM, Sean Anderson wrote:
>> reset_*_bulk expects a real pointer.
>>
>> Fixes: 4f7abafe1c ("driver: watchdog: reset watchdog in 
>> designware_wdt_stop() function")
>> Signed-off-by: Sean Anderson <seanga2@gmail.com>
>> ---
>>
>>   drivers/watchdog/designware_wdt.c | 10 +++++-----
>>   1 file changed, 5 insertions(+), 5 deletions(-)
>>
>> diff --git a/drivers/watchdog/designware_wdt.c 
>> b/drivers/watchdog/designware_wdt.c
>> index afed81e6c6..cfec29bd15 100644
>> --- a/drivers/watchdog/designware_wdt.c
>> +++ b/drivers/watchdog/designware_wdt.c
>> @@ -22,7 +22,7 @@
>>   struct designware_wdt_priv {
>>       void __iomem    *base;
>>       unsigned int    clk_khz;
>> -    struct reset_ctl_bulk *resets;
>> +    struct reset_ctl_bulk resets;
>>   };
>>   /*
>> @@ -99,11 +99,11 @@ static int designware_wdt_stop(struct udevice *dev)
>>           if (CONFIG_IS_ENABLED(DM_RESET)) {
>>           int ret;
>> -        ret = reset_assert_bulk(priv->resets);
>> +        ret = reset_assert_bulk(&priv->resets);
>>           if (ret)
>>               return ret;
>> -        ret = reset_deassert_bulk(priv->resets);
>> +        ret = reset_deassert_bulk(&priv->resets);
>>           if (ret)
>>               return ret;
>>       }
>> @@ -156,11 +156,11 @@ static int designware_wdt_probe(struct udevice 
>> *dev)
>>   #endif
>>       if (CONFIG_IS_ENABLED(DM_RESET)) {
>> -        ret = reset_get_bulk(dev, priv->resets);
>> +        ret = reset_get_bulk(dev, &priv->resets);
>>           if (ret)
>>               goto err;
>> -        ret = reset_deassert_bulk(priv->resets);
>> +        ret = reset_deassert_bulk(&priv->resets);
>>           if (ret)
>>               goto err;
>>       }
>>


Viele Grüße,
Stefan

-- 
DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-51 Fax: (+49)-8142-66989-80 Email: sr@denx.de

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

* Re: [PATCH] wdt: dw: Fix passing NULL pointer to reset functions
  2021-09-11 19:11 [PATCH] wdt: dw: Fix passing NULL pointer to reset functions Sean Anderson
  2021-09-19 23:07 ` Sean Anderson
@ 2021-09-20  5:32 ` Stefan Roese
  2021-09-20  8:26 ` Stefan Roese
  2 siblings, 0 replies; 5+ messages in thread
From: Stefan Roese @ 2021-09-20  5:32 UTC (permalink / raw)
  To: Sean Anderson, Simon Glass, u-boot; +Cc: Leo Liang, Meng Li

On 11.09.21 21:11, Sean Anderson wrote:
> reset_*_bulk expects a real pointer.
> 
> Fixes: 4f7abafe1c ("driver: watchdog: reset watchdog in designware_wdt_stop() function")
> Signed-off-by: Sean Anderson <seanga2@gmail.com>

Reviewed-by: Stefan Roese <sr@denx.de>

Thanks,
Stefan

> ---
> 
>   drivers/watchdog/designware_wdt.c | 10 +++++-----
>   1 file changed, 5 insertions(+), 5 deletions(-)
> 
> diff --git a/drivers/watchdog/designware_wdt.c b/drivers/watchdog/designware_wdt.c
> index afed81e6c6..cfec29bd15 100644
> --- a/drivers/watchdog/designware_wdt.c
> +++ b/drivers/watchdog/designware_wdt.c
> @@ -22,7 +22,7 @@
>   struct designware_wdt_priv {
>   	void __iomem	*base;
>   	unsigned int	clk_khz;
> -	struct reset_ctl_bulk *resets;
> +	struct reset_ctl_bulk resets;
>   };
>   
>   /*
> @@ -99,11 +99,11 @@ static int designware_wdt_stop(struct udevice *dev)
>           if (CONFIG_IS_ENABLED(DM_RESET)) {
>   		int ret;
>   
> -		ret = reset_assert_bulk(priv->resets);
> +		ret = reset_assert_bulk(&priv->resets);
>   		if (ret)
>   			return ret;
>   
> -		ret = reset_deassert_bulk(priv->resets);
> +		ret = reset_deassert_bulk(&priv->resets);
>   		if (ret)
>   			return ret;
>   	}
> @@ -156,11 +156,11 @@ static int designware_wdt_probe(struct udevice *dev)
>   #endif
>   
>   	if (CONFIG_IS_ENABLED(DM_RESET)) {
> -		ret = reset_get_bulk(dev, priv->resets);
> +		ret = reset_get_bulk(dev, &priv->resets);
>   		if (ret)
>   			goto err;
>   
> -		ret = reset_deassert_bulk(priv->resets);
> +		ret = reset_deassert_bulk(&priv->resets);
>   		if (ret)
>   			goto err;
>   	}
> 


Viele Grüße,
Stefan

-- 
DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-51 Fax: (+49)-8142-66989-80 Email: sr@denx.de

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

* Re: [PATCH] wdt: dw: Fix passing NULL pointer to reset functions
  2021-09-11 19:11 [PATCH] wdt: dw: Fix passing NULL pointer to reset functions Sean Anderson
  2021-09-19 23:07 ` Sean Anderson
  2021-09-20  5:32 ` Stefan Roese
@ 2021-09-20  8:26 ` Stefan Roese
  2 siblings, 0 replies; 5+ messages in thread
From: Stefan Roese @ 2021-09-20  8:26 UTC (permalink / raw)
  To: Sean Anderson, Simon Glass, u-boot; +Cc: Leo Liang, Meng Li

On 11.09.21 21:11, Sean Anderson wrote:
> reset_*_bulk expects a real pointer.
> 
> Fixes: 4f7abafe1c ("driver: watchdog: reset watchdog in designware_wdt_stop() function")
> Signed-off-by: Sean Anderson <seanga2@gmail.com>

Applied to u-boot-marvell/master

Thanks,
Stefan

> ---
> 
>   drivers/watchdog/designware_wdt.c | 10 +++++-----
>   1 file changed, 5 insertions(+), 5 deletions(-)
> 
> diff --git a/drivers/watchdog/designware_wdt.c b/drivers/watchdog/designware_wdt.c
> index afed81e6c6..cfec29bd15 100644
> --- a/drivers/watchdog/designware_wdt.c
> +++ b/drivers/watchdog/designware_wdt.c
> @@ -22,7 +22,7 @@
>   struct designware_wdt_priv {
>   	void __iomem	*base;
>   	unsigned int	clk_khz;
> -	struct reset_ctl_bulk *resets;
> +	struct reset_ctl_bulk resets;
>   };
>   
>   /*
> @@ -99,11 +99,11 @@ static int designware_wdt_stop(struct udevice *dev)
>           if (CONFIG_IS_ENABLED(DM_RESET)) {
>   		int ret;
>   
> -		ret = reset_assert_bulk(priv->resets);
> +		ret = reset_assert_bulk(&priv->resets);
>   		if (ret)
>   			return ret;
>   
> -		ret = reset_deassert_bulk(priv->resets);
> +		ret = reset_deassert_bulk(&priv->resets);
>   		if (ret)
>   			return ret;
>   	}
> @@ -156,11 +156,11 @@ static int designware_wdt_probe(struct udevice *dev)
>   #endif
>   
>   	if (CONFIG_IS_ENABLED(DM_RESET)) {
> -		ret = reset_get_bulk(dev, priv->resets);
> +		ret = reset_get_bulk(dev, &priv->resets);
>   		if (ret)
>   			goto err;
>   
> -		ret = reset_deassert_bulk(priv->resets);
> +		ret = reset_deassert_bulk(&priv->resets);
>   		if (ret)
>   			goto err;
>   	}
> 


Viele Grüße,
Stefan

-- 
DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-51 Fax: (+49)-8142-66989-80 Email: sr@denx.de

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

end of thread, other threads:[~2021-09-20  8:26 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-09-11 19:11 [PATCH] wdt: dw: Fix passing NULL pointer to reset functions Sean Anderson
2021-09-19 23:07 ` Sean Anderson
2021-09-20  5:31   ` Stefan Roese
2021-09-20  5:32 ` Stefan Roese
2021-09-20  8:26 ` Stefan Roese

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.