From: Martin Diehl <lists@mdiehl.de>
To: Paul Mackerras <paulus@samba.org>
Cc: Greg KH <greg@kroah.com>, <linux-kernel@vger.kernel.org>
Subject: Re: calling context when writing to tty_driver
Date: Thu, 3 Oct 2002 23:36:38 +0200 (CEST) [thread overview]
Message-ID: <Pine.LNX.4.44.0210032251480.3802-100000@notebook.home.mdiehl.de> (raw)
In-Reply-To: <15772.4878.969143.541225@nanango.paulus.ozlabs.org>
On Thu, 3 Oct 2002, Paul Mackerras wrote:
> > > If we agree serial drivers shouldn't sleep in write_room()/write() my
> > > impression is this needs to be addressed somehow, regardless whether
> > > usbserial uses the new serial core or not. Anybody tried this with a
> > > bluetooth dongle over usbserial?
> >
> > I don't know, do we agree that you can't sleep in those functions? If
> > so, I'll look into fixing the usbserial drivers up.
>
> I really think that write and write_room shouldn't be allowed to
> sleep. If they can sleep it will cause much grief for PPP, since the
> PPP start_xmit function does get called in softirq context, and in the
> common case where you are doing PPP over a serial port, that will
> ultimately end up in a call to the serial port's write routine. If we
> can't call the write routine from softirq context, that will mean we
... would see tons (basically 1+ per frame) of this:
usb.c: registered new driver serial
usbserial.c: USB Serial support registered for Generic
usbserial.c: USB Serial Driver core v1.6
usbserial.c: USB Serial support registered for PL-2303
usbserial.c: PL-2303 converter detected
usbserial.c: PL-2303 converter now attached to ttyUSB0 (or usb/tts/0 for devfs)
usb.c: registered new driver pl2303
pl2303.c: Prolific PL2303 USB to serial adaptor driver v0.9
CSLIP: code copyright 1989 Regents of the University of California
PPP generic driver version 2.4.2
Sleeping function called from illegal context at
/mnt/disk/kernel/v2.5.39-md/include/asm/semaphore.h:119
c72afe8c c011aa62 c024f160 cc88f780 00000077 ffffffea cc88d500 cc88f780
00000077 0000002d c921b000 00000000 c834a000 cc8a4e3c c834a000 00000000
c921b0ac 0000002d 00000001 00000060 00000246 cbfbdd04 000000c0 c921b000
Call Trace:
[<c011aa62>]__might_sleep+0x42/0x47
[<cc88f780>].LC4+0x0/0x100 [usbserial]
[<cc88d500>]serial_write+0x80/0x130 [usbserial]
[<cc88f780>].LC4+0x0/0x100 [usbserial]
[<cc8a4e3c>]ppp_async_push+0xcc/0x270 [ppp_async]
[<cc8a4d59>]ppp_async_send+0x39/0x50 [ppp_async]
[<cc89dd55>]ppp_channel_push+0x105/0x390 [ppp_generic]
[<c01fd348>]alloc_skb+0xe8/0x1e0
[<cc89c42f>]ppp_write+0x16f/0x180 [ppp_generic]
[<c014b277>]vfs_write+0xb7/0x140
[<c014b368>]sys_write+0x28/0x40
[<c01077d7>]syscall_call+0x7/0xb
My initial question for the irda ldisc was basically to find out whether
the assumption about write/write_room should not sleep was reasonable.
Looks like I'd better stay with this approach for now. The hope is it will
continue to work with serial - and with usbserial probably later ;-)
Martin
next prev parent reply other threads:[~2002-10-03 21:27 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-10-01 10:37 calling context when writing to tty_driver Martin Diehl
2002-10-01 11:13 ` David McIlwraith
2002-10-01 11:28 ` Martin Diehl
2002-10-01 11:32 ` David McIlwraith
2002-10-01 18:34 ` Greg KH
2002-10-01 19:30 ` Russell King
2002-10-01 21:10 ` Martin Diehl
2002-10-03 6:52 ` Greg KH
2002-10-03 9:51 ` Paul Mackerras
2002-10-03 21:36 ` Martin Diehl [this message]
2002-10-01 23:20 ` Paul Mackerras
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=Pine.LNX.4.44.0210032251480.3802-100000@notebook.home.mdiehl.de \
--to=lists@mdiehl.de \
--cc=greg@kroah.com \
--cc=linux-kernel@vger.kernel.org \
--cc=paulus@samba.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;
as well as URLs for NNTP newsgroup(s).