aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/s390/char/raw3270.c
diff options
context:
space:
mode:
authorSebastian Ott <sebott@linux.vnet.ibm.com>2014-01-27 07:28:10 -0500
committerMartin Schwidefsky <schwidefsky@de.ibm.com>2014-02-21 02:50:12 -0500
commit1e5320960510d6d6f2cbdc7ed33df9791283b7ea (patch)
tree85e3fbb9184567856ad88125d7edb7a93e4bd059 /drivers/s390/char/raw3270.c
parent2253e8d79237c69086ded391e6767afe16972527 (diff)
s390/cio: reorder initialization of ccw consoles
Drivers for ccw consoles use ccw_device_probe_console to receive an initialized ccw device which is already enabled for interrupts. After that the device driver does the initialization of its private data. This can race with unsolicited interrupts which can happen once the device is enabled for interrupts. Split ccw_device_probe_console into ccw_device_create_console and ccw_device_enable_console and reorder the initialization of the ccw console drivers. While at it mark these functions as __init. Reviewed-by: Peter Oberparleiter <oberpar@linux.vnet.ibm.com> Signed-off-by: Sebastian Ott <sebott@linux.vnet.ibm.com> Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Diffstat (limited to 'drivers/s390/char/raw3270.c')
-rw-r--r--drivers/s390/char/raw3270.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/drivers/s390/char/raw3270.c b/drivers/s390/char/raw3270.c
index de2c0483949f..041c65bc7bb1 100644
--- a/drivers/s390/char/raw3270.c
+++ b/drivers/s390/char/raw3270.c
@@ -790,7 +790,7 @@ struct raw3270 __init *raw3270_setup_console(void)
790 char *ascebc; 790 char *ascebc;
791 int rc; 791 int rc;
792 792
793 cdev = ccw_device_probe_console(&raw3270_ccw_driver); 793 cdev = ccw_device_create_console(&raw3270_ccw_driver);
794 if (IS_ERR(cdev)) 794 if (IS_ERR(cdev))
795 return ERR_CAST(cdev); 795 return ERR_CAST(cdev);
796 796
@@ -800,6 +800,13 @@ struct raw3270 __init *raw3270_setup_console(void)
800 if (rc) 800 if (rc)
801 return ERR_PTR(rc); 801 return ERR_PTR(rc);
802 set_bit(RAW3270_FLAGS_CONSOLE, &rp->flags); 802 set_bit(RAW3270_FLAGS_CONSOLE, &rp->flags);
803
804 rc = ccw_device_enable_console(cdev);
805 if (rc) {
806 ccw_device_destroy_console(cdev);
807 return ERR_PTR(rc);
808 }
809
803 spin_lock_irqsave(get_ccwdev_lock(rp->cdev), flags); 810 spin_lock_irqsave(get_ccwdev_lock(rp->cdev), flags);
804 do { 811 do {
805 __raw3270_reset_device(rp); 812 __raw3270_reset_device(rp);