Commit e0e32c8eba86fd5ea79eefad6f2c0b4988dfd02a

Authored by Peter Oberparleiter
Committed by Martin Schwidefsky
1 parent dd9963f9dd

[S390] cio: update path groups on logical CHPID changes.

CHPIDs that are logically varied off will not be removed from
a CCW device's path group because resign-from-pathgroup command is
issued with invalid path mask of 0 because internal CCW operations
are masked by the logical path mask after the relevant bits are
cleared by the vary operation.
Do not apply logical path mask to internal operations.

Signed-off-by: Peter Oberparleiter <peter.oberparleiter@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>

Showing 2 changed files with 15 additions and 2 deletions Side-by-side Diff

drivers/s390/cio/cio.c
... ... @@ -191,7 +191,7 @@
191 191 sch->orb.pfch = sch->options.prefetch == 0;
192 192 sch->orb.spnd = sch->options.suspend;
193 193 sch->orb.ssic = sch->options.suspend && sch->options.inter;
194   - sch->orb.lpm = (lpm != 0) ? (lpm & sch->opm) : sch->lpm;
  194 + sch->orb.lpm = (lpm != 0) ? lpm : sch->lpm;
195 195 #ifdef CONFIG_64BIT
196 196 /*
197 197 * for 64 bit we always support 64 bit IDAWs with 4k page size only
drivers/s390/cio/device_ops.c
... ... @@ -96,6 +96,12 @@
96 96 ret = cio_set_options (sch, flags);
97 97 if (ret)
98 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 105 ret = cio_start_key (sch, cpa, lpm, key);
100 106 if (ret == 0)
101 107 cdev->private->intparm = intparm;
... ... @@ -304,7 +310,7 @@
304 310 sch = to_subchannel(cdev->dev.parent);
305 311 do {
306 312 ret = cio_start (sch, ccw, lpm);
307   - if ((ret == -EBUSY) || (ret == -EACCES)) {
  313 + if (ret == -EBUSY) {
308 314 /* Try again later. */
309 315 spin_unlock_irq(&sch->lock);
310 316 msleep(10);
... ... @@ -432,6 +438,13 @@
432 438 ciw = ccw_device_get_ciw(cdev, CIW_TYPE_RCD);
433 439 if (!ciw || ciw->cmd == 0)
434 440 return -EOPNOTSUPP;
  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 + }
435 448  
436 449 rcd_ccw = kzalloc(sizeof(struct ccw1), GFP_KERNEL | GFP_DMA);
437 450 if (!rcd_ccw)