aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/infiniband
diff options
context:
space:
mode:
authorDave Olson <dave.olson@qlogic.com>2008-04-17 00:09:29 -0400
committerRoland Dreier <rolandd@cisco.com>2008-04-17 00:09:29 -0400
commitb3e8f541072ec688738abf8de4ef158127a6b5f2 (patch)
tree294b0fc0284dbcc82efae181f1bea71c99d1ef28 /drivers/infiniband
parent555b203e48faeacc0373eda7bc87db874db37136 (diff)
IB/ipath: Add support for IBTA 1.2 Heartbeat
This patch adds code to enable/disable the IBTA 1.2 heartbeat for testing if the HCA supports it. 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_common.h2
-rw-r--r--drivers/infiniband/hw/ipath/ipath_driver.c31
2 files changed, 30 insertions, 3 deletions
diff --git a/drivers/infiniband/hw/ipath/ipath_common.h b/drivers/infiniband/hw/ipath/ipath_common.h
index edd4183c3a28..3c05d4be34fd 100644
--- a/drivers/infiniband/hw/ipath/ipath_common.h
+++ b/drivers/infiniband/hw/ipath/ipath_common.h
@@ -80,6 +80,8 @@
80#define IPATH_IB_LINKDOWN_DISABLE 5 80#define IPATH_IB_LINKDOWN_DISABLE 5
81#define IPATH_IB_LINK_LOOPBACK 6 /* enable local loopback */ 81#define IPATH_IB_LINK_LOOPBACK 6 /* enable local loopback */
82#define IPATH_IB_LINK_EXTERNAL 7 /* normal, disable local loopback */ 82#define IPATH_IB_LINK_EXTERNAL 7 /* normal, disable local loopback */
83#define IPATH_IB_LINK_NO_HRTBT 8 /* disable Heartbeat, e.g. for loopback */
84#define IPATH_IB_LINK_HRTBT 9 /* enable heartbeat, normal, non-loopback */
83 85
84/* 86/*
85 * These 3 values (SDR and DDR may be ORed for auto-speed 87 * These 3 values (SDR and DDR may be ORed for auto-speed
diff --git a/drivers/infiniband/hw/ipath/ipath_driver.c b/drivers/infiniband/hw/ipath/ipath_driver.c
index d1bbee50b5ba..5e1dcb3dbc57 100644
--- a/drivers/infiniband/hw/ipath/ipath_driver.c
+++ b/drivers/infiniband/hw/ipath/ipath_driver.c
@@ -1880,16 +1880,41 @@ int ipath_set_linkstate(struct ipath_devdata *dd, u8 newstate)
1880 dd->ipath_ibcctrl |= INFINIPATH_IBCC_LOOPBACK; 1880 dd->ipath_ibcctrl |= INFINIPATH_IBCC_LOOPBACK;
1881 ipath_write_kreg(dd, dd->ipath_kregs->kr_ibcctrl, 1881 ipath_write_kreg(dd, dd->ipath_kregs->kr_ibcctrl,
1882 dd->ipath_ibcctrl); 1882 dd->ipath_ibcctrl);
1883
1884 /* turn heartbeat off, as it causes loopback to fail */
1885 dd->ipath_f_set_ib_cfg(dd, IPATH_IB_CFG_HRTBT,
1886 IPATH_IB_HRTBT_OFF);
1887 /* don't wait */
1883 ret = 0; 1888 ret = 0;
1884 goto bail; // no state change to wait for 1889 goto bail;
1885 1890
1886 case IPATH_IB_LINK_EXTERNAL: 1891 case IPATH_IB_LINK_EXTERNAL:
1887 dev_info(&dd->pcidev->dev, "Disabling IB local loopback (normal)\n"); 1892 dev_info(&dd->pcidev->dev,
1893 "Disabling IB local loopback (normal)\n");
1894 dd->ipath_f_set_ib_cfg(dd, IPATH_IB_CFG_HRTBT,
1895 IPATH_IB_HRTBT_ON);
1888 dd->ipath_ibcctrl &= ~INFINIPATH_IBCC_LOOPBACK; 1896 dd->ipath_ibcctrl &= ~INFINIPATH_IBCC_LOOPBACK;
1889 ipath_write_kreg(dd, dd->ipath_kregs->kr_ibcctrl, 1897 ipath_write_kreg(dd, dd->ipath_kregs->kr_ibcctrl,
1890 dd->ipath_ibcctrl); 1898 dd->ipath_ibcctrl);
1899 /* don't wait */
1891 ret = 0; 1900 ret = 0;
1892 goto bail; // no state change to wait for 1901 goto bail;
1902
1903 /*
1904 * Heartbeat can be explicitly enabled by the user via
1905 * "hrtbt_enable" "file", and if disabled, trying to enable here
1906 * will have no effect. Implicit changes (heartbeat off when
1907 * loopback on, and vice versa) are included to ease testing.
1908 */
1909 case IPATH_IB_LINK_HRTBT:
1910 ret = dd->ipath_f_set_ib_cfg(dd, IPATH_IB_CFG_HRTBT,
1911 IPATH_IB_HRTBT_ON);
1912 goto bail;
1913
1914 case IPATH_IB_LINK_NO_HRTBT:
1915 ret = dd->ipath_f_set_ib_cfg(dd, IPATH_IB_CFG_HRTBT,
1916 IPATH_IB_HRTBT_OFF);
1917 goto bail;
1893 1918
1894 default: 1919 default:
1895 ipath_dbg("Invalid linkstate 0x%x requested\n", newstate); 1920 ipath_dbg("Invalid linkstate 0x%x requested\n", newstate);