Commit 1371eb54 authored by Cornelia Huck's avatar Cornelia Huck Committed by Linus Torvalds

[PATCH] s390: common i/o layer changes.

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: default avatarMartin Schwidefsky <schwidefsky@de.ibm.com>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent f39dfb58
/* /*
* drivers/s390/cio/chsc.c * drivers/s390/cio/chsc.c
* S/390 common I/O routines -- channel subsystem call * S/390 common I/O routines -- channel subsystem call
* $Revision: 1.114 $ * $Revision: 1.115 $
* *
* Copyright (C) 1999-2002 IBM Deutschland Entwicklung GmbH, * Copyright (C) 1999-2002 IBM Deutschland Entwicklung GmbH,
* IBM Corporation * IBM Corporation
...@@ -906,8 +906,6 @@ new_channel_path(int chpid) ...@@ -906,8 +906,6 @@ new_channel_path(int chpid)
return -ENOMEM; return -ENOMEM;
memset(chp, 0, sizeof(struct channel_path)); memset(chp, 0, sizeof(struct channel_path));
chps[chpid] = chp;
/* fill in status, etc. */ /* fill in status, etc. */
chp->id = chpid; chp->id = chpid;
chp->state = 1; chp->state = 1;
...@@ -922,12 +920,17 @@ new_channel_path(int chpid) ...@@ -922,12 +920,17 @@ new_channel_path(int chpid)
if (ret) { if (ret) {
printk(KERN_WARNING "%s: could not register %02x\n", printk(KERN_WARNING "%s: could not register %02x\n",
__func__, chpid); __func__, chpid);
return ret; goto out_free;
} }
ret = device_create_file(&chp->dev, &dev_attr_status); ret = device_create_file(&chp->dev, &dev_attr_status);
if (ret) if (ret) {
device_unregister(&chp->dev); device_unregister(&chp->dev);
goto out_free;
} else
chps[chpid] = chp;
return ret;
out_free:
kfree(chp);
return ret; return ret;
} }
......
...@@ -127,10 +127,15 @@ extern int cio_set_options (struct subchannel *, int); ...@@ -127,10 +127,15 @@ extern int cio_set_options (struct subchannel *, int);
extern int cio_get_options (struct subchannel *); extern int cio_get_options (struct subchannel *);
extern int cio_modify (struct subchannel *); extern int cio_modify (struct subchannel *);
/* Use with care. */ /* Use with care. */
#ifdef CONFIG_CCW_CONSOLE
extern struct subchannel *cio_probe_console(void); extern struct subchannel *cio_probe_console(void);
extern void cio_release_console(void); extern void cio_release_console(void);
extern int cio_is_console(int irq); extern int cio_is_console(int irq);
extern struct subchannel *cio_get_console_subchannel(void); 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; extern int cio_show_msg;
......
...@@ -244,6 +244,7 @@ ccw_device_recog_done(struct ccw_device *cdev, int state) ...@@ -244,6 +244,7 @@ ccw_device_recog_done(struct ccw_device *cdev, int state)
}; };
if (notify) { if (notify) {
/* Get device online again. */ /* Get device online again. */
cdev->private->state = DEV_STATE_OFFLINE;
ccw_device_online(cdev); ccw_device_online(cdev);
wake_up(&cdev->private->wait_q); wake_up(&cdev->private->wait_q);
return; return;
......
...@@ -348,7 +348,8 @@ ccw_device_accumulate_basic_sense(struct ccw_device *cdev, struct irb *irb) ...@@ -348,7 +348,8 @@ ccw_device_accumulate_basic_sense(struct ccw_device *cdev, struct irb *irb)
(irb->scsw.actl & SCSW_ACTL_SUSPENDED))) (irb->scsw.actl & SCSW_ACTL_SUSPENDED)))
ccw_device_path_notoper(cdev); 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->irb.esw.esw0.erw.cons = 1;
cdev->private->flags.dosense = 0; cdev->private->flags.dosense = 0;
} }
......
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