Commit b35f8db
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: 10d8b34 ("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>1 parent 8afa6c6 commit b35f8db
1 file changed
+18
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
237 | 237 | | |
238 | 238 | | |
239 | 239 | | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
240 | 244 | | |
241 | 245 | | |
242 | 246 | | |
| |||
1346 | 1350 | | |
1347 | 1351 | | |
1348 | 1352 | | |
| 1353 | + | |
| 1354 | + | |
| 1355 | + | |
1349 | 1356 | | |
1350 | 1357 | | |
1351 | 1358 | | |
| |||
1354 | 1361 | | |
1355 | 1362 | | |
1356 | 1363 | | |
1357 | | - | |
1358 | | - | |
| 1364 | + | |
| 1365 | + | |
| 1366 | + | |
| 1367 | + | |
| 1368 | + | |
| 1369 | + | |
| 1370 | + | |
| 1371 | + | |
| 1372 | + | |
| 1373 | + | |
| 1374 | + | |
1359 | 1375 | | |
1360 | 1376 | | |
1361 | 1377 | | |
| |||
0 commit comments