Re: [RFC][PATCH 0/6] Use printk_safe context for TTY and UART port locks

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, Jun 19, 2018 at 5:30 PM Petr Mladek <pmladek@xxxxxxxx> wrote:
>
> To make it clear. This patch set adds yet another spin_lock API.
> It behaves exactly as spin_lock_irqsafe()/spin_unlock_irqrestore()
> but in addition it sets printk_context.
>
> This patchset forces safe context around TTY and UART locks.
> In fact, the deferred context would be enough to prevent
> all the mentioned deadlocks.

Please stop this garbage.

The rule is simple: DO NOT DO THAT THEN.

Don't make recursive locks. Don't make random complexity.  Just stop
doing the thing that hurts.

There is no valid reason why an UART driver should do a printk() of
any sort inside the critical region where the console is locked.

Just remove those printk's, don't add new crazy locking.

If you had a spinlock that deadlocked because it was inside an already
spinlocked region, you'd say "that's buggy".

This is the exact same issue. We don't work around buggy garbage. We
fix the bug - by removing the problematic printk.

           Linus
--
To unsubscribe from this list: send the line "unsubscribe linux-serial" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Linux PPP]     [Linux FS]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Linmodem]     [Device Mapper]     [Linux Kernel for ARM]

  Powered by Linux