aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/s390/cio/device_fsm.c
diff options
context:
space:
mode:
authorMartin Schwidefsky <schwidefsky@de.ibm.com>2006-12-08 09:53:57 -0500
committerMartin Schwidefsky <schwidefsky@de.ibm.com>2006-12-08 09:53:57 -0500
commitc16375329c2ab4667df873394c4be7a61d163c62 (patch)
tree9ee9505e4587ce5f472db3fd09935611b0062f83 /drivers/s390/cio/device_fsm.c
parente45ccc0562e3f391dcba8b2e8a02551e8e42d8db (diff)
[S390] more workqueue fixes.
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Diffstat (limited to 'drivers/s390/cio/device_fsm.c')
-rw-r--r--drivers/s390/cio/device_fsm.c38
1 files changed, 20 insertions, 18 deletions
diff --git a/drivers/s390/cio/device_fsm.c b/drivers/s390/cio/device_fsm.c
index 09c7672eb3f3..0f0301ce37fe 100644
--- a/drivers/s390/cio/device_fsm.c
+++ b/drivers/s390/cio/device_fsm.c
@@ -194,7 +194,7 @@ ccw_device_handle_oper(struct ccw_device *cdev)
194 cdev->id.dev_model != cdev->private->senseid.dev_model || 194 cdev->id.dev_model != cdev->private->senseid.dev_model ||
195 cdev->private->dev_id.devno != sch->schib.pmcw.dev) { 195 cdev->private->dev_id.devno != sch->schib.pmcw.dev) {
196 PREPARE_WORK(&cdev->private->kick_work, 196 PREPARE_WORK(&cdev->private->kick_work,
197 ccw_device_do_unreg_rereg, cdev); 197 ccw_device_do_unreg_rereg);
198 queue_work(ccw_device_work, &cdev->private->kick_work); 198 queue_work(ccw_device_work, &cdev->private->kick_work);
199 return 0; 199 return 0;
200 } 200 }
@@ -329,19 +329,21 @@ ccw_device_sense_id_done(struct ccw_device *cdev, int err)
329} 329}
330 330
331static void 331static void
332ccw_device_oper_notify(void *data) 332ccw_device_oper_notify(struct work_struct *work)
333{ 333{
334 struct ccw_device_private *priv;
334 struct ccw_device *cdev; 335 struct ccw_device *cdev;
335 struct subchannel *sch; 336 struct subchannel *sch;
336 int ret; 337 int ret;
337 338
338 cdev = data; 339 priv = container_of(work, struct ccw_device_private, kick_work);
340 cdev = priv->cdev;
339 sch = to_subchannel(cdev->dev.parent); 341 sch = to_subchannel(cdev->dev.parent);
340 ret = (sch->driver && sch->driver->notify) ? 342 ret = (sch->driver && sch->driver->notify) ?
341 sch->driver->notify(&sch->dev, CIO_OPER) : 0; 343 sch->driver->notify(&sch->dev, CIO_OPER) : 0;
342 if (!ret) 344 if (!ret)
343 /* Driver doesn't want device back. */ 345 /* Driver doesn't want device back. */
344 ccw_device_do_unreg_rereg(cdev); 346 ccw_device_do_unreg_rereg(work);
345 else { 347 else {
346 /* Reenable channel measurements, if needed. */ 348 /* Reenable channel measurements, if needed. */
347 cmf_reenable(cdev); 349 cmf_reenable(cdev);
@@ -377,8 +379,7 @@ ccw_device_done(struct ccw_device *cdev, int state)
377 379
378 if (cdev->private->flags.donotify) { 380 if (cdev->private->flags.donotify) {
379 cdev->private->flags.donotify = 0; 381 cdev->private->flags.donotify = 0;
380 PREPARE_WORK(&cdev->private->kick_work, ccw_device_oper_notify, 382 PREPARE_WORK(&cdev->private->kick_work, ccw_device_oper_notify);
381 cdev);
382 queue_work(ccw_device_notify_work, &cdev->private->kick_work); 383 queue_work(ccw_device_notify_work, &cdev->private->kick_work);
383 } 384 }
384 wake_up(&cdev->private->wait_q); 385 wake_up(&cdev->private->wait_q);
@@ -528,13 +529,15 @@ ccw_device_recog_timeout(struct ccw_device *cdev, enum dev_event dev_event)
528 529
529 530
530static void 531static void
531ccw_device_nopath_notify(void *data) 532ccw_device_nopath_notify(struct work_struct *work)
532{ 533{
534 struct ccw_device_private *priv;
533 struct ccw_device *cdev; 535 struct ccw_device *cdev;
534 struct subchannel *sch; 536 struct subchannel *sch;
535 int ret; 537 int ret;
536 538
537 cdev = data; 539 priv = container_of(work, struct ccw_device_private, kick_work);
540 cdev = priv->cdev;
538 sch = to_subchannel(cdev->dev.parent); 541 sch = to_subchannel(cdev->dev.parent);
539 /* Extra sanity. */ 542 /* Extra sanity. */
540 if (sch->lpm) 543 if (sch->lpm)
@@ -547,8 +550,7 @@ ccw_device_nopath_notify(void *data)
547 cio_disable_subchannel(sch); 550 cio_disable_subchannel(sch);
548 if (get_device(&cdev->dev)) { 551 if (get_device(&cdev->dev)) {
549 PREPARE_WORK(&cdev->private->kick_work, 552 PREPARE_WORK(&cdev->private->kick_work,
550 ccw_device_call_sch_unregister, 553 ccw_device_call_sch_unregister);
551 cdev);
552 queue_work(ccw_device_work, 554 queue_work(ccw_device_work,
553 &cdev->private->kick_work); 555 &cdev->private->kick_work);
554 } else 556 } else
@@ -607,7 +609,7 @@ ccw_device_verify_done(struct ccw_device *cdev, int err)
607 /* Reset oper notify indication after verify error. */ 609 /* Reset oper notify indication after verify error. */
608 cdev->private->flags.donotify = 0; 610 cdev->private->flags.donotify = 0;
609 PREPARE_WORK(&cdev->private->kick_work, 611 PREPARE_WORK(&cdev->private->kick_work,
610 ccw_device_nopath_notify, cdev); 612 ccw_device_nopath_notify);
611 queue_work(ccw_device_notify_work, &cdev->private->kick_work); 613 queue_work(ccw_device_notify_work, &cdev->private->kick_work);
612 ccw_device_done(cdev, DEV_STATE_NOT_OPER); 614 ccw_device_done(cdev, DEV_STATE_NOT_OPER);
613 break; 615 break;
@@ -738,7 +740,7 @@ ccw_device_offline_notoper(struct ccw_device *cdev, enum dev_event dev_event)
738 sch = to_subchannel(cdev->dev.parent); 740 sch = to_subchannel(cdev->dev.parent);
739 if (get_device(&cdev->dev)) { 741 if (get_device(&cdev->dev)) {
740 PREPARE_WORK(&cdev->private->kick_work, 742 PREPARE_WORK(&cdev->private->kick_work,
741 ccw_device_call_sch_unregister, cdev); 743 ccw_device_call_sch_unregister);
742 queue_work(ccw_device_work, &cdev->private->kick_work); 744 queue_work(ccw_device_work, &cdev->private->kick_work);
743 } 745 }
744 wake_up(&cdev->private->wait_q); 746 wake_up(&cdev->private->wait_q);
@@ -769,7 +771,7 @@ ccw_device_online_notoper(struct ccw_device *cdev, enum dev_event dev_event)
769 } 771 }
770 if (get_device(&cdev->dev)) { 772 if (get_device(&cdev->dev)) {
771 PREPARE_WORK(&cdev->private->kick_work, 773 PREPARE_WORK(&cdev->private->kick_work,
772 ccw_device_call_sch_unregister, cdev); 774 ccw_device_call_sch_unregister);
773 queue_work(ccw_device_work, &cdev->private->kick_work); 775 queue_work(ccw_device_work, &cdev->private->kick_work);
774 } 776 }
775 wake_up(&cdev->private->wait_q); 777 wake_up(&cdev->private->wait_q);
@@ -874,7 +876,7 @@ ccw_device_online_timeout(struct ccw_device *cdev, enum dev_event dev_event)
874 sch = to_subchannel(cdev->dev.parent); 876 sch = to_subchannel(cdev->dev.parent);
875 if (!sch->lpm) { 877 if (!sch->lpm) {
876 PREPARE_WORK(&cdev->private->kick_work, 878 PREPARE_WORK(&cdev->private->kick_work,
877 ccw_device_nopath_notify, cdev); 879 ccw_device_nopath_notify);
878 queue_work(ccw_device_notify_work, 880 queue_work(ccw_device_notify_work,
879 &cdev->private->kick_work); 881 &cdev->private->kick_work);
880 } else 882 } else
@@ -969,7 +971,7 @@ ccw_device_killing_irq(struct ccw_device *cdev, enum dev_event dev_event)
969 ERR_PTR(-EIO)); 971 ERR_PTR(-EIO));
970 if (!sch->lpm) { 972 if (!sch->lpm) {
971 PREPARE_WORK(&cdev->private->kick_work, 973 PREPARE_WORK(&cdev->private->kick_work,
972 ccw_device_nopath_notify, cdev); 974 ccw_device_nopath_notify);
973 queue_work(ccw_device_notify_work, &cdev->private->kick_work); 975 queue_work(ccw_device_notify_work, &cdev->private->kick_work);
974 } else if (cdev->private->flags.doverify) 976 } else if (cdev->private->flags.doverify)
975 /* Start delayed path verification. */ 977 /* Start delayed path verification. */
@@ -992,7 +994,7 @@ ccw_device_killing_timeout(struct ccw_device *cdev, enum dev_event dev_event)
992 sch = to_subchannel(cdev->dev.parent); 994 sch = to_subchannel(cdev->dev.parent);
993 if (!sch->lpm) { 995 if (!sch->lpm) {
994 PREPARE_WORK(&cdev->private->kick_work, 996 PREPARE_WORK(&cdev->private->kick_work,
995 ccw_device_nopath_notify, cdev); 997 ccw_device_nopath_notify);
996 queue_work(ccw_device_notify_work, 998 queue_work(ccw_device_notify_work,
997 &cdev->private->kick_work); 999 &cdev->private->kick_work);
998 } else 1000 } else
@@ -1021,7 +1023,7 @@ void device_kill_io(struct subchannel *sch)
1021 if (ret == -ENODEV) { 1023 if (ret == -ENODEV) {
1022 if (!sch->lpm) { 1024 if (!sch->lpm) {
1023 PREPARE_WORK(&cdev->private->kick_work, 1025 PREPARE_WORK(&cdev->private->kick_work,
1024 ccw_device_nopath_notify, cdev); 1026 ccw_device_nopath_notify);
1025 queue_work(ccw_device_notify_work, 1027 queue_work(ccw_device_notify_work,
1026 &cdev->private->kick_work); 1028 &cdev->private->kick_work);
1027 } else 1029 } else
@@ -1033,7 +1035,7 @@ void device_kill_io(struct subchannel *sch)
1033 ERR_PTR(-EIO)); 1035 ERR_PTR(-EIO));
1034 if (!sch->lpm) { 1036 if (!sch->lpm) {
1035 PREPARE_WORK(&cdev->private->kick_work, 1037 PREPARE_WORK(&cdev->private->kick_work,
1036 ccw_device_nopath_notify, cdev); 1038 ccw_device_nopath_notify);
1037 queue_work(ccw_device_notify_work, &cdev->private->kick_work); 1039 queue_work(ccw_device_notify_work, &cdev->private->kick_work);
1038 } else 1040 } else
1039 /* Start delayed path verification. */ 1041 /* Start delayed path verification. */