Skip to contentSkip to conversation

2.5.39 s390 (3/26): drivers.

PATCH In review Martin Schwidefsky 5 participants 7 messages Sep 30, 2002 – Oct 1, 2002

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

PATCH 1/1 2.5.39 s390 (3/26): drivers.

s390 minimal device drivers changes for 2.5.39.

drivers/s390/char/ctrlchar.c +1 -1
diff -urN linux-2.5.39/drivers/s390/char/ctrlchar.c linux-2.5.39-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_rw.c +2 -2
diff -urN linux-2.5.39/drivers/s390/char/hwc_rw.c linux-2.5.39-s390/drivers/s390/char/hwc_rw.c
@@ -2219,7 +2219,7 @@
 
 	u32 ext_int_param = hwc_ext_int_param ();
 
-	irq_enter (cpu, 0x2401);
+	irq_enter ();
 
 	if (hwc_data.flags & HWC_INIT) {
 
@@ -2240,7 +2240,7 @@
 		hwc_do_interrupt (ext_int_param);
 		spin_unlock (&hwc_data.lock);
 	}
-	irq_exit (cpu, 0x2401);
+	irq_exit ();
 }
 
 void 
drivers/s390/cio/cio.c +4 -4
diff -urN linux-2.5.39/drivers/s390/cio/cio.c linux-2.5.39-s390/drivers/s390/cio/cio.c
@@ -978,9 +978,9 @@
 		 */
 		if (tpi_info->adapter_IO == 1 &&
 		    tpi_info->int_type == IO_INTERRUPT_TYPE) {
-			irq_enter (cpu, -1);
+			irq_enter ();
 			do_adapter_IO (tpi_info->intparm);
-			irq_exit (cpu, -1);
+			irq_exit ();
 		} else {
 			unsigned int irq = tpi_info->irq;
 
@@ -1001,11 +1001,11 @@
 				return;
 			}
 
-			irq_enter (cpu, irq);
+			irq_enter ();
 			s390irq_spin_lock (irq);
 			s390_process_IRQ (irq);
 			s390irq_spin_unlock (irq);
-			irq_exit (cpu, irq);
+			irq_exit ();
 		}
 
 #ifdef CONFIG_FAST_IRQ
drivers/s390/cio/proc.c +33 -1
diff -urN linux-2.5.39/drivers/s390/cio/proc.c linux-2.5.39-s390/drivers/s390/cio/proc.c
@@ -1,7 +1,7 @@
 /*
  *  drivers/s390/cio/proc.c
  *   S/390 common I/O routines -- proc file system entries
- *   $Revision: 1.4 $
+ *   $Revision: 1.5 $
  *
  *    Copyright (C) 1999-2002 IBM Deutschland Entwicklung GmbH,
  *                            IBM Corporation
@@ -17,6 +17,7 @@
 #include <linux/config.h>
 #include <linux/init.h>
 #include <linux/proc_fs.h>
+#include <linux/seq_file.h>
 
 #include <asm/io.h>
 #include <asm/irq.h>
@@ -30,6 +31,31 @@
 
 static int chan_proc_init (void);
 
+int show_interrupts(struct seq_file *p, void *v)
+{
+	int i, j;
+
+	seq_puts(p, "           ");
+
+	for (j=0; j<num_online_cpus(); j++)
+		seq_printf(p, "CPU%d       ",j);
+
+	seq_putc(p, '\n');
+
+	for (i = 0 ; i < NR_IRQS ; i++) {
+		if (ioinfo[i] == INVALID_STORAGE_AREA)
+			continue;
+
+		seq_printf(p, "%3d: ",i);
+		seq_printf(p, "  %s", ioinfo[i]->irq_desc.name);
+
+		seq_putc(p, '\n');
+	
+	} /* endfor */
+
+	return 0;
+}
+
 /* 
  * Display info on subchannels in /proc/subchannels. 
  * Adapted from procfs stuff in dasd.c by Cornelia Huck, 02/28/01.      
@@ -267,3 +293,9 @@
 }
 
 __initcall (cio_irq_proc_init);
+
+void
+init_irq_proc(void)
+{
+	/* For now, nothing... */
+}
drivers/s390/cio/requestirq.c +19 -0
diff -urN linux-2.5.39/drivers/s390/cio/requestirq.c linux-2.5.39-s390/drivers/s390/cio/requestirq.c
@@ -122,6 +122,16 @@
 					 NULL, irqflags, devname, dev_id);
 }
 
+/*
+ * request_irq wrapper
+ */
+int
+request_irq(unsigned int irq, void (*handler)(int, void *, struct pt_regs *),
+	    unsigned long irqflags, const char *devname, void *dev_id)
+{
+	return s390_request_irq(irq, handler, irqflags, devname, dev_id);
+}
+
 void
 s390_free_irq (unsigned int irq, void *dev_id)
 {
@@ -224,6 +234,15 @@
 }
 
 /*
+ * free_irq wrapper.
+ */
+void
+free_irq(unsigned int irq, void *dev_id)
+{
+	s390_free_irq(irq, dev_id);
+}
+
+/*
  * Enable IRQ by modifying the subchannel
  */
 static int
drivers/s390/cio/s390io.c +9 -0
diff -urN linux-2.5.39/drivers/s390/cio/s390io.c linux-2.5.39-s390/drivers/s390/cio/s390io.c
@@ -209,6 +209,15 @@
 }
 
 /*
+ * init_IRQ wrapper
+ */
+void __init
+init_IRQ(void)
+{
+	s390_init_IRQ();
+}
+
+/*
  * dummy handler, used during init_IRQ() processing for compatibility only
  */
 static void
drivers/s390/misc/chandev.c +4 -1
diff -urN linux-2.5.39/drivers/s390/misc/chandev.c linux-2.5.39-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
@@ -2825,6 +2826,7 @@
 	struct stat statbuf;
 	char        *buff;
 	int         curr,left,len,fd;
+	mm_segment_t oldfs;
 
 	/* if called from chandev_register_and_probe & 
 	   the driver is compiled into the kernel the
@@ -2835,6 +2837,7 @@
 	if(in_interrupt()||current->fs->root==NULL)
 		return;
 	atomic_set(&chandev_conf_read,TRUE);
+	oldfs = get_fs();
 	set_fs(KERNEL_DS);
 	if(stat(CHANDEV_FILE,&statbuf)==0)
 	{
@@ -2859,7 +2862,7 @@
 			vfree(buff);
 		}
 	}
-	set_fs(USER_DS);
+	set_fs(oldfs);
 }
 
 static void chandev_read_conf_if_necessary(void)
drivers/s390/net/ctcmain.c +4 -3
diff -urN linux-2.5.39/drivers/s390/net/ctcmain.c linux-2.5.39-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>
@@ -195,7 +196,7 @@
 	unsigned long doios_multi;
 	unsigned long txlen;
 	unsigned long tx_time;
-	struct timeval send_stamp;
+	struct timespec send_stamp;
 } ctc_profile;
 
 /**
@@ -976,10 +977,10 @@
 	int            first = 1;
 	int            i;
 
-	struct timeval done_stamp = xtime;
+	struct timespec done_stamp = xtime;
 	unsigned long duration = 
 		(done_stamp.tv_sec - ch->prof.send_stamp.tv_sec) * 1000000 +
-		done_stamp.tv_usec - ch->prof.send_stamp.tv_usec;
+		(done_stamp.tv_nsec - ch->prof.send_stamp.tv_nsec) / 1000;
 	if (duration > ch->prof.tx_time)
 		ch->prof.tx_time = duration;
 
drivers/s390/net/ctctty.c +16 -25

114 lines not on this page · raw message

drivers/s390/net/iucv.c +5 -6
diff -urN linux-2.5.39/drivers/s390/net/iucv.c linux-2.5.39-s390/drivers/s390/net/iucv.c
@@ -302,7 +302,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 +318,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
@@ -2183,14 +2183,13 @@
 iucv_irq_handler(struct pt_regs *regs, __u16 code)
 {
 	iucv_irqdata *irqdata;
-	int          cpu = smp_processor_id();
 
-	irq_enter(cpu, 0x4000);
+	irq_enter();
 
 	irqdata = kmalloc(sizeof(iucv_irqdata), GFP_ATOMIC);
 	if (!irqdata) {
 		printk(KERN_WARNING "%s: out of memory\n", __FUNCTION__);
-		irq_exit(cpu, 0x4000);
+		irq_exit();
 		return;
 	}
 
@@ -2206,7 +2205,7 @@
 		mark_bh(IMMEDIATE_BH);
 	}
 
-	irq_exit(cpu, 0x4000);
+	irq_exit();
 	return;
 }
 
drivers/s390/net/lcs.c +1 -0
diff -urN linux-2.5.39/drivers/s390/net/lcs.c linux-2.5.39-s390/drivers/s390/net/lcs.c
@@ -126,6 +126,7 @@
 #include <linux/sched.h>
 #include <linux/errno.h>
 #include <linux/init.h>
+#include <linux/tqueue.h>
 #include <asm/system.h>
 #include <asm/io.h>
 #include <asm/irq.h>
drivers/s390/net/netiucv.c +1 -1
diff -urN linux-2.5.39/drivers/s390/net/netiucv.c linux-2.5.39-s390/drivers/s390/net/netiucv.c
@@ -88,7 +88,7 @@
 	unsigned long doios_multi;
 	unsigned long txlen;
 	unsigned long tx_time;
-	struct timeval send_stamp;
+	struct timespec send_stamp;
 } connection_profile;
 
 /**
drivers/s390/qdio.c +0 -5
diff -urN linux-2.5.39/drivers/s390/qdio.c linux-2.5.39-s390/drivers/s390/qdio.c
@@ -245,26 +245,21 @@
 static void qdio_wait_nonbusy(unsigned int timeout)
 {
         unsigned int start;
-        unsigned long flags;
         char dbf_text[15];
 
 	sprintf(dbf_text,"wtnb%4x",timeout);
 	QDIO_DBF_TEXT3(0,trace,dbf_text);
 
 	start=qdio_get_millis();
-	save_flags(flags); cli();
 	for (;;) {
 		set_task_state(current,TASK_INTERRUPTIBLE);
 		if (qdio_get_millis()-start>timeout) {
 			goto out;
 		}
-		restore_flags(flags);
 		schedule_timeout(((start+timeout-qdio_get_millis())>>10)*HZ);
-		save_flags(flags); cli();
 	}
 out:
 	set_task_state(current,TASK_RUNNING);
-	restore_flags(flags);
 }
 
 static int qdio_wait_for_no_use_count(atomic_t *use_count)
#1 lore raw
Quoted 27 lines
drivers/s390/misc/chandev.c +3 -0
@@ -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
@@ -2825,6 +2826,7 @@
 	struct stat statbuf;
 	char        *buff;
 	int         curr,left,len,fd;
+	mm_segment_t oldfs;
 
 	/* if called from chandev_register_and_probe & 
 	   the driver is compiled into the kernel the
@@ -2835,6 +2837,7 @@
 	if(in_interrupt()||current->fs->root==NULL)
 		return;
 	atomic_set(&chandev_conf_read,TRUE);
+	oldfs = get_fs();
 	set_fs(KERNEL_DS);
 	if(stat(CHANDEV_FILE,&statbuf)==0)
 	{

drivers/s390/misc/chandev.c line 2868

Quoted 8 lines
drivers/s390/misc/chandev.c +1 -1
@@ -2859,7 +2862,7 @@
 			vfree(buff);
 		}
 	}
-	set_fs(USER_DS);
+	set_fs(oldfs);
 }
 
 static void chandev_read_conf_if_necessary(void)

Ehm. Ok. This code STILL tries to read and parse config files. If you're fixing it, can you please fix it to NOT read and parse config files from inside the kernel? Please?

Greetings,
Arjan van de Ven

#2 lore raw
Quoted 3 lines

Ehm. Ok. This code STILL tries to read and parse config files. If you're fixing it, can you please fix it to NOT read and parse config files from inside the kernel? Please?

This is just a fix to keep chandev working as long as it's there and drivers depend on it. We're working on getting rid of chandev altogether, as we don't need any more it once driverfs and hotplug are working well for s390 ccw devices.

The new code is not stable yet and so far works only for qeth and dasd, so there is not much point in breaking everything else atm.

	Arnd <><
#3 lore raw
Quoted 2 lines · Arnd Bergmann

The new code is not stable yet and so far works only for qeth and dasd, so there is not much point in breaking everything else atm.

humm I tried to look but couldn't find the qeth driver... Any url to the source ?

Greetings,
Arjan van de Ven

#4 lore raw
Quoted 2 lines · Arjan van de Ven

humm I tried to look but couldn't find the qeth driver... Any url to the source ?

Sorry, I wish I could but that is still one of our two device drivers that we are not allowed to publish the source of.

There might be a way to regularly provide object files for 2.5.current, but I suppose that's not what you want ...

	Arnd <><
#5 lore raw
In reply to Arnd Bergmann
Quoted 8 lines · Arnd Bergmann
Quoted 3 lines

Ehm. Ok. This code STILL tries to read and parse config files. If you're fixing it, can you please fix it to NOT read and parse config files from inside the kernel? Please?

This is just a fix to keep chandev working as long as it's there and drivers depend on it. We're working on getting rid of chandev altogether, as we don't need any more it once driverfs and hotplug are working well for s390 ccw devices.

With the last patch I just sent to Linus, I think you have everything you need (from the driver core, exported to /sbin/hotplug.) Let me know if there's any changes that can help you out.

I'll work on adding /sbin/hotplug support for classes later this week, but I don't think your code would need that, correct?

thanks,

greg k-h

#6 lore raw
Quoted 3 lines · Greg KH

With the last patch I just sent to Linus, I think you have everything you need (from the driver core, exported to /sbin/hotplug.) Let me know if there's any changes that can help you out.

Great! I'll be on holidays for the rest of this week, but Cornelia should look if there are any conflicts with what we need to support the 'multiple subchannel devices make up a network device' scheme that our architecture dictates.

On the user space side I still have one patch for modutils to implement modules.ccwmap. I want to be sure that its interface is stable before submitting it, though.

Quoted 2 lines

I'll work on adding /sbin/hotplug support for classes later this week, but I don't think your code would need that, correct?

Not initially, but if the 'single major for all disks' stuff that has been discussed makes it into 2.5, we have to make sure that dasd works with that.
We already have a hotplug implementation for 2.4 dasd that could be ported instead, but a generic solution would be much nicer.

	Arnd <><