Commit e1ca3ff
serial: sifive: lock port in startup()/shutdown() callbacks
startup()/shutdown() callbacks access SIFIVE_SERIAL_IE_OFFS.
The register is also accessed from write() callback.
If console were printing and startup()/shutdown() callback
gets called, its access to the register could be overwritten.
Add port->lock to startup()/shutdown() callbacks to make sure
their access to SIFIVE_SERIAL_IE_OFFS is synchronized against
write() callback.
Fixes: 45c054d ("tty: serial: add driver for the SiFive UART")
Signed-off-by: Ryo Takakura <[email protected]>
Reviewed-by: Petr Mladek <[email protected]>
Cc: [email protected]
Reviewed-by: John Ogness <[email protected]>
Rule: add
Link: https://lore.kernel.org/stable/20250330003522.386632-1-ryotkkr98%40gmail.com
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Greg Kroah-Hartman <[email protected]>1 parent ee6a44d commit e1ca3ff
1 file changed
+6
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
563 | 563 | | |
564 | 564 | | |
565 | 565 | | |
| 566 | + | |
566 | 567 | | |
| 568 | + | |
567 | 569 | | |
| 570 | + | |
568 | 571 | | |
569 | 572 | | |
570 | 573 | | |
571 | 574 | | |
572 | 575 | | |
573 | 576 | | |
574 | 577 | | |
| 578 | + | |
575 | 579 | | |
| 580 | + | |
576 | 581 | | |
577 | 582 | | |
| 583 | + | |
578 | 584 | | |
579 | 585 | | |
580 | 586 | | |
| |||
0 commit comments