aboutsummaryrefslogtreecommitdiff
path: root/hw/p8-i2c.c
diff options
context:
space:
mode:
authorStewart Smith <stewart@linux.vnet.ibm.com>2017-06-07 14:08:43 +1000
committerStewart Smith <stewart@linux.vnet.ibm.com>2017-06-07 14:08:43 +1000
commit8552222ce46501ed7684ef26dd9fcca470aa5e6c (patch)
tree1b71667f4e0f1391a138e808e174899e53a62148 /hw/p8-i2c.c
parent05b8834b5a4ff9bd14548594700d354bc4486c5c (diff)
downloadskiboot-8552222ce46501ed7684ef26dd9fcca470aa5e6c.zip
skiboot-8552222ce46501ed7684ef26dd9fcca470aa5e6c.tar.gz
skiboot-8552222ce46501ed7684ef26dd9fcca470aa5e6c.tar.bz2
p8-i2c OCC lock: fix locking in p9_i2c_bus_owner_change
Fixes: c5fa0d718e9cda8999dcb83088118a7ea61814c5 Reported-by: Oliver O'Halloran <oohall@gmail.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
Diffstat (limited to 'hw/p8-i2c.c')
-rw-r--r--hw/p8-i2c.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/hw/p8-i2c.c b/hw/p8-i2c.c
index d55d08e..f4666e2 100644
--- a/hw/p8-i2c.c
+++ b/hw/p8-i2c.c
@@ -1,4 +1,4 @@
-/* Copyright 2013-2014 IBM Corp.
+/* Copyright 2013-2017 IBM Corp.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -1293,8 +1293,10 @@ void p9_i2c_bus_owner_change(u32 chip_id)
/* Can we now lock this master? */
rc = occ_i2c_lock(master);
- if (rc)
+ if (rc) {
+ unlock(&master->lock);
continue;
+ }
/* Run the state machine */
p8_i2c_check_status(master);