Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 454e1fa1 authored by Peter Oberparleiter's avatar Peter Oberparleiter Committed by Martin Schwidefsky
Browse files

[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: default avatarPeter Oberparleiter <peter.oberparleiter@de.ibm.com>
Signed-off-by: default avatarMartin Schwidefsky <schwidefsky@de.ibm.com>
parent 4257aaec
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -142,6 +142,8 @@ struct ccw1;
extern int ccw_device_set_options_mask(struct ccw_device *, unsigned long);
extern int ccw_device_set_options(struct ccw_device *, unsigned long);
extern void ccw_device_clear_options(struct ccw_device *, unsigned long);
int ccw_device_is_pathgroup(struct ccw_device *cdev);
int ccw_device_is_multipath(struct ccw_device *cdev);

/* Allow for i/o completion notification after primary interrupt status. */
#define CCWDEV_EARLY_NOTIFICATION	0x0001
@@ -151,6 +153,8 @@ extern void ccw_device_clear_options(struct ccw_device *, unsigned long);
#define CCWDEV_DO_PATHGROUP             0x0004
/* Allow forced onlining of boxed devices. */
#define CCWDEV_ALLOW_FORCE              0x0008
/* Try to use multipath mode. */
#define CCWDEV_DO_MULTIPATH		0x0010

extern int ccw_device_start(struct ccw_device *, struct ccw1 *,
			    unsigned long, __u8, unsigned long);
+0 −7
Original line number Diff line number Diff line
@@ -2208,13 +2208,6 @@ int dasd_generic_probe(struct ccw_device *cdev,
{
	int ret;

	ret = ccw_device_set_options(cdev, CCWDEV_DO_PATHGROUP);
	if (ret) {
		DBF_EVENT(DBF_WARNING,
		       "dasd_generic_probe: could not set ccw-device options "
		       "for %s\n", dev_name(&cdev->dev));
		return ret;
	}
	ret = dasd_add_sysfs_files(cdev);
	if (ret) {
		DBF_EVENT(DBF_WARNING,
+11 −1
Original line number Diff line number Diff line
@@ -86,7 +86,8 @@ dasd_eckd_probe (struct ccw_device *cdev)
	int ret;

	/* set ECKD specific ccw-device options */
	ret = ccw_device_set_options(cdev, CCWDEV_ALLOW_FORCE);
	ret = ccw_device_set_options(cdev, CCWDEV_ALLOW_FORCE |
				     CCWDEV_DO_PATHGROUP | CCWDEV_DO_MULTIPATH);
	if (ret) {
		DBF_EVENT(DBF_WARNING,
		       "dasd_eckd_probe: could not set ccw-device options "
@@ -1090,6 +1091,15 @@ dasd_eckd_check_characteristics(struct dasd_device *device)
	struct dasd_block *block;
	int is_known, rc;

	if (!ccw_device_is_pathgroup(device->cdev)) {
		dev_warn(&device->cdev->dev,
			 "A channel path group could not be established\n");
		return -EIO;
	}
	if (!ccw_device_is_multipath(device->cdev)) {
		dev_info(&device->cdev->dev,
			 "The DASD is not operating in multipath mode\n");
	}
	private = (struct dasd_eckd_private *) device->private;
	if (!private) {
		private = kzalloc(sizeof(*private), GFP_KERNEL | GFP_DMA);
+2 −1
Original line number Diff line number Diff line
@@ -579,7 +579,8 @@ tape_generic_probe(struct ccw_device *cdev)
	device = tape_alloc_device();
	if (IS_ERR(device))
		return -ENODEV;
	ccw_device_set_options(cdev, CCWDEV_DO_PATHGROUP);
	ccw_device_set_options(cdev, CCWDEV_DO_PATHGROUP |
				     CCWDEV_DO_MULTIPATH);
	ret = sysfs_create_group(&cdev->dev.kobj, &tape_attr_group);
	if (ret) {
		tape_put_device(device);
+1 −1
Original line number Diff line number Diff line
@@ -601,7 +601,7 @@ ccw_device_offline(struct ccw_device *cdev)
	if (cdev->private->state != DEV_STATE_ONLINE)
		return -EINVAL;
	/* Are we doing path grouping? */
	if (!cdev->private->options.pgroup) {
	if (!cdev->private->flags.pgroup) {
		/* No, set state offline immediately. */
		ccw_device_done(cdev, DEV_STATE_OFFLINE);
		return 0;
Loading