[S390] permanent subchannel busy conditions may cause I/O stall
[safe/jmp/linux-2.6] / drivers / s390 / cio / cio.c
index 7376bc8..89320c1 100644 (file)
@@ -1,18 +1,16 @@
 /*
  *  drivers/s390/cio/cio.c
  *   S/390 common I/O routines -- low level i/o calls
- *   $Revision: 1.138 $
  *
  *    Copyright (C) 1999-2002 IBM Deutschland Entwicklung GmbH,
  *                           IBM Corporation
  *    Author(s): Ingo Adlung (adlung@de.ibm.com)
- *              Cornelia Huck (cohuck@de.ibm.com)
+ *              Cornelia Huck (cornelia.huck@de.ibm.com)
  *              Arnd Bergmann (arndb@de.ibm.com)
  *              Martin Schwidefsky (schwidefsky@de.ibm.com)
  */
 
 #include <linux/module.h>
-#include <linux/config.h>
 #include <linux/init.h>
 #include <linux/slab.h>
 #include <linux/device.h>
@@ -68,7 +66,7 @@ cio_debug_init (void)
                goto out_unregister;
        debug_register_view (cio_debug_msg_id, &debug_sprintf_view);
        debug_set_level (cio_debug_msg_id, 2);
-       cio_debug_trace_id = debug_register ("cio_trace", 16, 4, 8);
+       cio_debug_trace_id = debug_register ("cio_trace", 16, 4, 16);
        if (!cio_debug_trace_id)
                goto out_unregister;
        debug_register_view (cio_debug_trace_id, &debug_hex_ascii_view);
@@ -149,7 +147,7 @@ cio_tpi(void)
                sch->driver->irq(&sch->dev);
        spin_unlock(&sch->lock);
        irq_exit ();
-       __local_bh_enable();
+       _local_bh_enable();
        return 1;
 }
 
@@ -521,6 +519,7 @@ cio_validate_subchannel (struct subchannel *sch, struct subchannel_id schid)
        memset(sch, 0, sizeof(struct subchannel));
 
        spin_lock_init(&sch->lock);
+       mutex_init(&sch->reg_mutex);
 
        /* Set a name for the subchannel */
        snprintf (sch->dev.bus_id, BUS_ID_SIZE, "0.%x.%04x", schid.ssid,
@@ -799,7 +798,7 @@ struct subchannel *
 cio_get_console_subchannel(void)
 {
        if (!console_subchannel_in_use)
-               return 0;
+               return NULL;
        return &console_subchannel;
 }
 
@@ -877,5 +876,6 @@ void
 reipl(unsigned long devno)
 {
        clear_all_subchannels();
+       cio_reset_channel_paths();
        do_reipl(devno);
 }