Hugo Villeneuve b35f8dbbce serial: max310x: prevent infinite while() loop in port startup
If there is a problem after resetting a port, the do/while() loop that
checks the default value of DIVLSB register may run forever and spam the
I2C bus.

Add a delay before each read of DIVLSB, and a maximum number of tries to
prevent that situation from happening.

Also fail probe if port reset is unsuccessful.

Fixes: 10d8b34a4217 ("serial: max310x: Driver rework")
Cc: stable@vger.kernel.org
Signed-off-by: Hugo Villeneuve <hvilleneuve@dimonoff.com>
Link: https://lore.kernel.org/r/20240116213001.3691629-5-hugo@hugovil.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2024-01-27 19:09:10 -08:00
..
2021-10-21 12:35:35 +02:00
2023-12-08 12:02:38 +01:00
2023-12-08 12:02:38 +01:00
2023-12-08 12:02:38 +01:00
2023-12-08 12:02:38 +01:00
2023-08-11 21:12:47 +02:00
2023-12-08 12:02:38 +01:00
2023-08-11 21:12:46 +02:00
2024-01-18 11:43:55 -08:00
2022-09-22 16:12:34 +02:00
2023-12-08 12:02:37 +01:00