linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Arnd Bergmann <arnd@arndb.de>
To: Sergey Senozhatsky <sergey.senozhatsky.work@gmail.com>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Linux-Next Mailing List <linux-next@vger.kernel.org>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	Stephen Rothwell <sfr@canb.auug.org.au>,
	Sergey Senozhatsky <sergey.senozhatsky@gmail.com>
Subject: Re: linux-next: Tree for Aug 1
Date: Tue, 1 Aug 2017 15:28:32 +0200	[thread overview]
Message-ID: <CAK8P3a3vOHteTswgXr+9cO-wX2HGVb_GXd3w3bByZLR=36MXFg@mail.gmail.com> (raw)
In-Reply-To: <CAK8P3a2dUdOf4OTLBEMLAVYXSpMyqFSHsRShz7aLEYBjViw61A@mail.gmail.com>

On Tue, Aug 1, 2017 at 3:20 PM, Arnd Bergmann <arnd@arndb.de> wrote:
> On Tue, Aug 1, 2017 at 2:42 PM, Sergey Senozhatsky
> <sergey.senozhatsky.work@gmail.com> wrote:
>> Hello,
>>
>>
>> seems that commit 979990c6284814617 ("tty: improve tty_insert_flip_char()
>> fast path") panics my kernel.
>>
>> in particular, this part
>
> Looking into it now, sorry for the breakage.

Does this fix it? I definitely got this part wrong as I see now, we must
look up the 'tail' after calling __tty_buffer_request_room, not before.

      Arnd

diff --git a/drivers/tty/tty_buffer.c b/drivers/tty/tty_buffer.c
index 6a8563633d4b..f8eba1c5412f 100644
--- a/drivers/tty/tty_buffer.c
+++ b/drivers/tty/tty_buffer.c
@@ -372,12 +372,13 @@ EXPORT_SYMBOL(tty_insert_flip_string_flags);
  */
 int __tty_insert_flip_char(struct tty_port *port, unsigned char ch, char flag)
 {
-       struct tty_buffer *tb = port->buf.tail;
+       struct tty_buffer *tb;
        int flags = (flag == TTY_NORMAL) ? TTYB_NORMAL : 0;

        if (!__tty_buffer_request_room(port, 1, flags))
                return 0;

+       tb = port->buf.tail;
        if (~tb->flags & TTYB_NORMAL)
                *flag_buf_ptr(tb, tb->used) = flag;
        *char_buf_ptr(tb, tb->used++) = ch;

  reply	other threads:[~2017-08-01 13:29 UTC|newest]

Thread overview: 40+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-08-01  7:37 linux-next: Tree for Aug 1 Stephen Rothwell
2017-08-01 12:42 ` Sergey Senozhatsky
2017-08-01 13:20   ` Arnd Bergmann
2017-08-01 13:28     ` Arnd Bergmann [this message]
2017-08-01 23:55       ` Sergey Senozhatsky
2017-08-02 11:13         ` Arnd Bergmann
  -- strict thread matches above, loose matches on Subject: below --
2023-08-01  5:19 Stephen Rothwell
2019-08-01  6:14 Stephen Rothwell
2018-08-01  7:58 Stephen Rothwell
2018-08-01 22:48 ` Guenter Roeck
2018-08-01 22:52   ` James Bottomley
2018-08-01 23:00     ` James Bottomley
2018-08-02  0:05       ` Stephen Rothwell
2018-08-02  1:19         ` Guenter Roeck
2018-08-01 23:47     ` Guenter Roeck
2018-08-01 23:57       ` Ming Lei
2018-08-02  0:03         ` James Bottomley
2018-08-02  0:20           ` Guenter Roeck
2018-08-02  4:58           ` Guenter Roeck
2018-08-02  5:04             ` Bart Van Assche
2018-08-02 12:46               ` Guenter Roeck
2018-08-02 12:51                 ` Johannes Thumshirn
2018-08-02 13:00                   ` Guenter Roeck
2018-08-02 13:06                     ` Johannes Thumshirn
2018-08-02 11:35             ` Ming Lei
2018-08-02 13:05               ` Guenter Roeck
2018-08-02 16:27                 ` Ming Lei
2018-08-02 16:40                   ` Bart Van Assche
2018-08-02 16:50                     ` Ming Lei
2018-08-02 16:57                       ` Bart Van Assche
2018-08-02  0:12         ` Guenter Roeck
2016-08-01  4:02 Stephen Rothwell
2014-08-01  9:14 Stephen Rothwell
2013-08-01  7:25 Stephen Rothwell
2013-08-01  7:50 ` Sedat Dilek
2011-08-01  4:47 Stephen Rothwell
2011-08-01  7:01 ` Sedat Dilek
2011-08-01 21:54   ` Randy Dunlap
2011-08-02  1:29     ` Stephen Rothwell
2011-08-02 10:38       ` Sedat Dilek

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAK8P3a3vOHteTswgXr+9cO-wX2HGVb_GXd3w3bByZLR=36MXFg@mail.gmail.com' \
    --to=arnd@arndb.de \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-next@vger.kernel.org \
    --cc=sergey.senozhatsky.work@gmail.com \
    --cc=sergey.senozhatsky@gmail.com \
    --cc=sfr@canb.auug.org.au \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).