diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2010-10-25 08:36:50 -0700 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2010-10-25 08:36:50 -0700 |
commit | c4a6eb3b7d5b483de331313e7ea38a6891a3447a (patch) | |
tree | de415b67626308b1fa414e47f17959939c017c92 /drivers/s390/cio/device_pgid.c | |
parent | 33081adf8b89d5a716d7e1c60171768d39795b39 (diff) | |
parent | 96f4a70d8eb4d746b19d5b5510407c8ff0d00340 (diff) |
Merge branch 'for-linus' of git://git390.marist.edu/pub/scm/linux-2.6
* 'for-linus' of git://git390.marist.edu/pub/scm/linux-2.6: (48 commits)
[S390] topology: export cpu topology via proc/sysinfo
[S390] topology: move topology sysinfo code
[S390] topology: clean up facility detection
[S390] cleanup facility list handling
[S390] enable ARCH_DMA_ADDR_T_64BIT with 64BIT
[S390] dasd: ignore unsolicited interrupts for DIAG
[S390] kvm: Enable z196 instruction facilities
[S390] dasd: fix unsolicited interrupt recognition
[S390] dasd: fix use after free in dbf
[S390] kvm: Fix badness at include/asm/mmu_context.h:83
[S390] cio: fix I/O cancel function
[S390] topology: change default
[S390] smp: use correct cpu address in print_cpu_info()
[S390] remove ieee_instruction_pointer from thread_struct
[S390] cleanup system call parameter setup
[S390] correct alignment of cpuid structure
[S390] cleanup lowcore access from external interrupts
[S390] cleanup lowcore access from program checks
[S390] pgtable: move pte_mkhuge() from hugetlb.h to pgtable.h
[S390] fix SIGBUS handling
...
Diffstat (limited to 'drivers/s390/cio/device_pgid.c')
-rw-r--r-- | drivers/s390/cio/device_pgid.c | 23 |
1 files changed, 17 insertions, 6 deletions
diff --git a/drivers/s390/cio/device_pgid.c b/drivers/s390/cio/device_pgid.c index 82a5ad0d63f..07a4fd29f09 100644 --- a/drivers/s390/cio/device_pgid.c +++ b/drivers/s390/cio/device_pgid.c @@ -213,6 +213,17 @@ static void spid_start(struct ccw_device *cdev) spid_do(cdev); } +static int pgid_is_reset(struct pgid *p) +{ + char *c; + + for (c = (char *)p + 1; c < (char *)(p + 1); c++) { + if (*c != 0) + return 0; + } + return 1; +} + static int pgid_cmp(struct pgid *p1, struct pgid *p2) { return memcmp((char *) p1 + 1, (char *) p2 + 1, @@ -223,7 +234,7 @@ static int pgid_cmp(struct pgid *p1, struct pgid *p2) * Determine pathgroup state from PGID data. */ static void pgid_analyze(struct ccw_device *cdev, struct pgid **p, - int *mismatch, int *reserved, int *reset) + int *mismatch, int *reserved, u8 *reset) { struct pgid *pgid = &cdev->private->pgid[0]; struct pgid *first = NULL; @@ -238,9 +249,8 @@ static void pgid_analyze(struct ccw_device *cdev, struct pgid **p, continue; if (pgid->inf.ps.state2 == SNID_STATE2_RESVD_ELSE) *reserved = 1; - if (pgid->inf.ps.state1 == SNID_STATE1_RESET) { - /* A PGID was reset. */ - *reset = 1; + if (pgid_is_reset(pgid)) { + *reset |= lpm; continue; } if (!first) { @@ -307,7 +317,7 @@ static void snid_done(struct ccw_device *cdev, int rc) struct pgid *pgid; int mismatch = 0; int reserved = 0; - int reset = 0; + u8 reset = 0; u8 donepm; if (rc) @@ -321,11 +331,12 @@ static void snid_done(struct ccw_device *cdev, int rc) donepm = pgid_to_donepm(cdev); sch->vpm = donepm & sch->opm; cdev->private->pgid_todo_mask &= ~donepm; + cdev->private->pgid_reset_mask |= reset; pgid_fill(cdev, pgid); } out: CIO_MSG_EVENT(2, "snid: device 0.%x.%04x: rc=%d pvm=%02x vpm=%02x " - "todo=%02x mism=%d rsvd=%d reset=%d\n", id->ssid, + "todo=%02x mism=%d rsvd=%d reset=%02x\n", id->ssid, id->devno, rc, cdev->private->pgid_valid_mask, sch->vpm, cdev->private->pgid_todo_mask, mismatch, reserved, reset); switch (rc) { |