Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

s390/3215: partially revert tty close handling fix

Partially revert ae289dc1f "s390/3215: fix tty close handling", since this
leads sometimes to hanging agetty processes and therefore systems that get
stuck while starting.

This was magically fixed (bisected) by a common code patch from Alan Cox:
36b3c070 "tty: Move the handling of the tty release logic", however it was
unrelated.

Since the removed code worked for a decade, nobody knows anymore why it was
in there in the first place and debugging the observed hang is non-trivial
(at least for me :) ), let's just re-add the removed code before we see
other side effects.

Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>

authored by

Heiko Carstens and committed by
Martin Schwidefsky
6673cd0b 93f3b2ee

+5 -1
+5 -1
drivers/s390/char/con3215.c
··· 44 44 #define RAW3215_NR_CCWS 3 45 45 #define RAW3215_TIMEOUT HZ/10 /* time for delayed output */ 46 46 47 + #define RAW3215_FIXED 1 /* 3215 console device is not be freed */ 47 48 #define RAW3215_WORKING 4 /* set if a request is being worked on */ 48 49 #define RAW3215_THROTTLED 8 /* set if reading is disabled */ 49 50 #define RAW3215_STOPPED 16 /* set if writing is disabled */ ··· 631 630 DECLARE_WAITQUEUE(wait, current); 632 631 unsigned long flags; 633 632 634 - if (!(raw->port.flags & ASYNC_INITIALIZED)) 633 + if (!(raw->port.flags & ASYNC_INITIALIZED) || 634 + (raw->flags & RAW3215_FIXED)) 635 635 return; 636 636 /* Wait for outstanding requests, then free irq */ 637 637 spin_lock_irqsave(get_ccwdev_lock(raw->cdev), flags); ··· 928 926 raw->cdev = cdev; 929 927 dev_set_drvdata(&cdev->dev, raw); 930 928 cdev->handler = raw3215_irq; 929 + 930 + raw->flags |= RAW3215_FIXED; 931 931 932 932 /* Request the console irq */ 933 933 if (raw3215_startup(raw) != 0) {