mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* [RFC PATCH] reset: Remove WARN_ON when CONFIG_RESET_CONTROLLER=n
@ 2021-03-12 15:21 Jules Maselbas
  2021-03-15  9:35 ` Sascha Hauer
  0 siblings, 1 reply; 3+ messages in thread
From: Jules Maselbas @ 2021-03-12 15:21 UTC (permalink / raw)
  To: barebox; +Cc: Jules Maselbas

Signed-off-by: Jules Maselbas <jmaselbas@kalray.eu>
---
I am using dwc2 but my platform doesn't has CONFIG_RESET_CONTROLLER enabled,
when booting barebox I got this kind of message:
WARNING: at barebox/include/linux/reset.h:54/device_reset_us()!

Not sure if removing all the WARN_ON is a good idea... asking for insight.
---
 include/linux/reset.h | 7 -------
 1 file changed, 7 deletions(-)

diff --git a/include/linux/reset.h b/include/linux/reset.h
index 4a92a177b..a166fe1cf 100644
--- a/include/linux/reset.h
+++ b/include/linux/reset.h
@@ -21,43 +21,36 @@ int __must_check device_reset_us(struct device_d *dev, int us);
 
 static inline int reset_control_reset(struct reset_control *rstc)
 {
-	WARN_ON(1);
 	return 0;
 }
 
 static inline int reset_control_assert(struct reset_control *rstc)
 {
-	WARN_ON(1);
 	return 0;
 }
 
 static inline int reset_control_deassert(struct reset_control *rstc)
 {
-	WARN_ON(1);
 	return 0;
 }
 
 static inline struct reset_control *
 reset_control_get(struct device_d *dev, const char *id)
 {
-	WARN_ON(1);
 	return NULL;
 }
 
 static inline void reset_control_put(struct reset_control *rstc)
 {
-	WARN_ON(1);
 }
 
 static inline int device_reset_us(struct device_d *dev, int us)
 {
-	WARN_ON(1);
 	return 0;
 }
 
 static inline int device_reset(struct device_d *dev)
 {
-	WARN_ON(1);
 	return 0;
 }
 
-- 
2.17.1



_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox


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

* Re: [RFC PATCH] reset: Remove WARN_ON when CONFIG_RESET_CONTROLLER=n
  2021-03-12 15:21 [RFC PATCH] reset: Remove WARN_ON when CONFIG_RESET_CONTROLLER=n Jules Maselbas
@ 2021-03-15  9:35 ` Sascha Hauer
  2021-03-15 11:03   ` Jules Maselbas
  0 siblings, 1 reply; 3+ messages in thread
From: Sascha Hauer @ 2021-03-15  9:35 UTC (permalink / raw)
  To: Jules Maselbas; +Cc: barebox

On Fri, Mar 12, 2021 at 04:21:45PM +0100, Jules Maselbas wrote:
> Signed-off-by: Jules Maselbas <jmaselbas@kalray.eu>
> ---
> I am using dwc2 but my platform doesn't has CONFIG_RESET_CONTROLLER enabled,
> when booting barebox I got this kind of message:
> WARNING: at barebox/include/linux/reset.h:54/device_reset_us()!
> 
> Not sure if removing all the WARN_ON is a good idea... asking for insight.

I looked at the kernel and it has no warnings in the stubs. For that
reason I applied this patch.

Having no warnings has its downside as well of course. If you really
need resets for your device to function then you won't notice that reset
support is missing.

Sascha


> ---
>  include/linux/reset.h | 7 -------
>  1 file changed, 7 deletions(-)
> 
> diff --git a/include/linux/reset.h b/include/linux/reset.h
> index 4a92a177b..a166fe1cf 100644
> --- a/include/linux/reset.h
> +++ b/include/linux/reset.h
> @@ -21,43 +21,36 @@ int __must_check device_reset_us(struct device_d *dev, int us);
>  
>  static inline int reset_control_reset(struct reset_control *rstc)
>  {
> -	WARN_ON(1);
>  	return 0;
>  }
>  
>  static inline int reset_control_assert(struct reset_control *rstc)
>  {
> -	WARN_ON(1);
>  	return 0;
>  }
>  
>  static inline int reset_control_deassert(struct reset_control *rstc)
>  {
> -	WARN_ON(1);
>  	return 0;
>  }
>  
>  static inline struct reset_control *
>  reset_control_get(struct device_d *dev, const char *id)
>  {
> -	WARN_ON(1);
>  	return NULL;
>  }
>  
>  static inline void reset_control_put(struct reset_control *rstc)
>  {
> -	WARN_ON(1);
>  }
>  
>  static inline int device_reset_us(struct device_d *dev, int us)
>  {
> -	WARN_ON(1);
>  	return 0;
>  }
>  
>  static inline int device_reset(struct device_d *dev)
>  {
> -	WARN_ON(1);
>  	return 0;
>  }
>  
> -- 
> 2.17.1
> 
> 
> 
> _______________________________________________
> barebox mailing list
> barebox@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/barebox
> 

-- 
Pengutronix e.K.                           |                             |
Steuerwalder Str. 21                       | http://www.pengutronix.de/  |
31137 Hildesheim, Germany                  | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox


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

* Re: [RFC PATCH] reset: Remove WARN_ON when CONFIG_RESET_CONTROLLER=n
  2021-03-15  9:35 ` Sascha Hauer
@ 2021-03-15 11:03   ` Jules Maselbas
  0 siblings, 0 replies; 3+ messages in thread
From: Jules Maselbas @ 2021-03-15 11:03 UTC (permalink / raw)
  To: Sascha Hauer; +Cc: barebox

On Mon, Mar 15, 2021 at 10:35:37AM +0100, Sascha Hauer wrote:
> On Fri, Mar 12, 2021 at 04:21:45PM +0100, Jules Maselbas wrote:
> > Signed-off-by: Jules Maselbas <jmaselbas@kalray.eu>
> > ---
> > I am using dwc2 but my platform doesn't has CONFIG_RESET_CONTROLLER enabled,
> > when booting barebox I got this kind of message:
> > WARNING: at barebox/include/linux/reset.h:54/device_reset_us()!
> > 
> > Not sure if removing all the WARN_ON is a good idea... asking for insight.
> 
> I looked at the kernel and it has no warnings in the stubs. For that
> reason I applied this patch.
> 
> Having no warnings has its downside as well of course. If you really
> need resets for your device to function then you won't notice that reset
> support is missing.
Yeah, that makes me a bit unconfortable with removing all WARN_ON.
I though to only warn if the function is call and the device has an
"reset" in it's of_tree node. But then it's no longer a stub.



_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox


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

end of thread, other threads:[~2021-03-15 11:06 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-03-12 15:21 [RFC PATCH] reset: Remove WARN_ON when CONFIG_RESET_CONTROLLER=n Jules Maselbas
2021-03-15  9:35 ` Sascha Hauer
2021-03-15 11:03   ` Jules Maselbas

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