aboutsummaryrefslogtreecommitdiff
path: root/hw/p8-i2c.c
diff options
context:
space:
mode:
authorBenjamin Herrenschmidt <benh@kernel.crashing.org>2016-07-24 09:26:56 +1000
committerStewart Smith <stewart@linux.vnet.ibm.com>2016-08-18 16:04:26 +1000
commit400a91f854c4cfbfeeae03bdb728aaf3437e1371 (patch)
tree38b21e0690bef9a551ef50d269a00e0fd63b5c21 /hw/p8-i2c.c
parent5c4bfc63a0e6ae9d3bb6f6e1bfaa9443c847998a (diff)
downloadskiboot-400a91f854c4cfbfeeae03bdb728aaf3437e1371.zip
skiboot-400a91f854c4cfbfeeae03bdb728aaf3437e1371.tar.gz
skiboot-400a91f854c4cfbfeeae03bdb728aaf3437e1371.tar.bz2
p8-i2c: Don't crash if a centaur errored out
If we had XSCOM/FSI errors accessing a centaur, we assert later on when trying to create it's i2c bus. Don't, just file an error log Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
Diffstat (limited to 'hw/p8-i2c.c')
-rw-r--r--hw/p8-i2c.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/hw/p8-i2c.c b/hw/p8-i2c.c
index fde9a80..4e29432 100644
--- a/hw/p8-i2c.c
+++ b/hw/p8-i2c.c
@@ -1288,7 +1288,13 @@ static void p8_i2c_init_one(struct dt_node *i2cm, enum p8_i2c_master_type type)
master->xscom_base = dt_get_address(i2cm, 0, NULL);
if (master->type == I2C_CENTAUR) {
struct centaur_chip *centaur = get_centaur(master->chip_id);
- assert(centaur);
+ if (centaur == NULL) {
+ log_simple_error(&e_info(OPAL_RC_I2C_INIT),
+ "I2C: Failed to get centaur 0x%x ",
+ master->chip_id);
+ free(master);
+ return;
+ }
chip_list = &centaur->i2cms;
/* Detect bad device-tree from HostBoot giving us bogus