summaryrefslogtreecommitdiffstats
path: root/hw/npu.c
diff options
context:
space:
mode:
authorGavin Shan <gwshan@linux.vnet.ibm.com>2016-04-26 11:56:52 +1000
committerStewart Smith <stewart@linux.vnet.ibm.com>2016-05-03 17:48:46 +1000
commit00f3d2ca92b325db1c7832e4560b564359977202 (patch)
tree86103015f09d73aedfcbf376ece2b0c25884f6d1 /hw/npu.c
parent98b80af1001027cc59dce040831c1f54d41e4f88 (diff)
downloadtalos-skiboot-00f3d2ca92b325db1c7832e4560b564359977202.tar.gz
talos-skiboot-00f3d2ca92b325db1c7832e4560b564359977202.zip
PCI: Move PHB lock to generic layer
All kinds of PHBs are maintaining a spinlock. At mean while, the spinlock is acquired or released by backends for phb_ops->lock() or phb_ops->unlock(). There're no difference of the logic on all kinds of PHBs. So it's reasonable to maintain the lock in the generic layer (struct phb). This moves lock from specific PHB to generic one. The spinlock is initialized when the generic PHB is registered in pci_register_phb(). Also, two inline functions phb_{lock, unlock}() are introduced to acquire/release it. No logical changes introduced. Signed-off-by: Gavin Shan <gwshan@linux.vnet.ibm.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
Diffstat (limited to 'hw/npu.c')
-rw-r--r--hw/npu.c17
1 files changed, 0 insertions, 17 deletions
diff --git a/hw/npu.c b/hw/npu.c
index a61dd202..1129151c 100644
--- a/hw/npu.c
+++ b/hw/npu.c
@@ -28,7 +28,6 @@
#include <affinity.h>
#include <npu-regs.h>
#include <npu.h>
-#include <lock.h>
#include <xscom.h>
/*
@@ -197,20 +196,6 @@ static uint64_t get_bar_size(uint64_t bar)
return (1 << GETFIELD(NX_MMIO_BAR_SIZE, bar)) * 0x10000;
}
-static void npu_lock(struct phb *phb)
-{
- struct npu *p = phb_to_npu(phb);
-
- lock(&p->lock);
-}
-
-static void npu_unlock(struct phb *phb)
-{
- struct npu *p = phb_to_npu(phb);
-
- unlock(&p->lock);
-}
-
/* Update the changes of the device BAR to link BARs */
static void npu_dev_bar_update(uint32_t gcid, struct npu_dev_bar *bar,
bool enable)
@@ -1102,8 +1087,6 @@ static int64_t npu_err_inject(struct phb *phb, uint32_t pe_num,
}
static const struct phb_ops npu_ops = {
- .lock = npu_lock,
- .unlock = npu_unlock,
.cfg_read8 = npu_dev_cfg_read8,
.cfg_read16 = npu_dev_cfg_read16,
.cfg_read32 = npu_dev_cfg_read32,
OpenPOWER on IntegriCloud