diff options
Diffstat (limited to 'drivers/s390/cio/device_ops.c')
-rw-r--r-- | drivers/s390/cio/device_ops.c | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/drivers/s390/cio/device_ops.c b/drivers/s390/cio/device_ops.c index 9e3de0bd59b5..93a897eebfff 100644 --- a/drivers/s390/cio/device_ops.c +++ b/drivers/s390/cio/device_ops.c | |||
@@ -96,6 +96,12 @@ ccw_device_start_key(struct ccw_device *cdev, struct ccw1 *cpa, | |||
96 | ret = cio_set_options (sch, flags); | 96 | ret = cio_set_options (sch, flags); |
97 | if (ret) | 97 | if (ret) |
98 | return ret; | 98 | return ret; |
99 | /* Adjust requested path mask to excluded varied off paths. */ | ||
100 | if (lpm) { | ||
101 | lpm &= sch->opm; | ||
102 | if (lpm == 0) | ||
103 | return -EACCES; | ||
104 | } | ||
99 | ret = cio_start_key (sch, cpa, lpm, key); | 105 | ret = cio_start_key (sch, cpa, lpm, key); |
100 | if (ret == 0) | 106 | if (ret == 0) |
101 | cdev->private->intparm = intparm; | 107 | cdev->private->intparm = intparm; |
@@ -250,7 +256,7 @@ ccw_device_get_path_mask(struct ccw_device *cdev) | |||
250 | if (!sch) | 256 | if (!sch) |
251 | return 0; | 257 | return 0; |
252 | else | 258 | else |
253 | return sch->vpm; | 259 | return sch->lpm; |
254 | } | 260 | } |
255 | 261 | ||
256 | static void | 262 | static void |
@@ -304,7 +310,7 @@ __ccw_device_retry_loop(struct ccw_device *cdev, struct ccw1 *ccw, long magic, _ | |||
304 | sch = to_subchannel(cdev->dev.parent); | 310 | sch = to_subchannel(cdev->dev.parent); |
305 | do { | 311 | do { |
306 | ret = cio_start (sch, ccw, lpm); | 312 | ret = cio_start (sch, ccw, lpm); |
307 | if ((ret == -EBUSY) || (ret == -EACCES)) { | 313 | if (ret == -EBUSY) { |
308 | /* Try again later. */ | 314 | /* Try again later. */ |
309 | spin_unlock_irq(&sch->lock); | 315 | spin_unlock_irq(&sch->lock); |
310 | msleep(10); | 316 | msleep(10); |
@@ -433,6 +439,13 @@ read_conf_data_lpm (struct ccw_device *cdev, void **buffer, int *length, __u8 lp | |||
433 | if (!ciw || ciw->cmd == 0) | 439 | if (!ciw || ciw->cmd == 0) |
434 | return -EOPNOTSUPP; | 440 | return -EOPNOTSUPP; |
435 | 441 | ||
442 | /* Adjust requested path mask to excluded varied off paths. */ | ||
443 | if (lpm) { | ||
444 | lpm &= sch->opm; | ||
445 | if (lpm == 0) | ||
446 | return -EACCES; | ||
447 | } | ||
448 | |||
436 | rcd_ccw = kzalloc(sizeof(struct ccw1), GFP_KERNEL | GFP_DMA); | 449 | rcd_ccw = kzalloc(sizeof(struct ccw1), GFP_KERNEL | GFP_DMA); |
437 | if (!rcd_ccw) | 450 | if (!rcd_ccw) |
438 | return -ENOMEM; | 451 | return -ENOMEM; |