* + s390-tty-prepare-for-put_char-to-return-success-fail.patch added to -mm tree
@ 2008-04-15 2:04 akpm
2008-04-15 7:21 ` Heiko Carstens
0 siblings, 1 reply; 6+ messages in thread
From: akpm @ 2008-04-15 2:04 UTC (permalink / raw)
To: mm-commits
Cc: alan, alan, borntraeger, heiko.carstens, peter.oberparleiter,
schwidefsky
The patch titled
s390 tty: Prepare for put_char to return success/fail
has been added to the -mm tree. Its filename is
s390-tty-prepare-for-put_char-to-return-success-fail.patch
Before you just go and hit "reply", please:
a) Consider who else should be cc'ed
b) Prefer to cc a suitable mailing list as well
c) Ideally: find the original patch on the mailing list and do a
reply-to-all to that, adding suitable additional cc's
*** Remember to use Documentation/SubmitChecklist when testing your code ***
See http://www.zip.com.au/~akpm/linux/patches/stuff/added-to-mm.txt to find
out what to do about this
The current -mm tree may be found at http://userweb.kernel.org/~akpm/mmotm/
------------------------------------------------------
Subject: s390 tty: Prepare for put_char to return success/fail
From: Alan Cox <alan@lxorguk.ukuu.org.uk>
Put the changes into the drivers first. This will still compile/work but
produce a warning if bisected so can still be debugged
Signed-off-by: Alan Cox <alan@redhat.com>
Cc: Martin Schwidefsky <schwidefsky@de.ibm.com>
Cc: Heiko Carstens <heiko.carstens@de.ibm.com>
Cc: Christian Borntraeger <borntraeger@de.ibm.com>
Cc: Peter Oberparleiter <peter.oberparleiter@de.ibm.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---
drivers/s390/char/con3215.c | 5 +++--
drivers/s390/char/sclp_tty.c | 4 ++--
drivers/s390/char/sclp_vt220.c | 6 +++++-
drivers/s390/char/tty3270.c | 3 ++-
4 files changed, 12 insertions(+), 6 deletions(-)
diff -puN drivers/s390/char/con3215.c~s390-tty-prepare-for-put_char-to-return-success-fail drivers/s390/char/con3215.c
--- a/drivers/s390/char/con3215.c~s390-tty-prepare-for-put_char-to-return-success-fail
+++ a/drivers/s390/char/con3215.c
@@ -982,15 +982,16 @@ tty3215_write(struct tty_struct * tty,
/*
* Put character routine for 3215 ttys
*/
-static void
+static int
tty3215_put_char(struct tty_struct *tty, unsigned char ch)
{
struct raw3215_info *raw;
if (!tty)
- return;
+ return 0;
raw = (struct raw3215_info *) tty->driver_data;
raw3215_putchar(raw, ch);
+ return 1;
}
static void
diff -puN drivers/s390/char/sclp_tty.c~s390-tty-prepare-for-put_char-to-return-success-fail drivers/s390/char/sclp_tty.c
--- a/drivers/s390/char/sclp_tty.c~s390-tty-prepare-for-put_char-to-return-success-fail
+++ a/drivers/s390/char/sclp_tty.c
@@ -412,14 +412,14 @@ sclp_tty_write(struct tty_struct *tty, c
* - including previous characters from sclp_tty_put_char() and strings from
* sclp_write() without final '\n' - will be written.
*/
-static void
+static int
sclp_tty_put_char(struct tty_struct *tty, unsigned char ch)
{
sclp_tty_chars[sclp_tty_chars_count++] = ch;
if (ch == '\n' || sclp_tty_chars_count >= SCLP_TTY_BUF_SIZE) {
sclp_tty_write_string(sclp_tty_chars, sclp_tty_chars_count);
sclp_tty_chars_count = 0;
- }
+ } return 1;
}
/*
diff -puN drivers/s390/char/sclp_vt220.c~s390-tty-prepare-for-put_char-to-return-success-fail drivers/s390/char/sclp_vt220.c
--- a/drivers/s390/char/sclp_vt220.c~s390-tty-prepare-for-put_char-to-return-success-fail
+++ a/drivers/s390/char/sclp_vt220.c
@@ -524,11 +524,15 @@ sclp_vt220_close(struct tty_struct *tty,
* NOTE: include/linux/tty_driver.h specifies that a character should be
* ignored if there is no room in the queue. This driver implements a different
* semantic in that it will block when there is no more room left.
+ *
+ * FIXME: putchar can currently be called from BH and other non blocking
+ * handlers so this semantic isn't a good idea.
*/
-static void
+static int
sclp_vt220_put_char(struct tty_struct *tty, unsigned char ch)
{
__sclp_vt220_write(&ch, 1, 0, 0, 1);
+ return 1;
}
/*
diff -puN drivers/s390/char/tty3270.c~s390-tty-prepare-for-put_char-to-return-success-fail drivers/s390/char/tty3270.c
--- a/drivers/s390/char/tty3270.c~s390-tty-prepare-for-put_char-to-return-success-fail
+++ a/drivers/s390/char/tty3270.c
@@ -965,7 +965,7 @@ tty3270_write_room(struct tty_struct *tt
* Insert character into the screen at the current position with the
* current color and highlight. This function does NOT do cursor movement.
*/
-static void
+static int
tty3270_put_character(struct tty3270 *tp, char ch)
{
struct tty3270_line *line;
@@ -986,6 +986,7 @@ tty3270_put_character(struct tty3270 *tp
cell->character = tp->view.ascebc[(unsigned int) ch];
cell->highlight = tp->highlight;
cell->f_color = tp->f_color;
+ return 1;
}
/*
_
Patches currently in -mm which might be from alan@lxorguk.ukuu.org.uk are
add-time_is_after_jiffies-and-others-which-compare-with-jiffies.patch
git-libata-all.patch
pata_atiixp-simplex-clear.patch
pata_atiixp-simplex-clear-fix.patch
8390-split-8390-support-into-a-pausing-and-a-non-pausing-driver-core.patch
8390-split-8390-support-into-a-pausing-and-a-non-pausing-driver-core-fix.patch
parisc-new-termios-definitions.patch
aacraid-fix-unchecked-down_interruptible.patch
crisv10-prepare-for-bkl-push-down.patch
fix-tty-speed-handling-on-8250.patch
uart_get_baud_rate-stop-mangling-termios.patch
serial-8250-tighten-test-for-using-backup-timer.patch
x86-geode-add-virtual-systems-architecture-detection.patch
do_task_stat-dont-take-rcu_read_lock.patch
amiserial-prepare-for-locking-relaxation-in-caller.patch
cyclades-prepare-for-relaxed-locking-in-callers.patch
epca-lock_kernel-push-down.patch
esp-lock_kernel-push-down.patch
isicom-prepare-for-lock_kernel-push-down.patch
isicom-istallion-prepare-for-lock_kernel-pushdown.patch
mxser-prepare-for-bkl-pushdown.patch
riscom8-prepare-for-bkl-pushdown.patch
rocket-prepare-for-bkl-pushdown.patch
serial167-prepare-to-push-bkl-down-into-drivers.patch
specialix-prepare-for-bkl-pushdown.patch
stallion-prepare-for-bkl-push-down.patch
sx-prepare-for-bkl-pushdown.patch
synclink-series-prepare-for-bkl-pushdown.patch
viocons-bkl-locking.patch
vt_ioctl-prepare-for-bkl-push-down.patch
isdn_tty-prepare-for-bkl-push-down.patch
68360serial-note-that-there-isnt-any-info-mcr-locking.patch
serial_core-prepare-for-bkl-push-down.patch
tty-bkl-pushdown.patch
tty-bkl-pushdown-fix1.patch
redo-locking-of-tty-pgrp.patch
resume-tty-on-susp-and-fix-crnl-order-in-n_tty-line-discipline.patch
tty_io-fix-remaining-pid-struct-locking.patch
tty_io-fix-remaining-pid-struct-locking-small-cleanup.patch
tty_ioctl-locking-for-tty_wait_until_sent.patch
tty_ioctl-soft-carrier-handling.patch
tty-drop-the-bkl-for-driver-ldisc-ioctl-methods.patch
sxc-fix-printk-warnings-on-sparc32.patch
istallion-tiocg-ssoftcar-handling-removal.patch
tty-serial-lay-the-foundations-for-the-next-set-of-reworks.patch
s390-tty-prepare-for-put_char-to-return-success-fail.patch
serial-m68k-put_char-returns.patch
usb-gadget-switch-to-put_char-returning-int.patch
amiserial-switch-put-char-to-return-success-fail.patch
char-switch-gs-cyclades-and-esp-to-return-int-for-put_char.patch
mxser-switch-to-put_char-being-int.patch
pcmcia-serial-to-int-put_char-method.patch
riscom-rocket-switch-to-int-put_char-method.patch
serial167-switch-to-int-put_char-method.patch
specialix-switch-to-int-put_char-method.patch
synclink-series-switch-to-int-put_char-method.patch
consoles-switch-to-int-put_char-method.patch
isdn-switch-to-int-put_char-method.patch
pty-prepare-for-tty-ops-changes.patch
pc300-update-to-tty_set_operations.patch
serial-switch-the-serial-core-to-int-put_char-methods.patch
isicom-bring-into-coding-style.patch
tty-the-big-operations-rework.patch
strip-fix-up-strip-for-the-new-order.patch
edac-new-support-for-intel-3100-chipset.patch
edac-add-e752x-parameter-for-sysbus_parity-selection.patch
edac-add-e752x-parameter-for-sysbus_parity-selection-checkpatch-fixes.patch
edac-remove-unneeded-functions-and-add-static-accessor.patch
edac-fix-module-initialization-on-several-modules-2nd-time.patch
put_pid-make-sure-we-dont-free-the-live-pid.patch
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: + s390-tty-prepare-for-put_char-to-return-success-fail.patch added to -mm tree
2008-04-15 2:04 + s390-tty-prepare-for-put_char-to-return-success-fail.patch added to -mm tree akpm
@ 2008-04-15 7:21 ` Heiko Carstens
2008-04-15 10:11 ` Alan Cox
0 siblings, 1 reply; 6+ messages in thread
From: Heiko Carstens @ 2008-04-15 7:21 UTC (permalink / raw)
To: linux-kernel
Cc: alan, alan, borntraeger, peter.oberparleiter, schwidefsky,
Andrew Morton
> * NOTE: include/linux/tty_driver.h specifies that a character should be
> * ignored if there is no room in the queue. This driver implements a different
> * semantic in that it will block when there is no more room left.
> + *
> + * FIXME: putchar can currently be called from BH and other non blocking
> + * handlers so this semantic isn't a good idea.
> */
> -static void
> +static int
> sclp_vt220_put_char(struct tty_struct *tty, unsigned char ch)
> {
> __sclp_vt220_write(&ch, 1, 0, 0, 1);
> + return 1;
Uh, oh... the comment above used to mean "block if in schedulable context or
busy wait otherwise". Figuring out which context we were in was done via
in_atomic(), which was broken on !SMP anyway, so that had to go.
So the last parameter for __sclp_vt220_write is now an indicator if scheduling
is allowed or not (1 means yes). Somebody told me that the put_char routine
will only be called from schedulable context, which now doesn't seem to be
true?!
For the console functions we pass indeed 0 to __sclp_vt220_write since printk
may be called within any context. Is that also true for the tty put_char
routine?
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: + s390-tty-prepare-for-put_char-to-return-success-fail.patch added to -mm tree
2008-04-15 7:21 ` Heiko Carstens
@ 2008-04-15 10:11 ` Alan Cox
2008-04-15 10:45 ` Heiko Carstens
0 siblings, 1 reply; 6+ messages in thread
From: Alan Cox @ 2008-04-15 10:11 UTC (permalink / raw)
To: Heiko Carstens
Cc: linux-kernel, alan, borntraeger, peter.oberparleiter, schwidefsky,
Andrew Morton
> is allowed or not (1 means yes). Somebody told me that the put_char routine
> will only be called from schedulable context, which now doesn't seem to be
> true?!
It isnt true.
> For the console functions we pass indeed 0 to __sclp_vt220_write since printk
> may be called within any context. Is that also true for the tty put_char
> routine?
Yes, but failing a put_char is perfectly acceptable.
Alan
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: + s390-tty-prepare-for-put_char-to-return-success-fail.patch added to -mm tree
2008-04-15 10:11 ` Alan Cox
@ 2008-04-15 10:45 ` Heiko Carstens
2008-04-15 11:07 ` Alan Cox
0 siblings, 1 reply; 6+ messages in thread
From: Heiko Carstens @ 2008-04-15 10:45 UTC (permalink / raw)
To: Alan Cox
Cc: linux-kernel, alan, borntraeger, peter.oberparleiter, schwidefsky,
Andrew Morton
On Tue, Apr 15, 2008 at 11:11:01AM +0100, Alan Cox wrote:
> > is allowed or not (1 means yes). Somebody told me that the put_char routine
> > will only be called from schedulable context, which now doesn't seem to be
> > true?!
>
> It isnt true.
>
> > For the console functions we pass indeed 0 to __sclp_vt220_write since printk
> > may be called within any context. Is that also true for the tty put_char
> > routine?
>
> Yes, but failing a put_char is perfectly acceptable.
Ok, thanks for pointing this out! We are going to fix this as soon as your
patch is merged, so we can avoid further merge conflicts.
I assume your patch is for 2.6.26?
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: + s390-tty-prepare-for-put_char-to-return-success-fail.patch added to -mm tree
2008-04-15 10:45 ` Heiko Carstens
@ 2008-04-15 11:07 ` Alan Cox
2008-04-15 17:59 ` Andrew Morton
0 siblings, 1 reply; 6+ messages in thread
From: Alan Cox @ 2008-04-15 11:07 UTC (permalink / raw)
To: Heiko Carstens
Cc: Alan Cox, linux-kernel, alan, borntraeger, peter.oberparleiter,
schwidefsky, Andrew Morton
On Tue, Apr 15, 2008 at 12:45:07PM +0200, Heiko Carstens wrote:
> Ok, thanks for pointing this out! We are going to fix this as soon as your
> patch is merged, so we can avoid further merge conflicts.
> I assume your patch is for 2.6.26?
I would hope so - assuming no other bugs fall out of this.
Alan
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: + s390-tty-prepare-for-put_char-to-return-success-fail.patch added to -mm tree
2008-04-15 11:07 ` Alan Cox
@ 2008-04-15 17:59 ` Andrew Morton
0 siblings, 0 replies; 6+ messages in thread
From: Andrew Morton @ 2008-04-15 17:59 UTC (permalink / raw)
To: Alan Cox
Cc: Heiko Carstens, Alan Cox, linux-kernel, borntraeger,
peter.oberparleiter, schwidefsky
On Tue, 15 Apr 2008 07:07:45 -0400 Alan Cox <alan@redhat.com> wrote:
> On Tue, Apr 15, 2008 at 12:45:07PM +0200, Heiko Carstens wrote:
> > Ok, thanks for pointing this out! We are going to fix this as soon as your
> > patch is merged, so we can avoid further merge conflicts.
> > I assume your patch is for 2.6.26?
>
> I would hope so - assuming no other bugs fall out of this.
>
It might be a bit late to find out - I'll _try_ to squeeze a -mm out this
week, but I have an ill-timed trip next week and then we're into the merge
window.
So please do double-check that it's not all catastrophically buggy in some
way ;)
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2008-04-15 18:01 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-04-15 2:04 + s390-tty-prepare-for-put_char-to-return-success-fail.patch added to -mm tree akpm
2008-04-15 7:21 ` Heiko Carstens
2008-04-15 10:11 ` Alan Cox
2008-04-15 10:45 ` Heiko Carstens
2008-04-15 11:07 ` Alan Cox
2008-04-15 17:59 ` Andrew Morton
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.