Skip to contentSkip to conversation

2.5.27: s390 fixes.

PATCH In review Martin Schwidefsky 2 participants 7 messages Jul 22, 2002 – Jul 23, 2002

Subsystems (8)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 2.5.27: s390 fixes.

Hi Linus,
s390 fixes for 2.5.27:
* designated initializer rework from Rusty Russell
* add sys_security system call
* smp_num_cpus adaptions
* link order in drivers/s390 to make cio get initialised first
* replace kdev_t in dasd driver structures by bdev pointer
* pass bdev pointer instead of a inode pointer in dasd ioctls
* replace tq_immediate by tasklet in con3215, ctctty and iucv
* add missing include statements
* remove xpram_release
* ## C-preprocessor magic in cio
* define USER_HZ
* add hweight64 in bitops
* fix typo in switch_to

blue skies,
Martin.

arch/s390/kernel/debug.c +4 -4
diff -urN linux-2.5.27/arch/s390/kernel/debug.c linux-2.5.27-s390/arch/s390/kernel/debug.c
@@ -149,10 +149,10 @@
 static int initialized = 0;
 
 static struct file_operations debug_file_ops = {
-	read:    debug_output,
-	write:   debug_input,	
-	open:    debug_open,
-	release: debug_close,
+	.read    = debug_output,
+	.write   = debug_input,	
+	.open    = debug_open,
+	.release = debug_close,
 };
 
 static struct proc_dir_entry *debug_proc_root_entry;
arch/s390/kernel/entry.S +2 -1
diff -urN linux-2.5.27/arch/s390/kernel/entry.S linux-2.5.27-s390/arch/s390/kernel/entry.S
@@ -581,7 +581,8 @@
 	.long  sys_futex
 	.long  sys_sched_setaffinity
 	.long  sys_sched_getaffinity	 /* 240 */
-	.rept  255-240
+	.long  sys_security
+	.rept  255-241
 	.long  sys_ni_syscall
 	.endr
 
arch/s390/kernel/irq.c +3 -2
diff -urN linux-2.5.27/arch/s390/kernel/irq.c linux-2.5.27-s390/arch/s390/kernel/irq.c
@@ -66,8 +66,9 @@
 
 	seq_puts(p, "           ");
 
-	for (j=0; j<smp_num_cpus; j++)
-		seq_printf(p, "CPU%d       ",j);
+	for (j=0; j<NR_CPUS; j++)
+		if (cpu_online(j))
+			seq_printf(p, "CPU%d       ",j);
 
 	seq_putc(p, '\n');
 
arch/s390/kernel/ptrace.c +3 -0
diff -urN linux-2.5.27/arch/s390/kernel/ptrace.c linux-2.5.27-s390/arch/s390/kernel/ptrace.c
@@ -227,6 +227,9 @@
 		/* are we already being traced? */
 		if (current->ptrace & PT_PTRACED)
 			goto out;
+		ret = security_ops->ptrace(current->parent, current);
+		if (ret)
+			goto out;
 		/* set the ptrace bit in the process flags. */
 		current->ptrace |= PT_PTRACED;
 		ret = 0;
