aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/infiniband
diff options
context:
space:
mode:
authorDave Olson <dave.olson@qlogic.com>2007-07-20 16:34:02 -0400
committerRoland Dreier <rolandd@cisco.com>2007-07-30 16:16:46 -0400
commitcf5b60aa4098a1ba169a8f69eb576ac02194bea6 (patch)
tree8cd46c782a6d65bab7abaa5b5e834a4c3dbdaa85 /drivers/infiniband
parentf17fddc9e266281bbb4d384b031e1521e1f2510e (diff)
IB/ipath: Use faster put_tid_2 routine after initialization
At one time the ipath_minrev field was initialized prior to the ipath_init_iba6120_funcs call, but that is no longer the case, so the slower put_tid routine was always being used. Signed-off-by: Dave Olson <dave.olson@qlogic.com> Signed-off-by: Roland Dreier <rolandd@cisco.com>
Diffstat (limited to 'drivers/infiniband')
-rw-r--r--drivers/infiniband/hw/ipath/ipath_iba6120.c20
1 files changed, 13 insertions, 7 deletions
diff --git a/drivers/infiniband/hw/ipath/ipath_iba6120.c b/drivers/infiniband/hw/ipath/ipath_iba6120.c
index 9868ccda5f26..5b6ac9a1a709 100644
--- a/drivers/infiniband/hw/ipath/ipath_iba6120.c
+++ b/drivers/infiniband/hw/ipath/ipath_iba6120.c
@@ -321,6 +321,8 @@ static const struct ipath_hwerror_msgs ipath_6120_hwerror_msgs[] = {
321 << INFINIPATH_HWE_TXEMEMPARITYERR_SHIFT) 321 << INFINIPATH_HWE_TXEMEMPARITYERR_SHIFT)
322 322
323static int ipath_pe_txe_recover(struct ipath_devdata *); 323static int ipath_pe_txe_recover(struct ipath_devdata *);
324static void ipath_pe_put_tid_2(struct ipath_devdata *, u64 __iomem *,
325 u32, unsigned long);
324 326
325/** 327/**
326 * ipath_pe_handle_hwerrors - display hardware errors. 328 * ipath_pe_handle_hwerrors - display hardware errors.
@@ -555,8 +557,11 @@ static int ipath_pe_boardname(struct ipath_devdata *dd, char *name,
555 ipath_dev_err(dd, "Unsupported InfiniPath hardware revision %u.%u!\n", 557 ipath_dev_err(dd, "Unsupported InfiniPath hardware revision %u.%u!\n",
556 dd->ipath_majrev, dd->ipath_minrev); 558 dd->ipath_majrev, dd->ipath_minrev);
557 ret = 1; 559 ret = 1;
558 } else 560 } else {
559 ret = 0; 561 ret = 0;
562 if (dd->ipath_minrev >= 2)
563 dd->ipath_f_put_tid = ipath_pe_put_tid_2;
564 }
560 565
561 return ret; 566 return ret;
562} 567}
@@ -1220,7 +1225,7 @@ static void ipath_pe_clear_tids(struct ipath_devdata *dd, unsigned port)
1220 port * dd->ipath_rcvtidcnt * sizeof(*tidbase)); 1225 port * dd->ipath_rcvtidcnt * sizeof(*tidbase));
1221 1226
1222 for (i = 0; i < dd->ipath_rcvtidcnt; i++) 1227 for (i = 0; i < dd->ipath_rcvtidcnt; i++)
1223 ipath_pe_put_tid(dd, &tidbase[i], RCVHQ_RCV_TYPE_EXPECTED, 1228 dd->ipath_f_put_tid(dd, &tidbase[i], RCVHQ_RCV_TYPE_EXPECTED,
1224 tidinv); 1229 tidinv);
1225 1230
1226 tidbase = (u64 __iomem *) 1231 tidbase = (u64 __iomem *)
@@ -1229,7 +1234,7 @@ static void ipath_pe_clear_tids(struct ipath_devdata *dd, unsigned port)
1229 port * dd->ipath_rcvegrcnt * sizeof(*tidbase)); 1234 port * dd->ipath_rcvegrcnt * sizeof(*tidbase));
1230 1235
1231 for (i = 0; i < dd->ipath_rcvegrcnt; i++) 1236 for (i = 0; i < dd->ipath_rcvegrcnt; i++)
1232 ipath_pe_put_tid(dd, &tidbase[i], RCVHQ_RCV_TYPE_EAGER, 1237 dd->ipath_f_put_tid(dd, &tidbase[i], RCVHQ_RCV_TYPE_EAGER,
1233 tidinv); 1238 tidinv);
1234} 1239}
1235 1240
@@ -1395,10 +1400,11 @@ void ipath_init_iba6120_funcs(struct ipath_devdata *dd)
1395 dd->ipath_f_quiet_serdes = ipath_pe_quiet_serdes; 1400 dd->ipath_f_quiet_serdes = ipath_pe_quiet_serdes;
1396 dd->ipath_f_bringup_serdes = ipath_pe_bringup_serdes; 1401 dd->ipath_f_bringup_serdes = ipath_pe_bringup_serdes;
1397 dd->ipath_f_clear_tids = ipath_pe_clear_tids; 1402 dd->ipath_f_clear_tids = ipath_pe_clear_tids;
1398 if (dd->ipath_minrev >= 2) 1403 /*
1399 dd->ipath_f_put_tid = ipath_pe_put_tid_2; 1404 * this may get changed after we read the chip revision,
1400 else 1405 * but we start with the safe version for all revs
1401 dd->ipath_f_put_tid = ipath_pe_put_tid; 1406 */
1407 dd->ipath_f_put_tid = ipath_pe_put_tid;
1402 dd->ipath_f_cleanup = ipath_setup_pe_cleanup; 1408 dd->ipath_f_cleanup = ipath_setup_pe_cleanup;
1403 dd->ipath_f_setextled = ipath_setup_pe_setextled; 1409 dd->ipath_f_setextled = ipath_setup_pe_setextled;
1404 dd->ipath_f_get_base_info = ipath_pe_get_base_info; 1410 dd->ipath_f_get_base_info = ipath_pe_get_base_info;