diff options
author | Ralph Campbell <ralph.campbell@qlogic.com> | 2008-01-07 00:12:38 -0500 |
---|---|---|
committer | Roland Dreier <rolandd@cisco.com> | 2008-01-25 17:15:39 -0500 |
commit | 4ea61b548bc93fb87cec6f52059851076e2ff54d (patch) | |
tree | b48ddf0865c393b2245dbb131098901f6cc3f318 /drivers/infiniband/hw | |
parent | 60948a415859cb859e24f0dfe739069d66577466 (diff) |
IB/ipath: Add flag and handling for chips with swapped register bug
The 6110 had a bug that caused some registers to be swapped; it was
fixed for the 7220 (and didn't affect the 6120 because it had fewer
registers). This adds a flag and related code to handle that, and
includes some minor cleanups in the same area.
Signed-off-by: Ralph Campbell <ralph.campbell@qlogic.com>
Diffstat (limited to 'drivers/infiniband/hw')
-rw-r--r-- | drivers/infiniband/hw/ipath/ipath_driver.c | 11 | ||||
-rw-r--r-- | drivers/infiniband/hw/ipath/ipath_iba6110.c | 2 | ||||
-rw-r--r-- | drivers/infiniband/hw/ipath/ipath_init_chip.c | 8 | ||||
-rw-r--r-- | drivers/infiniband/hw/ipath/ipath_intr.c | 4 | ||||
-rw-r--r-- | drivers/infiniband/hw/ipath/ipath_kernel.h | 1 |
5 files changed, 10 insertions, 16 deletions
diff --git a/drivers/infiniband/hw/ipath/ipath_driver.c b/drivers/infiniband/hw/ipath/ipath_driver.c index f130652cfaa3..5a9dc317f40a 100644 --- a/drivers/infiniband/hw/ipath/ipath_driver.c +++ b/drivers/infiniband/hw/ipath/ipath_driver.c | |||
@@ -1340,14 +1340,9 @@ static void ipath_update_pio_bufs(struct ipath_devdata *dd) | |||
1340 | /* | 1340 | /* |
1341 | * Chip Errata: bug 6641; even and odd qwords>3 are swapped | 1341 | * Chip Errata: bug 6641; even and odd qwords>3 are swapped |
1342 | */ | 1342 | */ |
1343 | if (i > 3) { | 1343 | if (i > 3 && (dd->ipath_flags & IPATH_SWAP_PIOBUFS)) |
1344 | if (i & 1) | 1344 | piov = le64_to_cpu(dd->ipath_pioavailregs_dma[i ^ 1]); |
1345 | piov = le64_to_cpu( | 1345 | else |
1346 | dd->ipath_pioavailregs_dma[i - 1]); | ||
1347 | else | ||
1348 | piov = le64_to_cpu( | ||
1349 | dd->ipath_pioavailregs_dma[i + 1]); | ||
1350 | } else | ||
1351 | piov = le64_to_cpu(dd->ipath_pioavailregs_dma[i]); | 1346 | piov = le64_to_cpu(dd->ipath_pioavailregs_dma[i]); |
1352 | pchg = _IPATH_ALL_CHECKBITS & | 1347 | pchg = _IPATH_ALL_CHECKBITS & |
1353 | ~(dd->ipath_pioavailshadow[i] ^ piov); | 1348 | ~(dd->ipath_pioavailshadow[i] ^ piov); |
diff --git a/drivers/infiniband/hw/ipath/ipath_iba6110.c b/drivers/infiniband/hw/ipath/ipath_iba6110.c index 0c900c51e538..3bfaf04a2148 100644 --- a/drivers/infiniband/hw/ipath/ipath_iba6110.c +++ b/drivers/infiniband/hw/ipath/ipath_iba6110.c | |||
@@ -1043,6 +1043,8 @@ static int ipath_setup_ht_config(struct ipath_devdata *dd, | |||
1043 | } while ((pos = pci_find_next_capability(pdev, pos, | 1043 | } while ((pos = pci_find_next_capability(pdev, pos, |
1044 | PCI_CAP_ID_HT))); | 1044 | PCI_CAP_ID_HT))); |
1045 | 1045 | ||
1046 | dd->ipath_flags |= IPATH_SWAP_PIOBUFS; | ||
1047 | |||
1046 | bail: | 1048 | bail: |
1047 | return ret; | 1049 | return ret; |
1048 | } | 1050 | } |
diff --git a/drivers/infiniband/hw/ipath/ipath_init_chip.c b/drivers/infiniband/hw/ipath/ipath_init_chip.c index 3174c315999b..4471674975cd 100644 --- a/drivers/infiniband/hw/ipath/ipath_init_chip.c +++ b/drivers/infiniband/hw/ipath/ipath_init_chip.c | |||
@@ -528,12 +528,8 @@ static void enable_chip(struct ipath_devdata *dd, | |||
528 | /* | 528 | /* |
529 | * Chip Errata bug 6641; even and odd qwords>3 are swapped. | 529 | * Chip Errata bug 6641; even and odd qwords>3 are swapped. |
530 | */ | 530 | */ |
531 | if (i > 3) { | 531 | if (i > 3 && (dd->ipath_flags & IPATH_SWAP_PIOBUFS)) |
532 | if (i & 1) | 532 | val = dd->ipath_pioavailregs_dma[i ^ 1]; |
533 | val = dd->ipath_pioavailregs_dma[i - 1]; | ||
534 | else | ||
535 | val = dd->ipath_pioavailregs_dma[i + 1]; | ||
536 | } | ||
537 | else | 533 | else |
538 | val = dd->ipath_pioavailregs_dma[i]; | 534 | val = dd->ipath_pioavailregs_dma[i]; |
539 | dd->ipath_pioavailshadow[i] = le64_to_cpu(val); | 535 | dd->ipath_pioavailshadow[i] = le64_to_cpu(val); |
diff --git a/drivers/infiniband/hw/ipath/ipath_intr.c b/drivers/infiniband/hw/ipath/ipath_intr.c index e2ce5314504d..ddc0a19c5eee 100644 --- a/drivers/infiniband/hw/ipath/ipath_intr.c +++ b/drivers/infiniband/hw/ipath/ipath_intr.c | |||
@@ -831,8 +831,8 @@ void ipath_clear_freeze(struct ipath_devdata *dd) | |||
831 | */ | 831 | */ |
832 | for (i = 0; i < dd->ipath_pioavregs; i++) { | 832 | for (i = 0; i < dd->ipath_pioavregs; i++) { |
833 | /* deal with 6110 chip bug */ | 833 | /* deal with 6110 chip bug */ |
834 | im = i > 3 ? ((i&1) ? i-1 : i+1) : i; | 834 | im = i > 3 ? i ^ 1 : i; |
835 | val = ipath_read_kreg64(dd, (0x1000/sizeof(u64))+im); | 835 | val = ipath_read_kreg64(dd, (0x1000 / sizeof(u64)) + im); |
836 | dd->ipath_pioavailregs_dma[i] = dd->ipath_pioavailshadow[i] | 836 | dd->ipath_pioavailregs_dma[i] = dd->ipath_pioavailshadow[i] |
837 | = le64_to_cpu(val); | 837 | = le64_to_cpu(val); |
838 | } | 838 | } |
diff --git a/drivers/infiniband/hw/ipath/ipath_kernel.h b/drivers/infiniband/hw/ipath/ipath_kernel.h index b9cca8403239..e07df0068312 100644 --- a/drivers/infiniband/hw/ipath/ipath_kernel.h +++ b/drivers/infiniband/hw/ipath/ipath_kernel.h | |||
@@ -756,6 +756,7 @@ int ipath_set_rx_pol_inv(struct ipath_devdata *dd, u8 new_pol_inv); | |||
756 | #define IPATH_DISABLED 0x80000 /* administratively disabled */ | 756 | #define IPATH_DISABLED 0x80000 /* administratively disabled */ |
757 | /* Use GPIO interrupts for new counters */ | 757 | /* Use GPIO interrupts for new counters */ |
758 | #define IPATH_GPIO_ERRINTRS 0x100000 | 758 | #define IPATH_GPIO_ERRINTRS 0x100000 |
759 | #define IPATH_SWAP_PIOBUFS 0x200000 | ||
759 | 760 | ||
760 | /* Bits in GPIO for the added interrupts */ | 761 | /* Bits in GPIO for the added interrupts */ |
761 | #define IPATH_GPIO_PORT0_BIT 2 | 762 | #define IPATH_GPIO_PORT0_BIT 2 |