Commit 910ef43
serial: 8250: Provide flag for IER toggling for RS485
For RS485 mode, if SER_RS485_RX_DURING_TX is not available, the
console ->write() callback needs to enable/disable Tx. It does
this by calling the ->rs485_start_tx() and ->rs485_stop_tx()
callbacks. However, some of these callbacks also disable/enable
interrupts and makes power management calls. This causes 2
problems for console writing:
1. A console write can occur in contexts that are illegal for
pm_runtime_*(). It is not even necessary for console writing
to use pm_runtime_*() because a console already does this in
serial8250_console_setup() and serial8250_console_exit().
2. The console ->write() callback already handles
disabling/enabling the interrupts by properly restoring the
previous IER value.
Add an argument @toggle_ier to the ->rs485_start_tx() and
->rs485_stop_tx() callbacks to specify if they may disable/enable
receive interrupts while using pm_runtime_*(). Console writing
will not allow the toggling.
For all call sites other than console writing there is no
functional change.
Signed-off-by: John Ogness <[email protected]>
Reviewed-by: Petr Mladek <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Greg Kroah-Hartman <[email protected]>1 parent 95a1b40 commit 910ef43
File tree
5 files changed
+22
-18
lines changed- drivers/tty/serial/8250
- include/linux
5 files changed
+22
-18
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
231 | 231 | | |
232 | 232 | | |
233 | 233 | | |
234 | | - | |
235 | | - | |
| 234 | + | |
| 235 | + | |
236 | 236 | | |
237 | 237 | | |
238 | 238 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
46 | 46 | | |
47 | 47 | | |
48 | 48 | | |
49 | | - | |
| 49 | + | |
50 | 50 | | |
51 | 51 | | |
52 | 52 | | |
| |||
65 | 65 | | |
66 | 66 | | |
67 | 67 | | |
68 | | - | |
| 68 | + | |
69 | 69 | | |
70 | 70 | | |
71 | 71 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
365 | 365 | | |
366 | 366 | | |
367 | 367 | | |
368 | | - | |
| 368 | + | |
369 | 369 | | |
370 | 370 | | |
371 | 371 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
578 | 578 | | |
579 | 579 | | |
580 | 580 | | |
581 | | - | |
| 581 | + | |
582 | 582 | | |
583 | 583 | | |
584 | 584 | | |
| |||
1398 | 1398 | | |
1399 | 1399 | | |
1400 | 1400 | | |
| 1401 | + | |
1401 | 1402 | | |
1402 | 1403 | | |
1403 | 1404 | | |
1404 | | - | |
| 1405 | + | |
1405 | 1406 | | |
1406 | 1407 | | |
1407 | 1408 | | |
| |||
1422 | 1423 | | |
1423 | 1424 | | |
1424 | 1425 | | |
1425 | | - | |
1426 | | - | |
| 1426 | + | |
| 1427 | + | |
| 1428 | + | |
| 1429 | + | |
1427 | 1430 | | |
1428 | 1431 | | |
1429 | 1432 | | |
| |||
1438 | 1441 | | |
1439 | 1442 | | |
1440 | 1443 | | |
1441 | | - | |
| 1444 | + | |
1442 | 1445 | | |
1443 | 1446 | | |
1444 | 1447 | | |
| |||
1470 | 1473 | | |
1471 | 1474 | | |
1472 | 1475 | | |
1473 | | - | |
| 1476 | + | |
1474 | 1477 | | |
1475 | 1478 | | |
1476 | 1479 | | |
| |||
1559 | 1562 | | |
1560 | 1563 | | |
1561 | 1564 | | |
| 1565 | + | |
1562 | 1566 | | |
1563 | 1567 | | |
1564 | 1568 | | |
1565 | 1569 | | |
1566 | 1570 | | |
1567 | 1571 | | |
1568 | 1572 | | |
1569 | | - | |
| 1573 | + | |
1570 | 1574 | | |
1571 | 1575 | | |
1572 | 1576 | | |
1573 | | - | |
| 1577 | + | |
1574 | 1578 | | |
1575 | 1579 | | |
1576 | 1580 | | |
| |||
1604 | 1608 | | |
1605 | 1609 | | |
1606 | 1610 | | |
1607 | | - | |
| 1611 | + | |
1608 | 1612 | | |
1609 | 1613 | | |
1610 | 1614 | | |
| |||
3424 | 3428 | | |
3425 | 3429 | | |
3426 | 3430 | | |
3427 | | - | |
| 3431 | + | |
3428 | 3432 | | |
3429 | 3433 | | |
3430 | 3434 | | |
| |||
3462 | 3466 | | |
3463 | 3467 | | |
3464 | 3468 | | |
3465 | | - | |
| 3469 | + | |
3466 | 3470 | | |
3467 | 3471 | | |
3468 | 3472 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
161 | 161 | | |
162 | 162 | | |
163 | 163 | | |
164 | | - | |
165 | | - | |
| 164 | + | |
| 165 | + | |
166 | 166 | | |
167 | 167 | | |
168 | 168 | | |
| |||
0 commit comments