arch/s390/kernel/setup.c +5 -5
diff -urN linux-2.5.27/arch/s390/kernel/setup.c linux-2.5.27-s390/arch/s390/kernel/setup.c
@@ -524,7 +524,7 @@
 		seq_printf(m, "vendor_id       : IBM/S390\n"
 			       "# processors    : %i\n"
 			       "bogomips per cpu: %lu.%02lu\n",
-			       smp_num_cpus, loops_per_jiffy/(500000/HZ),
+			       num_online_cpus(), loops_per_jiffy/(500000/HZ),
 			       (loops_per_jiffy/(5000/HZ))%100);
 	}
 	if (cpu_online_map & (1 << n)) {
@@ -553,8 +553,8 @@
 {
 }
 struct seq_operations cpuinfo_op = {
-	start:	c_start,
-	next:	c_next,
-	stop:	c_stop,
-	show:	show_cpuinfo,
+	.start = c_start,
+	.next  = c_next,
+	.stop  = c_stop,
+	.show  = show_cpuinfo,
 };
arch/s390/kernel/smp.c +18 -18
diff -urN linux-2.5.27/arch/s390/kernel/smp.c linux-2.5.27-s390/arch/s390/kernel/smp.c
@@ -48,7 +48,6 @@
  * An array with a pointer the lowcore of every CPU.
  */
 static int       max_cpus = NR_CPUS;	  /* Setup configured maximum number of CPUs to activate	*/
-int              smp_num_cpus;
 struct _lowcore *lowcore_ptr[NR_CPUS];
 cycles_t         cacheflush_time=0;
 int              smp_threads_ready=0;      /* Set when the idlers are all forked. */
@@ -150,7 +149,7 @@
  */
 {
 	struct call_data_struct data;
-	int cpus = smp_num_cpus-1;
+	int cpus = num_online_cpus()-1;
 
 	if (!cpus || !atomic_read(&smp_commenced))
 		return 0;
@@ -185,8 +184,8 @@
         int i, rc;
 
         /* stop all processors */
-        for (i =  0; i < smp_num_cpus; i++) {
-                if (smp_processor_id() == i)
+        for (i =  0; i < NR_CPUS; i++) {
+                if (!cpu_online(i) || smp_processor_id() == i)
 			continue;
 		do {
 			rc = signal_processor_ps(&dummy, 0, i, sigp_stop);
@@ -201,8 +200,8 @@
         int i, rc;
 
         /* store status of all processors in their lowcores (real 0) */
-        for (i =  0; i < smp_num_cpus; i++) {
-                if (smp_processor_id() == i)
+        for (i =  0; i < NR_CPUS; i++) {
+                if (!cpu_online(i) || smp_processor_id() == i)
 			continue;
 		low_core_addr = (unsigned long)get_cpu_lowcore(i);
 		do {
@@ -347,8 +346,8 @@
         struct _lowcore *lowcore;
         int i;
 
-        for (i = 0; i < smp_num_cpus; i++) {
-                if (smp_processor_id() == i)
+        for (i = 0; i < NR_CPUS; i++) {
+                if (!cpu_online(i) || smp_processor_id() == i)
                         continue;
                 lowcore = get_cpu_lowcore(i);
                 /*
@@ -459,24 +458,24 @@
 
 void smp_count_cpus(void)
 {
-        int curr_cpu;
+        int curr_cpu, num_cpus;
 
         current_thread_info()->cpu = 0;
-        smp_num_cpus = 1;
+        num_cpus = 1;
 	phys_cpu_present_map = 1;
 	cpu_online_map = 1;
         for (curr_cpu = 0;
-             curr_cpu <= 65535 && smp_num_cpus < max_cpus; curr_cpu++) {
+             curr_cpu <= 65535 && num_cpus < max_cpus; curr_cpu++) {
                 if ((__u16) curr_cpu == boot_cpu_addr)
                         continue;
-                __cpu_logical_map[smp_num_cpus] = (__u16) curr_cpu;
-                if (signal_processor(smp_num_cpus, sigp_sense) ==
+                __cpu_logical_map[num_cpus] = (__u16) curr_cpu;
+                if (signal_processor(num_cpus, sigp_sense) ==
                     sigp_not_operational)
                         continue;
-		set_bit(smp_num_cpus, &phys_cpu_present_map);
-                smp_num_cpus++;
+		set_bit(num_cpus, &phys_cpu_present_map);
+                num_cpus++;
         }
-        printk("Detected %d CPU's\n",(int) smp_num_cpus);
+        printk("Detected %d CPU's\n",(int) num_cpus);
         printk("Boot cpu address %2X\n", boot_cpu_addr);
 }
 
@@ -591,7 +590,9 @@
          */
         print_cpu_info(&safe_get_cpu_lowcore(0)->cpu_data);
 
-        for(i = 0; i < smp_num_cpus; i++) {
+        for(i = 0; i < NR_CPUS; i++) {
+		if (!test_bit(i, &phys_cpu_present_map))
+			continue;
 		lowcore_ptr[i] = (struct _lowcore *)
 			__get_free_page(GFP_KERNEL|GFP_DMA);
 		async_stack = __get_free_pages(GFP_KERNEL,1);
@@ -637,5 +638,4 @@
 EXPORT_SYMBOL(kernel_flag);
 EXPORT_SYMBOL(smp_ctl_set_bit);
 EXPORT_SYMBOL(smp_ctl_clear_bit);
-EXPORT_SYMBOL(smp_num_cpus);
 EXPORT_SYMBOL(smp_call_function);
arch/s390/mm/fault.c +6 -4
diff -urN linux-2.5.27/arch/s390/mm/fault.c linux-2.5.27-s390/arch/s390/mm/fault.c
@@ -234,16 +234,18 @@
 	 * the fault.
 	 */
 	switch (handle_mm_fault(mm, vma, address, error_code == 4)) {
-	case 1:
+	case VM_FAULT_MINOR:
 		tsk->min_flt++;
 		break;
-	case 2:
+	case VM_FAULT_MAJOR:
 		tsk->maj_flt++;
 		break;
-	case 0:
+	case VM_FAULT_SIGBUS:
 		goto do_sigbus;
-	default:
+	case VM_FAULT_OOM:
 		goto out_of_memory;
+	default:
+		BUG();
 	}
 
         up_read(&mm->mmap_sem);
arch/s390x/kernel/debug.c +4 -4
diff -urN linux-2.5.27/arch/s390x/kernel/debug.c linux-2.5.27-s390/arch/s390x/kernel/debug.c
@@ -149,10 +149,10 @@
 static int initialized = 0;
 
 static struct file_operations debug_file_ops = {
-	read:    debug_output,
-	write:   debug_input,	
-	open:    debug_open,
-	release: debug_close,
+	.read    = debug_output,
+	.write   = debug_input,	
+	.open    = debug_open,
+	.release = debug_close,
 };
 
 static struct proc_dir_entry *debug_proc_root_entry;
arch/s390x/kernel/entry.S +2 -1
diff -urN linux-2.5.27/arch/s390x/kernel/entry.S linux-2.5.27-s390/arch/s390x/kernel/entry.S
@@ -612,7 +612,8 @@
 	.long  SYSCALL(sys_futex,sys32_futex_wrapper)
 	.long  SYSCALL(sys_sched_setaffinity,sys32_sched_setaffinity_wrapper)
 	.long  SYSCALL(sys_sched_getaffinity,sys32_sched_getaffinity_wrapper)
-        .rept  255-240
+	.long  SYSCALL(sys_security, sys_ni_syscall)
+        .rept  255-241
 	.long  SYSCALL(sys_ni_syscall,sys_ni_syscall)
 	.endr
 
arch/s390x/kernel/irq.c +3 -2
diff -urN linux-2.5.27/arch/s390x/kernel/irq.c linux-2.5.27-s390/arch/s390x/kernel/irq.c
@@ -66,8 +66,9 @@
 
 	seq_puts(p, "           ");
 
-	for (j=0; j<smp_num_cpus; j++)
-		seq_printf(p, "CPU%d       ",j);
+	for (j=0; j<NR_CPUS; j++)
+		if (cpu_online(i))
+			seq_printf(p, "CPU%d       ",j);
 
 	seq_putc(p, '\n');
 
arch/s390x/kernel/linux32.c +4 -5
diff -urN linux-2.5.27/arch/s390x/kernel/linux32.c linux-2.5.27-s390/arch/s390x/kernel/linux32.c
@@ -514,16 +514,15 @@
 	if (!p)
 		return -ENOMEM;
 
+	err = -EINVAL;
 	if (second > MSGMAX || first < 0 || second < 0)
-		return -EINVAL;
+		goto out;
 
 	err = -EFAULT;
 	if (!uptr)
 		goto out;
-
-	err = get_user (p->mtype, &up->mtype);
-	err |= __copy_from_user (p->mtext, &up->mtext, second);
-	if (err)
+        if (get_user (p->mtype, &up->mtype) ||
+	    __copy_from_user (p->mtext, &up->mtext, second))
 		goto out;
 	old_fs = get_fs ();
 	set_fs (KERNEL_DS);
arch/s390x/kernel/linux32.h +0 -4
diff -urN linux-2.5.27/arch/s390x/kernel/linux32.h linux-2.5.27-s390/arch/s390x/kernel/linux32.h
@@ -8,8 +8,6 @@
 #include <linux/nfsd/nfsd.h>
 #include <linux/nfsd/export.h>
 
-#ifdef CONFIG_S390_SUPPORT
-
 /* Macro that masks the high order bit of an 32 bit pointer and converts it*/
 /*       to a 64 bit pointer */
 #define A(__x) ((unsigned long)((__x) & 0x7FFFFFFFUL))
@@ -241,6 +239,4 @@
 	sigset_t32		uc_sigmask;	/* mask last for extensibility */
 };
 
-#endif /* !CONFIG_S390_SUPPORT */
- 
 #endif /* _ASM_S390X_S390_H */
arch/s390x/kernel/setup.c +5 -5
diff -urN linux-2.5.27/arch/s390x/kernel/setup.c linux-2.5.27-s390/arch/s390x/kernel/setup.c
@@ -514,7 +514,7 @@
 		seq_printf(m, "vendor_id       : IBM/S390\n"
 				"# processors    : %i\n"
 				"bogomips per cpu: %lu.%02lu\n",
-				smp_num_cpus, loops_per_jiffy/(500000/HZ),
+				num_online_cpus(), loops_per_jiffy/(500000/HZ),
 				(loops_per_jiffy/(5000/HZ))%100);
 	}
 	if (cpu_online_map & (1 << n)) {
@@ -543,8 +543,8 @@
 {
 }
 struct seq_operations cpuinfo_op = {
-	start:	c_start,
-	next:	c_next,
-	stop:	c_stop,
-	show:	show_cpuinfo,
+	.start = c_start,
+	.next  = c_next,
+	.stop  = c_stop,
+	.show  = show_cpuinfo,
 };
arch/s390x/kernel/smp.c +18 -18
diff -urN linux-2.5.27/arch/s390x/kernel/smp.c linux-2.5.27-s390/arch/s390x/kernel/smp.c
@@ -47,7 +47,6 @@
  * An array with a pointer the lowcore of every CPU.
  */
 static int       max_cpus = NR_CPUS;	  /* Setup configured maximum number of CPUs to activate	*/
-int              smp_num_cpus;
 struct _lowcore *lowcore_ptr[NR_CPUS];
 cycles_t         cacheflush_time=0;
 int              smp_threads_ready=0;      /* Set when the idlers are all forked. */
@@ -149,7 +148,7 @@
  */
 {
 	struct call_data_struct data;
-	int cpus = smp_num_cpus-1;
+	int cpus = num_online_cpus()-1;
 
 	if (!cpus || !atomic_read(&smp_commenced))
 		return 0;
@@ -184,8 +183,8 @@
         int i, rc;
 
         /* stop all processors */
-        for (i =  0; i < smp_num_cpus; i++) {
-                if (smp_processor_id() == i)
+        for (i =  0; i < NR_CPUS; i++) {
+                if (!cpu_online(i) || smp_processor_id() == i)
 			continue;
 		do {
 			rc = signal_processor_ps(&dummy, 0, i, sigp_stop);
@@ -200,8 +199,8 @@
         int i, rc;
 
         /* store status of all processors in their lowcores (real 0) */
-        for (i =  0; i < smp_num_cpus; i++) {
-                if (smp_processor_id() == i) 
+        for (i =  0; i < NR_CPUS; i++) {
+                if (!cpu_online(i) || smp_processor_id() == i) 
 			continue;
 		low_core_addr = (unsigned long)get_cpu_lowcore(i);
 		do {
@@ -342,8 +341,8 @@
 {
         int i;
 
-        for (i = 0; i < smp_num_cpus; i++) {
-                if (smp_processor_id() == i)
+        for (i = 0; i < NR_CPUS; i++) {
+                if (!cpu_online(i) || smp_processor_id() == i)
                         continue;
                 /*
                  * Set signaling bit in lowcore of target cpu and kick it
@@ -440,24 +439,24 @@
 
 void smp_count_cpus(void)
 {
-        int curr_cpu;
+        int curr_cpu, num_cpus;
 
         current_thread_info()->cpu = 0;
-        smp_num_cpus = 1;
+        num_cpus = 1;
 	phys_cpu_present_map = 1;
         cpu_online_map = 1;
         for (curr_cpu = 0;
-             curr_cpu <= 65535 && smp_num_cpus < max_cpus; curr_cpu++) {
+             curr_cpu <= 65535 && num_cpus < max_cpus; curr_cpu++) {
                 if ((__u16) curr_cpu == boot_cpu_addr)
                         continue;
-                __cpu_logical_map[smp_num_cpus] = (__u16) curr_cpu;
-                if (signal_processor(smp_num_cpus, sigp_sense) ==
+                __cpu_logical_map[num_cpus] = (__u16) curr_cpu;
+                if (signal_processor(num_cpus, sigp_sense) ==
                     sigp_not_operational)
                         continue;
-		set_bit(smp_num_cpus, &phys_cpu_present_map);
-                smp_num_cpus++;
+		set_bit(num_cpus, &phys_cpu_present_map);
+                num_cpus++;
         }
-        printk("Detected %d CPU's\n",(int) smp_num_cpus);
+        printk("Detected %d CPU's\n",(int) num_cpus);
         printk("Boot cpu address %2X\n", boot_cpu_addr);
 }
 
@@ -571,7 +570,9 @@
          */
         print_cpu_info(&safe_get_cpu_lowcore(0)->cpu_data);
 
-        for(i = 0; i < smp_num_cpus; i++) {
+        for(i = 0; i < NR_CPUS; i++) {
+		if (!test_bit(i, &phys_cpu_present_map))
+			continue;
                 lowcore_ptr[i] = (struct _lowcore *)
                                     __get_free_pages(GFP_KERNEL|GFP_DMA, 1);
 		async_stack = __get_free_pages(GFP_KERNEL,2);
@@ -616,5 +617,4 @@
 EXPORT_SYMBOL(kernel_flag);
 EXPORT_SYMBOL(smp_ctl_set_bit);
 EXPORT_SYMBOL(smp_ctl_clear_bit);
-EXPORT_SYMBOL(smp_num_cpus);
 EXPORT_SYMBOL(smp_call_function);
arch/s390x/mm/fault.c +6 -4
diff -urN linux-2.5.27/arch/s390x/mm/fault.c linux-2.5.27-s390/arch/s390x/mm/fault.c
@@ -234,16 +234,18 @@
 	 * the fault.
 	 */
 	switch (handle_mm_fault(mm, vma, address, error_code == 4)) {
-	case 1:
+	case VM_FAULT_MINOR:
 		tsk->min_flt++;
 		break;
-	case 2:
+	case VM_FAULT_MAJOR:
 		tsk->maj_flt++;
 		break;
-	case 0:
+	case VM_FAULT_SIGBUS:
 		goto do_sigbus;
-	default:
+	case VM_FAULT_OOM:
 		goto out_of_memory;
+	default:
+		BUG();
 	}
 
         up_read(&mm->mmap_sem);
drivers/s390/Makefile +1 -1
diff -urN linux-2.5.27/drivers/s390/Makefile linux-2.5.27-s390/drivers/s390/Makefile
@@ -7,6 +7,6 @@
 obj-$(CONFIG_QDIO) += qdio.o
 
 obj-y += s390mach.o s390dyn.o sysinfo.o
-obj-y += block/ char/ misc/ net/ cio/
+obj-y += cio/ block/ char/ misc/ net/
 
 include $(TOPDIR)/Rules.make
drivers/s390/block/dasd.c +35 -25

144 lines not on this page · raw message

drivers/s390/block/dasd_devmap.c +9 -0
diff -urN linux-2.5.27/drivers/s390/block/dasd_devmap.c linux-2.5.27-s390/drivers/s390/block/dasd_devmap.c
@@ -449,6 +449,15 @@
 }
 
 /*
+ * Find the devmap for a device corresponding to a block_device.
+ */
+dasd_devmap_t *
+dasd_devmap_from_bdev(struct block_device *bdev)
+{
+	return dasd_devmap_from_kdev(to_kdev_t(bdev->bd_dev));
+}
+
+/*
  * Find the device structure for device number devno. If it does not
  * exists yet, allocate it. Increase the reference counter in the device
  * structure and return a pointer to it.
drivers/s390/block/dasd_diag.c +14 -13
diff -urN linux-2.5.27/drivers/s390/block/dasd_diag.c linux-2.5.27-s390/drivers/s390/block/dasd_diag.c
@@ -21,6 +21,7 @@
 #include <linux/kernel.h>
 #include <linux/slab.h>
 #include <linux/hdreg.h>	/* HDIO_GETGEO			    */
+#include <linux/bio.h>
 
 #include <asm/dasd.h>
 #include <asm/debug.h>
@@ -489,19 +490,19 @@
  * for one request. Give a little safety and the result is 240.
  */
 static dasd_discipline_t dasd_diag_discipline = {
-	owner:THIS_MODULE,
-	name:"DIAG",
-	ebcname:"DIAG",
-	max_blocks:240,
-	check_device:dasd_diag_check_device,
-	fill_geometry:dasd_diag_fill_geometry,
-	start_IO:dasd_start_diag,
-	examine_error:dasd_diag_examine_error,
-	erp_action:dasd_diag_erp_action,
-	erp_postaction:dasd_diag_erp_postaction,
-	build_cp:dasd_diag_build_cp,
-	dump_sense:dasd_diag_dump_sense,
-	fill_info:dasd_diag_fill_info,
+	.owner=THIS_MODULE,
+	.name="DIAG",
+	.ebcname="DIAG",
+	.max_blocks=240,
+	.check_device=dasd_diag_check_device,
+	.fill_geometry=dasd_diag_fill_geometry,
+	.start_IO=dasd_start_diag,
+	.examine_error=dasd_diag_examine_error,
+	.erp_action=dasd_diag_erp_action,
+	.erp_postaction=dasd_diag_erp_postaction,
+	.build_cp=dasd_diag_build_cp,
+	.dump_sense=dasd_diag_dump_sense,
+	.fill_info=dasd_diag_fill_info,
 };
 
 int
drivers/s390/block/dasd_eckd.c +46 -40

183 lines not on this page · raw message

drivers/s390/block/dasd_fba.c +22 -21

65 lines not on this page · raw message

drivers/s390/block/dasd_genhd.c +9 -6
diff -urN linux-2.5.27/drivers/s390/block/dasd_genhd.c linux-2.5.27-s390/drivers/s390/block/dasd_genhd.c
@@ -200,13 +200,15 @@
  * Return pointer to gendisk structure by kdev.
  */
 struct gendisk *
-dasd_gendisk_from_major(int major)
+dasd_gendisk_from_bdev(struct block_device *bdev)
 {
 	struct list_head *l;
 	struct major_info *mi;
 	struct gendisk *gdp;
+	int major;
 
 	spin_lock(&dasd_major_lock);
+	major = MAJOR(bdev->bd_dev);
 	gdp = NULL;
 	list_for_each(l, &dasd_major_info) {
 		mi = list_entry(l, struct major_info, list);
@@ -322,7 +324,8 @@
 void
 dasd_setup_partitions(dasd_device_t * device)
 {
-	grok_partitions(device->kdev, device->blocks << device->s2b_shift);
+	grok_partitions(to_kdev_t(device->bdev->bd_dev),
+			device->blocks << device->s2b_shift);
 }
 
 /*
@@ -335,14 +338,14 @@
 	struct gendisk *gdp;
 	int minor, i;
 
-	gdp = dasd_gendisk_from_major(major(device->kdev));
+	gdp = dasd_gendisk_from_bdev(device->bdev);
 	if (gdp == NULL)
 		return;
 
-	wipe_partitions(device->kdev);
+	wipe_partitions(to_kdev_t(device->bdev->bd_dev));
 
 	/* FIXME: do we really need that */
-	minor = minor(device->kdev);
+	minor = MINOR(device->bdev->bd_dev);
 	for (i = 0; i < (1 << DASD_PARTN_BITS); i++)
 		gdp->sizes[minor + i] = 0;
 
@@ -351,7 +354,7 @@
 	 * but the 1 as third parameter makes it do an unregister...
 	 * FIXME: there must be a better way to get rid of the devfs entries
 	 */
-	devfs_register_partitions(gdp, minor(device->kdev), 1);
+	devfs_register_partitions(gdp, minor, 1);
 }
 
 extern int (*genhd_dasd_name)(char *, int, int, struct gendisk *);
drivers/s390/block/dasd_int.h +8 -8
diff -urN linux-2.5.27/drivers/s390/block/dasd_int.h linux-2.5.27-s390/drivers/s390/block/dasd_int.h
@@ -69,7 +69,9 @@
 /*
  * SECTION: Type definitions
  */
-typedef int (*dasd_ioctl_fn_t) (void *inp, int no, long args);
+struct dasd_device_t;
+
+typedef int (*dasd_ioctl_fn_t) (struct block_device *bdev, int no, long args);
 
 typedef struct {
 	struct list_head list;
@@ -139,9 +141,8 @@
 /* messages to be written via klogd and dbf */
 #define DEV_MESSAGE(d_loglevel,d_device,d_string,d_args...)\
 do { \
-	printk(d_loglevel PRINTK_HEADER " /dev/%-7s(%3d:%3d),%04x@%02x: " \
-	       d_string "\n", d_device->name, \
-	       major(d_device->kdev), minor(d_device->kdev), \
+	printk(d_loglevel PRINTK_HEADER " %s,%04x@%02x: " \
+	       d_string "\n", bdevname(d_device->bdev), \
 	       d_device->devinfo.devno, d_device->devinfo.irq, \
 	       d_args); \
 	DBF_DEV_EVENT(DBF_ALERT, d_device, d_string, d_args); \
@@ -153,8 +154,6 @@
 	DBF_EVENT(DBF_ALERT, d_string, d_args); \
 } while(0)
 
-struct dasd_device_t;
-
 typedef struct dasd_ccw_req_t {
 	unsigned int magic;		/* Eye catcher */
         struct list_head list;		/* list_head for request queueing. */
@@ -262,7 +261,7 @@
 typedef struct dasd_device_t {
 	/* Block device stuff. */
 	char name[16];			/* The device name in /dev. */
-	kdev_t kdev;
+	struct block_device *bdev;
 	devfs_handle_t devfs_entry;
 	request_queue_t *request_queue;
 	spinlock_t request_queue_lock;
@@ -467,6 +466,7 @@
 dasd_devmap_t *dasd_devmap_from_devindex(int);
 dasd_devmap_t *dasd_devmap_from_irq(int);
 dasd_devmap_t *dasd_devmap_from_kdev(kdev_t);
+dasd_devmap_t *dasd_devmap_from_bdev(struct block_device *bdev);
 dasd_device_t *dasd_get_device(dasd_devmap_t *);
 void dasd_put_device(dasd_devmap_t *);
 
@@ -480,7 +480,7 @@
 void dasd_gendisk_exit(void);
 int  dasd_gendisk_new_major(void);
 int  dasd_gendisk_major_index(int);
-struct gendisk *dasd_gendisk_from_major(int);
+struct gendisk *dasd_gendisk_from_bdev(struct block_device *bdev);
 struct gendisk *dasd_gendisk_from_devindex(int);
 int  dasd_device_name(char *, int, int, struct gendisk *);
 void dasd_setup_partitions(dasd_device_t *);
drivers/s390/block/dasd_ioctl.c +86 -66

391 lines not on this page · raw message

drivers/s390/block/dasd_proc.c +9 -8
diff -urN linux-2.5.27/drivers/s390/block/dasd_proc.c linux-2.5.27-s390/drivers/s390/block/dasd_proc.c
@@ -15,6 +15,7 @@
 #include <linux/config.h>
 #include <linux/version.h>
 #include <linux/ctype.h>
+#include <linux/vmalloc.h>
 
 #include <asm/debug.h>
 #include <asm/irq.h>
@@ -274,10 +275,10 @@
 }
 
 static struct file_operations dasd_devices_file_ops = {
-	read:dasd_generic_read,		/* read */
-	write:dasd_devices_write,	/* write */
-	open:dasd_devices_open,		/* open */
-	release:dasd_generic_close,	/* close */
+	.read=dasd_generic_read,		/* read */
+	.write=dasd_devices_write,	/* write */
+	.open=dasd_devices_open,		/* open */
+	.release=dasd_generic_close,	/* close */
 };
 
 static struct inode_operations dasd_devices_inode_ops = {
@@ -430,10 +431,10 @@
 }
 
 static struct file_operations dasd_statistics_file_ops = {
-	read:	dasd_generic_read,	/* read */
-	write:	dasd_statistics_write,	/* write */
-	open:	dasd_statistics_open,	/* open */
-	release:dasd_generic_close,	/* close */
+	.read=dasd_generic_read,	/* read */
+	.write=dasd_statistics_write,	/* write */
+	.open=dasd_statistics_open,	/* open */
+	.release=dasd_generic_close,	/* close */
 };
 
 static struct inode_operations dasd_statistics_inode_ops = {
drivers/s390/block/xpram.c +6 -10
diff -urN linux-2.5.27/drivers/s390/block/xpram.c linux-2.5.27-s390/drivers/s390/block/xpram.c
@@ -15,7 +15,6 @@
  *   Device specific file operations
  *        xpram_iotcl
  *        xpram_open
- *        xpram_release
  *
  * "ad-hoc" partitioning:
  *    the expanded memory can be partitioned among several devices 
@@ -36,6 +35,7 @@
 #include <linux/blkpg.h>
 #include <linux/hdreg.h>  /* HDIO_GETGEO */
 #include <linux/device.h>
+#include <linux/bio.h>
 #include <asm/uaccess.h>
 
 #define XPRAM_NAME	"xpram"
@@ -48,8 +48,8 @@
 #define PRINT_ERR(x...)		printk(KERN_ERR XPRAM_NAME " error:" x)
 
 static struct device xpram_sys_device = {
-	name: "S/390 expanded memory RAM disk",
-	bus_id: "xpram",
+	.name = "S/390 expanded memory RAM disk",
+	.bus_id = "xpram",
 };
 
 typedef struct {
@@ -328,7 +328,6 @@
 	return 0;
 }
 
-
 static int xpram_ioctl (struct inode *inode, struct file *filp,
 		 unsigned int cmd, unsigned long arg)
 {
@@ -336,8 +335,6 @@
 	unsigned long size;
 	int idx;
 
-	if ((!inode) || kdev_none(inode->i_rdev))
-		return -EINVAL;
 	idx = minor(inode->i_rdev);
 	if (idx >= xpram_devs)
 		return -ENODEV;
@@ -375,10 +372,9 @@
 
 static struct block_device_operations xpram_devops =
 {
-	owner:   THIS_MODULE,
-	ioctl:   xpram_ioctl,
-	open:    xpram_open,
-	release: xpram_release,
+	.owner = THIS_MODULE,
+	.ioctl = xpram_ioctl,
+	.open = xpram_open,
 };
 
 /*
drivers/s390/char/con3215.c +15 -18
diff -urN linux-2.5.27/drivers/s390/char/con3215.c linux-2.5.27-s390/drivers/s390/char/con3215.c
@@ -89,7 +89,7 @@
         int written;                  /* number of bytes in write requests */
 	devstat_t devstat;	      /* device status structure for do_IO */
 	struct tty_struct *tty;	      /* pointer to tty structure if present */
-	struct tq_struct tqueue;      /* task queue to bottom half */
+	struct tasklet_struct tasklet;
 	raw3215_req *queued_read;     /* pointer to queued read requests */
 	raw3215_req *queued_write;    /* pointer to queued write requests */
 	wait_queue_head_t empty_wait; /* wait queue for flushing */
@@ -341,7 +341,7 @@
  * The bottom half handler routine for 3215 devices. It tries to start
  * the next IO and wakes up processes waiting on the tty.
  */
-static void raw3215_softint(void *data)
+static void raw3215_tasklet(void *data)
 {
 	raw3215_info *raw;
 	struct tty_struct *tty;
@@ -377,12 +377,7 @@
         if (raw->flags & RAW3215_BH_PENDING)
                 return;       /* already pending */
         raw->flags |= RAW3215_BH_PENDING;
-	INIT_LIST_HEAD(&raw->tqueue.list);
-	raw->tqueue.sync = 0;
-        raw->tqueue.routine = raw3215_softint;
-        raw->tqueue.data = raw;
-        queue_task(&raw->tqueue, &tq_immediate);
-        mark_bh(IMMEDIATE_BH);
+	tasklet_hi_schedule(&raw->tasklet);
 }
 
 /*
@@ -824,12 +819,12 @@
  *  The console structure for the 3215 console
  */
 static struct console con3215 = {
-	name:		"tty3215",
-	write:		con3215_write,
-	device:		con3215_device,
-	unblank:	con3215_unblank,
-	setup:		con3215_consetup,
-	flags:		CON_PRINTBUFFER,
+	.name =		"tty3215",
+	.write =	con3215_write,
+	.device =	con3215_device,
+	.unblank =	con3215_unblank,
+	.setup =	con3215_consetup,
+	.flags =	CON_PRINTBUFFER,
 };
 
 #endif
@@ -867,8 +862,9 @@
 			kfree(raw);
 			return -ENOMEM;
 		}
-		raw->tqueue.routine = raw3215_softint;
-		raw->tqueue.data = raw;
+		tasklet_init(&raw->tasklet, 
+			     (void (*)(unsigned long)) raw3215_tasklet,
+			     (unsigned long) raw);
                 init_waitqueue_head(&raw->empty_wait);
 		raw3215[line] = raw;
 	}
@@ -1097,8 +1093,9 @@
 	/* Find the first console */
 	raw->irq = raw3215_find_dev(0);
 	raw->flags |= RAW3215_FIXED;
-	raw->tqueue.routine = raw3215_softint;
-	raw->tqueue.data = raw;
+	tasklet_init(&raw->tasklet, 
+		     (void (*)(unsigned long)) raw3215_tasklet,
+		     (unsigned long) raw);
         init_waitqueue_head(&raw->empty_wait);
 
 	/* Request the console irq */
drivers/s390/char/ctrlchar.c +1 -1
diff -urN linux-2.5.27/drivers/s390/char/ctrlchar.c linux-2.5.27-s390/drivers/s390/char/ctrlchar.c
@@ -26,7 +26,7 @@
 
 static void
 ctrlchar_handle_sysrq(struct tty_struct *tty) {
-	handle_sysrq(ctrlchar_sysrq_key, NULL, NULL, tty);
+	handle_sysrq(ctrlchar_sysrq_key, NULL, tty);
 }
 #endif
 
drivers/s390/char/hwc_con.c +5 -5
diff -urN linux-2.5.27/drivers/s390/char/hwc_con.c linux-2.5.27-s390/drivers/s390/char/hwc_con.c
@@ -34,11 +34,11 @@
 struct console hwc_console =
 {
 
-	name:hwc_console_name,
-	write:hwc_console_write,
-	device:hwc_console_device,
-	unblank:hwc_console_unblank,
-	flags:CON_PRINTBUFFER,
+	.name=hwc_console_name,
+	.write=hwc_console_write,
+	.device=hwc_console_device,
+	.unblank=hwc_console_unblank,
+	.flags=CON_PRINTBUFFER,
 };
 
 void 
drivers/s390/char/tape.c +3 -3
diff -urN linux-2.5.27/drivers/s390/char/tape.c linux-2.5.27-s390/drivers/s390/char/tape.c
@@ -199,9 +199,9 @@
 
 static struct file_operations tape_proc_devices_file_ops =
 {
-	read:tape_proc_devices_read,	/* read */
-	open:tape_proc_devices_open,	/* open */
-	release:tape_proc_devices_release,	/* close */
+	.read=tape_proc_devices_read,		/* read */
+	.open=tape_proc_devices_open,		/* open */
+	.release=tape_proc_devices_release,	/* close */
 };
 
 /* 
drivers/s390/char/tapechar.c +5 -5
diff -urN linux-2.5.27/drivers/s390/char/tapechar.c linux-2.5.27-s390/drivers/s390/char/tapechar.c
@@ -40,11 +40,11 @@
  */
 static struct file_operations tape_fops =
 {
-	read:tapechar_read,
-	write:tapechar_write,
-	ioctl:tapechar_ioctl,
-	open:tapechar_open,
-	release:tapechar_release,
+	.read=tapechar_read,
+	.write=tapechar_write,
+	.ioctl=tapechar_ioctl,
+	.open=tapechar_open,
+	.release=tapechar_release,
 };
 
 int tapechar_major = TAPECHAR_MAJOR;
drivers/s390/char/tubfs.c +6 -6
diff -urN linux-2.5.27/drivers/s390/char/tubfs.c linux-2.5.27-s390/drivers/s390/char/tubfs.c
@@ -24,13 +24,13 @@
 
 static struct file_operations fs3270_fops = {
 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,3,0))
-	owner: THIS_MODULE,		/* owner */
+	.owner: THIS_MODULE,		/* owner */
 #endif
-	read: 	fs3270_read,	/* read */
-	write:	fs3270_write,	/* write */
-	ioctl:	fs3270_ioctl,	/* ioctl */
-	open: 	fs3270_open,	/* open */
-	release:fs3270_close,	/* release */
+	.read=fs3270_read,	/* read */
+	.write=fs3270_write,	/* write */
+	.ioctl=fs3270_ioctl,	/* ioctl */
+	.open=fs3270_open,	/* open */
+	.release=fs3270_close,	/* release */
 };
 
 #ifdef CONFIG_DEVFS_FS
drivers/s390/cio/blacklist.c +3 -3
diff -urN linux-2.5.27/drivers/s390/cio/blacklist.c linux-2.5.27-s390/drivers/s390/cio/blacklist.c
@@ -1,7 +1,7 @@
 /*
  *  drivers/s390/cio/blacklist.c
  *   S/390 common I/O routines -- blacklisting of specific devices
- *   $Revision: 1.5 $
+ *   $Revision: 1.6 $
  *
  *    Copyright (C) 1999-2002 IBM Deutschland Entwicklung GmbH,
  *                            IBM Corporation
@@ -243,10 +243,10 @@
 		return -EFAULT;
 	}
 	buf[user_len] = '\0';
-
+#if 0
 	CIO_DEBUG(KERN_DEBUG, 2, 
 		  "/proc/cio_ignore: '%s'\n", buf);
-
+#endif
 	blacklist_parse_proc_parameters (buf);
 
 	vfree (buf);
drivers/s390/cio/chsc.c +10 -10
diff -urN linux-2.5.27/drivers/s390/cio/chsc.c linux-2.5.27-s390/drivers/s390/cio/chsc.c
@@ -70,13 +70,13 @@
 		*ssd_res = &chsc_area_ssd.response_block.response_block_data.ssd_res;
 
 	chsc_area_ssd = (chsc_area_t) {
-		request_block: {
-			command_code1: 0x0010,
-			command_code2: 0x0004,
-			request_block_data: {
-				ssd_req: {
-					f_sch: irq,
-					l_sch: irq,
+		.request_block = {
+			.command_code1 = 0x0010,
+			.command_code2 = 0x0004,
+			.request_block_data = {
+				.ssd_req = {
+					.f_sch = irq,
+					.l_sch = irq,
 				}
 			}
 		}
@@ -554,9 +554,9 @@
 	 * allocation or prove that this function does not have to be
 	 * reentrant! */
 	static chsc_area_t chsc_area_sei __attribute__ ((aligned(PAGE_SIZE))) = {
-		request_block: {
-			command_code1: 0x0010,
-			command_code2: 0x000e
+		.request_block = {
+			.command_code1 = 0x0010,
+			.command_code2 = 0x000e
 		}
 	};
 
drivers/s390/cio/cio.c +3 -3
diff -urN linux-2.5.27/drivers/s390/cio/cio.c linux-2.5.27-s390/drivers/s390/cio/cio.c
@@ -1,7 +1,7 @@
 /*
  *  drivers/s390/cio/cio.c
  *   S/390 common I/O routines -- low level i/o calls
- *   $Revision: 1.15 $
+ *   $Revision: 1.17 $
  *
  *    Copyright (C) 1999-2002 IBM Deutschland Entwicklung GmbH,
  *                            IBM Corporation
@@ -52,7 +52,7 @@
 	}
 	DBG ("%s\n", buffer);
 	if (cio_debug_initialized) 
-		debug_text_event (cio_debug_trace_id, level, buffer);
+		debug_text_event (cio_debug_msg_id, level, buffer);
 }
 
 
@@ -1448,7 +1448,7 @@
 	
 	ioinfo[irq]->devstat.intparm = 0;
 	
-	if (!ioinfo[irq]->ui.flags.s_pend) 
+	if (!(ioinfo[irq]->ui.flags.s_pend || ioinfo[irq]->ui.flags.repnone))
 		ioinfo[irq]->irq_desc.handler (irq, udp, NULL);
 	
 	return 1;
drivers/s390/cio/cio_debug.h +2 -2
diff -urN linux-2.5.27/drivers/s390/cio/cio_debug.h linux-2.5.27-s390/drivers/s390/cio/cio_debug.h
@@ -20,14 +20,14 @@
 #define CIO_MSG_EVENT(imp, args...) do { \
         if (cio_debug_initialized) \
                 debug_sprintf_event(cio_debug_msg_id, \
-                                    imp, \
+                                    imp , \
                                     ##args); \
         } while (0)
 
 #define CIO_CRW_EVENT(imp, args...) do { \
         if (cio_debug_initialized) \
                 debug_sprintf_event(cio_debug_crw_id, \
-                                    imp, \
+                                    imp , \
                                     ##args); \
         } while (0)
 
drivers/s390/cio/proc.c +3 -3
diff -urN linux-2.5.27/drivers/s390/cio/proc.c linux-2.5.27-s390/drivers/s390/cio/proc.c
@@ -154,7 +154,7 @@
 }
 
 static struct file_operations chan_subch_file_ops = {
-	read:chan_subch_read, open:chan_subch_open, release:chan_subch_close,
+	.read=chan_subch_read, .open=chan_subch_open, .release=chan_subch_close,
 };
 
 static int
@@ -245,8 +245,8 @@
 }
 
 static struct file_operations cio_irq_proc_file_ops = {
-	read:cio_irq_proc_read, open:cio_irq_proc_open,
-	release:cio_irq_proc_close,
+	.read=cio_irq_proc_read, .open=cio_irq_proc_open,
+	.release=cio_irq_proc_close,
 };
 
 static int
drivers/s390/cio/requestirq.c +2 -2
diff -urN linux-2.5.27/drivers/s390/cio/requestirq.c linux-2.5.27-s390/drivers/s390/cio/requestirq.c
@@ -1,7 +1,7 @@
 /*
  *  drivers/s390/cio/requestirq.c
  *   S/390 common I/O routines -- 
- *   $Revision: 1.7 $
+ *   $Revision: 1.8 $
  *
  *    Copyright (C) 1999-2002 IBM Deutschland Entwicklung GmbH,
  *                            IBM Corporation
@@ -141,7 +141,7 @@
 
 	s390irq_spin_lock_irqsave (irq, flags);
 
-	CIO_DEBUG_NOCONS(irq,KERN_DEBUG, printk, 2, 
+	CIO_DEBUG_NOCONS(irq,KERN_DEBUG, DBG, 2, 
 			 "Trying to free IRQ %d\n", 
 			 irq);
 
drivers/s390/cio/s390io.c +11 -4
diff -urN linux-2.5.27/drivers/s390/cio/s390io.c linux-2.5.27-s390/drivers/s390/cio/s390io.c
@@ -1,7 +1,7 @@
 /*
  *  drivers/s390/cio/s390io.c
  *   S/390 common I/O routines
- *   $Revision: 1.11 $
+ *   $Revision: 1.12 $
  *
  *  S390 version
  *    Copyright (C) 1999, 2000 IBM Deutschland Entwicklung GmbH,
@@ -1910,12 +1910,19 @@
 
 				ret = 0;
 
-			} else {
+			} else if (ret == -ENODEV) {
 
 				CIO_DEBUG(KERN_ERR, 2,
-					  "PathVerification(%04X) - "
-					  "Unexpected error on device %04X\n",
+					  "PathVerification(%04X) "
+					  "- Device %04X is no longer there?!?\n",
 					  irq, ioinfo[irq]->schib.pmcw.dev);
+
+			} else if (ret) {
+
+				CIO_DEBUG(KERN_ERR, 2,
+					  "PathVerification(%04X) - "
+					  "Unexpected error %d on device %04X\n",
+					  irq, ret, ioinfo[irq]->schib.pmcw.dev);
 				
 				ioinfo[irq]->ui.flags.pgid_supp = 0;
 			}
drivers/s390/misc/chandev.c +1 -0
diff -urN linux-2.5.27/drivers/s390/misc/chandev.c linux-2.5.27-s390/drivers/s390/misc/chandev.c
@@ -24,6 +24,7 @@
 #include <asm/s390dyn.h>
 #include <asm/queue.h>
 #include <linux/kmod.h>
+#include <linux/tqueue.h>
 #ifndef MIN
 #define MIN(a,b) ((a<b)?a:b)
 #endif
drivers/s390/net/ctcmain.c +9 -8
diff -urN linux-2.5.27/drivers/s390/net/ctcmain.c linux-2.5.27-s390/drivers/s390/net/ctcmain.c
@@ -49,6 +49,7 @@
 #include <linux/interrupt.h>
 #include <linux/timer.h>
 #include <linux/sched.h>
+#include <linux/tqueue.h>
 
 #include <linux/signal.h>
 #include <linux/string.h>
@@ -2888,17 +2889,17 @@
 }
 
 static struct file_operations ctc_stat_fops = {
-	read:    ctc_stat_read,
-	write:   ctc_stat_write,
-	open:    ctc_stat_open,
-	release: ctc_stat_close,
+	.read    = ctc_stat_read,
+	.write   = ctc_stat_write,
+	.open    = ctc_stat_open,
+	.release = ctc_stat_close,
 };
 
 static struct file_operations ctc_ctrl_fops = {
-	read:    ctc_ctrl_read,
-	write:   ctc_ctrl_write,
-	open:    ctc_ctrl_open,
-	release: ctc_ctrl_close,
+	.read    = ctc_ctrl_read,
+	.write   = ctc_ctrl_write,
+	.open    = ctc_ctrl_open,
+	.release = ctc_ctrl_close,
 };
 
 static struct proc_dir_entry *ctc_dir = NULL;
drivers/s390/net/ctctty.c +11 -26
diff -urN linux-2.5.27/drivers/s390/net/ctctty.c linux-2.5.27-s390/drivers/s390/net/ctctty.c
@@ -86,7 +86,7 @@
   wait_queue_head_t	open_wait;
   wait_queue_head_t	close_wait;
   struct semaphore      write_sem;
-  struct tq_struct      tq;
+  struct tasklet_struct tasklet;
   struct timer_list     stoptimer;
 } ctc_tty_info;
 
@@ -272,8 +272,7 @@
 	 */
 	skb_queue_tail(&info->rx_queue, skb);
 	/* Schedule dequeuing */
-	queue_task(&info->tq, &tq_immediate);
-	mark_bh(IMMEDIATE_BH);
+	tasklet_schedule(&info->tasklet);
 }
 
 static int
@@ -390,8 +389,7 @@
 	skb_reserve(skb, skb_res);
 	*(skb_put(skb, 1)) = c;
 	skb_queue_head(&info->tx_queue, skb);
-	queue_task(&info->tq, &tq_immediate);
-	mark_bh(IMMEDIATE_BH);
+	tasklet_schedule(&info->tasklet);
 }
 
 static void
@@ -400,8 +398,7 @@
 	if (ctc_tty_shuttingdown)
 		return;
 	info->flags |= CTC_ASYNC_TX_LINESTAT;
-	queue_task(&info->tq, &tq_immediate);
-	mark_bh(IMMEDIATE_BH);
+	tasklet_schedule(&info->tasklet);
 }
 
 static void
@@ -562,8 +559,7 @@
 	}
 	if (skb_queue_len(&info->tx_queue)) {
 		info->lsr &= ~UART_LSR_TEMT;
-		queue_task(&info->tq, &tq_immediate);
-		mark_bh(IMMEDIATE_BH);
+		tasklet_schedule(&info->tasklet);
 	}
 	if (from_user)
 		up(&info->write_sem);
@@ -628,8 +624,7 @@
 		return;
 	if (tty->stopped || tty->hw_stopped || (!skb_queue_len(&info->tx_queue)))
 		return;
-	queue_task(&info->tq, &tq_immediate);
-	mark_bh(IMMEDIATE_BH);
+	tasklet_schedule(&info->tasklet);
 }
 
 /*
@@ -1170,8 +1165,9 @@
  * the lower levels.
  */
 static void
-ctc_tty_task(ctc_tty_info *info)
+ctc_tty_task(unsigned long arg)
 {
+	ctc_tty_info *info = (void *)arg;
 	unsigned long saveflags;
 	int again;
 
@@ -1182,8 +1178,7 @@
 			info->lsr |= UART_LSR_TEMT;
 		again |= ctc_tty_readmodem(info);
 		if (again) {
-			queue_task(&info->tq, &tq_immediate);
-			mark_bh(IMMEDIATE_BH);
+			tasklet_schedule(&info->tasklet);
 		}
 	}
 	spin_unlock_irqrestore(&ctc_tty_lock, saveflags);
@@ -1243,14 +1238,8 @@
 	for (i = 0; i < CTC_TTY_MAX_DEVICES; i++) {
 		info = &driver->info[i];
 		init_MUTEX(&info->write_sem);
-#if LINUX_VERSION_CODE >= 0x020400
-		INIT_LIST_HEAD(&info->tq.list);
-#else
-		info->tq.next    = NULL;
-#endif
-		info->tq.sync    = 0;
-		info->tq.routine = (void *)(void *)ctc_tty_task;
-		info->tq.data    = info;
+		tasklet_init(&info->tasklet, ctc_tty_task,
+				(unsigned long) info);
 		info->magic = CTC_ASYNC_MAGIC;
 		info->line = i;
 		info->tty = 0;
@@ -1331,10 +1320,6 @@
 		kfree(driver);
 		driver = NULL;
 	} else {
-		int i;
-
-		for (i = 0; i < CTC_TTY_MAX_DEVICES; i++)
-			driver->info[i].tq.routine = NULL;
 		tty_unregister_driver(&driver->ctc_tty_device);
 	}
 	spin_unlock_irqrestore(&ctc_tty_lock, saveflags);
drivers/s390/net/iucv.c +11 -23
diff -urN linux-2.5.27/drivers/s390/net/iucv.c linux-2.5.27-s390/drivers/s390/net/iucv.c
@@ -41,9 +41,9 @@
 #include <linux/kernel.h>
 #include <linux/slab.h>
 #include <linux/init.h>
-#include <linux/tqueue.h>
 #include <linux/interrupt.h>
 #include <linux/list.h>
+#include <linux/errno.h>
 #include <asm/atomic.h>
 #include "iucv.h"
 #include <asm/io.h>
@@ -99,16 +99,14 @@
 static struct list_head  iucv_irq_queue;
 static spinlock_t iucv_irq_queue_lock = SPIN_LOCK_UNLOCKED;
 
-static struct tq_struct  iucv_tq;
-
-static atomic_t   iucv_bh_scheduled = ATOMIC_INIT (0);
-
 /*
  *Internal function prototypes
  */
-static void iucv_bh_handler(void);
+static void iucv_tasklet_handler(unsigned long);
 static void iucv_irq_handler(struct pt_regs *, __u16);
 
+static DECLARE_TASKLET(iucv_tasklet,iucv_tasklet_handler,0);
+
 /************ FUNCTION ID'S ****************************/
 
 #define ACCEPT          10
@@ -302,7 +300,7 @@
 	if (debuglevel < 3)
 		return;
 
-	printk(KERN_DEBUG __FUNCTION__ ": %s\n", title);
+	printk(KERN_DEBUG "%s\n", title);
 	printk("  ");
 	for (i = 0; i < len; i++) {
 		if (!(i % 16) && i != 0)
@@ -318,7 +316,7 @@
 #define iucv_debug(lvl, fmt, args...) \
 do { \
 	if (debuglevel >= lvl) \
-		printk(KERN_DEBUG __FUNCTION__ ": " fmt "\n" , ## args); \
+		printk(KERN_DEBUG "%s: " fmt "\n", __FUNCTION__ , ## args); \
 } while (0)
 
 #else
@@ -385,11 +383,6 @@
 	}
 	memset(iucv_param_pool, 0, sizeof(iucv_param) * PARAM_POOL_SIZE);
 
-	/* Initialize task queue */
-	INIT_LIST_HEAD(&iucv_tq.list);
-	iucv_tq.sync = 0;
-	iucv_tq.routine = (void *)iucv_bh_handler;
-
 	/* Initialize irq queue */
 	INIT_LIST_HEAD(&iucv_irq_queue);
 
@@ -2177,7 +2170,7 @@
  * @code: irq code
  *
  * Handles external interrupts coming in from CP.
- * Places the interrupt buffer on a queue and schedules iucv_bh_handler().
+ * Places the interrupt buffer on a queue and schedules iucv_tasklet_handler().
  */
 static void
 iucv_irq_handler(struct pt_regs *regs, __u16 code)
@@ -2201,10 +2194,7 @@
 	list_add_tail(&irqdata->queue, &iucv_irq_queue);
 	spin_unlock(&iucv_irq_queue_lock);
 
-	if (atomic_compare_and_swap (0, 1, &iucv_bh_scheduled) == 0) {
-		queue_task (&iucv_tq, &tq_immediate);
-		mark_bh(IMMEDIATE_BH);
-	}
+	tasklet_schedule(&iucv_tasklet);
 
 	irq_exit(cpu, 0x4000);
 	return;
@@ -2215,7 +2205,7 @@
  * @int_buf: Pointer to copy of external interrupt buffer
  *
  * The workhorse for handling interrupts queued by iucv_irq_handler().
- * This function is called from the bottom half iucv_bh_handler().
+ * This function is called from the bottom half iucv_tasklet_handler().
  */
 static void
 iucv_do_int(iucv_GeneralInterrupt * int_buf)
@@ -2385,19 +2375,17 @@
 }
 
 /**
- * iucv_bh_handler:
+ * iucv_tasklet_handler:
  *
  * This function loops over the queue of irq buffers and runs iucv_do_int()
  * on every queue element.
  */
 static void
-iucv_bh_handler(void)
+iucv_tasklet_handler(unsigned long ignored)
 {
 	struct list_head head;
 	struct list_head *next;
 	ulong  flags;
-
-	atomic_set(&iucv_bh_scheduled, 0);
 
 	spin_lock_irqsave(&iucv_irq_queue_lock, flags);
 	list_add(&head, &iucv_irq_queue);
drivers/s390/net/lcs.c +1 -0
diff -urN linux-2.5.27/drivers/s390/net/lcs.c linux-2.5.27-s390/drivers/s390/net/lcs.c
@@ -124,6 +124,7 @@
 #include <linux/types.h>
 #include <linux/kernel.h>
 #include <linux/sched.h>
+#include <linux/tqueue.h>
 #include <linux/errno.h>
 #include <linux/init.h>
 #include <asm/system.h>
drivers/s390/net/netiucv.c +19 -19
diff -urN linux-2.5.27/drivers/s390/net/netiucv.c linux-2.5.27-s390/drivers/s390/net/netiucv.c
@@ -465,13 +465,13 @@
 }
 
 static iucv_interrupt_ops_t netiucv_ops = {
-	ConnectionPending:  netiucv_callback_connreq,
-	ConnectionComplete: netiucv_callback_connack,
-	ConnectionSevered:  netiucv_callback_connrej,
-	ConnectionQuiesced: netiucv_callback_connsusp,
-	ConnectionResumed:  netiucv_callback_connres,
-	MessagePending:     netiucv_callback_rx,
-	MessageComplete:    netiucv_callback_txdone
+	.ConnectionPending  = netiucv_callback_connreq,
+	.ConnectionComplete = netiucv_callback_connack,
+	.ConnectionSevered  = netiucv_callback_connrej,
+	.ConnectionQuiesced = netiucv_callback_connsusp,
+	.ConnectionResumed  = netiucv_callback_connres,
+	.MessagePending     = netiucv_callback_rx,
+	.MessageComplete    = netiucv_callback_txdone
 };
 
 /**
@@ -1566,24 +1566,24 @@
 }
 
 static struct file_operations netiucv_stat_fops = {
-	read:    netiucv_stat_read,
-	write:   netiucv_stat_write,
-	open:    netiucv_stat_open,
-	release: netiucv_stat_close,
+	.read    = netiucv_stat_read,
+	.write   = netiucv_stat_write,
+	.open    = netiucv_stat_open,
+	.release = netiucv_stat_close,
 };
 
 static struct file_operations netiucv_buffer_fops = {
-	read:    netiucv_buffer_read,
-	write:   netiucv_buffer_write,
-	open:    netiucv_buffer_open,
-	release: netiucv_buffer_close,
+	.read    = netiucv_buffer_read,
+	.write   = netiucv_buffer_write,
+	.open    = netiucv_buffer_open,
+	.release = netiucv_buffer_close,
 };
 
 static struct file_operations netiucv_user_fops = {
-	read:    netiucv_user_read,
-	write:   netiucv_user_write,
-	open:    netiucv_user_open,
-	release: netiucv_user_close,
+	.read    = netiucv_user_read,
+	.write   = netiucv_user_write,
+	.open    = netiucv_user_open,
+	.release = netiucv_user_close,
 };
 
 static struct proc_dir_entry *netiucv_dir = NULL;
include/asm-s390/debug.h +4 -2
diff -urN linux-2.5.27/include/asm-s390/debug.h linux-2.5.27-s390/include/asm-s390/debug.h
@@ -160,7 +160,8 @@
 }
 
 extern debug_entry_t *
-debug_sprintf_event(debug_info_t* id,int level,char *string,...);
+debug_sprintf_event(debug_info_t* id,int level,char *string,...)
+	__attribute__ ((format(printf, 3, 4)));
 
 
 extern inline debug_entry_t* 
@@ -195,7 +196,8 @@
 
 
 extern debug_entry_t *
-debug_sprintf_exception(debug_info_t* id,int level,char *string,...);
+debug_sprintf_exception(debug_info_t* id,int level,char *string,...)
+	__attribute__ ((format(printf, 3, 4)));
 
 int debug_register_view(debug_info_t* id, struct debug_view* view);
 int debug_unregister_view(debug_info_t* id, struct debug_view* view);
include/asm-s390/param.h +6 -4
diff -urN linux-2.5.27/include/asm-s390/param.h linux-2.5.27-s390/include/asm-s390/param.h
@@ -9,6 +9,12 @@
 #ifndef _ASMS390_PARAM_H
 #define _ASMS390_PARAM_H
 
+#ifdef __KERNEL__
+# define HZ		100		/* Internal kernel timer frequency */
+# define USER_HZ	100		/* .. some user interfaces are in "ticks" */
+# define CLOCKS_PER_SEC	(USER_HZ)	/* like times() */
+#endif
+
 #ifndef HZ
 #define HZ 100
 #endif
@@ -24,9 +30,5 @@
 #endif
 
 #define MAXHOSTNAMELEN	64	/* max length of hostname */
-
-#ifdef __KERNEL__
-# define CLOCKS_PER_SEC		HZ	/* frequency at which times() counts */
-#endif
 
 #endif
include/asm-s390/pgalloc.h +2 -0
diff -urN linux-2.5.27/include/asm-s390/pgalloc.h linux-2.5.27-s390/include/asm-s390/pgalloc.h
@@ -16,6 +16,8 @@
 #include <linux/config.h>
 #include <asm/processor.h>
 #include <linux/threads.h>
+#include <linux/gfp.h>
+#include <linux/mm.h>
 
 #define check_pgt_cache()	do {} while (0)
 
include/asm-s390/smp.h +9 -4
diff -urN linux-2.5.27/include/asm-s390/smp.h linux-2.5.27-s390/include/asm-s390/smp.h
@@ -46,14 +46,19 @@
 
 #define smp_processor_id() (current_thread_info()->cpu)
 
-extern __inline__ int cpu_logical_map(int cpu)
+#define cpu_online(cpu) (cpu_online_map & (1<<(cpu)))
+
+extern inline unsigned int num_online_cpus(void)
 {
-        return cpu;
+	return hweight32(cpu_online_map);
 }
 
-extern __inline__ int cpu_number_map(int cpu)
+extern inline int any_online_cpu(unsigned int mask)
 {
-        return cpu;
+	if (mask & cpu_online_map)
+		return __ffs(mask & cpu_online_map);
+
+	return -1;
 }
 
 extern __inline__ __u16 hard_smp_processor_id(void)
include/asm-s390/tlbflush.h +1 -2
diff -urN linux-2.5.27/include/asm-s390/tlbflush.h linux-2.5.27-s390/include/asm-s390/tlbflush.h
@@ -91,8 +91,7 @@
 
 static inline void __flush_tlb_mm(struct mm_struct * mm)
 {
-	if ((smp_num_cpus > 1) &&
-	    ((atomic_read(&mm->mm_count) != 1) ||
+	if (((atomic_read(&mm->mm_count) != 1) ||
 	     (mm->cpu_vm_mask != (1UL << smp_processor_id())))) {
 		mm->cpu_vm_mask = (1UL << smp_processor_id());
 		global_flush_tlb();
include/asm-s390/unistd.h +1 -0
diff -urN linux-2.5.27/include/asm-s390/unistd.h linux-2.5.27-s390/include/asm-s390/unistd.h
@@ -231,6 +231,7 @@
 #define __NR_futex		238
 #define __NR_sched_setaffinity	239
 #define __NR_sched_getaffinity	240
+#define __NR_security		241	/* syscall for security modules */
 
 
 /* user-visible error numbers are in the range -1 - -122: see <asm-s390/errno.h> */
include/asm-s390x/bitops.h +8 -1
diff -urN linux-2.5.27/include/asm-s390x/bitops.h linux-2.5.27-s390/include/asm-s390x/bitops.h
@@ -811,7 +811,14 @@
  * hweightN: returns the hamming weight (i.e. the number
  * of bits set) of a N-bit word
  */
-
+#define hweight64(x)						\
+({								\
+	unsigned long __x = (x);				\
+	unsigned int __w;					\
+	__w = generic_hweight32((unsigned int) __x);		\
+	__w += generic_hweight32((unsigned int) (__x>>32));	\
+	__w;							\
+})
 #define hweight32(x) generic_hweight32(x)
 #define hweight16(x) generic_hweight16(x)
 #define hweight8(x) generic_hweight8(x)
include/asm-s390x/debug.h +4 -2
diff -urN linux-2.5.27/include/asm-s390x/debug.h linux-2.5.27-s390/include/asm-s390x/debug.h
@@ -160,7 +160,8 @@
 }
 
 extern debug_entry_t *
-debug_sprintf_event(debug_info_t* id,int level,char *string,...);
+debug_sprintf_event(debug_info_t* id,int level,char *string,...)
+	__attribute__ ((format(printf, 3, 4)));
 
 
 extern inline debug_entry_t* 
@@ -195,7 +196,8 @@
 
 
 extern debug_entry_t *
-debug_sprintf_exception(debug_info_t* id,int level,char *string,...);
+debug_sprintf_exception(debug_info_t* id,int level,char *string,...)
+	__attribute__ ((format(printf, 3, 4)));
 
 int debug_register_view(debug_info_t* id, struct debug_view* view);
 int debug_unregister_view(debug_info_t* id, struct debug_view* view);
include/asm-s390x/param.h +6 -7
diff -urN linux-2.5.27/include/asm-s390x/param.h linux-2.5.27-s390/include/asm-s390x/param.h
@@ -9,11 +9,14 @@
 #ifndef _ASMS390_PARAM_H
 #define _ASMS390_PARAM_H
 
-#ifndef HZ
-#define HZ 100
 #ifdef __KERNEL__
-#define hz_to_std(a) (a)
+# define HZ		100		/* Internal kernel timer frequency */
+# define USER_HZ	100		/* .. some user interfaces are in "ticks" */
+# define CLOCKS_PER_SEC	(USER_HZ)	/* like times() */
 #endif
+
+#ifndef HZ
+#define HZ 100
 #endif
 
 #define EXEC_PAGESIZE	4096
@@ -28,8 +31,4 @@
 
 #define MAXHOSTNAMELEN	64	/* max length of hostname */
 
-#ifdef __KERNEL__
-# define CLOCKS_PER_SEC		HZ	/* frequency at which times() counts */
-#endif
-                                 
 #endif
include/asm-s390x/pgalloc.h +2 -0
diff -urN linux-2.5.27/include/asm-s390x/pgalloc.h linux-2.5.27-s390/include/asm-s390x/pgalloc.h
@@ -16,6 +16,8 @@
 #include <linux/config.h>
 #include <asm/processor.h>
 #include <linux/threads.h>
+#include <linux/gfp.h>
+#include <linux/mm.h>
 
 #define check_pgt_cache()	do { } while (0)
 
include/asm-s390x/smp.h +9 -4
diff -urN linux-2.5.27/include/asm-s390x/smp.h linux-2.5.27-s390/include/asm-s390x/smp.h
@@ -46,14 +46,19 @@
 
 #define smp_processor_id() (current_thread_info()->cpu)
 
-extern __inline__ int cpu_logical_map(int cpu)
+#define cpu_online(cpu) (cpu_online_map & (1<<(cpu)))
+
+extern inline unsigned int num_online_cpus(void)
 {
-        return cpu;
+	return hweight64(cpu_online_map);
 }
 
-extern __inline__ int cpu_number_map(int cpu)
+extern inline int any_online_cpu(unsigned int mask)
 {
-        return cpu;
+	if (mask & cpu_online_map)
+		return __ffs(mask & cpu_online_map);
+
+	return -1;
 }
 
 extern __inline__ __u16 hard_smp_processor_id(void)
include/asm-s390x/system.h +1 -1
diff -urN linux-2.5.27/include/asm-s390x/system.h linux-2.5.27-s390/include/asm-s390x/system.h
@@ -23,7 +23,7 @@
 #define prepare_arch_switch(rq)			do { } while (0)
 #define finish_arch_switch(rq)			spin_unlock_irq(&(rq)->lock)
 
-#define switch_to(prev,next),last do {					     \
+#define switch_to(prev,next,last) do {					     \
 	if (prev == next)						     \
 		break;							     \
 	save_fp_regs(&prev->thread.fp_regs);				     \
include/asm-s390x/tlbflush.h +1 -2
diff -urN linux-2.5.27/include/asm-s390x/tlbflush.h linux-2.5.27-s390/include/asm-s390x/tlbflush.h
@@ -88,8 +88,7 @@
 
 static inline void __flush_tlb_mm(struct mm_struct * mm)
 {
-	if ((smp_num_cpus > 1) &&
-	    ((atomic_read(&mm->mm_count) != 1) ||
+	if (((atomic_read(&mm->mm_count) != 1) ||
 	     (mm->cpu_vm_mask != (1UL << smp_processor_id())))) {
 		mm->cpu_vm_mask = (1UL << smp_processor_id());
 		global_flush_tlb();
include/asm-s390x/unistd.h +1 -0
diff -urN linux-2.5.27/include/asm-s390x/unistd.h linux-2.5.27-s390/include/asm-s390x/unistd.h
@@ -198,6 +198,7 @@
 #define __NR_futex		238
 #define __NR_sched_setaffinity	239
 #define __NR_sched_getaffinity	240
+#define __NR_security		241	/* syscall for security modules */
 
 
 /* user-visible error numbers are in the range -1 - -122: see <asm-s390/errno.h> */
#1 lore raw
Quoted 2 lines · Martin Schwidefsky

Hi Linus,
s390 fixes for 2.5.27:

This patch no longer applies to the bk version because of changes in dasd_ioctl.c. I have fixed that and split the patch into six smaller ones following here.

	Arnd <><

part 1/6:

# This is a BitKeeper generated patch for the following project:
# Project Name: Linux kernel tree
# This patch format is intended for GNU patch command version 2.5 or higher. # This patch includes the following deltas:
# ChangeSet 1.683 -> 1.683.1.1
# drivers/s390/cio/chsc.c 1.1 -> 1.2
# drivers/s390/char/hwc_con.c 1.5 -> 1.6
# arch/s390/kernel/setup.c 1.9 -> 1.10
# drivers/s390/cio/proc.c 1.1 -> 1.2
# arch/s390/kernel/debug.c 1.7 -> 1.8
# arch/s390x/kernel/debug.c 1.7 -> 1.8
# drivers/s390/net/ctcmain.c 1.8 -> 1.9
# arch/s390x/kernel/setup.c 1.7 -> 1.8
# drivers/s390/char/tapechar.c 1.7 -> 1.8
# drivers/s390/net/netiucv.c 1.11 -> 1.12
# drivers/s390/char/tubfs.c 1.4 -> 1.5
# drivers/s390/char/tape.c 1.5 -> 1.6
# drivers/s390/block/xpram.c 1.23 -> 1.24
#
# The following is the BitKeeper ChangeSet Log
# --------------------------------------------
# 02/07/23 [email protected] 1.683.1.1

# convert named struct initializers to C99 syntax in s390 specific files
# --------------------------------------------
#
diff -Nru a/arch/s390/kernel/debug.c b/arch/s390/kernel/debug.c
--- a/arch/s390/kernel/debug.c	Tue Jul 23 18:53:41 2002
+++ b/arch/s390/kernel/debug.c	Tue Jul 23 18:53:41 2002
@@ -149,10 +149,10 @@
 static int initialized = 0;

static struct file_operations debug_file_ops = {

-	read:    debug_output,
-	write:   debug_input,	
-	open:    debug_open,
-	release: debug_close,
+	.read    = debug_output,
+	.write   = debug_input,	
+	.open    = debug_open,

+ .release = debug_close,
};

static struct proc_dir_entry *debug_proc_root_entry;

arch/s390/kernel/setup.c +5 -5
diff -Nru a/arch/s390/kernel/setup.c b/arch/s390/kernel/setup.c
@@ -524,7 +524,7 @@
 		seq_printf(m, "vendor_id       : IBM/S390\n"
 			       "# processors    : %i\n"
 			       "bogomips per cpu: %lu.%02lu\n",
-			       smp_num_cpus, loops_per_jiffy/(500000/HZ),
+			       num_online_cpus(), loops_per_jiffy/(500000/HZ),
 			       (loops_per_jiffy/(5000/HZ))%100);
 	}
 	if (cpu_online_map & (1 << n)) {
@@ -553,8 +553,8 @@
 {
 }
 struct seq_operations cpuinfo_op = {
-	start:	c_start,
-	next:	c_next,
-	stop:	c_stop,
-	show:	show_cpuinfo,
+	.start = c_start,
+	.next  = c_next,
+	.stop  = c_stop,
+	.show  = show_cpuinfo,
 };
arch/s390x/kernel/debug.c +4 -4
diff -Nru a/arch/s390x/kernel/debug.c b/arch/s390x/kernel/debug.c
@@ -149,10 +149,10 @@
 static int initialized = 0;
 
 static struct file_operations debug_file_ops = {
-	read:    debug_output,
-	write:   debug_input,	
-	open:    debug_open,
-	release: debug_close,
+	.read    = debug_output,
+	.write   = debug_input,	
+	.open    = debug_open,
+	.release = debug_close,
 };
 
 static struct proc_dir_entry *debug_proc_root_entry;
arch/s390x/kernel/setup.c +5 -5
diff -Nru a/arch/s390x/kernel/setup.c b/arch/s390x/kernel/setup.c
@@ -514,7 +514,7 @@
 		seq_printf(m, "vendor_id       : IBM/S390\n"
 				"# processors    : %i\n"
 				"bogomips per cpu: %lu.%02lu\n",
-				smp_num_cpus, loops_per_jiffy/(500000/HZ),
+				num_online_cpus(), loops_per_jiffy/(500000/HZ),
 				(loops_per_jiffy/(5000/HZ))%100);
 	}
 	if (cpu_online_map & (1 << n)) {
@@ -543,8 +543,8 @@
 {
 }
 struct seq_operations cpuinfo_op = {
-	start:	c_start,
-	next:	c_next,
-	stop:	c_stop,
-	show:	show_cpuinfo,
+	.start = c_start,
+	.next  = c_next,
+	.stop  = c_stop,
+	.show  = show_cpuinfo,
 };
drivers/s390/block/xpram.c +6 -10
diff -Nru a/drivers/s390/block/xpram.c b/drivers/s390/block/xpram.c
@@ -15,7 +15,6 @@
  *   Device specific file operations
  *        xpram_iotcl
  *        xpram_open
- *        xpram_release
  *
  * "ad-hoc" partitioning:
  *    the expanded memory can be partitioned among several devices 
@@ -36,6 +35,7 @@
 #include <linux/blkpg.h>
 #include <linux/hdreg.h>  /* HDIO_GETGEO */
 #include <linux/device.h>
+#include <linux/bio.h>
 #include <asm/uaccess.h>
 
 #define XPRAM_NAME	"xpram"
@@ -48,8 +48,8 @@
 #define PRINT_ERR(x...)		printk(KERN_ERR XPRAM_NAME " error:" x)
 
 static struct device xpram_sys_device = {
-	name: "S/390 expanded memory RAM disk",
-	bus_id: "xpram",
+	.name   = "S/390 expanded memory RAM disk",
+	.bus_id = "xpram",
 };
 
 typedef struct {
@@ -328,7 +328,6 @@
 	return 0;
 }
 
-
 static int xpram_ioctl (struct inode *inode, struct file *filp,
 		 unsigned int cmd, unsigned long arg)
 {
@@ -336,8 +335,6 @@
 	unsigned long size;
 	int idx;
 
-	if ((!inode) || kdev_none(inode->i_rdev))
-		return -EINVAL;
 	idx = minor(inode->i_rdev);
 	if (idx >= xpram_devs)
 		return -ENODEV;
@@ -367,10 +364,9 @@
 
 static struct block_device_operations xpram_devops =
 {
-	owner:   THIS_MODULE,
-	ioctl:   xpram_ioctl,
-	open:    xpram_open,
-	release: xpram_release,
+	.owner = THIS_MODULE,
+	.ioctl = xpram_ioctl,
+	.open  = xpram_open,
 };
 
 /*
drivers/s390/char/hwc_con.c +5 -5
diff -Nru a/drivers/s390/char/hwc_con.c b/drivers/s390/char/hwc_con.c
@@ -34,11 +34,11 @@
 struct console hwc_console =
 {
 
-	name:hwc_console_name,
-	write:hwc_console_write,
-	device:hwc_console_device,
-	unblank:hwc_console_unblank,
-	flags:CON_PRINTBUFFER,
+	.name	= hwc_console_name,
+	.write	= hwc_console_write,
+	.device	= hwc_console_device,
+	.unblank= hwc_console_unblank,
+	.flags	= CON_PRINTBUFFER,
 };
 
 void 
drivers/s390/char/tape.c +3 -3
diff -Nru a/drivers/s390/char/tape.c b/drivers/s390/char/tape.c
@@ -199,9 +199,9 @@
 
 static struct file_operations tape_proc_devices_file_ops =
 {
-	read:tape_proc_devices_read,	/* read */
-	open:tape_proc_devices_open,	/* open */
-	release:tape_proc_devices_release,	/* close */
+	.read	 = tape_proc_devices_read,
+	.open	 = tape_proc_devices_open,
+	.release = tape_proc_devices_release,
 };
 
 /* 
drivers/s390/char/tapechar.c +5 -5
diff -Nru a/drivers/s390/char/tapechar.c b/drivers/s390/char/tapechar.c
@@ -40,11 +40,11 @@
  */
 static struct file_operations tape_fops =
 {
-	read:tapechar_read,
-	write:tapechar_write,
-	ioctl:tapechar_ioctl,
-	open:tapechar_open,
-	release:tapechar_release,
+	.read	 = tapechar_read,
+	.write	 = tapechar_write,
+	.ioctl	 = tapechar_ioctl,
+	.open	 = tapechar_open,
+	.release = tapechar_release,
 };
 
 int tapechar_major = TAPECHAR_MAJOR;
drivers/s390/char/tubfs.c +6 -6
diff -Nru a/drivers/s390/char/tubfs.c b/drivers/s390/char/tubfs.c
@@ -24,13 +24,13 @@
 
 static struct file_operations fs3270_fops = {
 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,3,0))
-	owner: THIS_MODULE,		/* owner */
+	.owner   = THIS_MODULE,		/* owner */
 #endif
-	read: 	fs3270_read,	/* read */
-	write:	fs3270_write,	/* write */
-	ioctl:	fs3270_ioctl,	/* ioctl */
-	open: 	fs3270_open,	/* open */
-	release:fs3270_close,	/* release */
+	.read    = fs3270_read,
+	.write   = fs3270_write,
+	.ioctl   = fs3270_ioctl,
+	.open    = fs3270_open,
+	.release = fs3270_close,
 };
 
 #ifdef CONFIG_DEVFS_FS
drivers/s390/cio/chsc.c +10 -10
diff -Nru a/drivers/s390/cio/chsc.c b/drivers/s390/cio/chsc.c
@@ -70,13 +70,13 @@
 		*ssd_res = &chsc_area_ssd.response_block.response_block_data.ssd_res;
 
 	chsc_area_ssd = (chsc_area_t) {
-		request_block: {
-			command_code1: 0x0010,
-			command_code2: 0x0004,
-			request_block_data: {
-				ssd_req: {
-					f_sch: irq,
-					l_sch: irq,
+		.request_block = {
+			.command_code1 = 0x0010,
+			.command_code2 = 0x0004,
+			.request_block_data = {
+				.ssd_req = {
+					.f_sch = irq,
+					.l_sch = irq,
 				}
 			}
 		}
@@ -554,9 +554,9 @@
 	 * allocation or prove that this function does not have to be
 	 * reentrant! */
 	static chsc_area_t chsc_area_sei __attribute__ ((aligned(PAGE_SIZE))) = {
-		request_block: {
-			command_code1: 0x0010,
-			command_code2: 0x000e
+		.request_block = {
+			.command_code1 = 0x0010,
+			.command_code2 = 0x000e
 		}
 	};
 
drivers/s390/cio/proc.c +3 -3
diff -Nru a/drivers/s390/cio/proc.c b/drivers/s390/cio/proc.c
@@ -154,7 +154,7 @@
 }
 
 static struct file_operations chan_subch_file_ops = {
-	read:chan_subch_read, open:chan_subch_open, release:chan_subch_close,
+	.read=chan_subch_read, .open=chan_subch_open, .release=chan_subch_close,
 };
 
 static int
@@ -245,8 +245,8 @@
 }
 
 static struct file_operations cio_irq_proc_file_ops = {
-	read:cio_irq_proc_read, open:cio_irq_proc_open,
-	release:cio_irq_proc_close,
+	.read=cio_irq_proc_read, .open=cio_irq_proc_open,
+	.release=cio_irq_proc_close,
 };
 
 static int
drivers/s390/net/ctcmain.c +9 -8
diff -Nru a/drivers/s390/net/ctcmain.c b/drivers/s390/net/ctcmain.c
@@ -49,6 +49,7 @@
 #include <linux/interrupt.h>
 #include <linux/timer.h>
 #include <linux/sched.h>
+#include <linux/tqueue.h>
 
 #include <linux/signal.h>
 #include <linux/string.h>
@@ -2888,17 +2889,17 @@
 }
 
 static struct file_operations ctc_stat_fops = {
-	read:    ctc_stat_read,
-	write:   ctc_stat_write,
-	open:    ctc_stat_open,
-	release: ctc_stat_close,
+	.read    = ctc_stat_read,
+	.write   = ctc_stat_write,
+	.open    = ctc_stat_open,
+	.release = ctc_stat_close,
 };
 
 static struct file_operations ctc_ctrl_fops = {
-	read:    ctc_ctrl_read,
-	write:   ctc_ctrl_write,
-	open:    ctc_ctrl_open,
-	release: ctc_ctrl_close,
+	.read    = ctc_ctrl_read,
+	.write   = ctc_ctrl_write,
+	.open    = ctc_ctrl_open,
+	.release = ctc_ctrl_close,
 };
 
 static struct proc_dir_entry *ctc_dir = NULL;
drivers/s390/net/netiucv.c +19 -19
diff -Nru a/drivers/s390/net/netiucv.c b/drivers/s390/net/netiucv.c
@@ -465,13 +465,13 @@
 }
 
 static iucv_interrupt_ops_t netiucv_ops = {
-	ConnectionPending:  netiucv_callback_connreq,
-	ConnectionComplete: netiucv_callback_connack,
-	ConnectionSevered:  netiucv_callback_connrej,
-	ConnectionQuiesced: netiucv_callback_connsusp,
-	ConnectionResumed:  netiucv_callback_connres,
-	MessagePending:     netiucv_callback_rx,
-	MessageComplete:    netiucv_callback_txdone
+	.ConnectionPending  = netiucv_callback_connreq,
+	.ConnectionComplete = netiucv_callback_connack,
+	.ConnectionSevered  = netiucv_callback_connrej,
+	.ConnectionQuiesced = netiucv_callback_connsusp,
+	.ConnectionResumed  = netiucv_callback_connres,
+	.MessagePending     = netiucv_callback_rx,
+	.MessageComplete    = netiucv_callback_txdone
 };
 
 /**
@@ -1566,24 +1566,24 @@
 }
 
 static struct file_operations netiucv_stat_fops = {
-	read:    netiucv_stat_read,
-	write:   netiucv_stat_write,
-	open:    netiucv_stat_open,
-	release: netiucv_stat_close,
+	.read    = netiucv_stat_read,
+	.write   = netiucv_stat_write,
+	.open    = netiucv_stat_open,
+	.release = netiucv_stat_close,
 };
 
 static struct file_operations netiucv_buffer_fops = {
-	read:    netiucv_buffer_read,
-	write:   netiucv_buffer_write,
-	open:    netiucv_buffer_open,
-	release: netiucv_buffer_close,
+	.read    = netiucv_buffer_read,
+	.write   = netiucv_buffer_write,
+	.open    = netiucv_buffer_open,
+	.release = netiucv_buffer_close,
 };
 
 static struct file_operations netiucv_user_fops = {
-	read:    netiucv_user_read,
-	write:   netiucv_user_write,
-	open:    netiucv_user_open,
-	release: netiucv_user_close,
+	.read    = netiucv_user_read,
+	.write   = netiucv_user_write,
+	.open    = netiucv_user_open,
+	.release = netiucv_user_close,
 };
 
 static struct proc_dir_entry *netiucv_dir = NULL;
#2 lore raw
In reply to Martin Schwidefsky

updated patch part 3/6:

# This is a BitKeeper generated patch for the following project:
# Project Name: Linux kernel tree
# This patch format is intended for GNU patch command version 2.5 or higher. # This patch includes the following deltas:
# ChangeSet 1.683.1.2 -> 1.683.1.3
# include/asm-s390x/unistd.h 1.7 -> 1.8
# arch/s390/kernel/entry.S 1.14 -> 1.15

#	arch/s390x/kernel/entry.S	1.13    -> 1.14   
#	arch/s390/kernel/ptrace.c	1.8     -> 1.9    
#	include/asm-s390/unistd.h	1.6     -> 1.7    

#
# The following is the BitKeeper ChangeSet Log
# --------------------------------------------
# 02/07/23 [email protected] 1.683.1.3

# add sys_security system call
# --------------------------------------------
#
diff -Nru a/arch/s390/kernel/entry.S b/arch/s390/kernel/entry.S
--- a/arch/s390/kernel/entry.S	Tue Jul 23 18:53:45 2002
+++ b/arch/s390/kernel/entry.S	Tue Jul 23 18:53:45 2002
@@ -581,7 +581,8 @@
 	.long  sys_futex
 	.long  sys_sched_setaffinity
 	.long  sys_sched_getaffinity	 /* 240 */
-	.rept  255-240
+	.long  sys_security
+	.rept  255-241
 	.long  sys_ni_syscall
 	.endr
arch/s390/kernel/ptrace.c +3 -0
diff -Nru a/arch/s390/kernel/ptrace.c b/arch/s390/kernel/ptrace.c
@@ -227,6 +227,9 @@
 		/* are we already being traced? */
 		if (current->ptrace & PT_PTRACED)
 			goto out;
+		ret = security_ops->ptrace(current->parent, current);
+		if (ret)
+			goto out;
 		/* set the ptrace bit in the process flags. */
 		current->ptrace |= PT_PTRACED;
 		ret = 0;
arch/s390x/kernel/entry.S +2 -1
diff -Nru a/arch/s390x/kernel/entry.S b/arch/s390x/kernel/entry.S
@@ -612,7 +612,8 @@
 	.long  SYSCALL(sys_futex,sys32_futex_wrapper)
 	.long  SYSCALL(sys_sched_setaffinity,sys32_sched_setaffinity_wrapper)
 	.long  SYSCALL(sys_sched_getaffinity,sys32_sched_getaffinity_wrapper)
-        .rept  255-240
+	.long  SYSCALL(sys_security, sys_ni_syscall)
+        .rept  255-241
 	.long  SYSCALL(sys_ni_syscall,sys_ni_syscall)
 	.endr
 
include/asm-s390/unistd.h +1 -0
diff -Nru a/include/asm-s390/unistd.h b/include/asm-s390/unistd.h
@@ -231,6 +231,7 @@
 #define __NR_futex		238
 #define __NR_sched_setaffinity	239
 #define __NR_sched_getaffinity	240
+#define __NR_security		241	/* syscall for security modules */
 
 
 /* user-visible error numbers are in the range -1 - -122: see <asm-s390/errno.h> */
include/asm-s390x/unistd.h +1 -0
diff -Nru a/include/asm-s390x/unistd.h b/include/asm-s390x/unistd.h
@@ -198,6 +198,7 @@
 #define __NR_futex		238
 #define __NR_sched_setaffinity	239
 #define __NR_sched_getaffinity	240
+#define __NR_security		241	/* syscall for security modules */
 
 
 /* user-visible error numbers are in the range -1 - -122: see <asm-s390/errno.h> */
#3 lore raw
In reply to Martin Schwidefsky

updated patch part 2/6:

# This is a BitKeeper generated patch for the following project:
# Project Name: Linux kernel tree
# This patch format is intended for GNU patch command version 2.5 or higher. # This patch includes the following deltas:
# ChangeSet 1.683.1.1 -> 1.683.1.2
# arch/s390/kernel/smp.c 1.12 -> 1.13
# include/asm-s390x/smp.h 1.4 -> 1.5
# include/asm-s390/smp.h 1.5 -> 1.6
# arch/s390/kernel/irq.c 1.8 -> 1.9
# arch/s390x/kernel/smp.c 1.11 -> 1.12
# include/asm-s390x/tlbflush.h 1.1 -> 1.2
# include/asm-s390x/bitops.h 1.3 -> 1.4
# include/asm-s390/tlbflush.h 1.1 -> 1.2
# arch/s390x/kernel/irq.c 1.6 -> 1.7
#
# The following is the BitKeeper ChangeSet Log
# --------------------------------------------
# 02/07/23 [email protected] 1.683.1.2

# smp_num_cpus adaptions
# --------------------------------------------
#
diff -Nru a/arch/s390/kernel/irq.c b/arch/s390/kernel/irq.c
--- a/arch/s390/kernel/irq.c	Tue Jul 23 18:53:43 2002
+++ b/arch/s390/kernel/irq.c	Tue Jul 23 18:53:43 2002
@@ -66,8 +66,9 @@

seq_puts(p, " ");

- for (j=0; j<smp_num_cpus; j++)
- seq_printf(p, "CPU%d ",j);
+ for (j=0; j<NR_CPUS; j++)
+ if (cpu_online(j))
+ seq_printf(p, "CPU%d ",j);

seq_putc(p, '\n');

arch/s390/kernel/smp.c +18 -18
diff -Nru a/arch/s390/kernel/smp.c b/arch/s390/kernel/smp.c
@@ -48,7 +48,6 @@
  * An array with a pointer the lowcore of every CPU.
  */
 static int       max_cpus = NR_CPUS;	  /* Setup configured maximum number of CPUs to activate	*/
-int              smp_num_cpus;
 struct _lowcore *lowcore_ptr[NR_CPUS];
 cycles_t         cacheflush_time=0;
 int              smp_threads_ready=0;      /* Set when the idlers are all forked. */
@@ -150,7 +149,7 @@
  */
 {
 	struct call_data_struct data;
-	int cpus = smp_num_cpus-1;
+	int cpus = num_online_cpus()-1;
 
 	if (!cpus || !atomic_read(&smp_commenced))
 		return 0;
@@ -185,8 +184,8 @@
         int i, rc;
 
         /* stop all processors */
-        for (i =  0; i < smp_num_cpus; i++) {
-                if (smp_processor_id() == i)
+        for (i =  0; i < NR_CPUS; i++) {
+                if (!cpu_online(i) || smp_processor_id() == i)
 			continue;
 		do {
 			rc = signal_processor_ps(&dummy, 0, i, sigp_stop);
@@ -201,8 +200,8 @@
         int i, rc;
 
         /* store status of all processors in their lowcores (real 0) */
-        for (i =  0; i < smp_num_cpus; i++) {
-                if (smp_processor_id() == i)
+        for (i =  0; i < NR_CPUS; i++) {
+                if (!cpu_online(i) || smp_processor_id() == i)
 			continue;
 		low_core_addr = (unsigned long)get_cpu_lowcore(i);
 		do {
@@ -347,8 +346,8 @@
         struct _lowcore *lowcore;
         int i;
 
-        for (i = 0; i < smp_num_cpus; i++) {
-                if (smp_processor_id() == i)
+        for (i = 0; i < NR_CPUS; i++) {
+                if (!cpu_online(i) || smp_processor_id() == i)
                         continue;
                 lowcore = get_cpu_lowcore(i);
                 /*
@@ -459,24 +458,24 @@
 
 void smp_count_cpus(void)
 {
-        int curr_cpu;
+        int curr_cpu, num_cpus;
 
         current_thread_info()->cpu = 0;
-        smp_num_cpus = 1;
+        num_cpus = 1;
 	phys_cpu_present_map = 1;
 	cpu_online_map = 1;
         for (curr_cpu = 0;
-             curr_cpu <= 65535 && smp_num_cpus < max_cpus; curr_cpu++) {
+             curr_cpu <= 65535 && num_cpus < max_cpus; curr_cpu++) {
                 if ((__u16) curr_cpu == boot_cpu_addr)
                         continue;
-                __cpu_logical_map[smp_num_cpus] = (__u16) curr_cpu;
-                if (signal_processor(smp_num_cpus, sigp_sense) ==
+                __cpu_logical_map[num_cpus] = (__u16) curr_cpu;
+                if (signal_processor(num_cpus, sigp_sense) ==
                     sigp_not_operational)
                         continue;
-		set_bit(smp_num_cpus, &phys_cpu_present_map);
-                smp_num_cpus++;
+		set_bit(num_cpus, &phys_cpu_present_map);
+                num_cpus++;
         }
-        printk("Detected %d CPU's\n",(int) smp_num_cpus);
+        printk("Detected %d CPU's\n",(int) num_cpus);
         printk("Boot cpu address %2X\n", boot_cpu_addr);
 }
 
@@ -591,7 +590,9 @@
          */
         print_cpu_info(&safe_get_cpu_lowcore(0)->cpu_data);
 
-        for(i = 0; i < smp_num_cpus; i++) {
+        for(i = 0; i < NR_CPUS; i++) {
+		if (!test_bit(i, &phys_cpu_present_map))
+			continue;
 		lowcore_ptr[i] = (struct _lowcore *)
 			__get_free_page(GFP_KERNEL|GFP_DMA);
 		async_stack = __get_free_pages(GFP_KERNEL,1);
@@ -637,5 +638,4 @@
 EXPORT_SYMBOL(kernel_flag);
 EXPORT_SYMBOL(smp_ctl_set_bit);
 EXPORT_SYMBOL(smp_ctl_clear_bit);
-EXPORT_SYMBOL(smp_num_cpus);
 EXPORT_SYMBOL(smp_call_function);
arch/s390x/kernel/irq.c +3 -2
diff -Nru a/arch/s390x/kernel/irq.c b/arch/s390x/kernel/irq.c
@@ -66,8 +66,9 @@
 
 	seq_puts(p, "           ");
 
-	for (j=0; j<smp_num_cpus; j++)
-		seq_printf(p, "CPU%d       ",j);
+	for (j=0; j<NR_CPUS; j++)
+		if (cpu_online(i))
+			seq_printf(p, "CPU%d       ",j);
 
 	seq_putc(p, '\n');
 
arch/s390x/kernel/smp.c +18 -18
diff -Nru a/arch/s390x/kernel/smp.c b/arch/s390x/kernel/smp.c
@@ -47,7 +47,6 @@
  * An array with a pointer the lowcore of every CPU.
  */
 static int       max_cpus = NR_CPUS;	  /* Setup configured maximum number of CPUs to activate	*/
-int              smp_num_cpus;
 struct _lowcore *lowcore_ptr[NR_CPUS];
 cycles_t         cacheflush_time=0;
 int              smp_threads_ready=0;      /* Set when the idlers are all forked. */
@@ -149,7 +148,7 @@
  */
 {
 	struct call_data_struct data;
-	int cpus = smp_num_cpus-1;
+	int cpus = num_online_cpus()-1;
 
 	if (!cpus || !atomic_read(&smp_commenced))
 		return 0;
@@ -184,8 +183,8 @@
         int i, rc;
 
         /* stop all processors */
-        for (i =  0; i < smp_num_cpus; i++) {
-                if (smp_processor_id() == i)
+        for (i =  0; i < NR_CPUS; i++) {
+                if (!cpu_online(i) || smp_processor_id() == i)
 			continue;
 		do {
 			rc = signal_processor_ps(&dummy, 0, i, sigp_stop);
@@ -200,8 +199,8 @@
         int i, rc;
 
         /* store status of all processors in their lowcores (real 0) */
-        for (i =  0; i < smp_num_cpus; i++) {
-                if (smp_processor_id() == i) 
+        for (i =  0; i < NR_CPUS; i++) {
+                if (!cpu_online(i) || smp_processor_id() == i) 
 			continue;
 		low_core_addr = (unsigned long)get_cpu_lowcore(i);
 		do {
@@ -342,8 +341,8 @@
 {
         int i;
 
-        for (i = 0; i < smp_num_cpus; i++) {
-                if (smp_processor_id() == i)
+        for (i = 0; i < NR_CPUS; i++) {
+                if (!cpu_online(i) || smp_processor_id() == i)
                         continue;
                 /*
                  * Set signaling bit in lowcore of target cpu and kick it
@@ -440,24 +439,24 @@
 
 void smp_count_cpus(void)
 {
-        int curr_cpu;
+        int curr_cpu, num_cpus;
 
         current_thread_info()->cpu = 0;
-        smp_num_cpus = 1;
+        num_cpus = 1;
 	phys_cpu_present_map = 1;
         cpu_online_map = 1;
         for (curr_cpu = 0;
-             curr_cpu <= 65535 && smp_num_cpus < max_cpus; curr_cpu++) {
+             curr_cpu <= 65535 && num_cpus < max_cpus; curr_cpu++) {
                 if ((__u16) curr_cpu == boot_cpu_addr)
                         continue;
-                __cpu_logical_map[smp_num_cpus] = (__u16) curr_cpu;
-                if (signal_processor(smp_num_cpus, sigp_sense) ==
+                __cpu_logical_map[num_cpus] = (__u16) curr_cpu;
+                if (signal_processor(num_cpus, sigp_sense) ==
                     sigp_not_operational)
                         continue;
-		set_bit(smp_num_cpus, &phys_cpu_present_map);
-                smp_num_cpus++;
+		set_bit(num_cpus, &phys_cpu_present_map);
+                num_cpus++;
         }
-        printk("Detected %d CPU's\n",(int) smp_num_cpus);
+        printk("Detected %d CPU's\n",(int) num_cpus);
         printk("Boot cpu address %2X\n", boot_cpu_addr);
 }
 
@@ -571,7 +570,9 @@
          */
         print_cpu_info(&safe_get_cpu_lowcore(0)->cpu_data);
 
-        for(i = 0; i < smp_num_cpus; i++) {
+        for(i = 0; i < NR_CPUS; i++) {
+		if (!test_bit(i, &phys_cpu_present_map))
+			continue;
                 lowcore_ptr[i] = (struct _lowcore *)
                                     __get_free_pages(GFP_KERNEL|GFP_DMA, 1);
 		async_stack = __get_free_pages(GFP_KERNEL,2);
@@ -616,5 +617,4 @@
 EXPORT_SYMBOL(kernel_flag);
 EXPORT_SYMBOL(smp_ctl_set_bit);
 EXPORT_SYMBOL(smp_ctl_clear_bit);
-EXPORT_SYMBOL(smp_num_cpus);
 EXPORT_SYMBOL(smp_call_function);
include/asm-s390/smp.h +9 -4
diff -Nru a/include/asm-s390/smp.h b/include/asm-s390/smp.h
@@ -46,14 +46,19 @@
 
 #define smp_processor_id() (current_thread_info()->cpu)
 
-extern __inline__ int cpu_logical_map(int cpu)
+#define cpu_online(cpu) (cpu_online_map & (1<<(cpu)))
+
+extern inline unsigned int num_online_cpus(void)
 {
-        return cpu;
+	return hweight32(cpu_online_map);
 }
 
-extern __inline__ int cpu_number_map(int cpu)
+extern inline int any_online_cpu(unsigned int mask)
 {
-        return cpu;
+	if (mask & cpu_online_map)
+		return __ffs(mask & cpu_online_map);
+
+	return -1;
 }
 
 extern __inline__ __u16 hard_smp_processor_id(void)
include/asm-s390/tlbflush.h +1 -2
diff -Nru a/include/asm-s390/tlbflush.h b/include/asm-s390/tlbflush.h
@@ -91,8 +91,7 @@
 
 static inline void __flush_tlb_mm(struct mm_struct * mm)
 {
-	if ((smp_num_cpus > 1) &&
-	    ((atomic_read(&mm->mm_count) != 1) ||
+	if (((atomic_read(&mm->mm_count) != 1) ||
 	     (mm->cpu_vm_mask != (1UL << smp_processor_id())))) {
 		mm->cpu_vm_mask = (1UL << smp_processor_id());
 		global_flush_tlb();
include/asm-s390x/bitops.h +8 -1
diff -Nru a/include/asm-s390x/bitops.h b/include/asm-s390x/bitops.h
@@ -811,7 +811,14 @@
  * hweightN: returns the hamming weight (i.e. the number
  * of bits set) of a N-bit word
  */
-
+#define hweight64(x)						\
+({								\
+	unsigned long __x = (x);				\
+	unsigned int __w;					\
+	__w = generic_hweight32((unsigned int) __x);		\
+	__w += generic_hweight32((unsigned int) (__x>>32));	\
+	__w;							\
+})
 #define hweight32(x) generic_hweight32(x)
 #define hweight16(x) generic_hweight16(x)
 #define hweight8(x) generic_hweight8(x)
include/asm-s390x/smp.h +9 -4
diff -Nru a/include/asm-s390x/smp.h b/include/asm-s390x/smp.h
@@ -46,14 +46,19 @@
 
 #define smp_processor_id() (current_thread_info()->cpu)
 
-extern __inline__ int cpu_logical_map(int cpu)
+#define cpu_online(cpu) (cpu_online_map & (1<<(cpu)))
+
+extern inline unsigned int num_online_cpus(void)
 {
-        return cpu;
+	return hweight64(cpu_online_map);
 }
 
-extern __inline__ int cpu_number_map(int cpu)
+extern inline int any_online_cpu(unsigned int mask)
 {
-        return cpu;
+	if (mask & cpu_online_map)
+		return __ffs(mask & cpu_online_map);
+
+	return -1;
 }
 
 extern __inline__ __u16 hard_smp_processor_id(void)
include/asm-s390x/tlbflush.h +1 -2
diff -Nru a/include/asm-s390x/tlbflush.h b/include/asm-s390x/tlbflush.h
@@ -88,8 +88,7 @@
 
 static inline void __flush_tlb_mm(struct mm_struct * mm)
 {
-	if ((smp_num_cpus > 1) &&
-	    ((atomic_read(&mm->mm_count) != 1) ||
+	if (((atomic_read(&mm->mm_count) != 1) ||
 	     (mm->cpu_vm_mask != (1UL << smp_processor_id())))) {
 		mm->cpu_vm_mask = (1UL << smp_processor_id());
#4 lore raw
In reply to Martin Schwidefsky

updated patch, part 5/6:

# This is a BitKeeper generated patch for the following project:
# Project Name: Linux kernel tree
# This patch format is intended for GNU patch command version 2.5 or higher. # This patch includes the following deltas:
# ChangeSet 1.683.1.4 -> 1.683.1.5
# include/asm-s390x/param.h 1.2 -> 1.3
# include/asm-s390/debug.h 1.5 -> 1.6
# include/asm-s390/param.h 1.2 -> 1.3
# drivers/s390/net/lcs.c 1.1 -> 1.2
# include/asm-s390x/pgalloc.h 1.6 -> 1.7
# arch/s390x/kernel/linux32.c 1.15 -> 1.16
# drivers/s390/cio/blacklist.c 1.1 -> 1.2
# arch/s390x/mm/fault.c 1.9 -> 1.10
# drivers/s390/misc/chandev.c 1.9 -> 1.10
# drivers/s390/Makefile 1.8 -> 1.9
# include/asm-s390x/debug.h 1.5 -> 1.6
# include/asm-s390/pgalloc.h 1.7 -> 1.8
# arch/s390/mm/fault.c 1.8 -> 1.9
# drivers/s390/cio/s390io.c 1.1 -> 1.2
# include/asm-s390x/system.h 1.5 -> 1.6
# arch/s390x/kernel/linux32.h 1.2 -> 1.3
# drivers/s390/cio/cio.c 1.1 -> 1.2
# drivers/s390/char/ctrlchar.c 1.3 -> 1.4
#
# The following is the BitKeeper ChangeSet Log
# --------------------------------------------
# 02/07/23 [email protected] 1.683.1.5

# trivial fixes to keep s390 arch working
# --------------------------------------------
#
diff -Nru a/arch/s390/mm/fault.c b/arch/s390/mm/fault.c
--- a/arch/s390/mm/fault.c	Tue Jul 23 18:53:49 2002
+++ b/arch/s390/mm/fault.c	Tue Jul 23 18:53:49 2002
@@ -234,16 +234,18 @@
 	 * the fault.
 	 */
 	switch (handle_mm_fault(mm, vma, address, error_code == 4)) {
-	case 1:
+	case VM_FAULT_MINOR:
 		tsk->min_flt++;
 		break;
-	case 2:
+	case VM_FAULT_MAJOR:
 		tsk->maj_flt++;
 		break;
-	case 0:
+	case VM_FAULT_SIGBUS:
 		goto do_sigbus;
-	default:
+	case VM_FAULT_OOM:
 		goto out_of_memory;
+	default:
+		BUG();
 	}
         up_read(&mm->mmap_sem);
arch/s390x/kernel/linux32.c +4 -5
diff -Nru a/arch/s390x/kernel/linux32.c b/arch/s390x/kernel/linux32.c
@@ -514,16 +514,15 @@
 	if (!p)
 		return -ENOMEM;
 
+	err = -EINVAL;
 	if (second > MSGMAX || first < 0 || second < 0)
-		return -EINVAL;
+		goto out;
 
 	err = -EFAULT;
 	if (!uptr)
 		goto out;
-
-	err = get_user (p->mtype, &up->mtype);
-	err |= __copy_from_user (p->mtext, &up->mtext, second);
-	if (err)
+        if (get_user (p->mtype, &up->mtype) ||
+	    __copy_from_user (p->mtext, &up->mtext, second))
 		goto out;
 	old_fs = get_fs ();
 	set_fs (KERNEL_DS);
arch/s390x/kernel/linux32.h +0 -4
diff -Nru a/arch/s390x/kernel/linux32.h b/arch/s390x/kernel/linux32.h
@@ -8,8 +8,6 @@
 #include <linux/nfsd/nfsd.h>
 #include <linux/nfsd/export.h>
 
-#ifdef CONFIG_S390_SUPPORT
-
 /* Macro that masks the high order bit of an 32 bit pointer and converts it*/
 /*       to a 64 bit pointer */
 #define A(__x) ((unsigned long)((__x) & 0x7FFFFFFFUL))
@@ -241,6 +239,4 @@
 	sigset_t32		uc_sigmask;	/* mask last for extensibility */
 };
 
-#endif /* !CONFIG_S390_SUPPORT */
- 
 #endif /* _ASM_S390X_S390_H */
arch/s390x/mm/fault.c +6 -4
diff -Nru a/arch/s390x/mm/fault.c b/arch/s390x/mm/fault.c
@@ -234,16 +234,18 @@
 	 * the fault.
 	 */
 	switch (handle_mm_fault(mm, vma, address, error_code == 4)) {
-	case 1:
+	case VM_FAULT_MINOR:
 		tsk->min_flt++;
 		break;
-	case 2:
+	case VM_FAULT_MAJOR:
 		tsk->maj_flt++;
 		break;
-	case 0:
+	case VM_FAULT_SIGBUS:
 		goto do_sigbus;
-	default:
+	case VM_FAULT_OOM:
 		goto out_of_memory;
+	default:
+		BUG();
 	}
 
         up_read(&mm->mmap_sem);
drivers/s390/Makefile +1 -1
diff -Nru a/drivers/s390/Makefile b/drivers/s390/Makefile
@@ -7,6 +7,6 @@
 obj-$(CONFIG_QDIO) += qdio.o
 
 obj-y += s390mach.o s390dyn.o sysinfo.o
-obj-y += block/ char/ misc/ net/ cio/
+obj-y += cio/ block/ char/ misc/ net/
 
 include $(TOPDIR)/Rules.make
drivers/s390/char/ctrlchar.c +1 -1
diff -Nru a/drivers/s390/char/ctrlchar.c b/drivers/s390/char/ctrlchar.c
@@ -26,7 +26,7 @@
 
 static void
 ctrlchar_handle_sysrq(struct tty_struct *tty) {
-	handle_sysrq(ctrlchar_sysrq_key, NULL, NULL, tty);
+	handle_sysrq(ctrlchar_sysrq_key, NULL, tty);
 }
 #endif
 
drivers/s390/cio/blacklist.c +3 -3
diff -Nru a/drivers/s390/cio/blacklist.c b/drivers/s390/cio/blacklist.c
@@ -1,7 +1,7 @@
 /*
  *  drivers/s390/cio/blacklist.c
  *   S/390 common I/O routines -- blacklisting of specific devices
- *   $Revision: 1.5 $
+ *   $Revision: 1.6 $
  *
  *    Copyright (C) 1999-2002 IBM Deutschland Entwicklung GmbH,
  *                            IBM Corporation
@@ -243,10 +243,10 @@
 		return -EFAULT;
 	}
 	buf[user_len] = '\0';
-
+#if 0
 	CIO_DEBUG(KERN_DEBUG, 2, 
 		  "/proc/cio_ignore: '%s'\n", buf);
-
+#endif
 	blacklist_parse_proc_parameters (buf);
 
 	vfree (buf);
drivers/s390/cio/cio.c +3 -3
diff -Nru a/drivers/s390/cio/cio.c b/drivers/s390/cio/cio.c
@@ -1,7 +1,7 @@
 /*
  *  drivers/s390/cio/cio.c
  *   S/390 common I/O routines -- low level i/o calls
- *   $Revision: 1.15 $
+ *   $Revision: 1.17 $
  *
  *    Copyright (C) 1999-2002 IBM Deutschland Entwicklung GmbH,
  *                            IBM Corporation
@@ -52,7 +52,7 @@
 	}
 	DBG ("%s\n", buffer);
 	if (cio_debug_initialized) 
-		debug_text_event (cio_debug_trace_id, level, buffer);
+		debug_text_event (cio_debug_msg_id, level, buffer);
 }
 
 
@@ -1448,7 +1448,7 @@
 	
 	ioinfo[irq]->devstat.intparm = 0;
 	
-	if (!ioinfo[irq]->ui.flags.s_pend) 
+	if (!(ioinfo[irq]->ui.flags.s_pend || ioinfo[irq]->ui.flags.repnone))
 		ioinfo[irq]->irq_desc.handler (irq, udp, NULL);
 	
 	return 1;
drivers/s390/cio/s390io.c +11 -4
diff -Nru a/drivers/s390/cio/s390io.c b/drivers/s390/cio/s390io.c
@@ -1,7 +1,7 @@
 /*
  *  drivers/s390/cio/s390io.c
  *   S/390 common I/O routines
- *   $Revision: 1.11 $
+ *   $Revision: 1.12 $
  *
  *  S390 version
  *    Copyright (C) 1999, 2000 IBM Deutschland Entwicklung GmbH,
@@ -1910,12 +1910,19 @@
 
 				ret = 0;
 
-			} else {
+			} else if (ret == -ENODEV) {
 
 				CIO_DEBUG(KERN_ERR, 2,
-					  "PathVerification(%04X) - "
-					  "Unexpected error on device %04X\n",
+					  "PathVerification(%04X) "
+					  "- Device %04X is no longer there?!?\n",
 					  irq, ioinfo[irq]->schib.pmcw.dev);
+
+			} else if (ret) {
+
+				CIO_DEBUG(KERN_ERR, 2,
+					  "PathVerification(%04X) - "
+					  "Unexpected error %d on device %04X\n",
+					  irq, ret, ioinfo[irq]->schib.pmcw.dev);
 				
 				ioinfo[irq]->ui.flags.pgid_supp = 0;
 			}
drivers/s390/misc/chandev.c +1 -0
diff -Nru a/drivers/s390/misc/chandev.c b/drivers/s390/misc/chandev.c
@@ -24,6 +24,7 @@
 #include <asm/s390dyn.h>
 #include <asm/queue.h>
 #include <linux/kmod.h>
+#include <linux/tqueue.h>
 #ifndef MIN
 #define MIN(a,b) ((a<b)?a:b)
 #endif
drivers/s390/net/lcs.c +1 -0
diff -Nru a/drivers/s390/net/lcs.c b/drivers/s390/net/lcs.c
@@ -124,6 +124,7 @@
 #include <linux/types.h>
 #include <linux/kernel.h>
 #include <linux/sched.h>
+#include <linux/tqueue.h>
 #include <linux/errno.h>
 #include <linux/init.h>
 #include <asm/system.h>
include/asm-s390/debug.h +4 -2
diff -Nru a/include/asm-s390/debug.h b/include/asm-s390/debug.h
@@ -160,7 +160,8 @@
 }
 
 extern debug_entry_t *
-debug_sprintf_event(debug_info_t* id,int level,char *string,...);
+debug_sprintf_event(debug_info_t* id,int level,char *string,...)
+	__attribute__ ((format(printf, 3, 4)));
 
 
 extern inline debug_entry_t* 
@@ -195,7 +196,8 @@
 
 
 extern debug_entry_t *
-debug_sprintf_exception(debug_info_t* id,int level,char *string,...);
+debug_sprintf_exception(debug_info_t* id,int level,char *string,...)
+	__attribute__ ((format(printf, 3, 4)));
 
 int debug_register_view(debug_info_t* id, struct debug_view* view);
 int debug_unregister_view(debug_info_t* id, struct debug_view* view);
include/asm-s390/param.h +6 -4
diff -Nru a/include/asm-s390/param.h b/include/asm-s390/param.h
@@ -9,6 +9,12 @@
 #ifndef _ASMS390_PARAM_H
 #define _ASMS390_PARAM_H
 
+#ifdef __KERNEL__
+# define HZ		100		/* Internal kernel timer frequency */
+# define USER_HZ	100		/* .. some user interfaces are in "ticks" */
+# define CLOCKS_PER_SEC	(USER_HZ)	/* like times() */
+#endif
+
 #ifndef HZ
 #define HZ 100
 #endif
@@ -24,9 +30,5 @@
 #endif
 
 #define MAXHOSTNAMELEN	64	/* max length of hostname */
-
-#ifdef __KERNEL__
-# define CLOCKS_PER_SEC		HZ	/* frequency at which times() counts */
-#endif
 
 #endif
include/asm-s390/pgalloc.h +2 -0
diff -Nru a/include/asm-s390/pgalloc.h b/include/asm-s390/pgalloc.h
@@ -16,6 +16,8 @@
 #include <linux/config.h>
 #include <asm/processor.h>
 #include <linux/threads.h>
+#include <linux/gfp.h>
+#include <linux/mm.h>
 
 #define check_pgt_cache()	do {} while (0)
 
include/asm-s390x/debug.h +4 -2
diff -Nru a/include/asm-s390x/debug.h b/include/asm-s390x/debug.h
@@ -160,7 +160,8 @@
 }
 
 extern debug_entry_t *
-debug_sprintf_event(debug_info_t* id,int level,char *string,...);
+debug_sprintf_event(debug_info_t* id,int level,char *string,...)
+	__attribute__ ((format(printf, 3, 4)));
 
 
 extern inline debug_entry_t* 
@@ -195,7 +196,8 @@
 
 
 extern debug_entry_t *
-debug_sprintf_exception(debug_info_t* id,int level,char *string,...);
+debug_sprintf_exception(debug_info_t* id,int level,char *string,...)
+	__attribute__ ((format(printf, 3, 4)));
 
 int debug_register_view(debug_info_t* id, struct debug_view* view);
 int debug_unregister_view(debug_info_t* id, struct debug_view* view);
include/asm-s390x/param.h +6 -7
diff -Nru a/include/asm-s390x/param.h b/include/asm-s390x/param.h
@@ -9,11 +9,14 @@
 #ifndef _ASMS390_PARAM_H
 #define _ASMS390_PARAM_H
 
-#ifndef HZ
-#define HZ 100
 #ifdef __KERNEL__
-#define hz_to_std(a) (a)
+# define HZ		100		/* Internal kernel timer frequency */
+# define USER_HZ	100		/* .. some user interfaces are in "ticks" */
+# define CLOCKS_PER_SEC	(USER_HZ)	/* like times() */
 #endif
+
+#ifndef HZ
+#define HZ 100
 #endif
 
 #define EXEC_PAGESIZE	4096
@@ -28,8 +31,4 @@
 
 #define MAXHOSTNAMELEN	64	/* max length of hostname */
 
-#ifdef __KERNEL__
-# define CLOCKS_PER_SEC		HZ	/* frequency at which times() counts */
-#endif
-                                 
 #endif
include/asm-s390x/pgalloc.h +2 -0
diff -Nru a/include/asm-s390x/pgalloc.h b/include/asm-s390x/pgalloc.h
@@ -16,6 +16,8 @@
 #include <linux/config.h>
 #include <asm/processor.h>
 #include <linux/threads.h>
+#include <linux/gfp.h>
+#include <linux/mm.h>
 
 #define check_pgt_cache()	do { } while (0)
 
include/asm-s390x/system.h +1 -1
diff -Nru a/include/asm-s390x/system.h b/include/asm-s390x/system.h
@@ -23,7 +23,7 @@
 #define prepare_arch_switch(rq)			do { } while (0)
 #define finish_arch_switch(rq)			spin_unlock_irq(&(rq)->lock)
 
-#define switch_to(prev,next),last do {					     \
+#define switch_to(prev,next,last) do {					     \
 	if (prev == next)						     \
 		break;							     \
#5 lore raw
In reply to Martin Schwidefsky

updated patch, part 4/6:

# This is a BitKeeper generated patch for the following project:
# Project Name: Linux kernel tree
# This patch format is intended for GNU patch command version 2.5 or higher. # This patch includes the following deltas:
# ChangeSet 1.683.1.3 -> 1.683.1.4
# drivers/s390/block/dasd_eckd.c 1.9 -> 1.10
# drivers/s390/block/dasd_ioctl.c 1.2 -> 1.3
# drivers/s390/block/dasd_diag.c 1.6 -> 1.7
# drivers/s390/block/dasd_proc.c 1.2 -> 1.3
# drivers/s390/block/dasd.c 1.26 -> 1.27
# drivers/s390/block/dasd_devmap.c 1.1 -> 1.2
# drivers/s390/block/dasd_fba.c 1.6 -> 1.7
# drivers/s390/block/dasd_int.h 1.6 -> 1.7
# drivers/s390/block/dasd_genhd.c 1.2 -> 1.3
#
# The following is the BitKeeper ChangeSet Log
# --------------------------------------------
# 02/07/23 [email protected] 1.683.1.4

# convert dasd driver to use struct block_device instead of kdev_t internally
# use C99 style named initializers for dasd
# --------------------------------------------
#
diff -Nru a/drivers/s390/block/dasd.c b/drivers/s390/block/dasd.c
--- a/drivers/s390/block/dasd.c	Tue Jul 23 18:53:47 2002
+++ b/drivers/s390/block/dasd.c	Tue Jul 23 18:53:47 2002
@@ -292,8 +292,8 @@
 		return -ENODEV;
 	minor = devmap->devindex % DASD_PER_MAJOR;

- /* Set kdev and the device name. */
- device->kdev = mk_kdev(gdp->major, minor << DASD_PARTN_BITS);
+ /* Set bdev and the device name. */
+ device->bdev = bdget(MKDEV(gdp->major, minor << DASD_PARTN_BITS));
dasd_device_name(device->name, minor, 0, gdp);

/* Find a discipline for the device. */
@@ -304,14 +304,14 @@
/* Add a proc directory and the dasd device entry to devfs. */ sprintf(buffer, "%04x", device->devinfo.devno);
dir = devfs_mk_dir(dasd_devfs_handle, buffer, device);
- gdp->de_arr[minor(device->kdev) >> DASD_PARTN_BITS] = dir;
+ gdp->de_arr[minor] = dir;
if (devmap->features & DASD_FEATURE_READONLY)
devfs_perm = S_IFBLK | S_IRUSR;
else
devfs_perm = S_IFBLK | S_IRUSR | S_IWUSR;
device->devfs_entry = devfs_register(dir, "device", DEVFS_FL_DEFAULT,

-					     major(device->kdev),
-					     minor(device->kdev),
+					     gdp->major,
+					     minor << DASD_PARTN_BITS,

devfs_perm, &dasd_device_operations, NULL);
device->state = DASD_STATE_KNOWN;
@@ -326,6 +326,7 @@
{
struct gendisk *gdp;
dasd_devmap_t *devmap;
+ struct block_device *bdev;
int minor;

devmap = dasd_devmap_from_devno(device->devinfo.devno);
@@ -341,6 +342,11 @@
/* Forget the discipline information. */ device->discipline = NULL;
device->state = DASD_STATE_NEW;
+
+ /* Forget the block device */
+ bdev = device->bdev;
+ device->bdev = NULL;
+ bdput(bdev);
}

/*
@@ -427,21 +433,29 @@
}

/*
+ * get the kdev_t of a device
+ * FIXME: remove this when no longer needed
+ */
+static inline kdev_t +dasd_partition_to_kdev_t(dasd_device_t *device, unsigned int partition) +{
+ return to_kdev_t(device->bdev->bd_dev+partition);
+}
+
+
+/*
* Setup block device.
*/
static inline int
dasd_state_accept_to_ready(dasd_device_t * device)
{
dasd_devmap_t *devmap;
- int major, minor;
int rc, i;

devmap = dasd_devmap_from_devno(device->devinfo.devno); if (devmap->features & DASD_FEATURE_READONLY) {
- major = major(device->kdev);
- minor = minor(device->kdev);
for (i = 0; i < (1 << DASD_PARTN_BITS); i++)
- set_device_ro(mk_kdev(major, minor+i), 1);
+ set_device_ro(dasd_partition_to_kdev_t(device, i), 1);
DEV_MESSAGE (KERN_WARNING, device, "%s",
"setting read-only mode ");
}
@@ -1547,11 +1561,9 @@
goto restart;
}

- /* Dechain request from device request queue ... */
+ /* Rechain request on device device request queue */
cqr->endclk = get_clock();
- list_del(&cqr->list);
- /* ... and add it to list of final requests. */
- list_add_tail(&cqr->list, final_queue);
+ list_move_tail(&cqr->list, final_queue);
}
}

@@ -1580,6 +1592,10 @@
dasd_ccw_req_t *cqr;
int nr_queued;

+ /* No bdev, no queue. */
+ bdev = device->bdev;
+ if (!bdev)
+ return;
queue = device->request_queue;
/* No queue ? Then there is nothing to do. */ if (queue == NULL)
@@ -1602,9 +1618,6 @@
if (cqr->status == DASD_CQR_QUEUED)
nr_queued++;
}
- bdev = bdget(kdev_t_to_nr(device->kdev));
- if (!bdev)
- return;
while (!blk_queue_plugged(queue) &&
!blk_queue_empty(queue) &&
nr_queued < DASD_CHANQ_MAX_SIZE) {
@@ -1636,7 +1649,6 @@
dasd_profile_start(device, cqr, req); nr_queued++;
}
- bdput(bdev);
}

/*
@@ -1715,11 +1727,9 @@
__dasd_process_erp(device, cqr); continue;
}
- /* Dechain request from device request queue ... */
+ /* Rechain request on device request queue */
cqr->endclk = get_clock();
- list_del(&cqr->list);
- /* ... and add it to list of flushed requests. */
- list_add_tail(&cqr->list, &flush_queue);
+ list_move_tail(&cqr->list, &flush_queue);
} spin_unlock_irq(get_irq_lock(device->devinfo.irq)); /* Now call the callback function of flushed requests */
@@ -2186,10 +2196,10 @@

struct
block_device_operations dasd_device_operations = {
- owner:THIS_MODULE,
- open:dasd_open,
- release:dasd_release,
- ioctl:dasd_ioctl,
+ .owner=THIS_MODULE,
+ .open=dasd_open,
+ .release=dasd_release,
+ .ioctl=dasd_ioctl,
};

drivers/s390/block/dasd_devmap.c +9 -0
diff -Nru a/drivers/s390/block/dasd_devmap.c b/drivers/s390/block/dasd_devmap.c
@@ -449,6 +449,15 @@
 }
 
 /*
+ * Find the devmap for a device corresponding to a block_device.
+ */
+dasd_devmap_t *
+dasd_devmap_from_bdev(struct block_device *bdev)
+{
+	return dasd_devmap_from_kdev(to_kdev_t(bdev->bd_dev));
+}
+
+/*
  * Find the device structure for device number devno. If it does not
  * exists yet, allocate it. Increase the reference counter in the device
  * structure and return a pointer to it.
drivers/s390/block/dasd_diag.c +14 -13
diff -Nru a/drivers/s390/block/dasd_diag.c b/drivers/s390/block/dasd_diag.c
@@ -21,6 +21,7 @@
 #include <linux/kernel.h>
 #include <linux/slab.h>
 #include <linux/hdreg.h>	/* HDIO_GETGEO			    */
+#include <linux/bio.h>
 
 #include <asm/dasd.h>
 #include <asm/debug.h>
@@ -489,19 +490,19 @@
  * for one request. Give a little safety and the result is 240.
  */
 static dasd_discipline_t dasd_diag_discipline = {
-	owner:THIS_MODULE,
-	name:"DIAG",
-	ebcname:"DIAG",
-	max_blocks:240,
-	check_device:dasd_diag_check_device,
-	fill_geometry:dasd_diag_fill_geometry,
-	start_IO:dasd_start_diag,
-	examine_error:dasd_diag_examine_error,
-	erp_action:dasd_diag_erp_action,
-	erp_postaction:dasd_diag_erp_postaction,
-	build_cp:dasd_diag_build_cp,
-	dump_sense:dasd_diag_dump_sense,
-	fill_info:dasd_diag_fill_info,
+	.owner=THIS_MODULE,
+	.name="DIAG",
+	.ebcname="DIAG",
+	.max_blocks=240,
+	.check_device=dasd_diag_check_device,
+	.fill_geometry=dasd_diag_fill_geometry,
+	.start_IO=dasd_start_diag,
+	.examine_error=dasd_diag_examine_error,
+	.erp_action=dasd_diag_erp_action,
+	.erp_postaction=dasd_diag_erp_postaction,
+	.build_cp=dasd_diag_build_cp,
+	.dump_sense=dasd_diag_dump_sense,
+	.fill_info=dasd_diag_fill_info,
 };
 
 int
drivers/s390/block/dasd_eckd.c +46 -40

183 lines not on this page · raw message

drivers/s390/block/dasd_fba.c +22 -21

65 lines not on this page · raw message

drivers/s390/block/dasd_genhd.c +9 -6
diff -Nru a/drivers/s390/block/dasd_genhd.c b/drivers/s390/block/dasd_genhd.c
@@ -200,13 +200,15 @@
  * Return pointer to gendisk structure by kdev.
  */
 struct gendisk *
-dasd_gendisk_from_major(int major)
+dasd_gendisk_from_bdev(struct block_device *bdev)
 {
 	struct list_head *l;
 	struct major_info *mi;
 	struct gendisk *gdp;
+	int major;
 
 	spin_lock(&dasd_major_lock);
+	major = MAJOR(bdev->bd_dev);
 	gdp = NULL;
 	list_for_each(l, &dasd_major_info) {
 		mi = list_entry(l, struct major_info, list);
@@ -322,7 +324,8 @@
 void
 dasd_setup_partitions(dasd_device_t * device)
 {
-	grok_partitions(device->kdev, device->blocks << device->s2b_shift);
+	grok_partitions(to_kdev_t(device->bdev->bd_dev),
+			device->blocks << device->s2b_shift);
 }
 
 /*
@@ -335,14 +338,14 @@
 	struct gendisk *gdp;
 	int minor, i;
 
-	gdp = dasd_gendisk_from_major(major(device->kdev));
+	gdp = dasd_gendisk_from_bdev(device->bdev);
 	if (gdp == NULL)
 		return;
 
-	wipe_partitions(device->kdev);
+	wipe_partitions(to_kdev_t(device->bdev->bd_dev));
 
 	/* FIXME: do we really need that */
-	minor = minor(device->kdev);
+	minor = MINOR(device->bdev->bd_dev);
 	for (i = 0; i < (1 << DASD_PARTN_BITS); i++)
 		gdp->sizes[minor + i] = 0;
 
@@ -351,7 +354,7 @@
 	 * but the 1 as third parameter makes it do an unregister...
 	 * FIXME: there must be a better way to get rid of the devfs entries
 	 */
-	devfs_register_partitions(gdp, minor(device->kdev), 1);
+	devfs_register_partitions(gdp, minor, 1);
 }
 
 extern int (*genhd_dasd_name)(char *, int, int, struct gendisk *);
drivers/s390/block/dasd_int.h +8 -8
diff -Nru a/drivers/s390/block/dasd_int.h b/drivers/s390/block/dasd_int.h
@@ -69,7 +69,9 @@
 /*
  * SECTION: Type definitions
  */
-typedef int (*dasd_ioctl_fn_t) (void *inp, int no, long args);
+struct dasd_device_t;
+
+typedef int (*dasd_ioctl_fn_t) (struct block_device *bdev, int no, long args);
 
 typedef struct {
 	struct list_head list;
@@ -139,9 +141,8 @@
 /* messages to be written via klogd and dbf */
 #define DEV_MESSAGE(d_loglevel,d_device,d_string,d_args...)\
 do { \
-	printk(d_loglevel PRINTK_HEADER " /dev/%-7s(%3d:%3d),%04x@%02x: " \
-	       d_string "\n", d_device->name, \
-	       major(d_device->kdev), minor(d_device->kdev), \
+	printk(d_loglevel PRINTK_HEADER " %s,%04x@%02x: " \
+	       d_string "\n", bdevname(d_device->bdev), \
 	       d_device->devinfo.devno, d_device->devinfo.irq, \
 	       d_args); \
 	DBF_DEV_EVENT(DBF_ALERT, d_device, d_string, d_args); \
@@ -153,8 +154,6 @@
 	DBF_EVENT(DBF_ALERT, d_string, d_args); \
 } while(0)
 
-struct dasd_device_t;
-
 typedef struct dasd_ccw_req_t {
 	unsigned int magic;		/* Eye catcher */
         struct list_head list;		/* list_head for request queueing. */
@@ -262,7 +261,7 @@
 typedef struct dasd_device_t {
 	/* Block device stuff. */
 	char name[16];			/* The device name in /dev. */
-	kdev_t kdev;
+	struct block_device *bdev;
 	devfs_handle_t devfs_entry;
 	request_queue_t *request_queue;
 	spinlock_t request_queue_lock;
@@ -467,6 +466,7 @@
 dasd_devmap_t *dasd_devmap_from_devindex(int);
 dasd_devmap_t *dasd_devmap_from_irq(int);
 dasd_devmap_t *dasd_devmap_from_kdev(kdev_t);
+dasd_devmap_t *dasd_devmap_from_bdev(struct block_device *bdev);
 dasd_device_t *dasd_get_device(dasd_devmap_t *);
 void dasd_put_device(dasd_devmap_t *);
 
@@ -480,7 +480,7 @@
 void dasd_gendisk_exit(void);
 int  dasd_gendisk_new_major(void);
 int  dasd_gendisk_major_index(int);
-struct gendisk *dasd_gendisk_from_major(int);
+struct gendisk *dasd_gendisk_from_bdev(struct block_device *bdev);
 struct gendisk *dasd_gendisk_from_devindex(int);
 int  dasd_device_name(char *, int, int, struct gendisk *);
 void dasd_setup_partitions(dasd_device_t *);
drivers/s390/block/dasd_ioctl.c +83 -64

382 lines not on this page · raw message

drivers/s390/block/dasd_proc.c +9 -8
diff -Nru a/drivers/s390/block/dasd_proc.c b/drivers/s390/block/dasd_proc.c
@@ -15,6 +15,7 @@
 #include <linux/config.h>
 #include <linux/version.h>
 #include <linux/ctype.h>
+#include <linux/vmalloc.h>
 
 #include <asm/debug.h>
 #include <asm/irq.h>
@@ -274,10 +275,10 @@
 }
 
 static struct file_operations dasd_devices_file_ops = {
-	read:dasd_generic_read,		/* read */
-	write:dasd_devices_write,	/* write */
-	open:dasd_devices_open,		/* open */
-	release:dasd_generic_close,	/* close */
+	.read    = dasd_generic_read,
+	.write   = dasd_devices_write,
+	.open    = dasd_devices_open,
+	.release = dasd_generic_close,
 };
 
 static struct inode_operations dasd_devices_inode_ops = {
@@ -430,10 +431,10 @@
 }
 
 static struct file_operations dasd_statistics_file_ops = {
-	read:	dasd_generic_read,	/* read */
-	write:	dasd_statistics_write,	/* write */
-	open:	dasd_statistics_open,	/* open */
-	release:dasd_generic_close,	/* close */
+	.read    = dasd_generic_read,
+	.write   = dasd_statistics_write,
+	.open    = dasd_statistics_open,
+	.release = dasd_generic_close,
 };
 
#6 lore raw
In reply to Martin Schwidefsky

updated patch, part 6/6

# This is a BitKeeper generated patch for the following project:
# Project Name: Linux kernel tree
# This patch format is intended for GNU patch command version 2.5 or higher. # This patch includes the following deltas:
# ChangeSet 1.683.1.5 -> 1.683.1.6
# drivers/s390/net/iucv.c 1.11 -> 1.12
# drivers/s390/char/con3215.c 1.6 -> 1.7
# drivers/s390/net/ctctty.c 1.4 -> 1.5
#
# The following is the BitKeeper ChangeSet Log
# --------------------------------------------
# 02/07/23 [email protected] 1.683.1.6

# use tasklets instead of IMMEDIATE_BH for 3215 console, ctc and iucv
# --------------------------------------------
#
diff -Nru a/drivers/s390/char/con3215.c b/drivers/s390/char/con3215.c
--- a/drivers/s390/char/con3215.c	Tue Jul 23 18:53:51 2002
+++ b/drivers/s390/char/con3215.c	Tue Jul 23 18:53:51 2002
@@ -89,7 +89,7 @@
         int written;                  /* number of bytes in write requests */
 	devstat_t devstat;	      /* device status structure for do_IO */
 	struct tty_struct *tty;	      /* pointer to tty structure if present */
-	struct tq_struct tqueue;      /* task queue to bottom half */
+	struct tasklet_struct tasklet;
 	raw3215_req *queued_read;     /* pointer to queued read requests */
 	raw3215_req *queued_write;    /* pointer to queued write requests */
 	wait_queue_head_t empty_wait; /* wait queue for flushing */
@@ -341,7 +341,7 @@
  * The bottom half handler routine for 3215 devices. It tries to start
  * the next IO and wakes up processes waiting on the tty.
  */
-static void raw3215_softint(void *data)
+static void raw3215_tasklet(void *data)
 {
 	raw3215_info *raw;
 	struct tty_struct *tty;
@@ -377,12 +377,7 @@
         if (raw->flags & RAW3215_BH_PENDING)
                 return;       /* already pending */
         raw->flags |= RAW3215_BH_PENDING;
-	INIT_LIST_HEAD(&raw->tqueue.list);
-	raw->tqueue.sync = 0;
-        raw->tqueue.routine = raw3215_softint;
-        raw->tqueue.data = raw;
-        queue_task(&raw->tqueue, &tq_immediate);
-        mark_bh(IMMEDIATE_BH);
+	tasklet_hi_schedule(&raw->tasklet);
 }

/*
@@ -824,12 +819,12 @@
* The console structure for the 3215 console
*/
static struct console con3215 = {
- name: "tty3215",
- write: con3215_write,
- device: con3215_device,
- unblank: con3215_unblank,
- setup: con3215_consetup,
- flags: CON_PRINTBUFFER,
+ .name = "tty3215",
+ .write = con3215_write,
+ .device = con3215_device,
+ .unblank = con3215_unblank,
+ .setup = con3215_consetup,
+ .flags = CON_PRINTBUFFER,
};

#endif
@@ -867,8 +862,9 @@
kfree(raw);
return -ENOMEM;
}
- raw->tqueue.routine = raw3215_softint;
- raw->tqueue.data = raw;
+ tasklet_init(&raw->tasklet,
+ (void (*)(unsigned long)) raw3215_tasklet,

+			     (unsigned long) raw);
                 init_waitqueue_head(&raw->empty_wait);

raw3215[line] = raw;
}
@@ -1097,8 +1093,9 @@
/* Find the first console */
raw->irq = raw3215_find_dev(0);
raw->flags |= RAW3215_FIXED;
- raw->tqueue.routine = raw3215_softint;
- raw->tqueue.data = raw;
+ tasklet_init(&raw->tasklet,
+ (void (*)(unsigned long)) raw3215_tasklet,

+		     (unsigned long) raw);
         init_waitqueue_head(&raw->empty_wait);

/* Request the console irq */

drivers/s390/net/ctctty.c +11 -26
diff -Nru a/drivers/s390/net/ctctty.c b/drivers/s390/net/ctctty.c
@@ -86,7 +86,7 @@
   wait_queue_head_t	open_wait;
   wait_queue_head_t	close_wait;
   struct semaphore      write_sem;
-  struct tq_struct      tq;
+  struct tasklet_struct tasklet;
   struct timer_list     stoptimer;
 } ctc_tty_info;
 
@@ -272,8 +272,7 @@
 	 */
 	skb_queue_tail(&info->rx_queue, skb);
 	/* Schedule dequeuing */
-	queue_task(&info->tq, &tq_immediate);
-	mark_bh(IMMEDIATE_BH);
+	tasklet_schedule(&info->tasklet);
 }
 
 static int
@@ -390,8 +389,7 @@
 	skb_reserve(skb, skb_res);
 	*(skb_put(skb, 1)) = c;
 	skb_queue_head(&info->tx_queue, skb);
-	queue_task(&info->tq, &tq_immediate);
-	mark_bh(IMMEDIATE_BH);
+	tasklet_schedule(&info->tasklet);
 }
 
 static void
@@ -400,8 +398,7 @@
 	if (ctc_tty_shuttingdown)
 		return;
 	info->flags |= CTC_ASYNC_TX_LINESTAT;
-	queue_task(&info->tq, &tq_immediate);
-	mark_bh(IMMEDIATE_BH);
+	tasklet_schedule(&info->tasklet);
 }
 
 static void
@@ -562,8 +559,7 @@
 	}
 	if (skb_queue_len(&info->tx_queue)) {
 		info->lsr &= ~UART_LSR_TEMT;
-		queue_task(&info->tq, &tq_immediate);
-		mark_bh(IMMEDIATE_BH);
+		tasklet_schedule(&info->tasklet);
 	}
 	if (from_user)
 		up(&info->write_sem);
@@ -628,8 +624,7 @@
 		return;
 	if (tty->stopped || tty->hw_stopped || (!skb_queue_len(&info->tx_queue)))
 		return;
-	queue_task(&info->tq, &tq_immediate);
-	mark_bh(IMMEDIATE_BH);
+	tasklet_schedule(&info->tasklet);
 }
 
 /*
@@ -1170,8 +1165,9 @@
  * the lower levels.
  */
 static void
-ctc_tty_task(ctc_tty_info *info)
+ctc_tty_task(unsigned long arg)
 {
+	ctc_tty_info *info = (void *)arg;
 	unsigned long saveflags;
 	int again;
 
@@ -1182,8 +1178,7 @@
 			info->lsr |= UART_LSR_TEMT;
 		again |= ctc_tty_readmodem(info);
 		if (again) {
-			queue_task(&info->tq, &tq_immediate);
-			mark_bh(IMMEDIATE_BH);
+			tasklet_schedule(&info->tasklet);
 		}
 	}
 	spin_unlock_irqrestore(&ctc_tty_lock, saveflags);
@@ -1243,14 +1238,8 @@
 	for (i = 0; i < CTC_TTY_MAX_DEVICES; i++) {
 		info = &driver->info[i];
 		init_MUTEX(&info->write_sem);
-#if LINUX_VERSION_CODE >= 0x020400
-		INIT_LIST_HEAD(&info->tq.list);
-#else
-		info->tq.next    = NULL;
-#endif
-		info->tq.sync    = 0;
-		info->tq.routine = (void *)(void *)ctc_tty_task;
-		info->tq.data    = info;
+		tasklet_init(&info->tasklet, ctc_tty_task,
+				(unsigned long) info);
 		info->magic = CTC_ASYNC_MAGIC;
 		info->line = i;
 		info->tty = 0;
@@ -1331,10 +1320,6 @@
 		kfree(driver);
 		driver = NULL;
 	} else {
-		int i;
-
-		for (i = 0; i < CTC_TTY_MAX_DEVICES; i++)
-			driver->info[i].tq.routine = NULL;
 		tty_unregister_driver(&driver->ctc_tty_device);
 	}
 	spin_unlock_irqrestore(&ctc_tty_lock, saveflags);
drivers/s390/net/iucv.c +11 -23
diff -Nru a/drivers/s390/net/iucv.c b/drivers/s390/net/iucv.c
@@ -41,9 +41,9 @@
 #include <linux/kernel.h>
 #include <linux/slab.h>
 #include <linux/init.h>
-#include <linux/tqueue.h>
 #include <linux/interrupt.h>
 #include <linux/list.h>
+#include <linux/errno.h>
 #include <asm/atomic.h>
 #include "iucv.h"
 #include <asm/io.h>
@@ -99,16 +99,14 @@
 static struct list_head  iucv_irq_queue;
 static spinlock_t iucv_irq_queue_lock = SPIN_LOCK_UNLOCKED;
 
-static struct tq_struct  iucv_tq;
-
-static atomic_t   iucv_bh_scheduled = ATOMIC_INIT (0);
-
 /*
  *Internal function prototypes
  */
-static void iucv_bh_handler(void);
+static void iucv_tasklet_handler(unsigned long);
 static void iucv_irq_handler(struct pt_regs *, __u16);
 
+static DECLARE_TASKLET(iucv_tasklet,iucv_tasklet_handler,0);
+
 /************ FUNCTION ID'S ****************************/
 
 #define ACCEPT          10
@@ -302,7 +300,7 @@
 	if (debuglevel < 3)
 		return;
 
-	printk(KERN_DEBUG __FUNCTION__ ": %s\n", title);
+	printk(KERN_DEBUG "%s\n", title);
 	printk("  ");
 	for (i = 0; i < len; i++) {
 		if (!(i % 16) && i != 0)
@@ -318,7 +316,7 @@
 #define iucv_debug(lvl, fmt, args...) \
 do { \
 	if (debuglevel >= lvl) \
-		printk(KERN_DEBUG __FUNCTION__ ": " fmt "\n" , ## args); \
+		printk(KERN_DEBUG "%s: " fmt "\n", __FUNCTION__ , ## args); \
 } while (0)
 
 #else
@@ -385,11 +383,6 @@
 	}
 	memset(iucv_param_pool, 0, sizeof(iucv_param) * PARAM_POOL_SIZE);
 
-	/* Initialize task queue */
-	INIT_LIST_HEAD(&iucv_tq.list);
-	iucv_tq.sync = 0;
-	iucv_tq.routine = (void *)iucv_bh_handler;
-
 	/* Initialize irq queue */
 	INIT_LIST_HEAD(&iucv_irq_queue);
 
@@ -2177,7 +2170,7 @@
  * @code: irq code
  *
  * Handles external interrupts coming in from CP.
- * Places the interrupt buffer on a queue and schedules iucv_bh_handler().
+ * Places the interrupt buffer on a queue and schedules iucv_tasklet_handler().
  */
 static void
 iucv_irq_handler(struct pt_regs *regs, __u16 code)
@@ -2201,10 +2194,7 @@
 	list_add_tail(&irqdata->queue, &iucv_irq_queue);
 	spin_unlock(&iucv_irq_queue_lock);
 
-	if (atomic_compare_and_swap (0, 1, &iucv_bh_scheduled) == 0) {
-		queue_task (&iucv_tq, &tq_immediate);
-		mark_bh(IMMEDIATE_BH);
-	}
+	tasklet_schedule(&iucv_tasklet);
 
 	irq_exit(cpu, 0x4000);
 	return;
@@ -2215,7 +2205,7 @@
  * @int_buf: Pointer to copy of external interrupt buffer
  *
  * The workhorse for handling interrupts queued by iucv_irq_handler().
- * This function is called from the bottom half iucv_bh_handler().
+ * This function is called from the bottom half iucv_tasklet_handler().
  */
 static void
 iucv_do_int(iucv_GeneralInterrupt * int_buf)
@@ -2385,19 +2375,17 @@
 }
 
 /**
- * iucv_bh_handler:
+ * iucv_tasklet_handler:
  *
  * This function loops over the queue of irq buffers and runs iucv_do_int()
  * on every queue element.
  */
 static void
-iucv_bh_handler(void)
+iucv_tasklet_handler(unsigned long ignored)
 {
 	struct list_head head;
 	struct list_head *next;
 	ulong  flags;
-
-	atomic_set(&iucv_bh_scheduled, 0);
 
 	spin_lock_irqsave(&iucv_irq_queue_lock, flags);