Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 88524
b: refs/heads/master
c: b3e8f54
h: refs/heads/master
v: v3
  • Loading branch information
Dave Olson authored and Roland Dreier committed Apr 17, 2008
1 parent 9533dd2 commit c3a517e
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 4 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 555b203e48faeacc0373eda7bc87db874db37136
refs/heads/master: b3e8f541072ec688738abf8de4ef158127a6b5f2
2 changes: 2 additions & 0 deletions trunk/drivers/infiniband/hw/ipath/ipath_common.h
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,8 @@
#define IPATH_IB_LINKDOWN_DISABLE 5
#define IPATH_IB_LINK_LOOPBACK 6 /* enable local loopback */
#define IPATH_IB_LINK_EXTERNAL 7 /* normal, disable local loopback */
#define IPATH_IB_LINK_NO_HRTBT 8 /* disable Heartbeat, e.g. for loopback */
#define IPATH_IB_LINK_HRTBT 9 /* enable heartbeat, normal, non-loopback */

/*
* These 3 values (SDR and DDR may be ORed for auto-speed
Expand Down
31 changes: 28 additions & 3 deletions trunk/drivers/infiniband/hw/ipath/ipath_driver.c
Original file line number Diff line number Diff line change
Expand Up @@ -1880,16 +1880,41 @@ int ipath_set_linkstate(struct ipath_devdata *dd, u8 newstate)
dd->ipath_ibcctrl |= INFINIPATH_IBCC_LOOPBACK;
ipath_write_kreg(dd, dd->ipath_kregs->kr_ibcctrl,
dd->ipath_ibcctrl);

/* turn heartbeat off, as it causes loopback to fail */
dd->ipath_f_set_ib_cfg(dd, IPATH_IB_CFG_HRTBT,
IPATH_IB_HRTBT_OFF);
/* don't wait */
ret = 0;
goto bail; // no state change to wait for
goto bail;

case IPATH_IB_LINK_EXTERNAL:
dev_info(&dd->pcidev->dev, "Disabling IB local loopback (normal)\n");
dev_info(&dd->pcidev->dev,
"Disabling IB local loopback (normal)\n");
dd->ipath_f_set_ib_cfg(dd, IPATH_IB_CFG_HRTBT,
IPATH_IB_HRTBT_ON);
dd->ipath_ibcctrl &= ~INFINIPATH_IBCC_LOOPBACK;
ipath_write_kreg(dd, dd->ipath_kregs->kr_ibcctrl,
dd->ipath_ibcctrl);
/* don't wait */
ret = 0;
goto bail; // no state change to wait for
goto bail;

/*
* Heartbeat can be explicitly enabled by the user via
* "hrtbt_enable" "file", and if disabled, trying to enable here
* will have no effect. Implicit changes (heartbeat off when
* loopback on, and vice versa) are included to ease testing.
*/
case IPATH_IB_LINK_HRTBT:
ret = dd->ipath_f_set_ib_cfg(dd, IPATH_IB_CFG_HRTBT,
IPATH_IB_HRTBT_ON);
goto bail;

case IPATH_IB_LINK_NO_HRTBT:
ret = dd->ipath_f_set_ib_cfg(dd, IPATH_IB_CFG_HRTBT,
IPATH_IB_HRTBT_OFF);
goto bail;

default:
ipath_dbg("Invalid linkstate 0x%x requested\n", newstate);
Expand Down

0 comments on commit c3a517e

Please sign in to comment.