Commit b371cbb
printk: convert @syslog_lock to mutex
@syslog_lock was a raw_spin_lock to simplify the transition of
removing @logbuf_lock and the safe buffers. With that transition
complete, and since all uses of @syslog_lock are within sleepable
contexts, @syslog_lock can become a mutex.
Note that until now register_console() would disable interrupts
using irqsave, which implies that it may be called with interrupts
disabled. And indeed, there is one possible call chain on parisc
where this happens:
handle_interruption(code=1) /* High-priority machine check (HPMC) */
pdc_console_restart()
pdc_console_init_force()
register_console()
However, register_console() calls console_lock(), which might sleep.
So it has never been allowed to call register_console() from an
atomic context and the above call chain is a bug.
Note that the removal of read_syslog_seq_irq() is slightly changing
the behavior of SYSLOG_ACTION_READ by testing against a possibly
outdated @seq value. However, the value of @seq could have changed
after the test, so it is not a new window. A follow-up commit closes
this window.
Signed-off-by: John Ogness <john.ogness@linutronix.de>
Reviewed-by: Petr Mladek <pmladek@suse.com>
Signed-off-by: Petr Mladek <pmladek@suse.com>
Link: https://lore.kernel.org/r/20210715193359.25946-6-john.ogness@linutronix.de1 parent 85e3e7f commit b371cbb
1 file changed
Lines changed: 20 additions & 29 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
356 | 356 | | |
357 | 357 | | |
358 | 358 | | |
359 | | - | |
| 359 | + | |
360 | 360 | | |
361 | 361 | | |
362 | 362 | | |
| |||
1497 | 1497 | | |
1498 | 1498 | | |
1499 | 1499 | | |
1500 | | - | |
| 1500 | + | |
1501 | 1501 | | |
1502 | | - | |
| 1502 | + | |
1503 | 1503 | | |
1504 | 1504 | | |
1505 | 1505 | | |
| |||
1528 | 1528 | | |
1529 | 1529 | | |
1530 | 1530 | | |
1531 | | - | |
| 1531 | + | |
1532 | 1532 | | |
1533 | 1533 | | |
1534 | 1534 | | |
| |||
1592 | 1592 | | |
1593 | 1593 | | |
1594 | 1594 | | |
1595 | | - | |
| 1595 | + | |
1596 | 1596 | | |
1597 | | - | |
| 1597 | + | |
1598 | 1598 | | |
1599 | 1599 | | |
1600 | 1600 | | |
| |||
1603 | 1603 | | |
1604 | 1604 | | |
1605 | 1605 | | |
1606 | | - | |
| 1606 | + | |
1607 | 1607 | | |
1608 | | - | |
1609 | | - | |
1610 | | - | |
1611 | | - | |
1612 | | - | |
1613 | | - | |
1614 | | - | |
1615 | | - | |
1616 | | - | |
1617 | | - | |
1618 | | - | |
1619 | | - | |
1620 | | - | |
| 1608 | + | |
1621 | 1609 | | |
1622 | 1610 | | |
1623 | 1611 | | |
| |||
1626 | 1614 | | |
1627 | 1615 | | |
1628 | 1616 | | |
| 1617 | + | |
1629 | 1618 | | |
1630 | 1619 | | |
1631 | 1620 | | |
| |||
1644 | 1633 | | |
1645 | 1634 | | |
1646 | 1635 | | |
1647 | | - | |
1648 | | - | |
| 1636 | + | |
| 1637 | + | |
| 1638 | + | |
| 1639 | + | |
| 1640 | + | |
| 1641 | + | |
1649 | 1642 | | |
1650 | 1643 | | |
1651 | 1644 | | |
| |||
1693 | 1686 | | |
1694 | 1687 | | |
1695 | 1688 | | |
1696 | | - | |
| 1689 | + | |
1697 | 1690 | | |
1698 | 1691 | | |
1699 | | - | |
| 1692 | + | |
1700 | 1693 | | |
1701 | 1694 | | |
1702 | 1695 | | |
| |||
1714 | 1707 | | |
1715 | 1708 | | |
1716 | 1709 | | |
1717 | | - | |
1718 | 1710 | | |
1719 | 1711 | | |
1720 | 1712 | | |
| |||
1724 | 1716 | | |
1725 | 1717 | | |
1726 | 1718 | | |
1727 | | - | |
| 1719 | + | |
1728 | 1720 | | |
1729 | 1721 | | |
1730 | 1722 | | |
| |||
2929 | 2921 | | |
2930 | 2922 | | |
2931 | 2923 | | |
2932 | | - | |
2933 | 2924 | | |
2934 | 2925 | | |
2935 | 2926 | | |
| |||
3034 | 3025 | | |
3035 | 3026 | | |
3036 | 3027 | | |
3037 | | - | |
| 3028 | + | |
3038 | 3029 | | |
3039 | | - | |
| 3030 | + | |
3040 | 3031 | | |
3041 | 3032 | | |
3042 | 3033 | | |
| |||
0 commit comments