aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/infiniband/hw/ipath/ipath_kernel.h
diff options
context:
space:
mode:
authorMichael Albaugh <michael.albaugh@qlogic.com>2007-05-17 10:05:04 -0400
committerRoland Dreier <rolandd@cisco.com>2007-07-09 23:12:25 -0400
commit17b2eb9fe6bfadcb3ece308ed50193d10b71ba6e (patch)
tree567c1e7d11cc14990ecabd11fe23b1941a2ebcfd /drivers/infiniband/hw/ipath/ipath_kernel.h
parent82466f00ec6ef0a5ca7ea8991c731af2ec561c7d (diff)
IB/ipath: Lock and always use shadow copies of GPIO register
The new LED blinking interface adds more contention for the unprotected GPIO pins that were already shared, though not commonly at the same time. We add locks to the accesses to these pins so that Read-Modify-Write is now safe. Some of these locks are added at interrupt context, so we shadow the registers which drive and inspect these pins to avoid the mmio read/writes. This mitigates the effects of the locks and hastens us through the interrupt. Add locking and always use shadows for registers controlling GPIO pins (ExtCtrl and GPIOout). The use of shadows implies doing less I/O, which can make I2C operation too fast on some platforms. An explicit udelay(1) in SCL manipulation fixes that. Signed-off-by: Michael Albaugh <michael.albaugh@qlogic.com> Signed-off-by: Roland Dreier <rolandd@cisco.com>
Diffstat (limited to 'drivers/infiniband/hw/ipath/ipath_kernel.h')
-rw-r--r--drivers/infiniband/hw/ipath/ipath_kernel.h7
1 files changed, 5 insertions, 2 deletions
diff --git a/drivers/infiniband/hw/ipath/ipath_kernel.h b/drivers/infiniband/hw/ipath/ipath_kernel.h
index 2f39db7df31c..bd1088a99891 100644
--- a/drivers/infiniband/hw/ipath/ipath_kernel.h
+++ b/drivers/infiniband/hw/ipath/ipath_kernel.h
@@ -399,6 +399,8 @@ struct ipath_devdata {
399 u64 ipath_gpio_out; 399 u64 ipath_gpio_out;
400 /* shadow the gpio mask register */ 400 /* shadow the gpio mask register */
401 u64 ipath_gpio_mask; 401 u64 ipath_gpio_mask;
402 /* shadow the gpio output enable, etc... */
403 u64 ipath_extctrl;
402 /* kr_revision shadow */ 404 /* kr_revision shadow */
403 u64 ipath_revision; 405 u64 ipath_revision;
404 /* 406 /*
@@ -473,8 +475,6 @@ struct ipath_devdata {
473 u32 ipath_cregbase; 475 u32 ipath_cregbase;
474 /* shadow the control register contents */ 476 /* shadow the control register contents */
475 u32 ipath_control; 477 u32 ipath_control;
476 /* shadow the gpio output contents */
477 u32 ipath_extctrl;
478 /* PCI revision register (HTC rev on FPGA) */ 478 /* PCI revision register (HTC rev on FPGA) */
479 u32 ipath_pcirev; 479 u32 ipath_pcirev;
480 480
@@ -576,6 +576,9 @@ struct ipath_devdata {
576 u64 ipath_gpio_sda; 576 u64 ipath_gpio_sda;
577 u64 ipath_gpio_scl; 577 u64 ipath_gpio_scl;
578 578
579 /* lock for doing RMW of shadows/regs for ExtCtrl and GPIO */
580 spinlock_t ipath_gpio_lock;
581
579 /* used to override LED behavior */ 582 /* used to override LED behavior */
580 u8 ipath_led_override; /* Substituted for normal value, if non-zero */ 583 u8 ipath_led_override; /* Substituted for normal value, if non-zero */
581 u16 ipath_led_override_timeoff; /* delta to next timer event */ 584 u16 ipath_led_override_timeoff; /* delta to next timer event */