diff options
Diffstat (limited to 'drivers/s390/cio')
-rw-r--r-- | drivers/s390/cio/chsc.c | 23 | ||||
-rw-r--r-- | drivers/s390/cio/cio.c | 4 | ||||
-rw-r--r-- | drivers/s390/cio/css.c | 9 | ||||
-rw-r--r-- | drivers/s390/cio/css.h | 7 | ||||
-rw-r--r-- | drivers/s390/cio/device.c | 51 | ||||
-rw-r--r-- | drivers/s390/cio/device.h | 2 | ||||
-rw-r--r-- | drivers/s390/cio/device_fsm.c | 117 | ||||
-rw-r--r-- | drivers/s390/cio/device_id.c | 14 | ||||
-rw-r--r-- | drivers/s390/cio/device_ops.c | 6 | ||||
-rw-r--r-- | drivers/s390/cio/device_pgid.c | 23 | ||||
-rw-r--r-- | drivers/s390/cio/device_status.c | 7 | ||||
-rw-r--r-- | drivers/s390/cio/qdio.c | 12 |
12 files changed, 109 insertions, 166 deletions
diff --git a/drivers/s390/cio/chsc.c b/drivers/s390/cio/chsc.c index 07c7f19339d2..2d78f0f4a40f 100644 --- a/drivers/s390/cio/chsc.c +++ b/drivers/s390/cio/chsc.c | |||
@@ -370,7 +370,7 @@ __s390_process_res_acc(struct subchannel_id schid, void *data) | |||
370 | struct res_acc_data *res_data; | 370 | struct res_acc_data *res_data; |
371 | struct subchannel *sch; | 371 | struct subchannel *sch; |
372 | 372 | ||
373 | res_data = (struct res_acc_data *)data; | 373 | res_data = data; |
374 | sch = get_subchannel_by_schid(schid); | 374 | sch = get_subchannel_by_schid(schid); |
375 | if (!sch) | 375 | if (!sch) |
376 | /* Check if a subchannel is newly available. */ | 376 | /* Check if a subchannel is newly available. */ |
@@ -444,7 +444,7 @@ __get_chpid_from_lir(void *data) | |||
444 | u32 isinfo[28]; | 444 | u32 isinfo[28]; |
445 | } *lir; | 445 | } *lir; |
446 | 446 | ||
447 | lir = (struct lir*) data; | 447 | lir = data; |
448 | if (!(lir->iq&0x80)) | 448 | if (!(lir->iq&0x80)) |
449 | /* NULL link incident record */ | 449 | /* NULL link incident record */ |
450 | return -EINVAL; | 450 | return -EINVAL; |
@@ -628,7 +628,7 @@ __chp_add(struct subchannel_id schid, void *data) | |||
628 | struct channel_path *chp; | 628 | struct channel_path *chp; |
629 | struct subchannel *sch; | 629 | struct subchannel *sch; |
630 | 630 | ||
631 | chp = (struct channel_path *)data; | 631 | chp = data; |
632 | sch = get_subchannel_by_schid(schid); | 632 | sch = get_subchannel_by_schid(schid); |
633 | if (!sch) | 633 | if (!sch) |
634 | /* Check if the subchannel is now available. */ | 634 | /* Check if the subchannel is now available. */ |
@@ -707,8 +707,7 @@ chp_process_crw(int chpid, int on) | |||
707 | return chp_add(chpid); | 707 | return chp_add(chpid); |
708 | } | 708 | } |
709 | 709 | ||
710 | static inline int | 710 | static inline int check_for_io_on_path(struct subchannel *sch, int index) |
711 | __check_for_io_and_kill(struct subchannel *sch, int index) | ||
712 | { | 711 | { |
713 | int cc; | 712 | int cc; |
714 | 713 | ||
@@ -718,10 +717,8 @@ __check_for_io_and_kill(struct subchannel *sch, int index) | |||
718 | cc = stsch(sch->schid, &sch->schib); | 717 | cc = stsch(sch->schid, &sch->schib); |
719 | if (cc) | 718 | if (cc) |
720 | return 0; | 719 | return 0; |
721 | if (sch->schib.scsw.actl && sch->schib.pmcw.lpum == (0x80 >> index)) { | 720 | if (sch->schib.scsw.actl && sch->schib.pmcw.lpum == (0x80 >> index)) |
722 | device_set_waiting(sch); | ||
723 | return 1; | 721 | return 1; |
724 | } | ||
725 | return 0; | 722 | return 0; |
726 | } | 723 | } |
727 | 724 | ||
@@ -750,12 +747,10 @@ __s390_subchannel_vary_chpid(struct subchannel *sch, __u8 chpid, int on) | |||
750 | } else { | 747 | } else { |
751 | sch->opm &= ~(0x80 >> chp); | 748 | sch->opm &= ~(0x80 >> chp); |
752 | sch->lpm &= ~(0x80 >> chp); | 749 | sch->lpm &= ~(0x80 >> chp); |
753 | /* | 750 | if (check_for_io_on_path(sch, chp)) |
754 | * Give running I/O a grace period in which it | 751 | /* Path verification is done after killing. */ |
755 | * can successfully terminate, even using the | 752 | device_kill_io(sch); |
756 | * just varied off path. Then kill it. | 753 | else if (!sch->lpm) { |
757 | */ | ||
758 | if (!__check_for_io_and_kill(sch, chp) && !sch->lpm) { | ||
759 | if (css_enqueue_subchannel_slow(sch->schid)) { | 754 | if (css_enqueue_subchannel_slow(sch->schid)) { |
760 | css_clear_subchannel_slow_list(); | 755 | css_clear_subchannel_slow_list(); |
761 | need_rescan = 1; | 756 | need_rescan = 1; |
diff --git a/drivers/s390/cio/cio.c b/drivers/s390/cio/cio.c index f18b1623cad7..8936e460a807 100644 --- a/drivers/s390/cio/cio.c +++ b/drivers/s390/cio/cio.c | |||
@@ -609,8 +609,8 @@ do_IRQ (struct pt_regs *regs) | |||
609 | struct irb *irb; | 609 | struct irb *irb; |
610 | struct pt_regs *old_regs; | 610 | struct pt_regs *old_regs; |
611 | 611 | ||
612 | irq_enter (); | ||
613 | old_regs = set_irq_regs(regs); | 612 | old_regs = set_irq_regs(regs); |
613 | irq_enter(); | ||
614 | asm volatile ("mc 0,0"); | 614 | asm volatile ("mc 0,0"); |
615 | if (S390_lowcore.int_clock >= S390_lowcore.jiffy_timer) | 615 | if (S390_lowcore.int_clock >= S390_lowcore.jiffy_timer) |
616 | /** | 616 | /** |
@@ -655,8 +655,8 @@ do_IRQ (struct pt_regs *regs) | |||
655 | * out of the sie which costs more cycles than it saves. | 655 | * out of the sie which costs more cycles than it saves. |
656 | */ | 656 | */ |
657 | } while (!MACHINE_IS_VM && tpi (NULL) != 0); | 657 | } while (!MACHINE_IS_VM && tpi (NULL) != 0); |
658 | irq_exit(); | ||
658 | set_irq_regs(old_regs); | 659 | set_irq_regs(old_regs); |
659 | irq_exit (); | ||
660 | } | 660 | } |
661 | 661 | ||
662 | #ifdef CONFIG_CCW_CONSOLE | 662 | #ifdef CONFIG_CCW_CONSOLE |
diff --git a/drivers/s390/cio/css.c b/drivers/s390/cio/css.c index 7086a74e9871..ad7f7e1c0163 100644 --- a/drivers/s390/cio/css.c +++ b/drivers/s390/cio/css.c | |||
@@ -177,7 +177,7 @@ get_subchannel_by_schid(struct subchannel_id schid) | |||
177 | struct device *dev; | 177 | struct device *dev; |
178 | 178 | ||
179 | dev = bus_find_device(&css_bus_type, NULL, | 179 | dev = bus_find_device(&css_bus_type, NULL, |
180 | (void *)&schid, check_subchannel); | 180 | &schid, check_subchannel); |
181 | 181 | ||
182 | return dev ? to_subchannel(dev) : NULL; | 182 | return dev ? to_subchannel(dev) : NULL; |
183 | } | 183 | } |
@@ -271,10 +271,6 @@ static int css_evaluate_known_subchannel(struct subchannel *sch, int slow) | |||
271 | /* Reset intparm to zeroes. */ | 271 | /* Reset intparm to zeroes. */ |
272 | sch->schib.pmcw.intparm = 0; | 272 | sch->schib.pmcw.intparm = 0; |
273 | cio_modify(sch); | 273 | cio_modify(sch); |
274 | |||
275 | /* Probe if necessary. */ | ||
276 | if (action == UNREGISTER_PROBE) | ||
277 | ret = css_probe_device(sch->schid); | ||
278 | break; | 274 | break; |
279 | case REPROBE: | 275 | case REPROBE: |
280 | device_trigger_reprobe(sch); | 276 | device_trigger_reprobe(sch); |
@@ -283,6 +279,9 @@ static int css_evaluate_known_subchannel(struct subchannel *sch, int slow) | |||
283 | break; | 279 | break; |
284 | } | 280 | } |
285 | spin_unlock_irqrestore(&sch->lock, flags); | 281 | spin_unlock_irqrestore(&sch->lock, flags); |
282 | /* Probe if necessary. */ | ||
283 | if (action == UNREGISTER_PROBE) | ||
284 | ret = css_probe_device(sch->schid); | ||
286 | 285 | ||
287 | return ret; | 286 | return ret; |
288 | } | 287 | } |
diff --git a/drivers/s390/cio/css.h b/drivers/s390/cio/css.h index 8aabb4adeb5f..4c2ff8336288 100644 --- a/drivers/s390/cio/css.h +++ b/drivers/s390/cio/css.h | |||
@@ -76,9 +76,8 @@ struct ccw_device_private { | |||
76 | int state; /* device state */ | 76 | int state; /* device state */ |
77 | atomic_t onoff; | 77 | atomic_t onoff; |
78 | unsigned long registered; | 78 | unsigned long registered; |
79 | __u16 devno; /* device number */ | 79 | struct ccw_dev_id dev_id; /* device id */ |
80 | __u16 sch_no; /* subchannel number */ | 80 | struct subchannel_id schid; /* subchannel number */ |
81 | __u8 ssid; /* subchannel set id */ | ||
82 | __u8 imask; /* lpm mask for SNID/SID/SPGID */ | 81 | __u8 imask; /* lpm mask for SNID/SID/SPGID */ |
83 | int iretry; /* retry counter SNID/SID/SPGID */ | 82 | int iretry; /* retry counter SNID/SID/SPGID */ |
84 | struct { | 83 | struct { |
@@ -171,7 +170,7 @@ void device_trigger_reprobe(struct subchannel *); | |||
171 | 170 | ||
172 | /* Helper functions for vary on/off. */ | 171 | /* Helper functions for vary on/off. */ |
173 | int device_is_online(struct subchannel *); | 172 | int device_is_online(struct subchannel *); |
174 | void device_set_waiting(struct subchannel *); | 173 | void device_kill_io(struct subchannel *); |
175 | 174 | ||
176 | /* Machine check helper function. */ | 175 | /* Machine check helper function. */ |
177 | void device_kill_pending_timer(struct subchannel *); | 176 | void device_kill_pending_timer(struct subchannel *); |
diff --git a/drivers/s390/cio/device.c b/drivers/s390/cio/device.c index 688945662c15..39c98f940507 100644 --- a/drivers/s390/cio/device.c +++ b/drivers/s390/cio/device.c | |||
@@ -532,8 +532,7 @@ device_remove_files(struct device *dev) | |||
532 | 532 | ||
533 | /* this is a simple abstraction for device_register that sets the | 533 | /* this is a simple abstraction for device_register that sets the |
534 | * correct bus type and adds the bus specific files */ | 534 | * correct bus type and adds the bus specific files */ |
535 | int | 535 | static int ccw_device_register(struct ccw_device *cdev) |
536 | ccw_device_register(struct ccw_device *cdev) | ||
537 | { | 536 | { |
538 | struct device *dev = &cdev->dev; | 537 | struct device *dev = &cdev->dev; |
539 | int ret; | 538 | int ret; |
@@ -552,21 +551,19 @@ ccw_device_register(struct ccw_device *cdev) | |||
552 | } | 551 | } |
553 | 552 | ||
554 | struct match_data { | 553 | struct match_data { |
555 | unsigned int devno; | 554 | struct ccw_dev_id dev_id; |
556 | unsigned int ssid; | ||
557 | struct ccw_device * sibling; | 555 | struct ccw_device * sibling; |
558 | }; | 556 | }; |
559 | 557 | ||
560 | static int | 558 | static int |
561 | match_devno(struct device * dev, void * data) | 559 | match_devno(struct device * dev, void * data) |
562 | { | 560 | { |
563 | struct match_data * d = (struct match_data *)data; | 561 | struct match_data * d = data; |
564 | struct ccw_device * cdev; | 562 | struct ccw_device * cdev; |
565 | 563 | ||
566 | cdev = to_ccwdev(dev); | 564 | cdev = to_ccwdev(dev); |
567 | if ((cdev->private->state == DEV_STATE_DISCONNECTED) && | 565 | if ((cdev->private->state == DEV_STATE_DISCONNECTED) && |
568 | (cdev->private->devno == d->devno) && | 566 | ccw_dev_id_is_equal(&cdev->private->dev_id, &d->dev_id) && |
569 | (cdev->private->ssid == d->ssid) && | ||
570 | (cdev != d->sibling)) { | 567 | (cdev != d->sibling)) { |
571 | cdev->private->state = DEV_STATE_NOT_OPER; | 568 | cdev->private->state = DEV_STATE_NOT_OPER; |
572 | return 1; | 569 | return 1; |
@@ -574,15 +571,13 @@ match_devno(struct device * dev, void * data) | |||
574 | return 0; | 571 | return 0; |
575 | } | 572 | } |
576 | 573 | ||
577 | static struct ccw_device * | 574 | static struct ccw_device * get_disc_ccwdev_by_dev_id(struct ccw_dev_id *dev_id, |
578 | get_disc_ccwdev_by_devno(unsigned int devno, unsigned int ssid, | 575 | struct ccw_device *sibling) |
579 | struct ccw_device *sibling) | ||
580 | { | 576 | { |
581 | struct device *dev; | 577 | struct device *dev; |
582 | struct match_data data; | 578 | struct match_data data; |
583 | 579 | ||
584 | data.devno = devno; | 580 | data.dev_id = *dev_id; |
585 | data.ssid = ssid; | ||
586 | data.sibling = sibling; | 581 | data.sibling = sibling; |
587 | dev = bus_find_device(&ccw_bus_type, NULL, &data, match_devno); | 582 | dev = bus_find_device(&ccw_bus_type, NULL, &data, match_devno); |
588 | 583 | ||
@@ -595,7 +590,7 @@ ccw_device_add_changed(void *data) | |||
595 | 590 | ||
596 | struct ccw_device *cdev; | 591 | struct ccw_device *cdev; |
597 | 592 | ||
598 | cdev = (struct ccw_device *)data; | 593 | cdev = data; |
599 | if (device_add(&cdev->dev)) { | 594 | if (device_add(&cdev->dev)) { |
600 | put_device(&cdev->dev); | 595 | put_device(&cdev->dev); |
601 | return; | 596 | return; |
@@ -616,9 +611,9 @@ ccw_device_do_unreg_rereg(void *data) | |||
616 | struct subchannel *sch; | 611 | struct subchannel *sch; |
617 | int need_rename; | 612 | int need_rename; |
618 | 613 | ||
619 | cdev = (struct ccw_device *)data; | 614 | cdev = data; |
620 | sch = to_subchannel(cdev->dev.parent); | 615 | sch = to_subchannel(cdev->dev.parent); |
621 | if (cdev->private->devno != sch->schib.pmcw.dev) { | 616 | if (cdev->private->dev_id.devno != sch->schib.pmcw.dev) { |
622 | /* | 617 | /* |
623 | * The device number has changed. This is usually only when | 618 | * The device number has changed. This is usually only when |
624 | * a device has been detached under VM and then re-appeared | 619 | * a device has been detached under VM and then re-appeared |
@@ -633,10 +628,12 @@ ccw_device_do_unreg_rereg(void *data) | |||
633 | * get possibly sick... | 628 | * get possibly sick... |
634 | */ | 629 | */ |
635 | struct ccw_device *other_cdev; | 630 | struct ccw_device *other_cdev; |
631 | struct ccw_dev_id dev_id; | ||
636 | 632 | ||
637 | need_rename = 1; | 633 | need_rename = 1; |
638 | other_cdev = get_disc_ccwdev_by_devno(sch->schib.pmcw.dev, | 634 | dev_id.devno = sch->schib.pmcw.dev; |
639 | sch->schid.ssid, cdev); | 635 | dev_id.ssid = sch->schid.ssid; |
636 | other_cdev = get_disc_ccwdev_by_dev_id(&dev_id, cdev); | ||
640 | if (other_cdev) { | 637 | if (other_cdev) { |
641 | struct subchannel *other_sch; | 638 | struct subchannel *other_sch; |
642 | 639 | ||
@@ -652,7 +649,7 @@ ccw_device_do_unreg_rereg(void *data) | |||
652 | } | 649 | } |
653 | /* Update ssd info here. */ | 650 | /* Update ssd info here. */ |
654 | css_get_ssd_info(sch); | 651 | css_get_ssd_info(sch); |
655 | cdev->private->devno = sch->schib.pmcw.dev; | 652 | cdev->private->dev_id.devno = sch->schib.pmcw.dev; |
656 | } else | 653 | } else |
657 | need_rename = 0; | 654 | need_rename = 0; |
658 | device_remove_files(&cdev->dev); | 655 | device_remove_files(&cdev->dev); |
@@ -662,7 +659,7 @@ ccw_device_do_unreg_rereg(void *data) | |||
662 | snprintf (cdev->dev.bus_id, BUS_ID_SIZE, "0.%x.%04x", | 659 | snprintf (cdev->dev.bus_id, BUS_ID_SIZE, "0.%x.%04x", |
663 | sch->schid.ssid, sch->schib.pmcw.dev); | 660 | sch->schid.ssid, sch->schib.pmcw.dev); |
664 | PREPARE_WORK(&cdev->private->kick_work, | 661 | PREPARE_WORK(&cdev->private->kick_work, |
665 | ccw_device_add_changed, (void *)cdev); | 662 | ccw_device_add_changed, cdev); |
666 | queue_work(ccw_device_work, &cdev->private->kick_work); | 663 | queue_work(ccw_device_work, &cdev->private->kick_work); |
667 | } | 664 | } |
668 | 665 | ||
@@ -687,7 +684,7 @@ io_subchannel_register(void *data) | |||
687 | int ret; | 684 | int ret; |
688 | unsigned long flags; | 685 | unsigned long flags; |
689 | 686 | ||
690 | cdev = (struct ccw_device *) data; | 687 | cdev = data; |
691 | sch = to_subchannel(cdev->dev.parent); | 688 | sch = to_subchannel(cdev->dev.parent); |
692 | 689 | ||
693 | if (klist_node_attached(&cdev->dev.knode_parent)) { | 690 | if (klist_node_attached(&cdev->dev.knode_parent)) { |
@@ -759,7 +756,7 @@ io_subchannel_recog_done(struct ccw_device *cdev) | |||
759 | break; | 756 | break; |
760 | sch = to_subchannel(cdev->dev.parent); | 757 | sch = to_subchannel(cdev->dev.parent); |
761 | PREPARE_WORK(&cdev->private->kick_work, | 758 | PREPARE_WORK(&cdev->private->kick_work, |
762 | ccw_device_call_sch_unregister, (void *) cdev); | 759 | ccw_device_call_sch_unregister, cdev); |
763 | queue_work(slow_path_wq, &cdev->private->kick_work); | 760 | queue_work(slow_path_wq, &cdev->private->kick_work); |
764 | if (atomic_dec_and_test(&ccw_device_init_count)) | 761 | if (atomic_dec_and_test(&ccw_device_init_count)) |
765 | wake_up(&ccw_device_init_wq); | 762 | wake_up(&ccw_device_init_wq); |
@@ -774,7 +771,7 @@ io_subchannel_recog_done(struct ccw_device *cdev) | |||
774 | if (!get_device(&cdev->dev)) | 771 | if (!get_device(&cdev->dev)) |
775 | break; | 772 | break; |
776 | PREPARE_WORK(&cdev->private->kick_work, | 773 | PREPARE_WORK(&cdev->private->kick_work, |
777 | io_subchannel_register, (void *) cdev); | 774 | io_subchannel_register, cdev); |
778 | queue_work(slow_path_wq, &cdev->private->kick_work); | 775 | queue_work(slow_path_wq, &cdev->private->kick_work); |
779 | break; | 776 | break; |
780 | } | 777 | } |
@@ -792,9 +789,9 @@ io_subchannel_recog(struct ccw_device *cdev, struct subchannel *sch) | |||
792 | 789 | ||
793 | /* Init private data. */ | 790 | /* Init private data. */ |
794 | priv = cdev->private; | 791 | priv = cdev->private; |
795 | priv->devno = sch->schib.pmcw.dev; | 792 | priv->dev_id.devno = sch->schib.pmcw.dev; |
796 | priv->ssid = sch->schid.ssid; | 793 | priv->dev_id.ssid = sch->schid.ssid; |
797 | priv->sch_no = sch->schid.sch_no; | 794 | priv->schid = sch->schid; |
798 | priv->state = DEV_STATE_NOT_OPER; | 795 | priv->state = DEV_STATE_NOT_OPER; |
799 | INIT_LIST_HEAD(&priv->cmb_list); | 796 | INIT_LIST_HEAD(&priv->cmb_list); |
800 | init_waitqueue_head(&priv->wait_q); | 797 | init_waitqueue_head(&priv->wait_q); |
@@ -912,7 +909,7 @@ io_subchannel_remove (struct subchannel *sch) | |||
912 | */ | 909 | */ |
913 | if (get_device(&cdev->dev)) { | 910 | if (get_device(&cdev->dev)) { |
914 | PREPARE_WORK(&cdev->private->kick_work, | 911 | PREPARE_WORK(&cdev->private->kick_work, |
915 | ccw_device_unregister, (void *) cdev); | 912 | ccw_device_unregister, cdev); |
916 | queue_work(ccw_device_work, &cdev->private->kick_work); | 913 | queue_work(ccw_device_work, &cdev->private->kick_work); |
917 | } | 914 | } |
918 | return 0; | 915 | return 0; |
@@ -1055,7 +1052,7 @@ __ccwdev_check_busid(struct device *dev, void *id) | |||
1055 | { | 1052 | { |
1056 | char *bus_id; | 1053 | char *bus_id; |
1057 | 1054 | ||
1058 | bus_id = (char *)id; | 1055 | bus_id = id; |
1059 | 1056 | ||
1060 | return (strncmp(bus_id, dev->bus_id, BUS_ID_SIZE) == 0); | 1057 | return (strncmp(bus_id, dev->bus_id, BUS_ID_SIZE) == 0); |
1061 | } | 1058 | } |
diff --git a/drivers/s390/cio/device.h b/drivers/s390/cio/device.h index 00be9a5b4acd..9233b5c0bcc8 100644 --- a/drivers/s390/cio/device.h +++ b/drivers/s390/cio/device.h | |||
@@ -21,7 +21,6 @@ enum dev_state { | |||
21 | /* states to wait for i/o completion before doing something */ | 21 | /* states to wait for i/o completion before doing something */ |
22 | DEV_STATE_CLEAR_VERIFY, | 22 | DEV_STATE_CLEAR_VERIFY, |
23 | DEV_STATE_TIMEOUT_KILL, | 23 | DEV_STATE_TIMEOUT_KILL, |
24 | DEV_STATE_WAIT4IO, | ||
25 | DEV_STATE_QUIESCE, | 24 | DEV_STATE_QUIESCE, |
26 | /* special states for devices gone not operational */ | 25 | /* special states for devices gone not operational */ |
27 | DEV_STATE_DISCONNECTED, | 26 | DEV_STATE_DISCONNECTED, |
@@ -79,7 +78,6 @@ void io_subchannel_recog_done(struct ccw_device *cdev); | |||
79 | 78 | ||
80 | int ccw_device_cancel_halt_clear(struct ccw_device *); | 79 | int ccw_device_cancel_halt_clear(struct ccw_device *); |
81 | 80 | ||
82 | int ccw_device_register(struct ccw_device *); | ||
83 | void ccw_device_do_unreg_rereg(void *); | 81 | void ccw_device_do_unreg_rereg(void *); |
84 | void ccw_device_call_sch_unregister(void *); | 82 | void ccw_device_call_sch_unregister(void *); |
85 | 83 | ||
diff --git a/drivers/s390/cio/device_fsm.c b/drivers/s390/cio/device_fsm.c index b67620208f36..de3d0857db9f 100644 --- a/drivers/s390/cio/device_fsm.c +++ b/drivers/s390/cio/device_fsm.c | |||
@@ -59,18 +59,6 @@ device_set_disconnected(struct subchannel *sch) | |||
59 | cdev->private->state = DEV_STATE_DISCONNECTED; | 59 | cdev->private->state = DEV_STATE_DISCONNECTED; |
60 | } | 60 | } |
61 | 61 | ||
62 | void | ||
63 | device_set_waiting(struct subchannel *sch) | ||
64 | { | ||
65 | struct ccw_device *cdev; | ||
66 | |||
67 | if (!sch->dev.driver_data) | ||
68 | return; | ||
69 | cdev = sch->dev.driver_data; | ||
70 | ccw_device_set_timeout(cdev, 10*HZ); | ||
71 | cdev->private->state = DEV_STATE_WAIT4IO; | ||
72 | } | ||
73 | |||
74 | /* | 62 | /* |
75 | * Timeout function. It just triggers a DEV_EVENT_TIMEOUT. | 63 | * Timeout function. It just triggers a DEV_EVENT_TIMEOUT. |
76 | */ | 64 | */ |
@@ -183,9 +171,9 @@ ccw_device_handle_oper(struct ccw_device *cdev) | |||
183 | cdev->id.cu_model != cdev->private->senseid.cu_model || | 171 | cdev->id.cu_model != cdev->private->senseid.cu_model || |
184 | cdev->id.dev_type != cdev->private->senseid.dev_type || | 172 | cdev->id.dev_type != cdev->private->senseid.dev_type || |
185 | cdev->id.dev_model != cdev->private->senseid.dev_model || | 173 | cdev->id.dev_model != cdev->private->senseid.dev_model || |
186 | cdev->private->devno != sch->schib.pmcw.dev) { | 174 | cdev->private->dev_id.devno != sch->schib.pmcw.dev) { |
187 | PREPARE_WORK(&cdev->private->kick_work, | 175 | PREPARE_WORK(&cdev->private->kick_work, |
188 | ccw_device_do_unreg_rereg, (void *)cdev); | 176 | ccw_device_do_unreg_rereg, cdev); |
189 | queue_work(ccw_device_work, &cdev->private->kick_work); | 177 | queue_work(ccw_device_work, &cdev->private->kick_work); |
190 | return 0; | 178 | return 0; |
191 | } | 179 | } |
@@ -255,7 +243,7 @@ ccw_device_recog_done(struct ccw_device *cdev, int state) | |||
255 | case DEV_STATE_NOT_OPER: | 243 | case DEV_STATE_NOT_OPER: |
256 | CIO_DEBUG(KERN_WARNING, 2, | 244 | CIO_DEBUG(KERN_WARNING, 2, |
257 | "SenseID : unknown device %04x on subchannel " | 245 | "SenseID : unknown device %04x on subchannel " |
258 | "0.%x.%04x\n", cdev->private->devno, | 246 | "0.%x.%04x\n", cdev->private->dev_id.devno, |
259 | sch->schid.ssid, sch->schid.sch_no); | 247 | sch->schid.ssid, sch->schid.sch_no); |
260 | break; | 248 | break; |
261 | case DEV_STATE_OFFLINE: | 249 | case DEV_STATE_OFFLINE: |
@@ -282,14 +270,15 @@ ccw_device_recog_done(struct ccw_device *cdev, int state) | |||
282 | CIO_DEBUG(KERN_INFO, 2, "SenseID : device 0.%x.%04x reports: " | 270 | CIO_DEBUG(KERN_INFO, 2, "SenseID : device 0.%x.%04x reports: " |
283 | "CU Type/Mod = %04X/%02X, Dev Type/Mod = " | 271 | "CU Type/Mod = %04X/%02X, Dev Type/Mod = " |
284 | "%04X/%02X\n", | 272 | "%04X/%02X\n", |
285 | cdev->private->ssid, cdev->private->devno, | 273 | cdev->private->dev_id.ssid, |
274 | cdev->private->dev_id.devno, | ||
286 | cdev->id.cu_type, cdev->id.cu_model, | 275 | cdev->id.cu_type, cdev->id.cu_model, |
287 | cdev->id.dev_type, cdev->id.dev_model); | 276 | cdev->id.dev_type, cdev->id.dev_model); |
288 | break; | 277 | break; |
289 | case DEV_STATE_BOXED: | 278 | case DEV_STATE_BOXED: |
290 | CIO_DEBUG(KERN_WARNING, 2, | 279 | CIO_DEBUG(KERN_WARNING, 2, |
291 | "SenseID : boxed device %04x on subchannel " | 280 | "SenseID : boxed device %04x on subchannel " |
292 | "0.%x.%04x\n", cdev->private->devno, | 281 | "0.%x.%04x\n", cdev->private->dev_id.devno, |
293 | sch->schid.ssid, sch->schid.sch_no); | 282 | sch->schid.ssid, sch->schid.sch_no); |
294 | break; | 283 | break; |
295 | } | 284 | } |
@@ -325,13 +314,13 @@ ccw_device_oper_notify(void *data) | |||
325 | struct subchannel *sch; | 314 | struct subchannel *sch; |
326 | int ret; | 315 | int ret; |
327 | 316 | ||
328 | cdev = (struct ccw_device *)data; | 317 | cdev = data; |
329 | sch = to_subchannel(cdev->dev.parent); | 318 | sch = to_subchannel(cdev->dev.parent); |
330 | ret = (sch->driver && sch->driver->notify) ? | 319 | ret = (sch->driver && sch->driver->notify) ? |
331 | sch->driver->notify(&sch->dev, CIO_OPER) : 0; | 320 | sch->driver->notify(&sch->dev, CIO_OPER) : 0; |
332 | if (!ret) | 321 | if (!ret) |
333 | /* Driver doesn't want device back. */ | 322 | /* Driver doesn't want device back. */ |
334 | ccw_device_do_unreg_rereg((void *)cdev); | 323 | ccw_device_do_unreg_rereg(cdev); |
335 | else { | 324 | else { |
336 | /* Reenable channel measurements, if needed. */ | 325 | /* Reenable channel measurements, if needed. */ |
337 | cmf_reenable(cdev); | 326 | cmf_reenable(cdev); |
@@ -363,12 +352,12 @@ ccw_device_done(struct ccw_device *cdev, int state) | |||
363 | if (state == DEV_STATE_BOXED) | 352 | if (state == DEV_STATE_BOXED) |
364 | CIO_DEBUG(KERN_WARNING, 2, | 353 | CIO_DEBUG(KERN_WARNING, 2, |
365 | "Boxed device %04x on subchannel %04x\n", | 354 | "Boxed device %04x on subchannel %04x\n", |
366 | cdev->private->devno, sch->schid.sch_no); | 355 | cdev->private->dev_id.devno, sch->schid.sch_no); |
367 | 356 | ||
368 | if (cdev->private->flags.donotify) { | 357 | if (cdev->private->flags.donotify) { |
369 | cdev->private->flags.donotify = 0; | 358 | cdev->private->flags.donotify = 0; |
370 | PREPARE_WORK(&cdev->private->kick_work, ccw_device_oper_notify, | 359 | PREPARE_WORK(&cdev->private->kick_work, ccw_device_oper_notify, |
371 | (void *)cdev); | 360 | cdev); |
372 | queue_work(ccw_device_notify_work, &cdev->private->kick_work); | 361 | queue_work(ccw_device_notify_work, &cdev->private->kick_work); |
373 | } | 362 | } |
374 | wake_up(&cdev->private->wait_q); | 363 | wake_up(&cdev->private->wait_q); |
@@ -412,7 +401,8 @@ static void __ccw_device_get_common_pgid(struct ccw_device *cdev) | |||
412 | /* PGID mismatch, can't pathgroup. */ | 401 | /* PGID mismatch, can't pathgroup. */ |
413 | CIO_MSG_EVENT(0, "SNID - pgid mismatch for device " | 402 | CIO_MSG_EVENT(0, "SNID - pgid mismatch for device " |
414 | "0.%x.%04x, can't pathgroup\n", | 403 | "0.%x.%04x, can't pathgroup\n", |
415 | cdev->private->ssid, cdev->private->devno); | 404 | cdev->private->dev_id.ssid, |
405 | cdev->private->dev_id.devno); | ||
416 | cdev->private->options.pgroup = 0; | 406 | cdev->private->options.pgroup = 0; |
417 | return; | 407 | return; |
418 | } | 408 | } |
@@ -523,7 +513,7 @@ ccw_device_nopath_notify(void *data) | |||
523 | struct subchannel *sch; | 513 | struct subchannel *sch; |
524 | int ret; | 514 | int ret; |
525 | 515 | ||
526 | cdev = (struct ccw_device *)data; | 516 | cdev = data; |
527 | sch = to_subchannel(cdev->dev.parent); | 517 | sch = to_subchannel(cdev->dev.parent); |
528 | /* Extra sanity. */ | 518 | /* Extra sanity. */ |
529 | if (sch->lpm) | 519 | if (sch->lpm) |
@@ -537,7 +527,7 @@ ccw_device_nopath_notify(void *data) | |||
537 | if (get_device(&cdev->dev)) { | 527 | if (get_device(&cdev->dev)) { |
538 | PREPARE_WORK(&cdev->private->kick_work, | 528 | PREPARE_WORK(&cdev->private->kick_work, |
539 | ccw_device_call_sch_unregister, | 529 | ccw_device_call_sch_unregister, |
540 | (void *)cdev); | 530 | cdev); |
541 | queue_work(ccw_device_work, | 531 | queue_work(ccw_device_work, |
542 | &cdev->private->kick_work); | 532 | &cdev->private->kick_work); |
543 | } else | 533 | } else |
@@ -588,11 +578,15 @@ ccw_device_verify_done(struct ccw_device *cdev, int err) | |||
588 | } | 578 | } |
589 | break; | 579 | break; |
590 | case -ETIME: | 580 | case -ETIME: |
581 | /* Reset oper notify indication after verify error. */ | ||
582 | cdev->private->flags.donotify = 0; | ||
591 | ccw_device_done(cdev, DEV_STATE_BOXED); | 583 | ccw_device_done(cdev, DEV_STATE_BOXED); |
592 | break; | 584 | break; |
593 | default: | 585 | default: |
586 | /* Reset oper notify indication after verify error. */ | ||
587 | cdev->private->flags.donotify = 0; | ||
594 | PREPARE_WORK(&cdev->private->kick_work, | 588 | PREPARE_WORK(&cdev->private->kick_work, |
595 | ccw_device_nopath_notify, (void *)cdev); | 589 | ccw_device_nopath_notify, cdev); |
596 | queue_work(ccw_device_notify_work, &cdev->private->kick_work); | 590 | queue_work(ccw_device_notify_work, &cdev->private->kick_work); |
597 | ccw_device_done(cdev, DEV_STATE_NOT_OPER); | 591 | ccw_device_done(cdev, DEV_STATE_NOT_OPER); |
598 | break; | 592 | break; |
@@ -723,7 +717,7 @@ ccw_device_offline_notoper(struct ccw_device *cdev, enum dev_event dev_event) | |||
723 | sch = to_subchannel(cdev->dev.parent); | 717 | sch = to_subchannel(cdev->dev.parent); |
724 | if (get_device(&cdev->dev)) { | 718 | if (get_device(&cdev->dev)) { |
725 | PREPARE_WORK(&cdev->private->kick_work, | 719 | PREPARE_WORK(&cdev->private->kick_work, |
726 | ccw_device_call_sch_unregister, (void *)cdev); | 720 | ccw_device_call_sch_unregister, cdev); |
727 | queue_work(ccw_device_work, &cdev->private->kick_work); | 721 | queue_work(ccw_device_work, &cdev->private->kick_work); |
728 | } | 722 | } |
729 | wake_up(&cdev->private->wait_q); | 723 | wake_up(&cdev->private->wait_q); |
@@ -754,7 +748,7 @@ ccw_device_online_notoper(struct ccw_device *cdev, enum dev_event dev_event) | |||
754 | } | 748 | } |
755 | if (get_device(&cdev->dev)) { | 749 | if (get_device(&cdev->dev)) { |
756 | PREPARE_WORK(&cdev->private->kick_work, | 750 | PREPARE_WORK(&cdev->private->kick_work, |
757 | ccw_device_call_sch_unregister, (void *)cdev); | 751 | ccw_device_call_sch_unregister, cdev); |
758 | queue_work(ccw_device_work, &cdev->private->kick_work); | 752 | queue_work(ccw_device_work, &cdev->private->kick_work); |
759 | } | 753 | } |
760 | wake_up(&cdev->private->wait_q); | 754 | wake_up(&cdev->private->wait_q); |
@@ -859,7 +853,7 @@ ccw_device_online_timeout(struct ccw_device *cdev, enum dev_event dev_event) | |||
859 | sch = to_subchannel(cdev->dev.parent); | 853 | sch = to_subchannel(cdev->dev.parent); |
860 | if (!sch->lpm) { | 854 | if (!sch->lpm) { |
861 | PREPARE_WORK(&cdev->private->kick_work, | 855 | PREPARE_WORK(&cdev->private->kick_work, |
862 | ccw_device_nopath_notify, (void *)cdev); | 856 | ccw_device_nopath_notify, cdev); |
863 | queue_work(ccw_device_notify_work, | 857 | queue_work(ccw_device_notify_work, |
864 | &cdev->private->kick_work); | 858 | &cdev->private->kick_work); |
865 | } else | 859 | } else |
@@ -885,7 +879,8 @@ ccw_device_w4sense(struct ccw_device *cdev, enum dev_event dev_event) | |||
885 | /* Basic sense hasn't started. Try again. */ | 879 | /* Basic sense hasn't started. Try again. */ |
886 | ccw_device_do_sense(cdev, irb); | 880 | ccw_device_do_sense(cdev, irb); |
887 | else { | 881 | else { |
888 | printk("Huh? %s(%s): unsolicited interrupt...\n", | 882 | printk(KERN_INFO "Huh? %s(%s): unsolicited " |
883 | "interrupt...\n", | ||
889 | __FUNCTION__, cdev->dev.bus_id); | 884 | __FUNCTION__, cdev->dev.bus_id); |
890 | if (cdev->handler) | 885 | if (cdev->handler) |
891 | cdev->handler (cdev, 0, irb); | 886 | cdev->handler (cdev, 0, irb); |
@@ -944,10 +939,10 @@ ccw_device_killing_irq(struct ccw_device *cdev, enum dev_event dev_event) | |||
944 | cdev->private->state = DEV_STATE_ONLINE; | 939 | cdev->private->state = DEV_STATE_ONLINE; |
945 | if (cdev->handler) | 940 | if (cdev->handler) |
946 | cdev->handler(cdev, cdev->private->intparm, | 941 | cdev->handler(cdev, cdev->private->intparm, |
947 | ERR_PTR(-ETIMEDOUT)); | 942 | ERR_PTR(-EIO)); |
948 | if (!sch->lpm) { | 943 | if (!sch->lpm) { |
949 | PREPARE_WORK(&cdev->private->kick_work, | 944 | PREPARE_WORK(&cdev->private->kick_work, |
950 | ccw_device_nopath_notify, (void *)cdev); | 945 | ccw_device_nopath_notify, cdev); |
951 | queue_work(ccw_device_notify_work, &cdev->private->kick_work); | 946 | queue_work(ccw_device_notify_work, &cdev->private->kick_work); |
952 | } else if (cdev->private->flags.doverify) | 947 | } else if (cdev->private->flags.doverify) |
953 | /* Start delayed path verification. */ | 948 | /* Start delayed path verification. */ |
@@ -970,7 +965,7 @@ ccw_device_killing_timeout(struct ccw_device *cdev, enum dev_event dev_event) | |||
970 | sch = to_subchannel(cdev->dev.parent); | 965 | sch = to_subchannel(cdev->dev.parent); |
971 | if (!sch->lpm) { | 966 | if (!sch->lpm) { |
972 | PREPARE_WORK(&cdev->private->kick_work, | 967 | PREPARE_WORK(&cdev->private->kick_work, |
973 | ccw_device_nopath_notify, (void *)cdev); | 968 | ccw_device_nopath_notify, cdev); |
974 | queue_work(ccw_device_notify_work, | 969 | queue_work(ccw_device_notify_work, |
975 | &cdev->private->kick_work); | 970 | &cdev->private->kick_work); |
976 | } else | 971 | } else |
@@ -981,51 +976,15 @@ ccw_device_killing_timeout(struct ccw_device *cdev, enum dev_event dev_event) | |||
981 | cdev->private->state = DEV_STATE_ONLINE; | 976 | cdev->private->state = DEV_STATE_ONLINE; |
982 | if (cdev->handler) | 977 | if (cdev->handler) |
983 | cdev->handler(cdev, cdev->private->intparm, | 978 | cdev->handler(cdev, cdev->private->intparm, |
984 | ERR_PTR(-ETIMEDOUT)); | 979 | ERR_PTR(-EIO)); |
985 | } | ||
986 | |||
987 | static void | ||
988 | ccw_device_wait4io_irq(struct ccw_device *cdev, enum dev_event dev_event) | ||
989 | { | ||
990 | struct irb *irb; | ||
991 | struct subchannel *sch; | ||
992 | |||
993 | irb = (struct irb *) __LC_IRB; | ||
994 | /* | ||
995 | * Accumulate status and find out if a basic sense is needed. | ||
996 | * This is fine since we have already adapted the lpm. | ||
997 | */ | ||
998 | ccw_device_accumulate_irb(cdev, irb); | ||
999 | if (cdev->private->flags.dosense) { | ||
1000 | if (ccw_device_do_sense(cdev, irb) == 0) { | ||
1001 | cdev->private->state = DEV_STATE_W4SENSE; | ||
1002 | } | ||
1003 | return; | ||
1004 | } | ||
1005 | |||
1006 | /* Iff device is idle, reset timeout. */ | ||
1007 | sch = to_subchannel(cdev->dev.parent); | ||
1008 | if (!stsch(sch->schid, &sch->schib)) | ||
1009 | if (sch->schib.scsw.actl == 0) | ||
1010 | ccw_device_set_timeout(cdev, 0); | ||
1011 | /* Call the handler. */ | ||
1012 | ccw_device_call_handler(cdev); | ||
1013 | if (!sch->lpm) { | ||
1014 | PREPARE_WORK(&cdev->private->kick_work, | ||
1015 | ccw_device_nopath_notify, (void *)cdev); | ||
1016 | queue_work(ccw_device_notify_work, &cdev->private->kick_work); | ||
1017 | } else if (cdev->private->flags.doverify) | ||
1018 | ccw_device_online_verify(cdev, 0); | ||
1019 | } | 980 | } |
1020 | 981 | ||
1021 | static void | 982 | void device_kill_io(struct subchannel *sch) |
1022 | ccw_device_wait4io_timeout(struct ccw_device *cdev, enum dev_event dev_event) | ||
1023 | { | 983 | { |
1024 | int ret; | 984 | int ret; |
1025 | struct subchannel *sch; | 985 | struct ccw_device *cdev; |
1026 | 986 | ||
1027 | sch = to_subchannel(cdev->dev.parent); | 987 | cdev = sch->dev.driver_data; |
1028 | ccw_device_set_timeout(cdev, 0); | ||
1029 | ret = ccw_device_cancel_halt_clear(cdev); | 988 | ret = ccw_device_cancel_halt_clear(cdev); |
1030 | if (ret == -EBUSY) { | 989 | if (ret == -EBUSY) { |
1031 | ccw_device_set_timeout(cdev, 3*HZ); | 990 | ccw_device_set_timeout(cdev, 3*HZ); |
@@ -1035,7 +994,7 @@ ccw_device_wait4io_timeout(struct ccw_device *cdev, enum dev_event dev_event) | |||
1035 | if (ret == -ENODEV) { | 994 | if (ret == -ENODEV) { |
1036 | if (!sch->lpm) { | 995 | if (!sch->lpm) { |
1037 | PREPARE_WORK(&cdev->private->kick_work, | 996 | PREPARE_WORK(&cdev->private->kick_work, |
1038 | ccw_device_nopath_notify, (void *)cdev); | 997 | ccw_device_nopath_notify, cdev); |
1039 | queue_work(ccw_device_notify_work, | 998 | queue_work(ccw_device_notify_work, |
1040 | &cdev->private->kick_work); | 999 | &cdev->private->kick_work); |
1041 | } else | 1000 | } else |
@@ -1044,12 +1003,12 @@ ccw_device_wait4io_timeout(struct ccw_device *cdev, enum dev_event dev_event) | |||
1044 | } | 1003 | } |
1045 | if (cdev->handler) | 1004 | if (cdev->handler) |
1046 | cdev->handler(cdev, cdev->private->intparm, | 1005 | cdev->handler(cdev, cdev->private->intparm, |
1047 | ERR_PTR(-ETIMEDOUT)); | 1006 | ERR_PTR(-EIO)); |
1048 | if (!sch->lpm) { | 1007 | if (!sch->lpm) { |
1049 | PREPARE_WORK(&cdev->private->kick_work, | 1008 | PREPARE_WORK(&cdev->private->kick_work, |
1050 | ccw_device_nopath_notify, (void *)cdev); | 1009 | ccw_device_nopath_notify, cdev); |
1051 | queue_work(ccw_device_notify_work, &cdev->private->kick_work); | 1010 | queue_work(ccw_device_notify_work, &cdev->private->kick_work); |
1052 | } else if (cdev->private->flags.doverify) | 1011 | } else |
1053 | /* Start delayed path verification. */ | 1012 | /* Start delayed path verification. */ |
1054 | ccw_device_online_verify(cdev, 0); | 1013 | ccw_device_online_verify(cdev, 0); |
1055 | } | 1014 | } |
@@ -1286,12 +1245,6 @@ fsm_func_t *dev_jumptable[NR_DEV_STATES][NR_DEV_EVENTS] = { | |||
1286 | [DEV_EVENT_TIMEOUT] = ccw_device_killing_timeout, | 1245 | [DEV_EVENT_TIMEOUT] = ccw_device_killing_timeout, |
1287 | [DEV_EVENT_VERIFY] = ccw_device_nop, //FIXME | 1246 | [DEV_EVENT_VERIFY] = ccw_device_nop, //FIXME |
1288 | }, | 1247 | }, |
1289 | [DEV_STATE_WAIT4IO] = { | ||
1290 | [DEV_EVENT_NOTOPER] = ccw_device_online_notoper, | ||
1291 | [DEV_EVENT_INTERRUPT] = ccw_device_wait4io_irq, | ||
1292 | [DEV_EVENT_TIMEOUT] = ccw_device_wait4io_timeout, | ||
1293 | [DEV_EVENT_VERIFY] = ccw_device_delay_verify, | ||
1294 | }, | ||
1295 | [DEV_STATE_QUIESCE] = { | 1248 | [DEV_STATE_QUIESCE] = { |
1296 | [DEV_EVENT_NOTOPER] = ccw_device_quiesce_done, | 1249 | [DEV_EVENT_NOTOPER] = ccw_device_quiesce_done, |
1297 | [DEV_EVENT_INTERRUPT] = ccw_device_quiesce_done, | 1250 | [DEV_EVENT_INTERRUPT] = ccw_device_quiesce_done, |
diff --git a/drivers/s390/cio/device_id.c b/drivers/s390/cio/device_id.c index 1398367b5f68..a74785b9e4eb 100644 --- a/drivers/s390/cio/device_id.c +++ b/drivers/s390/cio/device_id.c | |||
@@ -251,7 +251,7 @@ ccw_device_check_sense_id(struct ccw_device *cdev) | |||
251 | */ | 251 | */ |
252 | CIO_MSG_EVENT(2, "SenseID : device %04x on Subchannel " | 252 | CIO_MSG_EVENT(2, "SenseID : device %04x on Subchannel " |
253 | "0.%x.%04x reports cmd reject\n", | 253 | "0.%x.%04x reports cmd reject\n", |
254 | cdev->private->devno, sch->schid.ssid, | 254 | cdev->private->dev_id.devno, sch->schid.ssid, |
255 | sch->schid.sch_no); | 255 | sch->schid.sch_no); |
256 | return -EOPNOTSUPP; | 256 | return -EOPNOTSUPP; |
257 | } | 257 | } |
@@ -259,7 +259,8 @@ ccw_device_check_sense_id(struct ccw_device *cdev) | |||
259 | CIO_MSG_EVENT(2, "SenseID : UC on dev 0.%x.%04x, " | 259 | CIO_MSG_EVENT(2, "SenseID : UC on dev 0.%x.%04x, " |
260 | "lpum %02X, cnt %02d, sns :" | 260 | "lpum %02X, cnt %02d, sns :" |
261 | " %02X%02X%02X%02X %02X%02X%02X%02X ...\n", | 261 | " %02X%02X%02X%02X %02X%02X%02X%02X ...\n", |
262 | cdev->private->ssid, cdev->private->devno, | 262 | cdev->private->dev_id.ssid, |
263 | cdev->private->dev_id.devno, | ||
263 | irb->esw.esw0.sublog.lpum, | 264 | irb->esw.esw0.sublog.lpum, |
264 | irb->esw.esw0.erw.scnt, | 265 | irb->esw.esw0.erw.scnt, |
265 | irb->ecw[0], irb->ecw[1], | 266 | irb->ecw[0], irb->ecw[1], |
@@ -274,14 +275,15 @@ ccw_device_check_sense_id(struct ccw_device *cdev) | |||
274 | CIO_MSG_EVENT(2, "SenseID : path %02X for device %04x " | 275 | CIO_MSG_EVENT(2, "SenseID : path %02X for device %04x " |
275 | "on subchannel 0.%x.%04x is " | 276 | "on subchannel 0.%x.%04x is " |
276 | "'not operational'\n", sch->orb.lpm, | 277 | "'not operational'\n", sch->orb.lpm, |
277 | cdev->private->devno, sch->schid.ssid, | 278 | cdev->private->dev_id.devno, |
278 | sch->schid.sch_no); | 279 | sch->schid.ssid, sch->schid.sch_no); |
279 | return -EACCES; | 280 | return -EACCES; |
280 | } | 281 | } |
281 | /* Hmm, whatever happened, try again. */ | 282 | /* Hmm, whatever happened, try again. */ |
282 | CIO_MSG_EVENT(2, "SenseID : start_IO() for device %04x on " | 283 | CIO_MSG_EVENT(2, "SenseID : start_IO() for device %04x on " |
283 | "subchannel 0.%x.%04x returns status %02X%02X\n", | 284 | "subchannel 0.%x.%04x returns status %02X%02X\n", |
284 | cdev->private->devno, sch->schid.ssid, sch->schid.sch_no, | 285 | cdev->private->dev_id.devno, sch->schid.ssid, |
286 | sch->schid.sch_no, | ||
285 | irb->scsw.dstat, irb->scsw.cstat); | 287 | irb->scsw.dstat, irb->scsw.cstat); |
286 | return -EAGAIN; | 288 | return -EAGAIN; |
287 | } | 289 | } |
@@ -330,7 +332,7 @@ ccw_device_sense_id_irq(struct ccw_device *cdev, enum dev_event dev_event) | |||
330 | /* fall through. */ | 332 | /* fall through. */ |
331 | default: /* Sense ID failed. Try asking VM. */ | 333 | default: /* Sense ID failed. Try asking VM. */ |
332 | if (MACHINE_IS_VM) { | 334 | if (MACHINE_IS_VM) { |
333 | VM_virtual_device_info (cdev->private->devno, | 335 | VM_virtual_device_info (cdev->private->dev_id.devno, |
334 | &cdev->private->senseid); | 336 | &cdev->private->senseid); |
335 | if (cdev->private->senseid.cu_type != 0xFFFF) { | 337 | if (cdev->private->senseid.cu_type != 0xFFFF) { |
336 | /* Got the device information from VM. */ | 338 | /* Got the device information from VM. */ |
diff --git a/drivers/s390/cio/device_ops.c b/drivers/s390/cio/device_ops.c index 84b9b18eabc2..b39c1fa48acd 100644 --- a/drivers/s390/cio/device_ops.c +++ b/drivers/s390/cio/device_ops.c | |||
@@ -50,7 +50,6 @@ ccw_device_clear(struct ccw_device *cdev, unsigned long intparm) | |||
50 | if (cdev->private->state == DEV_STATE_NOT_OPER) | 50 | if (cdev->private->state == DEV_STATE_NOT_OPER) |
51 | return -ENODEV; | 51 | return -ENODEV; |
52 | if (cdev->private->state != DEV_STATE_ONLINE && | 52 | if (cdev->private->state != DEV_STATE_ONLINE && |
53 | cdev->private->state != DEV_STATE_WAIT4IO && | ||
54 | cdev->private->state != DEV_STATE_W4SENSE) | 53 | cdev->private->state != DEV_STATE_W4SENSE) |
55 | return -EINVAL; | 54 | return -EINVAL; |
56 | sch = to_subchannel(cdev->dev.parent); | 55 | sch = to_subchannel(cdev->dev.parent); |
@@ -155,7 +154,6 @@ ccw_device_halt(struct ccw_device *cdev, unsigned long intparm) | |||
155 | if (cdev->private->state == DEV_STATE_NOT_OPER) | 154 | if (cdev->private->state == DEV_STATE_NOT_OPER) |
156 | return -ENODEV; | 155 | return -ENODEV; |
157 | if (cdev->private->state != DEV_STATE_ONLINE && | 156 | if (cdev->private->state != DEV_STATE_ONLINE && |
158 | cdev->private->state != DEV_STATE_WAIT4IO && | ||
159 | cdev->private->state != DEV_STATE_W4SENSE) | 157 | cdev->private->state != DEV_STATE_W4SENSE) |
160 | return -EINVAL; | 158 | return -EINVAL; |
161 | sch = to_subchannel(cdev->dev.parent); | 159 | sch = to_subchannel(cdev->dev.parent); |
@@ -592,13 +590,13 @@ ccw_device_get_chp_desc(struct ccw_device *cdev, int chp_no) | |||
592 | int | 590 | int |
593 | _ccw_device_get_subchannel_number(struct ccw_device *cdev) | 591 | _ccw_device_get_subchannel_number(struct ccw_device *cdev) |
594 | { | 592 | { |
595 | return cdev->private->sch_no; | 593 | return cdev->private->schid.sch_no; |
596 | } | 594 | } |
597 | 595 | ||
598 | int | 596 | int |
599 | _ccw_device_get_device_number(struct ccw_device *cdev) | 597 | _ccw_device_get_device_number(struct ccw_device *cdev) |
600 | { | 598 | { |
601 | return cdev->private->devno; | 599 | return cdev->private->dev_id.devno; |
602 | } | 600 | } |
603 | 601 | ||
604 | 602 | ||
diff --git a/drivers/s390/cio/device_pgid.c b/drivers/s390/cio/device_pgid.c index 84917b39de45..2975ce888c19 100644 --- a/drivers/s390/cio/device_pgid.c +++ b/drivers/s390/cio/device_pgid.c | |||
@@ -79,7 +79,8 @@ __ccw_device_sense_pgid_start(struct ccw_device *cdev) | |||
79 | CIO_MSG_EVENT(2, "SNID - Device %04x on Subchannel " | 79 | CIO_MSG_EVENT(2, "SNID - Device %04x on Subchannel " |
80 | "0.%x.%04x, lpm %02X, became 'not " | 80 | "0.%x.%04x, lpm %02X, became 'not " |
81 | "operational'\n", | 81 | "operational'\n", |
82 | cdev->private->devno, sch->schid.ssid, | 82 | cdev->private->dev_id.devno, |
83 | sch->schid.ssid, | ||
83 | sch->schid.sch_no, cdev->private->imask); | 84 | sch->schid.sch_no, cdev->private->imask); |
84 | 85 | ||
85 | } | 86 | } |
@@ -135,7 +136,8 @@ __ccw_device_check_sense_pgid(struct ccw_device *cdev) | |||
135 | CIO_MSG_EVENT(2, "SNID - device 0.%x.%04x, unit check, " | 136 | CIO_MSG_EVENT(2, "SNID - device 0.%x.%04x, unit check, " |
136 | "lpum %02X, cnt %02d, sns : " | 137 | "lpum %02X, cnt %02d, sns : " |
137 | "%02X%02X%02X%02X %02X%02X%02X%02X ...\n", | 138 | "%02X%02X%02X%02X %02X%02X%02X%02X ...\n", |
138 | cdev->private->ssid, cdev->private->devno, | 139 | cdev->private->dev_id.ssid, |
140 | cdev->private->dev_id.devno, | ||
139 | irb->esw.esw0.sublog.lpum, | 141 | irb->esw.esw0.sublog.lpum, |
140 | irb->esw.esw0.erw.scnt, | 142 | irb->esw.esw0.erw.scnt, |
141 | irb->ecw[0], irb->ecw[1], | 143 | irb->ecw[0], irb->ecw[1], |
@@ -147,7 +149,7 @@ __ccw_device_check_sense_pgid(struct ccw_device *cdev) | |||
147 | if (irb->scsw.cc == 3) { | 149 | if (irb->scsw.cc == 3) { |
148 | CIO_MSG_EVENT(2, "SNID - Device %04x on Subchannel 0.%x.%04x," | 150 | CIO_MSG_EVENT(2, "SNID - Device %04x on Subchannel 0.%x.%04x," |
149 | " lpm %02X, became 'not operational'\n", | 151 | " lpm %02X, became 'not operational'\n", |
150 | cdev->private->devno, sch->schid.ssid, | 152 | cdev->private->dev_id.devno, sch->schid.ssid, |
151 | sch->schid.sch_no, sch->orb.lpm); | 153 | sch->schid.sch_no, sch->orb.lpm); |
152 | return -EACCES; | 154 | return -EACCES; |
153 | } | 155 | } |
@@ -155,7 +157,7 @@ __ccw_device_check_sense_pgid(struct ccw_device *cdev) | |||
155 | if (cdev->private->pgid[i].inf.ps.state2 == SNID_STATE2_RESVD_ELSE) { | 157 | if (cdev->private->pgid[i].inf.ps.state2 == SNID_STATE2_RESVD_ELSE) { |
156 | CIO_MSG_EVENT(2, "SNID - Device %04x on Subchannel 0.%x.%04x " | 158 | CIO_MSG_EVENT(2, "SNID - Device %04x on Subchannel 0.%x.%04x " |
157 | "is reserved by someone else\n", | 159 | "is reserved by someone else\n", |
158 | cdev->private->devno, sch->schid.ssid, | 160 | cdev->private->dev_id.devno, sch->schid.ssid, |
159 | sch->schid.sch_no); | 161 | sch->schid.sch_no); |
160 | return -EUSERS; | 162 | return -EUSERS; |
161 | } | 163 | } |
@@ -261,7 +263,7 @@ __ccw_device_do_pgid(struct ccw_device *cdev, __u8 func) | |||
261 | /* PGID command failed on this path. */ | 263 | /* PGID command failed on this path. */ |
262 | CIO_MSG_EVENT(2, "SPID - Device %04x on Subchannel " | 264 | CIO_MSG_EVENT(2, "SPID - Device %04x on Subchannel " |
263 | "0.%x.%04x, lpm %02X, became 'not operational'\n", | 265 | "0.%x.%04x, lpm %02X, became 'not operational'\n", |
264 | cdev->private->devno, sch->schid.ssid, | 266 | cdev->private->dev_id.devno, sch->schid.ssid, |
265 | sch->schid.sch_no, cdev->private->imask); | 267 | sch->schid.sch_no, cdev->private->imask); |
266 | return ret; | 268 | return ret; |
267 | } | 269 | } |
@@ -301,7 +303,7 @@ static int __ccw_device_do_nop(struct ccw_device *cdev) | |||
301 | /* nop command failed on this path. */ | 303 | /* nop command failed on this path. */ |
302 | CIO_MSG_EVENT(2, "NOP - Device %04x on Subchannel " | 304 | CIO_MSG_EVENT(2, "NOP - Device %04x on Subchannel " |
303 | "0.%x.%04x, lpm %02X, became 'not operational'\n", | 305 | "0.%x.%04x, lpm %02X, became 'not operational'\n", |
304 | cdev->private->devno, sch->schid.ssid, | 306 | cdev->private->dev_id.devno, sch->schid.ssid, |
305 | sch->schid.sch_no, cdev->private->imask); | 307 | sch->schid.sch_no, cdev->private->imask); |
306 | return ret; | 308 | return ret; |
307 | } | 309 | } |
@@ -328,8 +330,9 @@ __ccw_device_check_pgid(struct ccw_device *cdev) | |||
328 | CIO_MSG_EVENT(2, "SPID - device 0.%x.%04x, unit check, " | 330 | CIO_MSG_EVENT(2, "SPID - device 0.%x.%04x, unit check, " |
329 | "cnt %02d, " | 331 | "cnt %02d, " |
330 | "sns : %02X%02X%02X%02X %02X%02X%02X%02X ...\n", | 332 | "sns : %02X%02X%02X%02X %02X%02X%02X%02X ...\n", |
331 | cdev->private->ssid, | 333 | cdev->private->dev_id.ssid, |
332 | cdev->private->devno, irb->esw.esw0.erw.scnt, | 334 | cdev->private->dev_id.devno, |
335 | irb->esw.esw0.erw.scnt, | ||
333 | irb->ecw[0], irb->ecw[1], | 336 | irb->ecw[0], irb->ecw[1], |
334 | irb->ecw[2], irb->ecw[3], | 337 | irb->ecw[2], irb->ecw[3], |
335 | irb->ecw[4], irb->ecw[5], | 338 | irb->ecw[4], irb->ecw[5], |
@@ -339,7 +342,7 @@ __ccw_device_check_pgid(struct ccw_device *cdev) | |||
339 | if (irb->scsw.cc == 3) { | 342 | if (irb->scsw.cc == 3) { |
340 | CIO_MSG_EVENT(2, "SPID - Device %04x on Subchannel 0.%x.%04x," | 343 | CIO_MSG_EVENT(2, "SPID - Device %04x on Subchannel 0.%x.%04x," |
341 | " lpm %02X, became 'not operational'\n", | 344 | " lpm %02X, became 'not operational'\n", |
342 | cdev->private->devno, sch->schid.ssid, | 345 | cdev->private->dev_id.devno, sch->schid.ssid, |
343 | sch->schid.sch_no, cdev->private->imask); | 346 | sch->schid.sch_no, cdev->private->imask); |
344 | return -EACCES; | 347 | return -EACCES; |
345 | } | 348 | } |
@@ -362,7 +365,7 @@ static int __ccw_device_check_nop(struct ccw_device *cdev) | |||
362 | if (irb->scsw.cc == 3) { | 365 | if (irb->scsw.cc == 3) { |
363 | CIO_MSG_EVENT(2, "NOP - Device %04x on Subchannel 0.%x.%04x," | 366 | CIO_MSG_EVENT(2, "NOP - Device %04x on Subchannel 0.%x.%04x," |
364 | " lpm %02X, became 'not operational'\n", | 367 | " lpm %02X, became 'not operational'\n", |
365 | cdev->private->devno, sch->schid.ssid, | 368 | cdev->private->dev_id.devno, sch->schid.ssid, |
366 | sch->schid.sch_no, cdev->private->imask); | 369 | sch->schid.sch_no, cdev->private->imask); |
367 | return -EACCES; | 370 | return -EACCES; |
368 | } | 371 | } |
diff --git a/drivers/s390/cio/device_status.c b/drivers/s390/cio/device_status.c index caf148d5caad..3f7cbce4cd87 100644 --- a/drivers/s390/cio/device_status.c +++ b/drivers/s390/cio/device_status.c | |||
@@ -32,19 +32,18 @@ ccw_device_msg_control_check(struct ccw_device *cdev, struct irb *irb) | |||
32 | SCHN_STAT_CHN_CTRL_CHK | | 32 | SCHN_STAT_CHN_CTRL_CHK | |
33 | SCHN_STAT_INTF_CTRL_CHK))) | 33 | SCHN_STAT_INTF_CTRL_CHK))) |
34 | return; | 34 | return; |
35 | |||
36 | CIO_MSG_EVENT(0, "Channel-Check or Interface-Control-Check " | 35 | CIO_MSG_EVENT(0, "Channel-Check or Interface-Control-Check " |
37 | "received" | 36 | "received" |
38 | " ... device %04x on subchannel 0.%x.%04x, dev_stat " | 37 | " ... device %04x on subchannel 0.%x.%04x, dev_stat " |
39 | ": %02X sch_stat : %02X\n", | 38 | ": %02X sch_stat : %02X\n", |
40 | cdev->private->devno, cdev->private->ssid, | 39 | cdev->private->dev_id.devno, cdev->private->schid.ssid, |
41 | cdev->private->sch_no, | 40 | cdev->private->schid.sch_no, |
42 | irb->scsw.dstat, irb->scsw.cstat); | 41 | irb->scsw.dstat, irb->scsw.cstat); |
43 | 42 | ||
44 | if (irb->scsw.cc != 3) { | 43 | if (irb->scsw.cc != 3) { |
45 | char dbf_text[15]; | 44 | char dbf_text[15]; |
46 | 45 | ||
47 | sprintf(dbf_text, "chk%x", cdev->private->sch_no); | 46 | sprintf(dbf_text, "chk%x", cdev->private->schid.sch_no); |
48 | CIO_TRACE_EVENT(0, dbf_text); | 47 | CIO_TRACE_EVENT(0, dbf_text); |
49 | CIO_HEX_EVENT(0, irb, sizeof (struct irb)); | 48 | CIO_HEX_EVENT(0, irb, sizeof (struct irb)); |
50 | } | 49 | } |
diff --git a/drivers/s390/cio/qdio.c b/drivers/s390/cio/qdio.c index cde822d8b5c8..476aa1da5cbc 100644 --- a/drivers/s390/cio/qdio.c +++ b/drivers/s390/cio/qdio.c | |||
@@ -1741,7 +1741,7 @@ qdio_fill_qs(struct qdio_irq *irq_ptr, struct ccw_device *cdev, | |||
1741 | void *ptr; | 1741 | void *ptr; |
1742 | int available; | 1742 | int available; |
1743 | 1743 | ||
1744 | sprintf(dbf_text,"qfqs%4x",cdev->private->sch_no); | 1744 | sprintf(dbf_text,"qfqs%4x",cdev->private->schid.sch_no); |
1745 | QDIO_DBF_TEXT0(0,setup,dbf_text); | 1745 | QDIO_DBF_TEXT0(0,setup,dbf_text); |
1746 | for (i=0;i<no_input_qs;i++) { | 1746 | for (i=0;i<no_input_qs;i++) { |
1747 | q=irq_ptr->input_qs[i]; | 1747 | q=irq_ptr->input_qs[i]; |
@@ -2924,7 +2924,7 @@ qdio_establish_handle_irq(struct ccw_device *cdev, int cstat, int dstat) | |||
2924 | 2924 | ||
2925 | irq_ptr = cdev->private->qdio_data; | 2925 | irq_ptr = cdev->private->qdio_data; |
2926 | 2926 | ||
2927 | sprintf(dbf_text,"qehi%4x",cdev->private->sch_no); | 2927 | sprintf(dbf_text,"qehi%4x",cdev->private->schid.sch_no); |
2928 | QDIO_DBF_TEXT0(0,setup,dbf_text); | 2928 | QDIO_DBF_TEXT0(0,setup,dbf_text); |
2929 | QDIO_DBF_TEXT0(0,trace,dbf_text); | 2929 | QDIO_DBF_TEXT0(0,trace,dbf_text); |
2930 | 2930 | ||
@@ -2943,7 +2943,7 @@ qdio_initialize(struct qdio_initialize *init_data) | |||
2943 | int rc; | 2943 | int rc; |
2944 | char dbf_text[15]; | 2944 | char dbf_text[15]; |
2945 | 2945 | ||
2946 | sprintf(dbf_text,"qini%4x",init_data->cdev->private->sch_no); | 2946 | sprintf(dbf_text,"qini%4x",init_data->cdev->private->schid.sch_no); |
2947 | QDIO_DBF_TEXT0(0,setup,dbf_text); | 2947 | QDIO_DBF_TEXT0(0,setup,dbf_text); |
2948 | QDIO_DBF_TEXT0(0,trace,dbf_text); | 2948 | QDIO_DBF_TEXT0(0,trace,dbf_text); |
2949 | 2949 | ||
@@ -2964,7 +2964,7 @@ qdio_allocate(struct qdio_initialize *init_data) | |||
2964 | struct qdio_irq *irq_ptr; | 2964 | struct qdio_irq *irq_ptr; |
2965 | char dbf_text[15]; | 2965 | char dbf_text[15]; |
2966 | 2966 | ||
2967 | sprintf(dbf_text,"qalc%4x",init_data->cdev->private->sch_no); | 2967 | sprintf(dbf_text,"qalc%4x",init_data->cdev->private->schid.sch_no); |
2968 | QDIO_DBF_TEXT0(0,setup,dbf_text); | 2968 | QDIO_DBF_TEXT0(0,setup,dbf_text); |
2969 | QDIO_DBF_TEXT0(0,trace,dbf_text); | 2969 | QDIO_DBF_TEXT0(0,trace,dbf_text); |
2970 | if ( (init_data->no_input_qs>QDIO_MAX_QUEUES_PER_IRQ) || | 2970 | if ( (init_data->no_input_qs>QDIO_MAX_QUEUES_PER_IRQ) || |
@@ -3187,7 +3187,7 @@ qdio_establish(struct qdio_initialize *init_data) | |||
3187 | tiqdio_set_delay_target(irq_ptr,TIQDIO_DELAY_TARGET); | 3187 | tiqdio_set_delay_target(irq_ptr,TIQDIO_DELAY_TARGET); |
3188 | } | 3188 | } |
3189 | 3189 | ||
3190 | sprintf(dbf_text,"qest%4x",cdev->private->sch_no); | 3190 | sprintf(dbf_text,"qest%4x",cdev->private->schid.sch_no); |
3191 | QDIO_DBF_TEXT0(0,setup,dbf_text); | 3191 | QDIO_DBF_TEXT0(0,setup,dbf_text); |
3192 | QDIO_DBF_TEXT0(0,trace,dbf_text); | 3192 | QDIO_DBF_TEXT0(0,trace,dbf_text); |
3193 | 3193 | ||
@@ -3529,7 +3529,7 @@ do_QDIO(struct ccw_device *cdev,unsigned int callflags, | |||
3529 | #ifdef CONFIG_QDIO_DEBUG | 3529 | #ifdef CONFIG_QDIO_DEBUG |
3530 | char dbf_text[20]; | 3530 | char dbf_text[20]; |
3531 | 3531 | ||
3532 | sprintf(dbf_text,"doQD%04x",cdev->private->sch_no); | 3532 | sprintf(dbf_text,"doQD%04x",cdev->private->schid.sch_no); |
3533 | QDIO_DBF_TEXT3(0,trace,dbf_text); | 3533 | QDIO_DBF_TEXT3(0,trace,dbf_text); |
3534 | #endif /* CONFIG_QDIO_DEBUG */ | 3534 | #endif /* CONFIG_QDIO_DEBUG */ |
3535 | 3535 | ||