From: Jiri Slaby <jslaby@suse.cz>
To: Alan Cox <alan@lxorguk.ukuu.org.uk>
Cc: Jack Stone <jwjstone@fastmail.fm>, Mac <kmac@poczta.fm>,
linux-kernel@vger.kernel.org, linux-ppp@vger.kernel.org,
Greg Kroah-Hartman <gregkh@suse.de>,
Jiri Slaby <jirislaby@gmail.com>
Subject: Re: 'scheduling while atomic' during ppp connection on 2.6.37.1 and 2.6.38
Date: Thu, 31 Mar 2011 22:53:59 +0200 [thread overview]
Message-ID: <4D94E9E7.2050600@suse.cz> (raw)
In-Reply-To: <20110321110214.5174f1b2@lxorguk.ukuu.org.uk>
On 03/21/2011 12:02 PM, Alan Cox wrote:
>> Anyway is the test needed at all? I.e. could
>> tty->ops->write/chars_in_buffer/ntty_write_room be called with
>> port->port.count == 0 at all?
>
> I'm not entirely sure what the Nozomi driver is trying to do. Generally
> any case a driver is looking at port->port.count it's a bug and should
> not matter with the tty krefs. However the chances are it should be
> testing *something* instead in this case.
Well, I looked into the history of the driver and into the driver
itself. What I've found out is:
* tty_sem is useless now. It was used to protect port->tty_open_count
which was later switched to port->port.count. The lock should have been
switched to port->lock at that time too.
* the port->port.count == 0 tests are an illusion of protection against
race with hup.
IOW both of them are crap nowadays. The former doesn't protect anything,
the latter is not protected by anything.
What is the proper way to avoid a race with HUP in tty->ops->write,
chars_in_buffer, ntty_write_room and possibly others?
I looked into the drivers, moxa tests tty->driver_data (why? [1]), mxser
does nothing as well as rocket and many others. What is the reference
driver I should look into?
[1] Perhaps leftover from when moxa_shutdown used to NULL it.
I don't see why the driver should care at all. It has a tty,
tty->driver_data and thus all the HW info. So it should ignore the race,
i.e. test nothing, right?
thanks,
--
js
suse labs
next prev parent reply other threads:[~2011-03-31 20:54 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-03-19 22:06 'scheduling while atomic' during ppp connection on 2.6.37.1 and 2.6.38 Mac
2011-03-20 18:42 ` Jack Stone
2011-03-20 21:52 ` Jiri Slaby
2011-03-20 23:09 ` Jack Stone
2011-03-20 21:58 ` Alan Cox
2011-03-20 23:05 ` Jack Stone
2011-03-21 11:27 ` Alan Cox
2011-03-21 17:40 ` Jack Stone
2011-03-21 9:15 ` Jiri Slaby
2011-03-21 11:02 ` Alan Cox
2011-03-31 20:53 ` Jiri Slaby [this message]
2011-03-31 21:39 ` Alan Cox
-- strict thread matches above, loose matches on Subject: below --
2011-03-19 21:56 Mac
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=4D94E9E7.2050600@suse.cz \
--to=jslaby@suse.cz \
--cc=alan@lxorguk.ukuu.org.uk \
--cc=gregkh@suse.de \
--cc=jirislaby@gmail.com \
--cc=jwjstone@fastmail.fm \
--cc=kmac@poczta.fm \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-ppp@vger.kernel.org \
/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