aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@g5.osdl.org>2006-10-11 14:20:11 -0400
committerLinus Torvalds <torvalds@g5.osdl.org>2006-10-11 14:20:11 -0400
commit0ca9caae2d05ee0c4878aa3e2619cd23f4ad4cb4 (patch)
tree93323b1f7146aefb1843cb995def6c09613bb363
parent6bf1f75bc6dabc357a29e3b3d6bd4ff00c3d5e6e (diff)
parent75e9de18f079a51fa987ef0703112d5bc125fdb7 (diff)
Merge branch 'for-linus' of git://git390.osdl.marist.edu/pub/scm/linux-2.6
* 'for-linus' of git://git390.osdl.marist.edu/pub/scm/linux-2.6: [S390] stacktrace bug. [S390] cio: remove casts from/to (void *). [S390] cio: Remove grace period for vary off chpid. [S390] cio: Use ccw_dev_id and subchannel_id in ccw_device_private [S390] monwriter kzalloc size. [S390] cio: add missing KERN_INFO printk header. [S390] irq change improvements.
-rw-r--r--arch/s390/appldata/appldata_base.c2
-rw-r--r--arch/s390/kernel/s390_ext.c4
-rw-r--r--arch/s390/kernel/stacktrace.c17
-rw-r--r--arch/s390/kernel/vtime.c8
-rw-r--r--drivers/s390/char/monwriter.c2
-rw-r--r--drivers/s390/cio/chsc.c23
-rw-r--r--drivers/s390/cio/cio.c4
-rw-r--r--drivers/s390/cio/css.c2
-rw-r--r--drivers/s390/cio/css.h7
-rw-r--r--drivers/s390/cio/device.c48
-rw-r--r--drivers/s390/cio/device.h1
-rw-r--r--drivers/s390/cio/device_fsm.c113
-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.c10
-rw-r--r--include/asm-s390/cio.h6
-rw-r--r--include/asm-s390/timer.h2
19 files changed, 123 insertions, 176 deletions
diff --git a/arch/s390/appldata/appldata_base.c b/arch/s390/appldata/appldata_base.c
index 2b1e6c9a6e0e..45c9fa7d7545 100644
--- a/arch/s390/appldata/appldata_base.c
+++ b/arch/s390/appldata/appldata_base.c
@@ -109,7 +109,7 @@ static LIST_HEAD(appldata_ops_list);
109 * 109 *
110 * schedule work and reschedule timer 110 * schedule work and reschedule timer
111 */ 111 */
112static void appldata_timer_function(unsigned long data, struct pt_regs *regs) 112static void appldata_timer_function(unsigned long data)
113{ 113{
114 P_DEBUG(" -= Timer =-\n"); 114 P_DEBUG(" -= Timer =-\n");
115 P_DEBUG("CPU: %i, expire_count: %i\n", smp_processor_id(), 115 P_DEBUG("CPU: %i, expire_count: %i\n", smp_processor_id(),
diff --git a/arch/s390/kernel/s390_ext.c b/arch/s390/kernel/s390_ext.c
index c49ab8c784d2..4faf96f8a834 100644
--- a/arch/s390/kernel/s390_ext.c
+++ b/arch/s390/kernel/s390_ext.c
@@ -117,8 +117,8 @@ void do_extint(struct pt_regs *regs, unsigned short code)
117 int index; 117 int index;
118 struct pt_regs *old_regs; 118 struct pt_regs *old_regs;
119 119
120 irq_enter();
121 old_regs = set_irq_regs(regs); 120 old_regs = set_irq_regs(regs);
121 irq_enter();
122 asm volatile ("mc 0,0"); 122 asm volatile ("mc 0,0");
123 if (S390_lowcore.int_clock >= S390_lowcore.jiffy_timer) 123 if (S390_lowcore.int_clock >= S390_lowcore.jiffy_timer)
124 /** 124 /**
@@ -134,8 +134,8 @@ void do_extint(struct pt_regs *regs, unsigned short code)
134 p->handler(code); 134 p->handler(code);
135 } 135 }
136 } 136 }
137 set_irq_regs(old_regs);
138 irq_exit(); 137 irq_exit();
138 set_irq_regs(old_regs);
139} 139}
140 140
141EXPORT_SYMBOL(register_external_interrupt); 141EXPORT_SYMBOL(register_external_interrupt);
diff --git a/arch/s390/kernel/stacktrace.c b/arch/s390/kernel/stacktrace.c
index d9428a0fc8fb..0d14a4789bf2 100644
--- a/arch/s390/kernel/stacktrace.c
+++ b/arch/s390/kernel/stacktrace.c
@@ -62,27 +62,26 @@ static inline unsigned long save_context_stack(struct stack_trace *trace,
62void save_stack_trace(struct stack_trace *trace, struct task_struct *task) 62void save_stack_trace(struct stack_trace *trace, struct task_struct *task)
63{ 63{
64 register unsigned long sp asm ("15"); 64 register unsigned long sp asm ("15");
65 unsigned long orig_sp; 65 unsigned long orig_sp, new_sp;
66 66
67 sp &= PSW_ADDR_INSN; 67 orig_sp = sp & PSW_ADDR_INSN;
68 orig_sp = sp;
69 68
70 sp = save_context_stack(trace, &trace->skip, sp, 69 new_sp = save_context_stack(trace, &trace->skip, orig_sp,
71 S390_lowcore.panic_stack - PAGE_SIZE, 70 S390_lowcore.panic_stack - PAGE_SIZE,
72 S390_lowcore.panic_stack); 71 S390_lowcore.panic_stack);
73 if ((sp != orig_sp) && !trace->all_contexts) 72 if ((new_sp != orig_sp) && !trace->all_contexts)
74 return; 73 return;
75 sp = save_context_stack(trace, &trace->skip, sp, 74 new_sp = save_context_stack(trace, &trace->skip, new_sp,
76 S390_lowcore.async_stack - ASYNC_SIZE, 75 S390_lowcore.async_stack - ASYNC_SIZE,
77 S390_lowcore.async_stack); 76 S390_lowcore.async_stack);
78 if ((sp != orig_sp) && !trace->all_contexts) 77 if ((new_sp != orig_sp) && !trace->all_contexts)
79 return; 78 return;
80 if (task) 79 if (task)
81 save_context_stack(trace, &trace->skip, sp, 80 save_context_stack(trace, &trace->skip, new_sp,
82 (unsigned long) task_stack_page(task), 81 (unsigned long) task_stack_page(task),
83 (unsigned long) task_stack_page(task) + THREAD_SIZE); 82 (unsigned long) task_stack_page(task) + THREAD_SIZE);
84 else 83 else
85 save_context_stack(trace, &trace->skip, sp, 84 save_context_stack(trace, &trace->skip, new_sp,
86 S390_lowcore.thread_info, 85 S390_lowcore.thread_info,
87 S390_lowcore.thread_info + THREAD_SIZE); 86 S390_lowcore.thread_info + THREAD_SIZE);
88 return; 87 return;
diff --git a/arch/s390/kernel/vtime.c b/arch/s390/kernel/vtime.c
index 1d7d3938b2b1..21baaf5496d6 100644
--- a/arch/s390/kernel/vtime.c
+++ b/arch/s390/kernel/vtime.c
@@ -209,11 +209,11 @@ static void list_add_sorted(struct vtimer_list *timer, struct list_head *head)
209 * Do the callback functions of expired vtimer events. 209 * Do the callback functions of expired vtimer events.
210 * Called from within the interrupt handler. 210 * Called from within the interrupt handler.
211 */ 211 */
212static void do_callbacks(struct list_head *cb_list, struct pt_regs *regs) 212static void do_callbacks(struct list_head *cb_list)
213{ 213{
214 struct vtimer_queue *vt_list; 214 struct vtimer_queue *vt_list;
215 struct vtimer_list *event, *tmp; 215 struct vtimer_list *event, *tmp;
216 void (*fn)(unsigned long, struct pt_regs*); 216 void (*fn)(unsigned long);
217 unsigned long data; 217 unsigned long data;
218 218
219 if (list_empty(cb_list)) 219 if (list_empty(cb_list))
@@ -224,7 +224,7 @@ static void do_callbacks(struct list_head *cb_list, struct pt_regs *regs)
224 list_for_each_entry_safe(event, tmp, cb_list, entry) { 224 list_for_each_entry_safe(event, tmp, cb_list, entry) {
225 fn = event->function; 225 fn = event->function;
226 data = event->data; 226 data = event->data;
227 fn(data, regs); 227 fn(data);
228 228
229 if (!event->interval) 229 if (!event->interval)
230 /* delete one shot timer */ 230 /* delete one shot timer */
@@ -275,7 +275,7 @@ static void do_cpu_timer_interrupt(__u16 error_code)
275 list_move_tail(&event->entry, &cb_list); 275 list_move_tail(&event->entry, &cb_list);
276 } 276 }
277 spin_unlock(&vt_list->lock); 277 spin_unlock(&vt_list->lock);
278 do_callbacks(&cb_list, get_irq_regs()); 278 do_callbacks(&cb_list);
279 279
280 /* next event is first in list */ 280 /* next event is first in list */
281 spin_lock(&vt_list->lock); 281 spin_lock(&vt_list->lock);
diff --git a/drivers/s390/char/monwriter.c b/drivers/s390/char/monwriter.c
index 4362ff260244..abd02ed501cb 100644
--- a/drivers/s390/char/monwriter.c
+++ b/drivers/s390/char/monwriter.c
@@ -110,7 +110,7 @@ static int monwrite_new_hdr(struct mon_private *monpriv)
110 monbuf = kzalloc(sizeof(struct mon_buf), GFP_KERNEL); 110 monbuf = kzalloc(sizeof(struct mon_buf), GFP_KERNEL);
111 if (!monbuf) 111 if (!monbuf)
112 return -ENOMEM; 112 return -ENOMEM;
113 monbuf->data = kzalloc(monbuf->hdr.datalen, 113 monbuf->data = kzalloc(monhdr->datalen,
114 GFP_KERNEL | GFP_DMA); 114 GFP_KERNEL | GFP_DMA);
115 if (!monbuf->data) { 115 if (!monbuf->data) {
116 kfree(monbuf); 116 kfree(monbuf);
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..a2dee5bf5a17 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}
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..94bdd4d8a4c9 100644
--- a/drivers/s390/cio/device.c
+++ b/drivers/s390/cio/device.c
@@ -552,21 +552,19 @@ ccw_device_register(struct ccw_device *cdev)
552} 552}
553 553
554struct match_data { 554struct match_data {
555 unsigned int devno; 555 struct ccw_dev_id dev_id;
556 unsigned int ssid;
557 struct ccw_device * sibling; 556 struct ccw_device * sibling;
558}; 557};
559 558
560static int 559static int
561match_devno(struct device * dev, void * data) 560match_devno(struct device * dev, void * data)
562{ 561{
563 struct match_data * d = (struct match_data *)data; 562 struct match_data * d = data;
564 struct ccw_device * cdev; 563 struct ccw_device * cdev;
565 564
566 cdev = to_ccwdev(dev); 565 cdev = to_ccwdev(dev);
567 if ((cdev->private->state == DEV_STATE_DISCONNECTED) && 566 if ((cdev->private->state == DEV_STATE_DISCONNECTED) &&
568 (cdev->private->devno == d->devno) && 567 ccw_dev_id_is_equal(&cdev->private->dev_id, &d->dev_id) &&
569 (cdev->private->ssid == d->ssid) &&
570 (cdev != d->sibling)) { 568 (cdev != d->sibling)) {
571 cdev->private->state = DEV_STATE_NOT_OPER; 569 cdev->private->state = DEV_STATE_NOT_OPER;
572 return 1; 570 return 1;
@@ -574,15 +572,13 @@ match_devno(struct device * dev, void * data)
574 return 0; 572 return 0;
575} 573}
576 574
577static struct ccw_device * 575static 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, 576 struct ccw_device *sibling)
579 struct ccw_device *sibling)
580{ 577{
581 struct device *dev; 578 struct device *dev;
582 struct match_data data; 579 struct match_data data;
583 580
584 data.devno = devno; 581 data.dev_id = *dev_id;
585 data.ssid = ssid;
586 data.sibling = sibling; 582 data.sibling = sibling;
587 dev = bus_find_device(&ccw_bus_type, NULL, &data, match_devno); 583 dev = bus_find_device(&ccw_bus_type, NULL, &data, match_devno);
588 584
@@ -595,7 +591,7 @@ ccw_device_add_changed(void *data)
595 591
596 struct ccw_device *cdev; 592 struct ccw_device *cdev;
597 593
598 cdev = (struct ccw_device *)data; 594 cdev = data;
599 if (device_add(&cdev->dev)) { 595 if (device_add(&cdev->dev)) {
600 put_device(&cdev->dev); 596 put_device(&cdev->dev);
601 return; 597 return;
@@ -616,9 +612,9 @@ ccw_device_do_unreg_rereg(void *data)
616 struct subchannel *sch; 612 struct subchannel *sch;
617 int need_rename; 613 int need_rename;
618 614
619 cdev = (struct ccw_device *)data; 615 cdev = data;
620 sch = to_subchannel(cdev->dev.parent); 616 sch = to_subchannel(cdev->dev.parent);
621 if (cdev->private->devno != sch->schib.pmcw.dev) { 617 if (cdev->private->dev_id.devno != sch->schib.pmcw.dev) {
622 /* 618 /*
623 * The device number has changed. This is usually only when 619 * The device number has changed. This is usually only when
624 * a device has been detached under VM and then re-appeared 620 * a device has been detached under VM and then re-appeared
@@ -633,10 +629,12 @@ ccw_device_do_unreg_rereg(void *data)
633 * get possibly sick... 629 * get possibly sick...
634 */ 630 */
635 struct ccw_device *other_cdev; 631 struct ccw_device *other_cdev;
632 struct ccw_dev_id dev_id;
636 633
637 need_rename = 1; 634 need_rename = 1;
638 other_cdev = get_disc_ccwdev_by_devno(sch->schib.pmcw.dev, 635 dev_id.devno = sch->schib.pmcw.dev;
639 sch->schid.ssid, cdev); 636 dev_id.ssid = sch->schid.ssid;
637 other_cdev = get_disc_ccwdev_by_dev_id(&dev_id, cdev);
640 if (other_cdev) { 638 if (other_cdev) {
641 struct subchannel *other_sch; 639 struct subchannel *other_sch;
642 640
@@ -652,7 +650,7 @@ ccw_device_do_unreg_rereg(void *data)
652 } 650 }
653 /* Update ssd info here. */ 651 /* Update ssd info here. */
654 css_get_ssd_info(sch); 652 css_get_ssd_info(sch);
655 cdev->private->devno = sch->schib.pmcw.dev; 653 cdev->private->dev_id.devno = sch->schib.pmcw.dev;
656 } else 654 } else
657 need_rename = 0; 655 need_rename = 0;
658 device_remove_files(&cdev->dev); 656 device_remove_files(&cdev->dev);
@@ -662,7 +660,7 @@ ccw_device_do_unreg_rereg(void *data)
662 snprintf (cdev->dev.bus_id, BUS_ID_SIZE, "0.%x.%04x", 660 snprintf (cdev->dev.bus_id, BUS_ID_SIZE, "0.%x.%04x",
663 sch->schid.ssid, sch->schib.pmcw.dev); 661 sch->schid.ssid, sch->schib.pmcw.dev);
664 PREPARE_WORK(&cdev->private->kick_work, 662 PREPARE_WORK(&cdev->private->kick_work,
665 ccw_device_add_changed, (void *)cdev); 663 ccw_device_add_changed, cdev);
666 queue_work(ccw_device_work, &cdev->private->kick_work); 664 queue_work(ccw_device_work, &cdev->private->kick_work);
667} 665}
668 666
@@ -687,7 +685,7 @@ io_subchannel_register(void *data)
687 int ret; 685 int ret;
688 unsigned long flags; 686 unsigned long flags;
689 687
690 cdev = (struct ccw_device *) data; 688 cdev = data;
691 sch = to_subchannel(cdev->dev.parent); 689 sch = to_subchannel(cdev->dev.parent);
692 690
693 if (klist_node_attached(&cdev->dev.knode_parent)) { 691 if (klist_node_attached(&cdev->dev.knode_parent)) {
@@ -759,7 +757,7 @@ io_subchannel_recog_done(struct ccw_device *cdev)
759 break; 757 break;
760 sch = to_subchannel(cdev->dev.parent); 758 sch = to_subchannel(cdev->dev.parent);
761 PREPARE_WORK(&cdev->private->kick_work, 759 PREPARE_WORK(&cdev->private->kick_work,
762 ccw_device_call_sch_unregister, (void *) cdev); 760 ccw_device_call_sch_unregister, cdev);
763 queue_work(slow_path_wq, &cdev->private->kick_work); 761 queue_work(slow_path_wq, &cdev->private->kick_work);
764 if (atomic_dec_and_test(&ccw_device_init_count)) 762 if (atomic_dec_and_test(&ccw_device_init_count))
765 wake_up(&ccw_device_init_wq); 763 wake_up(&ccw_device_init_wq);
@@ -774,7 +772,7 @@ io_subchannel_recog_done(struct ccw_device *cdev)
774 if (!get_device(&cdev->dev)) 772 if (!get_device(&cdev->dev))
775 break; 773 break;
776 PREPARE_WORK(&cdev->private->kick_work, 774 PREPARE_WORK(&cdev->private->kick_work,
777 io_subchannel_register, (void *) cdev); 775 io_subchannel_register, cdev);
778 queue_work(slow_path_wq, &cdev->private->kick_work); 776 queue_work(slow_path_wq, &cdev->private->kick_work);
779 break; 777 break;
780 } 778 }
@@ -792,9 +790,9 @@ io_subchannel_recog(struct ccw_device *cdev, struct subchannel *sch)
792 790
793 /* Init private data. */ 791 /* Init private data. */
794 priv = cdev->private; 792 priv = cdev->private;
795 priv->devno = sch->schib.pmcw.dev; 793 priv->dev_id.devno = sch->schib.pmcw.dev;
796 priv->ssid = sch->schid.ssid; 794 priv->dev_id.ssid = sch->schid.ssid;
797 priv->sch_no = sch->schid.sch_no; 795 priv->schid = sch->schid;
798 priv->state = DEV_STATE_NOT_OPER; 796 priv->state = DEV_STATE_NOT_OPER;
799 INIT_LIST_HEAD(&priv->cmb_list); 797 INIT_LIST_HEAD(&priv->cmb_list);
800 init_waitqueue_head(&priv->wait_q); 798 init_waitqueue_head(&priv->wait_q);
@@ -912,7 +910,7 @@ io_subchannel_remove (struct subchannel *sch)
912 */ 910 */
913 if (get_device(&cdev->dev)) { 911 if (get_device(&cdev->dev)) {
914 PREPARE_WORK(&cdev->private->kick_work, 912 PREPARE_WORK(&cdev->private->kick_work,
915 ccw_device_unregister, (void *) cdev); 913 ccw_device_unregister, cdev);
916 queue_work(ccw_device_work, &cdev->private->kick_work); 914 queue_work(ccw_device_work, &cdev->private->kick_work);
917 } 915 }
918 return 0; 916 return 0;
@@ -1055,7 +1053,7 @@ __ccwdev_check_busid(struct device *dev, void *id)
1055{ 1053{
1056 char *bus_id; 1054 char *bus_id;
1057 1055
1058 bus_id = (char *)id; 1056 bus_id = id;
1059 1057
1060 return (strncmp(bus_id, dev->bus_id, BUS_ID_SIZE) == 0); 1058 return (strncmp(bus_id, dev->bus_id, BUS_ID_SIZE) == 0);
1061} 1059}
diff --git a/drivers/s390/cio/device.h b/drivers/s390/cio/device.h
index 00be9a5b4acd..c6140cc97a80 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,
diff --git a/drivers/s390/cio/device_fsm.c b/drivers/s390/cio/device_fsm.c
index b67620208f36..fcaf28d7b4eb 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
@@ -592,7 +582,7 @@ ccw_device_verify_done(struct ccw_device *cdev, int err)
592 break; 582 break;
593 default: 583 default:
594 PREPARE_WORK(&cdev->private->kick_work, 584 PREPARE_WORK(&cdev->private->kick_work,
595 ccw_device_nopath_notify, (void *)cdev); 585 ccw_device_nopath_notify, cdev);
596 queue_work(ccw_device_notify_work, &cdev->private->kick_work); 586 queue_work(ccw_device_notify_work, &cdev->private->kick_work);
597 ccw_device_done(cdev, DEV_STATE_NOT_OPER); 587 ccw_device_done(cdev, DEV_STATE_NOT_OPER);
598 break; 588 break;
@@ -723,7 +713,7 @@ ccw_device_offline_notoper(struct ccw_device *cdev, enum dev_event dev_event)
723 sch = to_subchannel(cdev->dev.parent); 713 sch = to_subchannel(cdev->dev.parent);
724 if (get_device(&cdev->dev)) { 714 if (get_device(&cdev->dev)) {
725 PREPARE_WORK(&cdev->private->kick_work, 715 PREPARE_WORK(&cdev->private->kick_work,
726 ccw_device_call_sch_unregister, (void *)cdev); 716 ccw_device_call_sch_unregister, cdev);
727 queue_work(ccw_device_work, &cdev->private->kick_work); 717 queue_work(ccw_device_work, &cdev->private->kick_work);
728 } 718 }
729 wake_up(&cdev->private->wait_q); 719 wake_up(&cdev->private->wait_q);
@@ -754,7 +744,7 @@ ccw_device_online_notoper(struct ccw_device *cdev, enum dev_event dev_event)
754 } 744 }
755 if (get_device(&cdev->dev)) { 745 if (get_device(&cdev->dev)) {
756 PREPARE_WORK(&cdev->private->kick_work, 746 PREPARE_WORK(&cdev->private->kick_work,
757 ccw_device_call_sch_unregister, (void *)cdev); 747 ccw_device_call_sch_unregister, cdev);
758 queue_work(ccw_device_work, &cdev->private->kick_work); 748 queue_work(ccw_device_work, &cdev->private->kick_work);
759 } 749 }
760 wake_up(&cdev->private->wait_q); 750 wake_up(&cdev->private->wait_q);
@@ -859,7 +849,7 @@ ccw_device_online_timeout(struct ccw_device *cdev, enum dev_event dev_event)
859 sch = to_subchannel(cdev->dev.parent); 849 sch = to_subchannel(cdev->dev.parent);
860 if (!sch->lpm) { 850 if (!sch->lpm) {
861 PREPARE_WORK(&cdev->private->kick_work, 851 PREPARE_WORK(&cdev->private->kick_work,
862 ccw_device_nopath_notify, (void *)cdev); 852 ccw_device_nopath_notify, cdev);
863 queue_work(ccw_device_notify_work, 853 queue_work(ccw_device_notify_work,
864 &cdev->private->kick_work); 854 &cdev->private->kick_work);
865 } else 855 } else
@@ -885,7 +875,8 @@ ccw_device_w4sense(struct ccw_device *cdev, enum dev_event dev_event)
885 /* Basic sense hasn't started. Try again. */ 875 /* Basic sense hasn't started. Try again. */
886 ccw_device_do_sense(cdev, irb); 876 ccw_device_do_sense(cdev, irb);
887 else { 877 else {
888 printk("Huh? %s(%s): unsolicited interrupt...\n", 878 printk(KERN_INFO "Huh? %s(%s): unsolicited "
879 "interrupt...\n",
889 __FUNCTION__, cdev->dev.bus_id); 880 __FUNCTION__, cdev->dev.bus_id);
890 if (cdev->handler) 881 if (cdev->handler)
891 cdev->handler (cdev, 0, irb); 882 cdev->handler (cdev, 0, irb);
@@ -944,10 +935,10 @@ ccw_device_killing_irq(struct ccw_device *cdev, enum dev_event dev_event)
944 cdev->private->state = DEV_STATE_ONLINE; 935 cdev->private->state = DEV_STATE_ONLINE;
945 if (cdev->handler) 936 if (cdev->handler)
946 cdev->handler(cdev, cdev->private->intparm, 937 cdev->handler(cdev, cdev->private->intparm,
947 ERR_PTR(-ETIMEDOUT)); 938 ERR_PTR(-EIO));
948 if (!sch->lpm) { 939 if (!sch->lpm) {
949 PREPARE_WORK(&cdev->private->kick_work, 940 PREPARE_WORK(&cdev->private->kick_work,
950 ccw_device_nopath_notify, (void *)cdev); 941 ccw_device_nopath_notify, cdev);
951 queue_work(ccw_device_notify_work, &cdev->private->kick_work); 942 queue_work(ccw_device_notify_work, &cdev->private->kick_work);
952 } else if (cdev->private->flags.doverify) 943 } else if (cdev->private->flags.doverify)
953 /* Start delayed path verification. */ 944 /* Start delayed path verification. */
@@ -970,7 +961,7 @@ ccw_device_killing_timeout(struct ccw_device *cdev, enum dev_event dev_event)
970 sch = to_subchannel(cdev->dev.parent); 961 sch = to_subchannel(cdev->dev.parent);
971 if (!sch->lpm) { 962 if (!sch->lpm) {
972 PREPARE_WORK(&cdev->private->kick_work, 963 PREPARE_WORK(&cdev->private->kick_work,
973 ccw_device_nopath_notify, (void *)cdev); 964 ccw_device_nopath_notify, cdev);
974 queue_work(ccw_device_notify_work, 965 queue_work(ccw_device_notify_work,
975 &cdev->private->kick_work); 966 &cdev->private->kick_work);
976 } else 967 } else
@@ -981,51 +972,15 @@ ccw_device_killing_timeout(struct ccw_device *cdev, enum dev_event dev_event)
981 cdev->private->state = DEV_STATE_ONLINE; 972 cdev->private->state = DEV_STATE_ONLINE;
982 if (cdev->handler) 973 if (cdev->handler)
983 cdev->handler(cdev, cdev->private->intparm, 974 cdev->handler(cdev, cdev->private->intparm,
984 ERR_PTR(-ETIMEDOUT)); 975 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} 976}
1020 977
1021static void 978void device_kill_io(struct subchannel *sch)
1022ccw_device_wait4io_timeout(struct ccw_device *cdev, enum dev_event dev_event)
1023{ 979{
1024 int ret; 980 int ret;
1025 struct subchannel *sch; 981 struct ccw_device *cdev;
1026 982
1027 sch = to_subchannel(cdev->dev.parent); 983 cdev = sch->dev.driver_data;
1028 ccw_device_set_timeout(cdev, 0);
1029 ret = ccw_device_cancel_halt_clear(cdev); 984 ret = ccw_device_cancel_halt_clear(cdev);
1030 if (ret == -EBUSY) { 985 if (ret == -EBUSY) {
1031 ccw_device_set_timeout(cdev, 3*HZ); 986 ccw_device_set_timeout(cdev, 3*HZ);
@@ -1035,7 +990,7 @@ ccw_device_wait4io_timeout(struct ccw_device *cdev, enum dev_event dev_event)
1035 if (ret == -ENODEV) { 990 if (ret == -ENODEV) {
1036 if (!sch->lpm) { 991 if (!sch->lpm) {
1037 PREPARE_WORK(&cdev->private->kick_work, 992 PREPARE_WORK(&cdev->private->kick_work,
1038 ccw_device_nopath_notify, (void *)cdev); 993 ccw_device_nopath_notify, cdev);
1039 queue_work(ccw_device_notify_work, 994 queue_work(ccw_device_notify_work,
1040 &cdev->private->kick_work); 995 &cdev->private->kick_work);
1041 } else 996 } else
@@ -1044,12 +999,12 @@ ccw_device_wait4io_timeout(struct ccw_device *cdev, enum dev_event dev_event)
1044 } 999 }
1045 if (cdev->handler) 1000 if (cdev->handler)
1046 cdev->handler(cdev, cdev->private->intparm, 1001 cdev->handler(cdev, cdev->private->intparm,
1047 ERR_PTR(-ETIMEDOUT)); 1002 ERR_PTR(-EIO));
1048 if (!sch->lpm) { 1003 if (!sch->lpm) {
1049 PREPARE_WORK(&cdev->private->kick_work, 1004 PREPARE_WORK(&cdev->private->kick_work,
1050 ccw_device_nopath_notify, (void *)cdev); 1005 ccw_device_nopath_notify, cdev);
1051 queue_work(ccw_device_notify_work, &cdev->private->kick_work); 1006 queue_work(ccw_device_notify_work, &cdev->private->kick_work);
1052 } else if (cdev->private->flags.doverify) 1007 } else
1053 /* Start delayed path verification. */ 1008 /* Start delayed path verification. */
1054 ccw_device_online_verify(cdev, 0); 1009 ccw_device_online_verify(cdev, 0);
1055} 1010}
@@ -1286,12 +1241,6 @@ fsm_func_t *dev_jumptable[NR_DEV_STATES][NR_DEV_EVENTS] = {
1286 [DEV_EVENT_TIMEOUT] = ccw_device_killing_timeout, 1241 [DEV_EVENT_TIMEOUT] = ccw_device_killing_timeout,
1287 [DEV_EVENT_VERIFY] = ccw_device_nop, //FIXME 1242 [DEV_EVENT_VERIFY] = ccw_device_nop, //FIXME
1288 }, 1243 },
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] = { 1244 [DEV_STATE_QUIESCE] = {
1296 [DEV_EVENT_NOTOPER] = ccw_device_quiesce_done, 1245 [DEV_EVENT_NOTOPER] = ccw_device_quiesce_done,
1297 [DEV_EVENT_INTERRUPT] = ccw_device_quiesce_done, 1246 [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..0648ce5bb684 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
diff --git a/include/asm-s390/cio.h b/include/asm-s390/cio.h
index da063cd5f0a0..81287d86329d 100644
--- a/include/asm-s390/cio.h
+++ b/include/asm-s390/cio.h
@@ -275,6 +275,12 @@ struct ccw_dev_id {
275 u16 devno; 275 u16 devno;
276}; 276};
277 277
278static inline int ccw_dev_id_is_equal(struct ccw_dev_id *dev_id1,
279 struct ccw_dev_id *dev_id2)
280{
281 return !memcmp(dev_id1, dev_id2, sizeof(struct ccw_dev_id));
282}
283
278extern int diag210(struct diag210 *addr); 284extern int diag210(struct diag210 *addr);
279 285
280extern void wait_cons_dev(void); 286extern void wait_cons_dev(void);
diff --git a/include/asm-s390/timer.h b/include/asm-s390/timer.h
index fcd6c256a2d1..30e5cbe570f2 100644
--- a/include/asm-s390/timer.h
+++ b/include/asm-s390/timer.h
@@ -26,7 +26,7 @@ struct vtimer_list {
26 spinlock_t lock; 26 spinlock_t lock;
27 unsigned long magic; 27 unsigned long magic;
28 28
29 void (*function)(unsigned long, struct pt_regs*); 29 void (*function)(unsigned long);
30 unsigned long data; 30 unsigned long data;
31}; 31};
32 32