aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/s390
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/s390')
-rw-r--r--drivers/s390/block/dasd.c1
-rw-r--r--drivers/s390/char/monwriter.c16
-rw-r--r--drivers/s390/cio/chsc.c23
-rw-r--r--drivers/s390/cio/cio.c4
-rw-r--r--drivers/s390/cio/css.c9
-rw-r--r--drivers/s390/cio/css.h7
-rw-r--r--drivers/s390/cio/device.c51
-rw-r--r--drivers/s390/cio/device.h2
-rw-r--r--drivers/s390/cio/device_fsm.c117
-rw-r--r--drivers/s390/cio/device_id.c14
-rw-r--r--drivers/s390/cio/device_ops.c6
-rw-r--r--drivers/s390/cio/device_pgid.c23
-rw-r--r--drivers/s390/cio/device_status.c7
-rw-r--r--drivers/s390/cio/qdio.c12
-rw-r--r--drivers/s390/crypto/ap_bus.c7
-rw-r--r--drivers/s390/scsi/zfcp_def.h4
-rw-r--r--drivers/s390/scsi/zfcp_scsi.c1
17 files changed, 132 insertions, 172 deletions
diff --git a/drivers/s390/block/dasd.c b/drivers/s390/block/dasd.c
index d0647d116eaa..79ffef6bfaf8 100644
--- a/drivers/s390/block/dasd.c
+++ b/drivers/s390/block/dasd.c
@@ -203,6 +203,7 @@ dasd_state_basic_to_known(struct dasd_device * device)
203 rc = dasd_flush_ccw_queue(device, 1); 203 rc = dasd_flush_ccw_queue(device, 1);
204 if (rc) 204 if (rc)
205 return rc; 205 return rc;
206 dasd_clear_timer(device);
206 207
207 DBF_DEV_EVENT(DBF_EMERG, device, "%p debug area deleted", device); 208 DBF_DEV_EVENT(DBF_EMERG, device, "%p debug area deleted", device);
208 if (device->debug_area != NULL) { 209 if (device->debug_area != NULL) {
diff --git a/drivers/s390/char/monwriter.c b/drivers/s390/char/monwriter.c
index 4362ff260244..b9b0fc3f812b 100644
--- a/drivers/s390/char/monwriter.c
+++ b/drivers/s390/char/monwriter.c
@@ -73,12 +73,15 @@ static inline struct mon_buf *monwrite_find_hdr(struct mon_private *monpriv,
73 struct mon_buf *entry, *next; 73 struct mon_buf *entry, *next;
74 74
75 list_for_each_entry_safe(entry, next, &monpriv->list, list) 75 list_for_each_entry_safe(entry, next, &monpriv->list, list)
76 if (entry->hdr.applid == monhdr->applid && 76 if ((entry->hdr.mon_function == monhdr->mon_function ||
77 monhdr->mon_function == MONWRITE_STOP_INTERVAL) &&
78 entry->hdr.applid == monhdr->applid &&
77 entry->hdr.record_num == monhdr->record_num && 79 entry->hdr.record_num == monhdr->record_num &&
78 entry->hdr.version == monhdr->version && 80 entry->hdr.version == monhdr->version &&
79 entry->hdr.release == monhdr->release && 81 entry->hdr.release == monhdr->release &&
80 entry->hdr.mod_level == monhdr->mod_level) 82 entry->hdr.mod_level == monhdr->mod_level)
81 return entry; 83 return entry;
84
82 return NULL; 85 return NULL;
83} 86}
84 87
@@ -92,7 +95,9 @@ static int monwrite_new_hdr(struct mon_private *monpriv)
92 monhdr->mon_function > MONWRITE_START_CONFIG || 95 monhdr->mon_function > MONWRITE_START_CONFIG ||
93 monhdr->hdrlen != sizeof(struct monwrite_hdr)) 96 monhdr->hdrlen != sizeof(struct monwrite_hdr))
94 return -EINVAL; 97 return -EINVAL;
95 monbuf = monwrite_find_hdr(monpriv, monhdr); 98 monbuf = NULL;
99 if (monhdr->mon_function != MONWRITE_GEN_EVENT)
100 monbuf = monwrite_find_hdr(monpriv, monhdr);
96 if (monbuf) { 101 if (monbuf) {
97 if (monhdr->mon_function == MONWRITE_STOP_INTERVAL) { 102 if (monhdr->mon_function == MONWRITE_STOP_INTERVAL) {
98 monhdr->datalen = monbuf->hdr.datalen; 103 monhdr->datalen = monbuf->hdr.datalen;
@@ -104,13 +109,13 @@ static int monwrite_new_hdr(struct mon_private *monpriv)
104 kfree(monbuf); 109 kfree(monbuf);
105 monbuf = NULL; 110 monbuf = NULL;
106 } 111 }
107 } else { 112 } else if (monhdr->mon_function != MONWRITE_STOP_INTERVAL) {
108 if (mon_buf_count >= mon_max_bufs) 113 if (mon_buf_count >= mon_max_bufs)
109 return -ENOSPC; 114 return -ENOSPC;
110 monbuf = kzalloc(sizeof(struct mon_buf), GFP_KERNEL); 115 monbuf = kzalloc(sizeof(struct mon_buf), GFP_KERNEL);
111 if (!monbuf) 116 if (!monbuf)
112 return -ENOMEM; 117 return -ENOMEM;
113 monbuf->data = kzalloc(monbuf->hdr.datalen, 118 monbuf->data = kzalloc(monhdr->datalen,
114 GFP_KERNEL | GFP_DMA); 119 GFP_KERNEL | GFP_DMA);
115 if (!monbuf->data) { 120 if (!monbuf->data) {
116 kfree(monbuf); 121 kfree(monbuf);
@@ -118,7 +123,8 @@ static int monwrite_new_hdr(struct mon_private *monpriv)
118 } 123 }
119 monbuf->hdr = *monhdr; 124 monbuf->hdr = *monhdr;
120 list_add_tail(&monbuf->list, &monpriv->list); 125 list_add_tail(&monbuf->list, &monpriv->list);
121 mon_buf_count++; 126 if (monhdr->mon_function != MONWRITE_GEN_EVENT)
127 mon_buf_count++;
122 } 128 }
123 monpriv->current_buf = monbuf; 129 monpriv->current_buf = monbuf;
124 return 0; 130 return 0;
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
710static inline int 710static 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. */
173int device_is_online(struct subchannel *); 172int device_is_online(struct subchannel *);
174void device_set_waiting(struct subchannel *); 173void device_kill_io(struct subchannel *);
175 174
176/* Machine check helper function. */ 175/* Machine check helper function. */
177void device_kill_pending_timer(struct subchannel *); 176void 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 */
535int 535static int ccw_device_register(struct ccw_device *cdev)
536ccw_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
554struct match_data { 553struct 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
560static int 558static int
561match_devno(struct device * dev, void * data) 559match_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
577static struct ccw_device * 574static struct ccw_device * get_disc_ccwdev_by_dev_id(struct ccw_dev_id *dev_id,
578get_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
80int ccw_device_cancel_halt_clear(struct ccw_device *); 79int ccw_device_cancel_halt_clear(struct ccw_device *);
81 80
82int ccw_device_register(struct ccw_device *);
83void ccw_device_do_unreg_rereg(void *); 81void ccw_device_do_unreg_rereg(void *);
84void ccw_device_call_sch_unregister(void *); 82void 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
62void
63device_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
987static void
988ccw_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
1021static void 982void device_kill_io(struct subchannel *sch)
1022ccw_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)
592int 590int
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
598int 596int
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
diff --git a/drivers/s390/crypto/ap_bus.c b/drivers/s390/crypto/ap_bus.c
index c5ccd20b110c..79d89c368919 100644
--- a/drivers/s390/crypto/ap_bus.c
+++ b/drivers/s390/crypto/ap_bus.c
@@ -739,11 +739,16 @@ static void ap_scan_bus(void *data)
739 dev = bus_find_device(&ap_bus_type, NULL, 739 dev = bus_find_device(&ap_bus_type, NULL,
740 (void *)(unsigned long)qid, 740 (void *)(unsigned long)qid,
741 __ap_scan_bus); 741 __ap_scan_bus);
742 rc = ap_query_queue(qid, &queue_depth, &device_type);
743 if (dev && rc) {
744 put_device(dev);
745 device_unregister(dev);
746 continue;
747 }
742 if (dev) { 748 if (dev) {
743 put_device(dev); 749 put_device(dev);
744 continue; 750 continue;
745 } 751 }
746 rc = ap_query_queue(qid, &queue_depth, &device_type);
747 if (rc) 752 if (rc)
748 continue; 753 continue;
749 rc = ap_init_queue(qid); 754 rc = ap_init_queue(qid);
diff --git a/drivers/s390/scsi/zfcp_def.h b/drivers/s390/scsi/zfcp_def.h
index 8f882690994d..74c0eac083e4 100644
--- a/drivers/s390/scsi/zfcp_def.h
+++ b/drivers/s390/scsi/zfcp_def.h
@@ -107,6 +107,10 @@ zfcp_address_to_sg(void *address, struct scatterlist *list)
107 (ZFCP_MAX_SBALS_PER_REQ * ZFCP_MAX_SBALES_PER_SBAL - 2) 107 (ZFCP_MAX_SBALS_PER_REQ * ZFCP_MAX_SBALES_PER_SBAL - 2)
108 /* request ID + QTCB in SBALE 0 + 1 of first SBAL in chain */ 108 /* request ID + QTCB in SBALE 0 + 1 of first SBAL in chain */
109 109
110#define ZFCP_MAX_SECTORS (ZFCP_MAX_SBALES_PER_REQ * 8)
111 /* max. number of (data buffer) SBALEs in largest SBAL chain
112 multiplied with number of sectors per 4k block */
113
110/* FIXME(tune): free space should be one max. SBAL chain plus what? */ 114/* FIXME(tune): free space should be one max. SBAL chain plus what? */
111#define ZFCP_QDIO_PCI_INTERVAL (QDIO_MAX_BUFFERS_PER_Q \ 115#define ZFCP_QDIO_PCI_INTERVAL (QDIO_MAX_BUFFERS_PER_Q \
112 - (ZFCP_MAX_SBALS_PER_REQ + 4)) 116 - (ZFCP_MAX_SBALS_PER_REQ + 4))
diff --git a/drivers/s390/scsi/zfcp_scsi.c b/drivers/s390/scsi/zfcp_scsi.c
index 4d2bc7981324..452d96f92a14 100644
--- a/drivers/s390/scsi/zfcp_scsi.c
+++ b/drivers/s390/scsi/zfcp_scsi.c
@@ -58,6 +58,7 @@ struct zfcp_data zfcp_data = {
58 .cmd_per_lun = 1, 58 .cmd_per_lun = 1,
59 .use_clustering = 1, 59 .use_clustering = 1,
60 .sdev_attrs = zfcp_sysfs_sdev_attrs, 60 .sdev_attrs = zfcp_sysfs_sdev_attrs,
61 .max_sectors = ZFCP_MAX_SECTORS,
61 }, 62 },
62 .driver_version = ZFCP_VERSION, 63 .driver_version = ZFCP_VERSION,
63}; 64};