summaryrefslogtreecommitdiffstats
path: root/drivers/staging/rdma/hfi1/chip.c
diff options
context:
space:
mode:
authorDean Luick2016-03-05 17:50:01 +0100
committerDoug Ledford2016-03-17 20:55:14 +0100
commit576531fde8473333322905ea09fd5cfd14ce91ef (patch)
tree47f5d34bf5a53b0b7f35ab10b42d547d1f4a1e4d /drivers/staging/rdma/hfi1/chip.c
parentIB/hfi1: Change EPROM handling to use resource reservation (diff)
downloadkernel-qcow2-linux-576531fde8473333322905ea09fd5cfd14ce91ef.tar.gz
kernel-qcow2-linux-576531fde8473333322905ea09fd5cfd14ce91ef.tar.xz
kernel-qcow2-linux-576531fde8473333322905ea09fd5cfd14ce91ef.zip
IB/hfi1: Change SBus handling to use resource reservation
The SBus resource includes SBUS, PCIE, and THERM registers. Change SBus handling to use the new ASIC resource reservation system. Reviewed-by: Mitko Haralanov <mitko.haralanov@intel.com> Reviewed-by: Easwar Hariharan <easwar.hariharan@intel.com> Signed-off-by: Dean Luick <dean.luick@intel.com> Signed-off-by: Jubin John <jubin.john@intel.com> Signed-off-by: Doug Ledford <dledford@redhat.com>
Diffstat (limited to 'drivers/staging/rdma/hfi1/chip.c')
-rw-r--r--drivers/staging/rdma/hfi1/chip.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/drivers/staging/rdma/hfi1/chip.c b/drivers/staging/rdma/hfi1/chip.c
index 98ebee4aac22..269c9775f7c6 100644
--- a/drivers/staging/rdma/hfi1/chip.c
+++ b/drivers/staging/rdma/hfi1/chip.c
@@ -14324,7 +14324,12 @@ static int thermal_init(struct hfi1_devdata *dd)
!(dd->flags & HFI1_DO_INIT_ASIC))
return ret;
- acquire_hw_mutex(dd);
+ ret = acquire_chip_resource(dd, CR_SBUS, SBUS_TIMEOUT);
+ if (ret) {
+ THERM_FAILURE(dd, ret, "Acquire SBus");
+ return ret;
+ }
+
dd_dev_info(dd, "Initializing thermal sensor\n");
/* Disable polling of thermal readings */
write_csr(dd, ASIC_CFG_THERM_POLL_EN, 0x0);
@@ -14372,7 +14377,7 @@ static int thermal_init(struct hfi1_devdata *dd)
/* Enable polling of thermal readings */
write_csr(dd, ASIC_CFG_THERM_POLL_EN, 0x1);
done:
- release_hw_mutex(dd);
+ release_chip_resource(dd, CR_SBUS);
return ret;
}