aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/s390
diff options
context:
space:
mode:
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>2013-04-14 22:13:28 -0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2013-04-14 22:13:28 -0400
commit11b397e6eb12191300ca19290f29f51f61118953 (patch)
tree6e0f8cb52cbcdb02108755f3d643a025a943bd79 /drivers/s390
parente1c969f7814dcd23bbfe8d777544321a492b6fee (diff)
parent41ef2d5678d83af030125550329b6ae8b74618fa (diff)
Merge 3.9-rc7 intp tty-next
We want the fixes here. Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/s390')
-rw-r--r--drivers/s390/block/scm_blk.c11
-rw-r--r--drivers/s390/block/scm_drv.c2
-rw-r--r--drivers/s390/char/tty3270.c16
-rw-r--r--drivers/s390/net/qeth_core.h3
-rw-r--r--drivers/s390/net/qeth_core_main.c19
-rw-r--r--drivers/s390/net/qeth_l2_main.c2
-rw-r--r--drivers/s390/net/qeth_l3_main.c2
7 files changed, 43 insertions, 12 deletions
diff --git a/drivers/s390/block/scm_blk.c b/drivers/s390/block/scm_blk.c
index 5ac9c935c151..e9b9c8392832 100644
--- a/drivers/s390/block/scm_blk.c
+++ b/drivers/s390/block/scm_blk.c
@@ -307,7 +307,7 @@ static void scm_blk_handle_error(struct scm_request *scmrq)
307 case EQC_WR_PROHIBIT: 307 case EQC_WR_PROHIBIT:
308 spin_lock_irqsave(&bdev->lock, flags); 308 spin_lock_irqsave(&bdev->lock, flags);
309 if (bdev->state != SCM_WR_PROHIBIT) 309 if (bdev->state != SCM_WR_PROHIBIT)
310 pr_info("%lu: Write access to the SCM increment is suspended\n", 310 pr_info("%lx: Write access to the SCM increment is suspended\n",
311 (unsigned long) bdev->scmdev->address); 311 (unsigned long) bdev->scmdev->address);
312 bdev->state = SCM_WR_PROHIBIT; 312 bdev->state = SCM_WR_PROHIBIT;
313 spin_unlock_irqrestore(&bdev->lock, flags); 313 spin_unlock_irqrestore(&bdev->lock, flags);
@@ -445,7 +445,7 @@ void scm_blk_set_available(struct scm_blk_dev *bdev)
445 445
446 spin_lock_irqsave(&bdev->lock, flags); 446 spin_lock_irqsave(&bdev->lock, flags);
447 if (bdev->state == SCM_WR_PROHIBIT) 447 if (bdev->state == SCM_WR_PROHIBIT)
448 pr_info("%lu: Write access to the SCM increment is restored\n", 448 pr_info("%lx: Write access to the SCM increment is restored\n",
449 (unsigned long) bdev->scmdev->address); 449 (unsigned long) bdev->scmdev->address);
450 bdev->state = SCM_OPER; 450 bdev->state = SCM_OPER;
451 spin_unlock_irqrestore(&bdev->lock, flags); 451 spin_unlock_irqrestore(&bdev->lock, flags);
@@ -463,12 +463,15 @@ static int __init scm_blk_init(void)
463 goto out; 463 goto out;
464 464
465 scm_major = ret; 465 scm_major = ret;
466 if (scm_alloc_rqs(nr_requests)) 466 ret = scm_alloc_rqs(nr_requests);
467 if (ret)
467 goto out_unreg; 468 goto out_unreg;
468 469
469 scm_debug = debug_register("scm_log", 16, 1, 16); 470 scm_debug = debug_register("scm_log", 16, 1, 16);
470 if (!scm_debug) 471 if (!scm_debug) {
472 ret = -ENOMEM;
471 goto out_free; 473 goto out_free;
474 }
472 475
473 debug_register_view(scm_debug, &debug_hex_ascii_view); 476 debug_register_view(scm_debug, &debug_hex_ascii_view);
474 debug_set_level(scm_debug, 2); 477 debug_set_level(scm_debug, 2);
diff --git a/drivers/s390/block/scm_drv.c b/drivers/s390/block/scm_drv.c
index 5f6180d6ff08..c98cf52d78d1 100644
--- a/drivers/s390/block/scm_drv.c
+++ b/drivers/s390/block/scm_drv.c
@@ -19,7 +19,7 @@ static void scm_notify(struct scm_device *scmdev, enum scm_event event)
19 19
20 switch (event) { 20 switch (event) {
21 case SCM_CHANGE: 21 case SCM_CHANGE:
22 pr_info("%lu: The capabilities of the SCM increment changed\n", 22 pr_info("%lx: The capabilities of the SCM increment changed\n",
23 (unsigned long) scmdev->address); 23 (unsigned long) scmdev->address);
24 SCM_LOG(2, "State changed"); 24 SCM_LOG(2, "State changed");
25 SCM_LOG_STATE(2, scmdev); 25 SCM_LOG_STATE(2, scmdev);
diff --git a/drivers/s390/char/tty3270.c b/drivers/s390/char/tty3270.c
index b907dba24025..cee69dac3e18 100644
--- a/drivers/s390/char/tty3270.c
+++ b/drivers/s390/char/tty3270.c
@@ -915,7 +915,7 @@ static int tty3270_install(struct tty_driver *driver, struct tty_struct *tty)
915 int i, rc; 915 int i, rc;
916 916
917 /* Check if the tty3270 is already there. */ 917 /* Check if the tty3270 is already there. */
918 view = raw3270_find_view(&tty3270_fn, tty->index); 918 view = raw3270_find_view(&tty3270_fn, tty->index + RAW3270_FIRSTMINOR);
919 if (!IS_ERR(view)) { 919 if (!IS_ERR(view)) {
920 tp = container_of(view, struct tty3270, view); 920 tp = container_of(view, struct tty3270, view);
921 tty->driver_data = tp; 921 tty->driver_data = tp;
@@ -927,15 +927,16 @@ static int tty3270_install(struct tty_driver *driver, struct tty_struct *tty)
927 tp->inattr = TF_INPUT; 927 tp->inattr = TF_INPUT;
928 return tty_port_install(&tp->port, driver, tty); 928 return tty_port_install(&tp->port, driver, tty);
929 } 929 }
930 if (tty3270_max_index < tty->index) 930 if (tty3270_max_index < tty->index + 1)
931 tty3270_max_index = tty->index; 931 tty3270_max_index = tty->index + 1;
932 932
933 /* Allocate tty3270 structure on first open. */ 933 /* Allocate tty3270 structure on first open. */
934 tp = tty3270_alloc_view(); 934 tp = tty3270_alloc_view();
935 if (IS_ERR(tp)) 935 if (IS_ERR(tp))
936 return PTR_ERR(tp); 936 return PTR_ERR(tp);
937 937
938 rc = raw3270_add_view(&tp->view, &tty3270_fn, tty->index); 938 rc = raw3270_add_view(&tp->view, &tty3270_fn,
939 tty->index + RAW3270_FIRSTMINOR);
939 if (rc) { 940 if (rc) {
940 tty3270_free_view(tp); 941 tty3270_free_view(tp);
941 return rc; 942 return rc;
@@ -1846,12 +1847,12 @@ static const struct tty_operations tty3270_ops = {
1846 1847
1847void tty3270_create_cb(int minor) 1848void tty3270_create_cb(int minor)
1848{ 1849{
1849 tty_register_device(tty3270_driver, minor, NULL); 1850 tty_register_device(tty3270_driver, minor - RAW3270_FIRSTMINOR, NULL);
1850} 1851}
1851 1852
1852void tty3270_destroy_cb(int minor) 1853void tty3270_destroy_cb(int minor)
1853{ 1854{
1854 tty_unregister_device(tty3270_driver, minor); 1855 tty_unregister_device(tty3270_driver, minor - RAW3270_FIRSTMINOR);
1855} 1856}
1856 1857
1857struct raw3270_notifier tty3270_notifier = 1858struct raw3270_notifier tty3270_notifier =
@@ -1884,7 +1885,8 @@ static int __init tty3270_init(void)
1884 driver->driver_name = "tty3270"; 1885 driver->driver_name = "tty3270";
1885 driver->name = "3270/tty"; 1886 driver->name = "3270/tty";
1886 driver->major = IBM_TTY3270_MAJOR; 1887 driver->major = IBM_TTY3270_MAJOR;
1887 driver->minor_start = 0; 1888 driver->minor_start = RAW3270_FIRSTMINOR;
1889 driver->name_base = RAW3270_FIRSTMINOR;
1888 driver->type = TTY_DRIVER_TYPE_SYSTEM; 1890 driver->type = TTY_DRIVER_TYPE_SYSTEM;
1889 driver->subtype = SYSTEM_TYPE_TTY; 1891 driver->subtype = SYSTEM_TYPE_TTY;
1890 driver->init_termios = tty_std_termios; 1892 driver->init_termios = tty_std_termios;
diff --git a/drivers/s390/net/qeth_core.h b/drivers/s390/net/qeth_core.h
index 8c0622399fcd..6ccb7457746b 100644
--- a/drivers/s390/net/qeth_core.h
+++ b/drivers/s390/net/qeth_core.h
@@ -769,6 +769,7 @@ struct qeth_card {
769 unsigned long thread_start_mask; 769 unsigned long thread_start_mask;
770 unsigned long thread_allowed_mask; 770 unsigned long thread_allowed_mask;
771 unsigned long thread_running_mask; 771 unsigned long thread_running_mask;
772 struct task_struct *recovery_task;
772 spinlock_t ip_lock; 773 spinlock_t ip_lock;
773 struct list_head ip_list; 774 struct list_head ip_list;
774 struct list_head *ip_tbd_list; 775 struct list_head *ip_tbd_list;
@@ -862,6 +863,8 @@ extern struct qeth_card_list_struct qeth_core_card_list;
862extern struct kmem_cache *qeth_core_header_cache; 863extern struct kmem_cache *qeth_core_header_cache;
863extern struct qeth_dbf_info qeth_dbf[QETH_DBF_INFOS]; 864extern struct qeth_dbf_info qeth_dbf[QETH_DBF_INFOS];
864 865
866void qeth_set_recovery_task(struct qeth_card *);
867void qeth_clear_recovery_task(struct qeth_card *);
865void qeth_set_allowed_threads(struct qeth_card *, unsigned long , int); 868void qeth_set_allowed_threads(struct qeth_card *, unsigned long , int);
866int qeth_threads_running(struct qeth_card *, unsigned long); 869int qeth_threads_running(struct qeth_card *, unsigned long);
867int qeth_wait_for_threads(struct qeth_card *, unsigned long); 870int qeth_wait_for_threads(struct qeth_card *, unsigned long);
diff --git a/drivers/s390/net/qeth_core_main.c b/drivers/s390/net/qeth_core_main.c
index 0d73a999983d..451f92020599 100644
--- a/drivers/s390/net/qeth_core_main.c
+++ b/drivers/s390/net/qeth_core_main.c
@@ -177,6 +177,23 @@ const char *qeth_get_cardname_short(struct qeth_card *card)
177 return "n/a"; 177 return "n/a";
178} 178}
179 179
180void qeth_set_recovery_task(struct qeth_card *card)
181{
182 card->recovery_task = current;
183}
184EXPORT_SYMBOL_GPL(qeth_set_recovery_task);
185
186void qeth_clear_recovery_task(struct qeth_card *card)
187{
188 card->recovery_task = NULL;
189}
190EXPORT_SYMBOL_GPL(qeth_clear_recovery_task);
191
192static bool qeth_is_recovery_task(const struct qeth_card *card)
193{
194 return card->recovery_task == current;
195}
196
180void qeth_set_allowed_threads(struct qeth_card *card, unsigned long threads, 197void qeth_set_allowed_threads(struct qeth_card *card, unsigned long threads,
181 int clear_start_mask) 198 int clear_start_mask)
182{ 199{
@@ -205,6 +222,8 @@ EXPORT_SYMBOL_GPL(qeth_threads_running);
205 222
206int qeth_wait_for_threads(struct qeth_card *card, unsigned long threads) 223int qeth_wait_for_threads(struct qeth_card *card, unsigned long threads)
207{ 224{
225 if (qeth_is_recovery_task(card))
226 return 0;
208 return wait_event_interruptible(card->wait_q, 227 return wait_event_interruptible(card->wait_q,
209 qeth_threads_running(card, threads) == 0); 228 qeth_threads_running(card, threads) == 0);
210} 229}
diff --git a/drivers/s390/net/qeth_l2_main.c b/drivers/s390/net/qeth_l2_main.c
index d690166efeaf..155b101bd730 100644
--- a/drivers/s390/net/qeth_l2_main.c
+++ b/drivers/s390/net/qeth_l2_main.c
@@ -1143,6 +1143,7 @@ static int qeth_l2_recover(void *ptr)
1143 QETH_CARD_TEXT(card, 2, "recover2"); 1143 QETH_CARD_TEXT(card, 2, "recover2");
1144 dev_warn(&card->gdev->dev, 1144 dev_warn(&card->gdev->dev,
1145 "A recovery process has been started for the device\n"); 1145 "A recovery process has been started for the device\n");
1146 qeth_set_recovery_task(card);
1146 __qeth_l2_set_offline(card->gdev, 1); 1147 __qeth_l2_set_offline(card->gdev, 1);
1147 rc = __qeth_l2_set_online(card->gdev, 1); 1148 rc = __qeth_l2_set_online(card->gdev, 1);
1148 if (!rc) 1149 if (!rc)
@@ -1153,6 +1154,7 @@ static int qeth_l2_recover(void *ptr)
1153 dev_warn(&card->gdev->dev, "The qeth device driver " 1154 dev_warn(&card->gdev->dev, "The qeth device driver "
1154 "failed to recover an error on the device\n"); 1155 "failed to recover an error on the device\n");
1155 } 1156 }
1157 qeth_clear_recovery_task(card);
1156 qeth_clear_thread_start_bit(card, QETH_RECOVER_THREAD); 1158 qeth_clear_thread_start_bit(card, QETH_RECOVER_THREAD);
1157 qeth_clear_thread_running_bit(card, QETH_RECOVER_THREAD); 1159 qeth_clear_thread_running_bit(card, QETH_RECOVER_THREAD);
1158 return 0; 1160 return 0;
diff --git a/drivers/s390/net/qeth_l3_main.c b/drivers/s390/net/qeth_l3_main.c
index 8710337dab3e..1f7edf1b26c3 100644
--- a/drivers/s390/net/qeth_l3_main.c
+++ b/drivers/s390/net/qeth_l3_main.c
@@ -3515,6 +3515,7 @@ static int qeth_l3_recover(void *ptr)
3515 QETH_CARD_TEXT(card, 2, "recover2"); 3515 QETH_CARD_TEXT(card, 2, "recover2");
3516 dev_warn(&card->gdev->dev, 3516 dev_warn(&card->gdev->dev,
3517 "A recovery process has been started for the device\n"); 3517 "A recovery process has been started for the device\n");
3518 qeth_set_recovery_task(card);
3518 __qeth_l3_set_offline(card->gdev, 1); 3519 __qeth_l3_set_offline(card->gdev, 1);
3519 rc = __qeth_l3_set_online(card->gdev, 1); 3520 rc = __qeth_l3_set_online(card->gdev, 1);
3520 if (!rc) 3521 if (!rc)
@@ -3525,6 +3526,7 @@ static int qeth_l3_recover(void *ptr)
3525 dev_warn(&card->gdev->dev, "The qeth device driver " 3526 dev_warn(&card->gdev->dev, "The qeth device driver "
3526 "failed to recover an error on the device\n"); 3527 "failed to recover an error on the device\n");
3527 } 3528 }
3529 qeth_clear_recovery_task(card);
3528 qeth_clear_thread_start_bit(card, QETH_RECOVER_THREAD); 3530 qeth_clear_thread_start_bit(card, QETH_RECOVER_THREAD);
3529 qeth_clear_thread_running_bit(card, QETH_RECOVER_THREAD); 3531 qeth_clear_thread_running_bit(card, QETH_RECOVER_THREAD);
3530 return 0; 3532 return 0;