public inbox for linux-i2c@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] i2c: stm32f7: remove noisy and imprecise log messages
@ 2021-11-30  9:38 Wolfram Sang
  2021-11-30 16:25 ` Alain Volmat
  0 siblings, 1 reply; 5+ messages in thread
From: Wolfram Sang @ 2021-11-30  9:38 UTC (permalink / raw)
  To: linux-i2c; +Cc: Alain Volmat, linux-stm32, Wolfram Sang

The log messages talk about 'bus recovery' while it is not a bus
recovery with 9 pulses but merely a controller reset. Controller resets
are not worth log messages. The 'bus busy' message should be emitted by
upper layers, a busy bus may be expectected in some cases.

Signed-off-by: Wolfram Sang <wsa@kernel.org>
---

Alain, do you agree? Only compile tested.

 drivers/i2c/busses/i2c-stm32f7.c | 8 +-------
 1 file changed, 1 insertion(+), 7 deletions(-)

diff --git a/drivers/i2c/busses/i2c-stm32f7.c b/drivers/i2c/busses/i2c-stm32f7.c
index b9b19a2a2ffa..e0e7d0001cbc 100644
--- a/drivers/i2c/busses/i2c-stm32f7.c
+++ b/drivers/i2c/busses/i2c-stm32f7.c
@@ -832,8 +832,6 @@ static int stm32f7_i2c_release_bus(struct i2c_adapter *i2c_adap)
 {
 	struct stm32f7_i2c_dev *i2c_dev = i2c_get_adapdata(i2c_adap);
 
-	dev_info(i2c_dev->dev, "Trying to recover bus\n");
-
 	stm32f7_i2c_clr_bits(i2c_dev->base + STM32F7_I2C_CR1,
 			     STM32F7_I2C_CR1_PE);
 
@@ -854,13 +852,9 @@ static int stm32f7_i2c_wait_free_bus(struct stm32f7_i2c_dev *i2c_dev)
 	if (!ret)
 		return 0;
 
-	dev_info(i2c_dev->dev, "bus busy\n");
-
 	ret = stm32f7_i2c_release_bus(&i2c_dev->adap);
-	if (ret) {
-		dev_err(i2c_dev->dev, "Failed to recover the bus (%d)\n", ret);
+	if (ret)
 		return ret;
-	}
 
 	return -EBUSY;
 }
-- 
2.30.2


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

* Re: [PATCH] i2c: stm32f7: remove noisy and imprecise log messages
  2021-11-30  9:38 [PATCH] i2c: stm32f7: remove noisy and imprecise log messages Wolfram Sang
@ 2021-11-30 16:25 ` Alain Volmat
  2021-11-30 21:41   ` Wolfram Sang
  0 siblings, 1 reply; 5+ messages in thread
From: Alain Volmat @ 2021-11-30 16:25 UTC (permalink / raw)
  To: Wolfram Sang; +Cc: linux-i2c, linux-stm32, pierre-yves.mordret

Hi Wolfram,

On Tue, Nov 30, 2021 at 10:38:16AM +0100, Wolfram Sang wrote:
> The log messages talk about 'bus recovery' while it is not a bus
> recovery with 9 pulses but merely a controller reset. Controller resets
> are not worth log messages. The 'bus busy' message should be emitted by
> upper layers, a busy bus may be expectected in some cases.
> 
> Signed-off-by: Wolfram Sang <wsa@kernel.org>
> ---
> 
> Alain, do you agree? Only compile tested.

Yes I fully agree with that, thanks for doing that.
2 minor points:
- s/expectected/expected, within the commit log
- looking at this area of code again, it appears that the function stm32f7_i2c_release_bus
is ALWAYS returning 0. So it should actually be a void function.  I thus
propose, if you agree with that, that I propose, and apply a patch PRIOR to your/this patch
to change that and remove the error checking of the stm32f7_i2c_release_bus function since it is useless.
Is that fine for you ?

Alain

> 
>  drivers/i2c/busses/i2c-stm32f7.c | 8 +-------
>  1 file changed, 1 insertion(+), 7 deletions(-)
> 
> diff --git a/drivers/i2c/busses/i2c-stm32f7.c b/drivers/i2c/busses/i2c-stm32f7.c
> index b9b19a2a2ffa..e0e7d0001cbc 100644
> --- a/drivers/i2c/busses/i2c-stm32f7.c
> +++ b/drivers/i2c/busses/i2c-stm32f7.c
> @@ -832,8 +832,6 @@ static int stm32f7_i2c_release_bus(struct i2c_adapter *i2c_adap)
>  {
>  	struct stm32f7_i2c_dev *i2c_dev = i2c_get_adapdata(i2c_adap);
>  
> -	dev_info(i2c_dev->dev, "Trying to recover bus\n");
> -
>  	stm32f7_i2c_clr_bits(i2c_dev->base + STM32F7_I2C_CR1,
>  			     STM32F7_I2C_CR1_PE);
>  
> @@ -854,13 +852,9 @@ static int stm32f7_i2c_wait_free_bus(struct stm32f7_i2c_dev *i2c_dev)
>  	if (!ret)
>  		return 0;
>  
> -	dev_info(i2c_dev->dev, "bus busy\n");
> -
>  	ret = stm32f7_i2c_release_bus(&i2c_dev->adap);
> -	if (ret) {
> -		dev_err(i2c_dev->dev, "Failed to recover the bus (%d)\n", ret);
> +	if (ret)
>  		return ret;
> -	}
>  
>  	return -EBUSY;
>  }
> -- 
> 2.30.2
> 

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

* Re: [PATCH] i2c: stm32f7: remove noisy and imprecise log messages
  2021-11-30 16:25 ` Alain Volmat
