--- zzzz-none-000/linux-4.1.52/drivers/tty/n_tty.c 2018-05-28 02:26:45.000000000 +0000 +++ bcm63-7530ax-731/linux-4.1.52/drivers/tty/n_tty.c 2022-03-02 11:37:13.000000000 +0000 @@ -2375,6 +2375,15 @@ down_read(&tty->termios_rwsem); +#if defined(CONFIG_AVM_ENHANCED) + if (tty->driver->ops->avm_console_enabled) { + if (!tty->driver->ops->avm_console_enabled(tty)) { + b += nr; + goto skip_out; + } + } +#endif + /* Write out any echoed characters that are still pending */ process_echoes(tty); @@ -2439,6 +2448,9 @@ } break_out: remove_wait_queue(&tty->write_wait, &wait); +#if defined(CONFIG_AVM_ENHANCED) +skip_out: +#endif if (b - buf != nr && tty->fasync) set_bit(TTY_DO_WRITE_WAKEUP, &tty->flags); up_read(&tty->termios_rwsem);