Re: tickle nmi watchdog whilst doing serial writes.

Russell King
2005-05-15T12:08:06Z

On Sun, May 15, 2005 at 01:38:02PM +0200, Andi Kleen wrote:
> Dave Jones <davej@redhat.com> writes:
> >
> > #include <asm/io.h>
> > #include <asm/irq.h>
> > @@ -2099,8 +2100,10 @@ static inline void wait_for_xmitr(struct
> > if (up->port.flags & UPF_CONS_FLOW) {
> > tmout = 1000000;
> > while (--tmout &&
> > - ((serial_in(up, UART_MSR) & UART_MSR_CTS) == 0))
> > + ((serial_in(up, UART_MSR) & UART_MSR_CTS) == 0)) {
> > udelay(1);
> > + touch_nmi_watchdog();
>
> Note that touch_nmi_watchdog is not exported on i386 - Linus vetoed
> that some time ago. The real fix of course is to use schedule_timeout(),
> but that might break printk() with interrupts off :/

Not to mention printk() from atomic contexts and panic(). No,
schedule_timeout() is _not_ a "real fix" but a kludge.

--
Russell King
Linux kernel 2.6 ARM Linux - http://www.arm.linux.org.uk/
maintainer of: 2.6 Serial core