public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* ppp_synctty and in_interrupt
@ 2002-06-13 14:25 Klaus Herb
  2002-06-13 15:06 ` Paul Fulghum
  0 siblings, 1 reply; 2+ messages in thread
From: Klaus Herb @ 2002-06-13 14:25 UTC (permalink / raw)
  To: 'linux-kernel@vger.kernel.org'

Hello,
I am currently developing a tty-Driver which is used for synchronous PPP.

System:
Board		Special Hardware with a Motorola XPC8260 Microcontroller
OS		Elinos V2 with Kernel Version 2.4.3
PPP		pppd and ppp Modules Version 2.4.1

The following Problem occurs:

The ppp_synctty ldisc only calls my ttywrite function in interrupt context. 
But to avoid a race condition I must include a Semaphore in my ttywrite 
function, so I get a Kernel Oops when this Semaphore causes a call to 
schedule().

Is there a way to stop this ppp_synctty ldisc from sending in Interrupt 
Context?
or
Why does this ldisc only write in interrupt context?


Please CC your replay to klaus.herb@ikon-gmbh.de


Thanks!

Klaus Herb

 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Klaus Herb
ikon GmbH
Benzstrasse 17
89079 Ulm
Germany

phone  +49/731/94661-0
fax       +49/731/94661-61
mailto:klaus.herb@ikon-gmbh.de
http://www.ikon-gmbh.de
 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: ppp_synctty and in_interrupt
  2002-06-13 14:25 ppp_synctty and in_interrupt Klaus Herb
@ 2002-06-13 15:06 ` Paul Fulghum
  0 siblings, 0 replies; 2+ messages in thread
From: Paul Fulghum @ 2002-06-13 15:06 UTC (permalink / raw)
  To: klaus.herb, linux-kernel

> I am currently developing a tty-Driver which is used for synchronous PPP.
> ...
> The ppp_synctty ldisc only calls my ttywrite function in interrupt
context.
> But to avoid a race condition I must include a Semaphore in my ttywrite
> function, so I get a Kernel Oops when this Semaphore causes a call to
> schedule().
>
> Is there a way to stop this ppp_synctty ldisc from sending in Interrupt
> Context?
> or
> Why does this ldisc only write in interrupt context?
>
> Please CC your replay to klaus.herb@ikon-gmbh.de

It should not call the tty write function in interrupt context.

The ldisc will call the tty write in two situtations:
1. when a new packet to send is available
2. when the tty driver calls the ldisc write_wakeup
  to send queued frames

My guess is that your driver is calling write_wakeup
in an interrupt context (in response to a tx complete IRQ).
You should call write_wakeup() from a bottom half
handler scheduled by the interrupt service routine instead
of directly from the ISR.

Paul Fulghum, paulkf@microgate.com
Microgate Corporation, www.microgate.com


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2002-06-13 15:09 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-06-13 14:25 ppp_synctty and in_interrupt Klaus Herb
2002-06-13 15:06 ` Paul Fulghum

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox