Commit ebc7ac0f authored by Martin Schwidefsky's avatar Martin Schwidefsky Committed by Linus Torvalds

[PATCH] s390 update (3/27): drivers.

s390 minimal device drivers changes for 2.5.39.
parent 3cefba2a
...@@ -26,7 +26,7 @@ static struct tq_struct ctrlchar_tq; ...@@ -26,7 +26,7 @@ static struct tq_struct ctrlchar_tq;
static void static void
ctrlchar_handle_sysrq(struct tty_struct *tty) { ctrlchar_handle_sysrq(struct tty_struct *tty) {
handle_sysrq(ctrlchar_sysrq_key, NULL, NULL, tty); handle_sysrq(ctrlchar_sysrq_key, NULL, tty);
} }
#endif #endif
......
...@@ -2219,7 +2219,7 @@ hwc_interrupt_handler (struct pt_regs *regs, __u16 code) ...@@ -2219,7 +2219,7 @@ hwc_interrupt_handler (struct pt_regs *regs, __u16 code)
u32 ext_int_param = hwc_ext_int_param (); u32 ext_int_param = hwc_ext_int_param ();
irq_enter (cpu, 0x2401); irq_enter ();
if (hwc_data.flags & HWC_INIT) { if (hwc_data.flags & HWC_INIT) {
...@@ -2240,7 +2240,7 @@ hwc_interrupt_handler (struct pt_regs *regs, __u16 code) ...@@ -2240,7 +2240,7 @@ hwc_interrupt_handler (struct pt_regs *regs, __u16 code)
hwc_do_interrupt (ext_int_param); hwc_do_interrupt (ext_int_param);
spin_unlock (&hwc_data.lock); spin_unlock (&hwc_data.lock);
} }
irq_exit (cpu, 0x2401); irq_exit ();
} }
void void
......
...@@ -978,9 +978,9 @@ do_IRQ (struct pt_regs regs) ...@@ -978,9 +978,9 @@ do_IRQ (struct pt_regs regs)
*/ */
if (tpi_info->adapter_IO == 1 && if (tpi_info->adapter_IO == 1 &&
tpi_info->int_type == IO_INTERRUPT_TYPE) { tpi_info->int_type == IO_INTERRUPT_TYPE) {
irq_enter (cpu, -1); irq_enter ();
do_adapter_IO (tpi_info->intparm); do_adapter_IO (tpi_info->intparm);
irq_exit (cpu, -1); irq_exit ();
} else { } else {
unsigned int irq = tpi_info->irq; unsigned int irq = tpi_info->irq;
...@@ -1001,11 +1001,11 @@ do_IRQ (struct pt_regs regs) ...@@ -1001,11 +1001,11 @@ do_IRQ (struct pt_regs regs)
return; return;
} }
irq_enter (cpu, irq); irq_enter ();
s390irq_spin_lock (irq); s390irq_spin_lock (irq);
s390_process_IRQ (irq); s390_process_IRQ (irq);
s390irq_spin_unlock (irq); s390irq_spin_unlock (irq);
irq_exit (cpu, irq); irq_exit ();
} }
#ifdef CONFIG_FAST_IRQ #ifdef CONFIG_FAST_IRQ
......
/* /*
* drivers/s390/cio/proc.c * drivers/s390/cio/proc.c
* S/390 common I/O routines -- proc file system entries * S/390 common I/O routines -- proc file system entries
* $Revision: 1.4 $ * $Revision: 1.5 $
* *
* Copyright (C) 1999-2002 IBM Deutschland Entwicklung GmbH, * Copyright (C) 1999-2002 IBM Deutschland Entwicklung GmbH,
* IBM Corporation * IBM Corporation
...@@ -17,6 +17,7 @@ ...@@ -17,6 +17,7 @@
#include <linux/config.h> #include <linux/config.h>
#include <linux/init.h> #include <linux/init.h>
#include <linux/proc_fs.h> #include <linux/proc_fs.h>
#include <linux/seq_file.h>
#include <asm/io.h> #include <asm/io.h>
#include <asm/irq.h> #include <asm/irq.h>
...@@ -30,6 +31,31 @@ ...@@ -30,6 +31,31 @@
static int chan_proc_init (void); 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. * Display info on subchannels in /proc/subchannels.
* Adapted from procfs stuff in dasd.c by Cornelia Huck, 02/28/01. * Adapted from procfs stuff in dasd.c by Cornelia Huck, 02/28/01.
...@@ -267,3 +293,9 @@ cio_irq_proc_init (void) ...@@ -267,3 +293,9 @@ cio_irq_proc_init (void)
} }
__initcall (cio_irq_proc_init); __initcall (cio_irq_proc_init);
void
init_irq_proc(void)
{
/* For now, nothing... */
}
...@@ -122,6 +122,16 @@ s390_request_irq (unsigned int irq, ...@@ -122,6 +122,16 @@ s390_request_irq (unsigned int irq,
NULL, irqflags, devname, dev_id); 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 void
s390_free_irq (unsigned int irq, void *dev_id) s390_free_irq (unsigned int irq, void *dev_id)
{ {
...@@ -223,6 +233,15 @@ s390_free_irq (unsigned int irq, void *dev_id) ...@@ -223,6 +233,15 @@ s390_free_irq (unsigned int irq, void *dev_id)
} }
} }
/*
* free_irq wrapper.
*/
void
free_irq(unsigned int irq, void *dev_id)
{
s390_free_irq(irq, dev_id);
}
/* /*
* Enable IRQ by modifying the subchannel * Enable IRQ by modifying the subchannel
*/ */
......
...@@ -208,6 +208,15 @@ s390_init_IRQ (void) ...@@ -208,6 +208,15 @@ s390_init_IRQ (void)
return; return;
} }
/*
* init_IRQ wrapper
*/
void __init
init_IRQ(void)
{
s390_init_IRQ();
}
/* /*
* dummy handler, used during init_IRQ() processing for compatibility only * dummy handler, used during init_IRQ() processing for compatibility only
*/ */
......
...@@ -24,6 +24,7 @@ ...@@ -24,6 +24,7 @@
#include <asm/s390dyn.h> #include <asm/s390dyn.h>
#include <asm/queue.h> #include <asm/queue.h>
#include <linux/kmod.h> #include <linux/kmod.h>
#include <linux/tqueue.h>
#ifndef MIN #ifndef MIN
#define MIN(a,b) ((a<b)?a:b) #define MIN(a,b) ((a<b)?a:b)
#endif #endif
...@@ -2825,6 +2826,7 @@ static void chandev_read_conf(void) ...@@ -2825,6 +2826,7 @@ static void chandev_read_conf(void)
struct stat statbuf; struct stat statbuf;
char *buff; char *buff;
int curr,left,len,fd; int curr,left,len,fd;
mm_segment_t oldfs;
/* if called from chandev_register_and_probe & /* if called from chandev_register_and_probe &
the driver is compiled into the kernel the the driver is compiled into the kernel the
...@@ -2835,6 +2837,7 @@ static void chandev_read_conf(void) ...@@ -2835,6 +2837,7 @@ static void chandev_read_conf(void)
if(in_interrupt()||current->fs->root==NULL) if(in_interrupt()||current->fs->root==NULL)
return; return;
atomic_set(&chandev_conf_read,TRUE); atomic_set(&chandev_conf_read,TRUE);
oldfs = get_fs();
set_fs(KERNEL_DS); set_fs(KERNEL_DS);
if(stat(CHANDEV_FILE,&statbuf)==0) if(stat(CHANDEV_FILE,&statbuf)==0)
{ {
...@@ -2859,7 +2862,7 @@ static void chandev_read_conf(void) ...@@ -2859,7 +2862,7 @@ static void chandev_read_conf(void)
vfree(buff); vfree(buff);
} }
} }
set_fs(USER_DS); set_fs(oldfs);
} }
static void chandev_read_conf_if_necessary(void) static void chandev_read_conf_if_necessary(void)
......
...@@ -49,6 +49,7 @@ ...@@ -49,6 +49,7 @@
#include <linux/interrupt.h> #include <linux/interrupt.h>
#include <linux/timer.h> #include <linux/timer.h>
#include <linux/sched.h> #include <linux/sched.h>
#include <linux/tqueue.h>
#include <linux/signal.h> #include <linux/signal.h>
#include <linux/string.h> #include <linux/string.h>
...@@ -195,7 +196,7 @@ typedef struct { ...@@ -195,7 +196,7 @@ typedef struct {
unsigned long doios_multi; unsigned long doios_multi;
unsigned long txlen; unsigned long txlen;
unsigned long tx_time; unsigned long tx_time;
struct timeval send_stamp; struct timespec send_stamp;
} ctc_profile; } ctc_profile;
/** /**
...@@ -976,10 +977,10 @@ static void ch_action_txdone(fsm_instance *fi, int event, void *arg) ...@@ -976,10 +977,10 @@ static void ch_action_txdone(fsm_instance *fi, int event, void *arg)
int first = 1; int first = 1;
int i; int i;
struct timeval done_stamp = xtime; struct timespec done_stamp = xtime;
unsigned long duration = unsigned long duration =
(done_stamp.tv_sec - ch->prof.send_stamp.tv_sec) * 1000000 + (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) if (duration > ch->prof.tx_time)
ch->prof.tx_time = duration; ch->prof.tx_time = duration;
......
...@@ -596,21 +596,17 @@ ctc_tty_flush_buffer(struct tty_struct *tty) ...@@ -596,21 +596,17 @@ ctc_tty_flush_buffer(struct tty_struct *tty)
ctc_tty_info *info; ctc_tty_info *info;
unsigned long flags; unsigned long flags;
#warning FIXME [kj] Consider using spinlocks. if (!tty)
save_flags(flags);
cli();
if (!tty) {
restore_flags(flags);
return; return;
} spin_lock_irqsave(&ctc_tty_lock, flags);
info = (ctc_tty_info *) tty->driver_data; info = (ctc_tty_info *) tty->driver_data;
if (ctc_tty_paranoia_check(info, tty->device, "ctc_tty_flush_buffer")) { if (ctc_tty_paranoia_check(info, tty->device, "ctc_tty_flush_buffer")) {
restore_flags(flags); spin_unlock_irqrestore(&ctc_tty_lock, flags);
return; return;
} }
skb_queue_purge(&info->tx_queue); skb_queue_purge(&info->tx_queue);
info->lsr |= UART_LSR_TEMT; info->lsr |= UART_LSR_TEMT;
restore_flags(flags); spin_unlock_irqrestore(&ctc_tty_lock, flags);
wake_up_interruptible(&tty->write_wait); wake_up_interruptible(&tty->write_wait);
if ((tty->flags & (1 << TTY_DO_WRITE_WAKEUP)) && if ((tty->flags & (1 << TTY_DO_WRITE_WAKEUP)) &&
tty->ldisc.write_wakeup) tty->ldisc.write_wakeup)
...@@ -689,10 +685,9 @@ ctc_tty_get_lsr_info(ctc_tty_info * info, uint * value) ...@@ -689,10 +685,9 @@ ctc_tty_get_lsr_info(ctc_tty_info * info, uint * value)
uint result; uint result;
ulong flags; ulong flags;
save_flags(flags); spin_lock_irqsave(&ctc_tty_lock, flags);
cli();
status = info->lsr; status = info->lsr;
restore_flags(flags); spin_unlock_irqrestore(&ctc_tty_lock, flags);
result = ((status & UART_LSR_TEMT) ? TIOCSER_TEMT : 0); result = ((status & UART_LSR_TEMT) ? TIOCSER_TEMT : 0);
put_user(result, (uint *) value); put_user(result, (uint *) value);
return 0; return 0;
...@@ -708,10 +703,9 @@ ctc_tty_get_ctc_tty_info(ctc_tty_info * info, uint * value) ...@@ -708,10 +703,9 @@ ctc_tty_get_ctc_tty_info(ctc_tty_info * info, uint * value)
ulong flags; ulong flags;
control = info->mcr; control = info->mcr;
save_flags(flags); spin_lock_irqsave(&ctc_tty_lock, flags);
cli();
status = info->msr; status = info->msr;
restore_flags(flags); spin_unlock_irqrestore(&ctc_tty_lock, flags);
result = ((control & UART_MCR_RTS) ? TIOCM_RTS : 0) result = ((control & UART_MCR_RTS) ? TIOCM_RTS : 0)
| ((control & UART_MCR_DTR) ? TIOCM_DTR : 0) | ((control & UART_MCR_DTR) ? TIOCM_DTR : 0)
| ((status & UART_MSR_DCD) ? TIOCM_CAR : 0) | ((status & UART_MSR_DCD) ? TIOCM_CAR : 0)
...@@ -942,11 +936,10 @@ ctc_tty_block_til_ready(struct tty_struct *tty, struct file *filp, ctc_tty_info ...@@ -942,11 +936,10 @@ ctc_tty_block_til_ready(struct tty_struct *tty, struct file *filp, ctc_tty_info
printk(KERN_DEBUG "ctc_tty_block_til_ready before block: %s%d, count = %d\n", printk(KERN_DEBUG "ctc_tty_block_til_ready before block: %s%d, count = %d\n",
CTC_TTY_NAME, info->line, info->count); CTC_TTY_NAME, info->line, info->count);
#endif #endif
save_flags(flags); spin_lock_irqsave(&ctc_tty_lock, flags);
cli();
if (!(tty_hung_up_p(filp))) if (!(tty_hung_up_p(filp)))
info->count--; info->count--;
restore_flags(flags); spin_unlock_irqrestore(&ctc_tty_lock, flags);
info->blocked_open++; info->blocked_open++;
while (1) { while (1) {
set_current_state(TASK_INTERRUPTIBLE); set_current_state(TASK_INTERRUPTIBLE);
...@@ -1053,16 +1046,14 @@ static void ...@@ -1053,16 +1046,14 @@ static void
ctc_tty_close(struct tty_struct *tty, struct file *filp) ctc_tty_close(struct tty_struct *tty, struct file *filp)
{ {
ctc_tty_info *info = (ctc_tty_info *) tty->driver_data; ctc_tty_info *info = (ctc_tty_info *) tty->driver_data;
unsigned long saveflags;
ulong flags; ulong flags;
ulong timeout; ulong timeout;
if (!info || ctc_tty_paranoia_check(info, tty->device, "ctc_tty_close")) if (!info || ctc_tty_paranoia_check(info, tty->device, "ctc_tty_close"))
return; return;
save_flags(flags); spin_lock_irqsave(&ctc_tty_lock, flags);
cli();
if (tty_hung_up_p(filp)) { if (tty_hung_up_p(filp)) {
restore_flags(flags); spin_unlock_irqrestore(&ctc_tty_lock, flags);
#ifdef CTC_DEBUG_MODEM_OPEN #ifdef CTC_DEBUG_MODEM_OPEN
printk(KERN_DEBUG "ctc_tty_close return after tty_hung_up_p\n"); printk(KERN_DEBUG "ctc_tty_close return after tty_hung_up_p\n");
#endif #endif
...@@ -1086,7 +1077,7 @@ ctc_tty_close(struct tty_struct *tty, struct file *filp) ...@@ -1086,7 +1077,7 @@ ctc_tty_close(struct tty_struct *tty, struct file *filp)
info->count = 0; info->count = 0;
} }
if (info->count) { if (info->count) {
restore_flags(flags); local_irq_restore(flags);
#ifdef CTC_DEBUG_MODEM_OPEN #ifdef CTC_DEBUG_MODEM_OPEN
printk(KERN_DEBUG "ctc_tty_close after info->count != 0\n"); printk(KERN_DEBUG "ctc_tty_close after info->count != 0\n");
#endif #endif
...@@ -1117,7 +1108,9 @@ ctc_tty_close(struct tty_struct *tty, struct file *filp) ...@@ -1117,7 +1108,9 @@ ctc_tty_close(struct tty_struct *tty, struct file *filp)
timeout = jiffies + HZ; timeout = jiffies + HZ;
while (!(info->lsr & UART_LSR_TEMT)) { while (!(info->lsr & UART_LSR_TEMT)) {
set_current_state(TASK_INTERRUPTIBLE); set_current_state(TASK_INTERRUPTIBLE);
spin_unlock_irqrestore(&ctc_tty_lock, flags);
schedule_timeout(20); schedule_timeout(20);
spin_lock_irqsave(&ctc_tty_lock, flags);
if (time_after(jiffies,timeout)) if (time_after(jiffies,timeout))
break; break;
} }
...@@ -1127,9 +1120,7 @@ ctc_tty_close(struct tty_struct *tty, struct file *filp) ...@@ -1127,9 +1120,7 @@ ctc_tty_close(struct tty_struct *tty, struct file *filp)
tty->driver.flush_buffer(tty); tty->driver.flush_buffer(tty);
if (tty->ldisc.flush_buffer) if (tty->ldisc.flush_buffer)
tty->ldisc.flush_buffer(tty); tty->ldisc.flush_buffer(tty);
spin_lock_irqsave(&ctc_tty_lock, saveflags);
info->tty = 0; info->tty = 0;
spin_unlock_irqrestore(&ctc_tty_lock, saveflags);
tty->closing = 0; tty->closing = 0;
if (info->blocked_open) { if (info->blocked_open) {
set_current_state(TASK_INTERRUPTIBLE); set_current_state(TASK_INTERRUPTIBLE);
...@@ -1138,7 +1129,7 @@ ctc_tty_close(struct tty_struct *tty, struct file *filp) ...@@ -1138,7 +1129,7 @@ ctc_tty_close(struct tty_struct *tty, struct file *filp)
} }
info->flags &= ~(CTC_ASYNC_NORMAL_ACTIVE | CTC_ASYNC_CLOSING); info->flags &= ~(CTC_ASYNC_NORMAL_ACTIVE | CTC_ASYNC_CLOSING);
wake_up_interruptible(&info->close_wait); wake_up_interruptible(&info->close_wait);
restore_flags(flags); spin_unlock_irqrestore(&ctc_tty_lock, flags);
#ifdef CTC_DEBUG_MODEM_OPEN #ifdef CTC_DEBUG_MODEM_OPEN
printk(KERN_DEBUG "ctc_tty_close normal exit\n"); printk(KERN_DEBUG "ctc_tty_close normal exit\n");
#endif #endif
......
...@@ -302,7 +302,7 @@ iucv_dumpit(char *title, void *buf, int len) ...@@ -302,7 +302,7 @@ iucv_dumpit(char *title, void *buf, int len)
if (debuglevel < 3) if (debuglevel < 3)
return; return;
printk(KERN_DEBUG __FUNCTION__ ": %s\n", title); printk(KERN_DEBUG "%s\n", title);
printk(" "); printk(" ");
for (i = 0; i < len; i++) { for (i = 0; i < len; i++) {
if (!(i % 16) && i != 0) if (!(i % 16) && i != 0)
...@@ -318,7 +318,7 @@ iucv_dumpit(char *title, void *buf, int len) ...@@ -318,7 +318,7 @@ iucv_dumpit(char *title, void *buf, int len)
#define iucv_debug(lvl, fmt, args...) \ #define iucv_debug(lvl, fmt, args...) \
do { \ do { \
if (debuglevel >= lvl) \ if (debuglevel >= lvl) \
printk(KERN_DEBUG __FUNCTION__ ": " fmt "\n" , ## args); \ printk(KERN_DEBUG "%s: " fmt "\n", __FUNCTION__ , ## args); \
} while (0) } while (0)
#else #else
...@@ -2183,14 +2183,13 @@ static void ...@@ -2183,14 +2183,13 @@ static void
iucv_irq_handler(struct pt_regs *regs, __u16 code) iucv_irq_handler(struct pt_regs *regs, __u16 code)
{ {
iucv_irqdata *irqdata; iucv_irqdata *irqdata;
int cpu = smp_processor_id();
irq_enter(cpu, 0x4000); irq_enter();
irqdata = kmalloc(sizeof(iucv_irqdata), GFP_ATOMIC); irqdata = kmalloc(sizeof(iucv_irqdata), GFP_ATOMIC);
if (!irqdata) { if (!irqdata) {
printk(KERN_WARNING "%s: out of memory\n", __FUNCTION__); printk(KERN_WARNING "%s: out of memory\n", __FUNCTION__);
irq_exit(cpu, 0x4000); irq_exit();
return; return;
} }
...@@ -2206,7 +2205,7 @@ iucv_irq_handler(struct pt_regs *regs, __u16 code) ...@@ -2206,7 +2205,7 @@ iucv_irq_handler(struct pt_regs *regs, __u16 code)
mark_bh(IMMEDIATE_BH); mark_bh(IMMEDIATE_BH);
} }
irq_exit(cpu, 0x4000); irq_exit();
return; return;
} }
......
...@@ -126,6 +126,7 @@ whether it is should wake up a process currently issuing lan commands. ...@@ -126,6 +126,7 @@ whether it is should wake up a process currently issuing lan commands.
#include <linux/sched.h> #include <linux/sched.h>
#include <linux/errno.h> #include <linux/errno.h>
#include <linux/init.h> #include <linux/init.h>
#include <linux/tqueue.h>
#include <asm/system.h> #include <asm/system.h>
#include <asm/io.h> #include <asm/io.h>
#include <asm/irq.h> #include <asm/irq.h>
......
...@@ -88,7 +88,7 @@ typedef struct connection_profile_t { ...@@ -88,7 +88,7 @@ typedef struct connection_profile_t {
unsigned long doios_multi; unsigned long doios_multi;
unsigned long txlen; unsigned long txlen;
unsigned long tx_time; unsigned long tx_time;
struct timeval send_stamp; struct timespec send_stamp;
} connection_profile; } connection_profile;
/** /**
......
...@@ -245,26 +245,21 @@ static __inline__ int atomic_return_add (int i, atomic_t *v) ...@@ -245,26 +245,21 @@ static __inline__ int atomic_return_add (int i, atomic_t *v)
static void qdio_wait_nonbusy(unsigned int timeout) static void qdio_wait_nonbusy(unsigned int timeout)
{ {
unsigned int start; unsigned int start;
unsigned long flags;
char dbf_text[15]; char dbf_text[15];
sprintf(dbf_text,"wtnb%4x",timeout); sprintf(dbf_text,"wtnb%4x",timeout);
QDIO_DBF_TEXT3(0,trace,dbf_text); QDIO_DBF_TEXT3(0,trace,dbf_text);
start=qdio_get_millis(); start=qdio_get_millis();
save_flags(flags); cli();
for (;;) { for (;;) {
set_task_state(current,TASK_INTERRUPTIBLE); set_task_state(current,TASK_INTERRUPTIBLE);
if (qdio_get_millis()-start>timeout) { if (qdio_get_millis()-start>timeout) {
goto out; goto out;
} }
restore_flags(flags);
schedule_timeout(((start+timeout-qdio_get_millis())>>10)*HZ); schedule_timeout(((start+timeout-qdio_get_millis())>>10)*HZ);
save_flags(flags); cli();
} }
out: out:
set_task_state(current,TASK_RUNNING); set_task_state(current,TASK_RUNNING);
restore_flags(flags);
} }
static int qdio_wait_for_no_use_count(atomic_t *use_count) static int qdio_wait_for_no_use_count(atomic_t *use_count)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment