]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/commit
[S390] sclp_tty: Fix scheduling while atomic bug.
authorHeiko Carstens <heiko.carstens@de.ibm.com>
Mon, 14 Jul 2008 07:59:46 +0000 (09:59 +0200)
committerHeiko Carstens <heiko.carstens@de.ibm.com>
Mon, 14 Jul 2008 08:02:25 +0000 (10:02 +0200)
commit5e34599fc8ba1e8889095bd56a71fd9802ed5a51
tree180691e2c05ac92fd111e32e2eb1f3339c302b42
parent095761d28ae43eae7d4504d49b0b952cf02b0188
[S390] sclp_tty: Fix scheduling while atomic bug.

Finally fixes a possible scheduling while in atomic context bug. The driver
used to wait on a waitqueue if no empty buffer was available. This could
lead to a deadlock if the driver was called from non-schedulable context.
So fix this. The write operation may fail now. It returns the number of
characters accepted. put_char will never fail, since it writes characters
to an intermediate buffer which gets flushed as soon as it is full.
That means the driver now can busy wait if something is in the intermediate
buffer and a write_string operation follows. Seems to be an acceptable
compromise, since that shouldn't happen too often.

Cc: Peter Oberparleiter <peter.oberparleiter@de.ibm.com>
Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Cc: Martin Schwidefsky <schwidefsky@de.ibm.com>
drivers/s390/char/sclp_tty.c