linux-input.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] Input: ads7846 - ratelimit the spi_sync error message
@ 2024-07-08 21:18 Marek Vasut
  2024-07-08 21:39 ` Dmitry Torokhov
  0 siblings, 1 reply; 4+ messages in thread
From: Marek Vasut @ 2024-07-08 21:18 UTC (permalink / raw)
  To: linux-input
  Cc: Marek Vasut, Arnd Bergmann, Dmitry Torokhov, Greg Kroah-Hartman,
	Linus Walleij, kernel

In case the touch controller is not connected, this message keeps scrolling
on the console indefinitelly. Ratelimit it to avoid filling kernel logs.

"
ads7846 spi2.1: spi_sync --> -22
"

Signed-off-by: Marek Vasut <marex@denx.de>
---
Cc: Arnd Bergmann <arnd@arndb.de>
Cc: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Linus Walleij <linus.walleij@linaro.org>
Cc: kernel@dh-electronics.com
Cc: linux-input@vger.kernel.org
---
 drivers/input/touchscreen/ads7846.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/input/touchscreen/ads7846.c b/drivers/input/touchscreen/ads7846.c
index 3dc41687aa1d9..f7bc0a3e56d86 100644
--- a/drivers/input/touchscreen/ads7846.c
+++ b/drivers/input/touchscreen/ads7846.c
@@ -834,7 +834,7 @@ static void ads7846_read_state(struct ads7846 *ts)
 		m = &ts->msg[msg_idx];
 		error = spi_sync(ts->spi, m);
 		if (error) {
-			dev_err(&ts->spi->dev, "spi_sync --> %d\n", error);
+			dev_err_ratelimited(&ts->spi->dev, "spi_sync --> %d\n", error);
 			packet->ignore = true;
 			return;
 		}
-- 
2.43.0


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

* Re: [PATCH] Input: ads7846 - ratelimit the spi_sync error message
  2024-07-08 21:18 [PATCH] Input: ads7846 - ratelimit the spi_sync error message Marek Vasut
@ 2024-07-08 21:39 ` Dmitry Torokhov
  2024-07-18  0:02   ` Marek Vasut
  0 siblings, 1 reply; 4+ messages in thread
From: Dmitry Torokhov @ 2024-07-08 21:39 UTC (permalink / raw)
  To: Marek Vasut, linux-input
  Cc: Arnd Bergmann, Greg Kroah-Hartman, Linus Walleij, kernel

On July 8, 2024 2:18:57 PM PDT, Marek Vasut <marex@denx.de> wrote:
>In case the touch controller is not connected, this message keeps scrolling
>on the console indefinitelly. Ratelimit it to avoid filling kernel logs.

Instead of ratelimiting, maybe we should try reading touchscreen state when
probing and abort if the device dies not respond?

Thanks.
Hi Marek,
-- 
Dmitry

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

* Re: [PATCH] Input: ads7846 - ratelimit the spi_sync error message
  2024-07-08 21:39 ` Dmitry Torokhov
@ 2024-07-18  0:02   ` Marek Vasut
  2024-07-24  4:10     ` Dmitry Torokhov
  0 siblings, 1 reply; 4+ messages in thread
From: Marek Vasut @ 2024-07-18  0:02 UTC (permalink / raw)
  To: Dmitry Torokhov, linux-input
  Cc: Arnd Bergmann, Greg Kroah-Hartman, Linus Walleij, kernel

On 7/8/24 11:39 PM, Dmitry Torokhov wrote:
> On July 8, 2024 2:18:57 PM PDT, Marek Vasut <marex@denx.de> wrote:
>> In case the touch controller is not connected, this message keeps scrolling
>> on the console indefinitelly. Ratelimit it to avoid filling kernel logs.
> 
> Instead of ratelimiting, maybe we should try reading touchscreen state when
> probing and abort if the device dies not respond?

Ratelimiting also helps if the touch controller fails or disconnects at 
runtime, which would still trigger the scrolling messages. With this 
cheap prototype hardware, that happens.

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

* Re: [PATCH] Input: ads7846 - ratelimit the spi_sync error message
  2024-07-18  0:02   ` Marek Vasut
@ 2024-07-24  4:10     ` Dmitry Torokhov
  0 siblings, 0 replies; 4+ messages in thread
From: Dmitry Torokhov @ 2024-07-24  4:10 UTC (permalink / raw)
  To: Marek Vasut
  Cc: linux-input, Arnd Bergmann, Greg Kroah-Hartman, Linus Walleij,
	kernel

On Thu, Jul 18, 2024 at 02:02:50AM +0200, Marek Vasut wrote:
> On 7/8/24 11:39 PM, Dmitry Torokhov wrote:
> > On July 8, 2024 2:18:57 PM PDT, Marek Vasut <marex@denx.de> wrote:
> > > In case the touch controller is not connected, this message keeps scrolling
> > > on the console indefinitelly. Ratelimit it to avoid filling kernel logs.
> > 
> > Instead of ratelimiting, maybe we should try reading touchscreen state when
> > probing and abort if the device dies not respond?
> 
> Ratelimiting also helps if the touch controller fails or disconnects at
> runtime, which would still trigger the scrolling messages. With this cheap
> prototype hardware, that happens.

OK, fair enough. Applied, thank you.

-- 
Dmitry

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

end of thread, other threads:[~2024-07-24  4:11 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-07-08 21:18 [PATCH] Input: ads7846 - ratelimit the spi_sync error message Marek Vasut
2024-07-08 21:39 ` Dmitry Torokhov
2024-07-18  0:02   ` Marek Vasut
2024-07-24  4:10     ` Dmitry Torokhov

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).