aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/s390/cio/device_ops.c
diff options
context:
space:
mode:
authorPeter Oberparleiter <peter.oberparleiter@de.ibm.com>2009-12-07 06:51:30 -0500
committerMartin Schwidefsky <sky@mschwide.boeblingen.de.ibm.com>2009-12-07 06:51:31 -0500
commit454e1fa1ebae7cff707b2e3f12b775c263c8408b (patch)
treeeab290fcacd6faaf7e01e3a637cb9678bb367c66 /drivers/s390/cio/device_ops.c
parent4257aaecffab77bad43e12057f56a5590b360f9f (diff)
[S390] cio: split PGID settings and status
Split setting (driver wants feature enabled) and status (feature setup was successful) for PGID related ccw device features so that setup errors can be detected. Previously, incorrectly handled setup errors could in rare cases lead to erratic I/O behavior and permanently unusuable devices. Signed-off-by: Peter Oberparleiter <peter.oberparleiter@de.ibm.com> Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Diffstat (limited to 'drivers/s390/cio/device_ops.c')
-rw-r--r--drivers/s390/cio/device_ops.c27
1 files changed, 27 insertions, 0 deletions
diff --git a/drivers/s390/cio/device_ops.c b/drivers/s390/cio/device_ops.c
index 5ab90ec42318..d4be16acebe4 100644
--- a/drivers/s390/cio/device_ops.c
+++ b/drivers/s390/cio/device_ops.c
@@ -46,6 +46,7 @@ int ccw_device_set_options_mask(struct ccw_device *cdev, unsigned long flags)
46 cdev->private->options.repall = (flags & CCWDEV_REPORT_ALL) != 0; 46 cdev->private->options.repall = (flags & CCWDEV_REPORT_ALL) != 0;
47 cdev->private->options.pgroup = (flags & CCWDEV_DO_PATHGROUP) != 0; 47 cdev->private->options.pgroup = (flags & CCWDEV_DO_PATHGROUP) != 0;
48 cdev->private->options.force = (flags & CCWDEV_ALLOW_FORCE) != 0; 48 cdev->private->options.force = (flags & CCWDEV_ALLOW_FORCE) != 0;
49 cdev->private->options.mpath = (flags & CCWDEV_DO_MULTIPATH) != 0;
49 return 0; 50 return 0;
50} 51}
51 52
@@ -74,6 +75,7 @@ int ccw_device_set_options(struct ccw_device *cdev, unsigned long flags)
74 cdev->private->options.repall |= (flags & CCWDEV_REPORT_ALL) != 0; 75 cdev->private->options.repall |= (flags & CCWDEV_REPORT_ALL) != 0;
75 cdev->private->options.pgroup |= (flags & CCWDEV_DO_PATHGROUP) != 0; 76 cdev->private->options.pgroup |= (flags & CCWDEV_DO_PATHGROUP) != 0;
76 cdev->private->options.force |= (flags & CCWDEV_ALLOW_FORCE) != 0; 77 cdev->private->options.force |= (flags & CCWDEV_ALLOW_FORCE) != 0;
78 cdev->private->options.mpath |= (flags & CCWDEV_DO_MULTIPATH) != 0;
77 return 0; 79 return 0;
78} 80}
79 81
@@ -90,9 +92,34 @@ void ccw_device_clear_options(struct ccw_device *cdev, unsigned long flags)
90 cdev->private->options.repall &= (flags & CCWDEV_REPORT_ALL) == 0; 92 cdev->private->options.repall &= (flags & CCWDEV_REPORT_ALL) == 0;
91 cdev->private->options.pgroup &= (flags & CCWDEV_DO_PATHGROUP) == 0; 93 cdev->private->options.pgroup &= (flags & CCWDEV_DO_PATHGROUP) == 0;
92 cdev->private->options.force &= (flags & CCWDEV_ALLOW_FORCE) == 0; 94 cdev->private->options.force &= (flags & CCWDEV_ALLOW_FORCE) == 0;
95 cdev->private->options.mpath &= (flags & CCWDEV_DO_MULTIPATH) == 0;
93} 96}
94 97
95/** 98/**
99 * ccw_device_is_pathgroup - determine if paths to this device are grouped
100 * @cdev: ccw device
101 *
102 * Return non-zero if there is a path group, zero otherwise.
103 */
104int ccw_device_is_pathgroup(struct ccw_device *cdev)
105{
106 return cdev->private->flags.pgroup;
107}
108EXPORT_SYMBOL(ccw_device_is_pathgroup);
109
110/**
111 * ccw_device_is_multipath - determine if device is operating in multipath mode
112 * @cdev: ccw device
113 *
114 * Return non-zero if device is operating in multipath mode, zero otherwise.
115 */
116int ccw_device_is_multipath(struct ccw_device *cdev)
117{
118 return cdev->private->flags.mpath;
119}
120EXPORT_SYMBOL(ccw_device_is_multipath);
121
122/**
96 * ccw_device_clear() - terminate I/O request processing 123 * ccw_device_clear() - terminate I/O request processing
97 * @cdev: target ccw device 124 * @cdev: target ccw device
98 * @intparm: interruption parameter; value is only used if no I/O is 125 * @intparm: interruption parameter; value is only used if no I/O is