]> git.hungrycats.org Git - linux/commitdiff
[PATCH] s390: common i/o layer changes.
authorCornelia Huck <cohuck@de.ibm.com>
Sat, 7 Aug 2004 07:55:13 +0000 (00:55 -0700)
committerLinus Torvalds <torvalds@ppc970.osdl.org>
Sat, 7 Aug 2004 07:55:13 +0000 (00:55 -0700)
common i/o layer changes:
 - Set state of a disconnected device to offline before calling
   ccw_device_online, otherwise the device doesn't come up again.
 - Check for channel end when trying to find out if basic sense
   was successful.
 - Fix error handling in new_channel_path.

Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
drivers/s390/cio/chsc.c
drivers/s390/cio/cio.h
drivers/s390/cio/device_fsm.c
drivers/s390/cio/device_status.c

index e5a9b015874813d9db346c6ad4517b0857fa7247..de60cfd4550a4984c3b85169d68f0f9dddbe6e75 100644 (file)
@@ -1,7 +1,7 @@
 /*
  *  drivers/s390/cio/chsc.c
  *   S/390 common I/O routines -- channel subsystem call
- *   $Revision: 1.114 $
+ *   $Revision: 1.115 $
  *
  *    Copyright (C) 1999-2002 IBM Deutschland Entwicklung GmbH,
  *                           IBM Corporation
@@ -906,8 +906,6 @@ new_channel_path(int chpid)
                return -ENOMEM;
        memset(chp, 0, sizeof(struct channel_path));
 
-       chps[chpid] = chp;
-
        /* fill in status, etc. */
        chp->id = chpid;
        chp->state = 1;
@@ -922,12 +920,17 @@ new_channel_path(int chpid)
        if (ret) {
                printk(KERN_WARNING "%s: could not register %02x\n",
                       __func__, chpid);
-               return ret;
+               goto out_free;
        }
        ret = device_create_file(&chp->dev, &dev_attr_status);
-       if (ret)
+       if (ret) {
                device_unregister(&chp->dev);
-
+               goto out_free;
+       } else
+               chps[chpid] = chp;
+       return ret;
+out_free:
+       kfree(chp);
        return ret;
 }
 
index f653fe5e8629e250cf4d14dfa3c575daba95c63a..8e09ce4b5e536b70c93c9dbf086818ab5a450c13 100644 (file)
@@ -127,10 +127,15 @@ extern int cio_set_options (struct subchannel *, int);
 extern int cio_get_options (struct subchannel *);
 extern int cio_modify (struct subchannel *);
 /* Use with care. */
+#ifdef CONFIG_CCW_CONSOLE
 extern struct subchannel *cio_probe_console(void);
 extern void cio_release_console(void);
 extern int cio_is_console(int irq);
 extern struct subchannel *cio_get_console_subchannel(void);
+#else
+#define cio_is_console(irq) 0
+#define cio_get_console_subchannel() NULL
+#endif
 
 extern int cio_show_msg;
 
index 35e584c454004021912ab1c58fb6e825f8fd5918..6a8db84505b35a52810c0cbce1eb72e05bf2ba85 100644 (file)
@@ -244,6 +244,7 @@ ccw_device_recog_done(struct ccw_device *cdev, int state)
                };
                if (notify) {
                        /* Get device online again. */
+                       cdev->private->state = DEV_STATE_OFFLINE;
                        ccw_device_online(cdev);
                        wake_up(&cdev->private->wait_q);
                        return;
index cf8e573dec7434911feba5f4335f88a8b8635c55..4ab2e0d950097baaef9953c30b0db2888be400c2 100644 (file)
@@ -348,7 +348,8 @@ ccw_device_accumulate_basic_sense(struct ccw_device *cdev, struct irb *irb)
             (irb->scsw.actl & SCSW_ACTL_SUSPENDED)))
                ccw_device_path_notoper(cdev);
 
-       if (!(irb->scsw.dstat & DEV_STAT_UNIT_CHECK)) {
+       if (!(irb->scsw.dstat & DEV_STAT_UNIT_CHECK) &&
+           (irb->scsw.dstat & DEV_STAT_CHN_END)) {
                cdev->private->irb.esw.esw0.erw.cons = 1;
                cdev->private->flags.dosense = 0;
        }