@ 2021-11-30 21:41   ` Wolfram Sang
  2021-12-01 10:59     ` Alain Volmat
  0 siblings, 1 reply; 5+ messages in thread
From: Wolfram Sang @ 2021-11-30 21:41 UTC (permalink / raw)
  To: Alain Volmat; +Cc: linux-i2c, linux-stm32, pierre-yves.mordret

[-- Attachment #1: Type: text/plain, Size: 555 bytes --]


> - looking at this area of code again, it appears that the function stm32f7_i2c_release_bus
> is ALWAYS returning 0. So it should actually be a void function.  I thus
> propose, if you agree with that, that I propose, and apply a patch PRIOR to your/this patch
> to change that and remove the error checking of the stm32f7_i2c_release_bus function since it is useless.
> Is that fine for you ?

Well, I'd think we can also apply this patch first and then make the
function void, but I don't really care about the order. But we should do
both, I agree.


[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

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

* Re: [PATCH] i2c: stm32f7: remove noisy and imprecise log messages
  2021-11-30 21:41   ` Wolfram Sang
@ 2021-12-01 10:59     ` Alain Volmat
  2021-12-01 11:04       ` Wolfram Sang
  0 siblings, 1 reply; 5+ messages in thread
From: Alain Volmat @ 2021-12-01 10:59 UTC (permalink / raw)
  To: Wolfram Sang, linux-i2c, linux-stm32, pierre-yves.mordret

On Tue, Nov 30, 2021 at 10:41:37PM +0100, Wolfram Sang wrote:
> 
> > - looking at this area of code again, it appears that the function stm32f7_i2c_release_bus
> > is ALWAYS returning 0. So it should actually be a void function.  I thus
> > propose, if you agree with that, that I propose, and apply a patch PRIOR to your/this patch
> > to change that and remove the error checking of the stm32f7_i2c_release_bus function since it is useless.
> > Is that fine for you ?
> 
> Well, I'd think we can also apply this patch first and then make the
> function void, but I don't really care about the order. But we should do
> both, I agree.
> 

Ok, I thus send a 2 patches serie with mine and yours reworked on top of
mine together. Hope you don't mind.

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

* Re: [PATCH] i2c: stm32f7: remove noisy and imprecise log messages
  2021-12-01 10:59     ` Alain Volmat
@ 2021-12-01 11:04       ` Wolfram Sang
  0 siblings, 0 replies; 5+ messages in thread
From: Wolfram Sang @ 2021-12-01 11:04 UTC (permalink / raw)
  To: linux-i2c, linux-stm32, pierre-yves.mordret

[-- Attachment #1: Type: text/plain, Size: 127 bytes --]


> Ok, I thus send a 2 patches serie with mine and yours reworked on top of
> mine together. Hope you don't mind.

Please do.


[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

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

end of thread, other threads:[~2021-12-01 11:04 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-11-30  9:38 [PATCH] i2c: stm32f7: remove noisy and imprecise log messages Wolfram Sang
2021-11-30 16:25 ` Alain Volmat
2021-11-30 21:41   ` Wolfram Sang
2021-12-01 10:59     ` Alain Volmat
2021-12-01 11:04       ` Wolfram Sang

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