linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] i2c: stm32: remove unnecessary DMA kernel error log
@ 2020-08-14 14:13 Holger Assmann
  2020-09-10  9:30 ` Alain Volmat
  0 siblings, 1 reply; 2+ messages in thread
From: Holger Assmann @ 2020-08-14 14:13 UTC (permalink / raw)
  To: Pierre-Yves MORDRET, Maxime Coquelin, Alexandre Torgue,
	Wolfram Sang, Alain Volmat, Etienne Carriere
  Cc: kernel, Holger Assmann, linux-i2c, linux-stm32, linux-arm-kernel,
	linux-kernel

We currently print errors twice when there is an actual error
when requesting a DMA channel, once in stm32f7_i2c_probe()
when stm32_i2c_dma_request() fails and once more in
stm32_i2c_dma_request() itself. stm32_i2c_dma_request() is only
called from stm32f7_i2c_probe(), so we could drop the duplicate
error message.

This has the effect that we no longer warn about absence of a
DMA channel. This is intended as it is not mandatory for the
i2c-stm32 devices to have DMA enabled.  Also, the overall number
of DMA channels on the STM32 is limited and has to be shared
with other peripherals. This may lead to DMA being intentionally
off for specific devices.

This patch removes the unnecessary error message.

Fixes: e07a89775c71 ("i2c: stm32: don't print an error on probe deferral")
Signed-off-by: Holger Assmann <h.assmann@pengutronix.de>
---
 drivers/i2c/busses/i2c-stm32.c | 5 -----
 1 file changed, 5 deletions(-)

diff --git a/drivers/i2c/busses/i2c-stm32.c b/drivers/i2c/busses/i2c-stm32.c
index 3f69a3bb6119..cc05a4202559 100644
--- a/drivers/i2c/busses/i2c-stm32.c
+++ b/drivers/i2c/busses/i2c-stm32.c
@@ -26,8 +26,6 @@ struct stm32_i2c_dma *stm32_i2c_dma_request(struct device *dev,
 	dma->chan_tx = dma_request_chan(dev, "tx");
 	if (IS_ERR(dma->chan_tx)) {
 		ret = PTR_ERR(dma->chan_tx);
-		if (ret != -EPROBE_DEFER)
-			dev_err(dev, "can't request DMA tx channel\n");
 		goto fail_al;
 	}
 
@@ -46,9 +44,6 @@ struct stm32_i2c_dma *stm32_i2c_dma_request(struct device *dev,
 	dma->chan_rx = dma_request_chan(dev, "rx");
 	if (IS_ERR(dma->chan_rx)) {
 		ret = PTR_ERR(dma->chan_rx);
-		if (ret != -EPROBE_DEFER)
-			dev_err(dev, "can't request DMA rx channel\n");
-
 		goto fail_tx;
 	}
 
-- 
2.20.1


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

* Re: [PATCH] i2c: stm32: remove unnecessary DMA kernel error log
  2020-08-14 14:13 [PATCH] i2c: stm32: remove unnecessary DMA kernel error log Holger Assmann
@ 2020-09-10  9:30 ` Alain Volmat
  0 siblings, 0 replies; 2+ messages in thread
From: Alain Volmat @ 2020-09-10  9:30 UTC (permalink / raw)
  To: Holger Assmann
  Cc: Pierre Yves MORDRET, Maxime Coquelin, Alexandre TORGUE,
	Wolfram Sang, Etienne CARRIERE, kernel, linux-i2c, linux-stm32,
	linux-arm-kernel, linux-kernel

Hi Holger,

Thanks for your patch.
there is an ongoing tree wide action to update all those common pattern
of checking for the -EPROBE_DEFER.

I thus propose, to first integrate the patch [i2c: stm32: Simplify with dev_err_probe()] that has been proposed few days ago, and on top of that add an
additional patch to check for the -ENODEV error case due to DMA being
optional.

I've prepared a patch for that and will post it now, could you consider it ?

Alain

On Fri, Aug 14, 2020 at 02:13:55PM +0000, Holger Assmann wrote:
> We currently print errors twice when there is an actual error
> when requesting a DMA channel, once in stm32f7_i2c_probe()
> when stm32_i2c_dma_request() fails and once more in
> stm32_i2c_dma_request() itself. stm32_i2c_dma_request() is only
> called from stm32f7_i2c_probe(), so we could drop the duplicate
> error message.
> 
> This has the effect that we no longer warn about absence of a
> DMA channel. This is intended as it is not mandatory for the
> i2c-stm32 devices to have DMA enabled.  Also, the overall number
> of DMA channels on the STM32 is limited and has to be shared
> with other peripherals. This may lead to DMA being intentionally
> off for specific devices.
> 
> This patch removes the unnecessary error message.
> 
> Fixes: e07a89775c71 ("i2c: stm32: don't print an error on probe deferral")
> Signed-off-by: Holger Assmann <h.assmann@pengutronix.de>
> ---
>  drivers/i2c/busses/i2c-stm32.c | 5 -----
>  1 file changed, 5 deletions(-)
> 
> diff --git a/drivers/i2c/busses/i2c-stm32.c b/drivers/i2c/busses/i2c-stm32.c
> index 3f69a3bb6119..cc05a4202559 100644
> --- a/drivers/i2c/busses/i2c-stm32.c
> +++ b/drivers/i2c/busses/i2c-stm32.c
> @@ -26,8 +26,6 @@ struct stm32_i2c_dma *stm32_i2c_dma_request(struct device *dev,
>  	dma->chan_tx = dma_request_chan(dev, "tx");
>  	if (IS_ERR(dma->chan_tx)) {
>  		ret = PTR_ERR(dma->chan_tx);
> -		if (ret != -EPROBE_DEFER)
> -			dev_err(dev, "can't request DMA tx channel\n");
>  		goto fail_al;
>  	}
>  
> @@ -46,9 +44,6 @@ struct stm32_i2c_dma *stm32_i2c_dma_request(struct device *dev,
>  	dma->chan_rx = dma_request_chan(dev, "rx");
>  	if (IS_ERR(dma->chan_rx)) {
>  		ret = PTR_ERR(dma->chan_rx);
> -		if (ret != -EPROBE_DEFER)
> -			dev_err(dev, "can't request DMA rx channel\n");
> -
>  		goto fail_tx;
>  	}
>  
> -- 
> 2.20.1
> 

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

end of thread, other threads:[~2020-09-10  9:31 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-08-14 14:13 [PATCH] i2c: stm32: remove unnecessary DMA kernel error log Holger Assmann
2020-09-10  9:30 ` Alain Volmat

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).