summaryrefslogtreecommitdiffstats
path: root/drivers/staging/rdma/hfi1/mad.c
diff options
context:
space:
mode:
authorEaswar Hariharan2016-03-07 20:35:03 +0100
committerDoug Ledford2016-03-17 20:55:18 +0100
commit2243472e9d98c3ca0cb735f96ad48a7b59bdb34d (patch)
tree2c18012d1b1974701d282e8c8f3126f912e8308f /drivers/staging/rdma/hfi1/mad.c
parentIB/hfi1: Don't call cond_resched in atomic mode when sending packets (diff)
downloadkernel-qcow2-linux-2243472e9d98c3ca0cb735f96ad48a7b59bdb34d.tar.gz
kernel-qcow2-linux-2243472e9d98c3ca0cb735f96ad48a7b59bdb34d.tar.xz
kernel-qcow2-linux-2243472e9d98c3ca0cb735f96ad48a7b59bdb34d.zip
IB/hfi1: Improve LED beaconing
The current LED beaconing code is unclear and uses the timer handler to turn off the timer. This patch simplifies the code by removing the special semantics of timeon = timeoff = 0 being interpreted as a request to turn off the beaconing. Reviewed-by: Ira Weiny <ira.weiny@intel.com> Reviewed-by: Dennis Dalessandro <dennis.dalessandro@intel.com> Signed-off-by: Easwar Hariharan <easwar.hariharan@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/mad.c')
-rw-r--r--drivers/staging/rdma/hfi1/mad.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/drivers/staging/rdma/hfi1/mad.c b/drivers/staging/rdma/hfi1/mad.c
index 5925798db4d1..0ec748e7e7b6 100644
--- a/drivers/staging/rdma/hfi1/mad.c
+++ b/drivers/staging/rdma/hfi1/mad.c
@@ -583,11 +583,11 @@ static int __subn_get_opa_portinfo(struct opa_smp *smp, u32 am, u8 *data,
pi->port_states.ledenable_offlinereason |=
ppd->is_sm_config_started << 5;
/*
- * This pairs with the memory barrier implied by the atomic_dec in
- * hfi1_set_led_override to ensure that we read the correct state of
- * LED beaconing represented by led_override_timer_active
+ * This pairs with the memory barrier in hfi1_start_led_override to
+ * ensure that we read the correct state of LED beaconing represented
+ * by led_override_timer_active
*/
- smp_mb();
+ smp_rmb();
is_beaconing_active = !!atomic_read(&ppd->led_override_timer_active);
pi->port_states.ledenable_offlinereason |= is_beaconing_active << 6;
pi->port_states.ledenable_offlinereason |=
@@ -3598,11 +3598,11 @@ static int __subn_get_opa_led_info(struct opa_smp *smp, u32 am, u8 *data,
}
/*
- * This pairs with the memory barrier implied by the atomic_dec in
- * hfi1_set_led_override to ensure that we read the correct state of
- * LED beaconing represented by led_override_timer_active
+ * This pairs with the memory barrier in hfi1_start_led_override to
+ * ensure that we read the correct state of LED beaconing represented
+ * by led_override_timer_active
*/
- smp_mb();
+ smp_rmb();
is_beaconing_active = !!atomic_read(&ppd->led_override_timer_active);
p->rsvd_led_mask = cpu_to_be32(is_beaconing_active << OPA_LED_SHIFT);
@@ -3627,9 +3627,9 @@ static int __subn_set_opa_led_info(struct opa_smp *smp, u32 am, u8 *data,
}
if (on)
- hfi1_set_led_override(dd->pport, 2000, 1500);
+ hfi1_start_led_override(dd->pport, 2000, 1500);
else
- hfi1_set_led_override(dd->pport, 0, 0);
+ shutdown_led_override(dd->pport);
return __subn_get_opa_led_info(smp, am, data, ibdev, port, resp_len);
}