aboutsummaryrefslogtreecommitdiff
path: root/hw
diff options
context:
space:
mode:
authorBenjamin Herrenschmidt <benh@kernel.crashing.org>2015-04-29 15:01:47 +1000
committerStewart Smith <stewart@linux.vnet.ibm.com>2015-05-01 15:38:17 +1000
commit96ed5814761ca57ff2338d4501c4e40bf213f8e2 (patch)
treed37446eef1291f55c602745ad36dca75a921b0e0 /hw
parentedadd363dda399c7901ed546ea088631ec827454 (diff)
downloadskiboot-96ed5814761ca57ff2338d4501c4e40bf213f8e2.zip
skiboot-96ed5814761ca57ff2338d4501c4e40bf213f8e2.tar.gz
skiboot-96ed5814761ca57ff2338d4501c4e40bf213f8e2.tar.bz2
xscom: Remove recursive locking
Nothing should be using it nowadays and it's dangerous. Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
Diffstat (limited to 'hw')
-rw-r--r--hw/xscom.c24
1 files changed, 6 insertions, 18 deletions
diff --git a/hw/xscom.c b/hw/xscom.c
index d8af989..bbf0f24 100644
--- a/hw/xscom.c
+++ b/hw/xscom.c
@@ -342,7 +342,6 @@ static uint32_t xscom_decode_chiplet(uint32_t partid, uint64_t *pcb_addr)
*/
int xscom_read(uint32_t partid, uint64_t pcb_addr, uint64_t *val)
{
- bool need_unlock;
uint32_t gcid;
int rc;
@@ -360,12 +359,8 @@ int xscom_read(uint32_t partid, uint64_t pcb_addr, uint64_t *val)
return OPAL_PARAMETER;
}
- /*
- * HW822317 requires locking. We use a recursive lock as error
- * conditions might cause printf's which might then try to take
- * the lock again
- */
- need_unlock = lock_recursive(&xscom_lock);
+ /* HW822317 requires us to do global locking */
+ lock(&xscom_lock);
/* Direct vs indirect access */
if (pcb_addr & XSCOM_ADDR_IND_FLAG)
@@ -374,8 +369,7 @@ int xscom_read(uint32_t partid, uint64_t pcb_addr, uint64_t *val)
rc = __xscom_read(gcid, pcb_addr & 0x7fffffff, val);
/* Unlock it */
- if (need_unlock)
- unlock(&xscom_lock);
+ unlock(&xscom_lock);
return rc;
}
@@ -383,7 +377,6 @@ opal_call(OPAL_XSCOM_READ, xscom_read, 3);
int xscom_write(uint32_t partid, uint64_t pcb_addr, uint64_t val)
{
- bool need_unlock;
uint32_t gcid;
int rc;
@@ -401,12 +394,8 @@ int xscom_write(uint32_t partid, uint64_t pcb_addr, uint64_t val)
return OPAL_PARAMETER;
}
- /*
- * HW822317 requires locking. We use a recursive lock as error
- * conditions might cause printf's which might then try to take
- * the lock again
- */
- need_unlock = lock_recursive(&xscom_lock);
+ /* HW822317 requires us to do global locking */
+ lock(&xscom_lock);
/* Direct vs indirect access */
if (pcb_addr & XSCOM_ADDR_IND_FLAG)
@@ -415,8 +404,7 @@ int xscom_write(uint32_t partid, uint64_t pcb_addr, uint64_t val)
rc = __xscom_write(gcid, pcb_addr & 0x7fffffff, val);
/* Unlock it */
- if (need_unlock)
- unlock(&xscom_lock);
+ unlock(&xscom_lock);
return rc;
}
opal_call(OPAL_XSCOM_WRITE, xscom_write, 3);