summaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
authorRyan Grimm <grimm@linux.vnet.ibm.com>2014-10-01 19:12:49 -0400
committerBenjamin Herrenschmidt <benh@kernel.crashing.org>2014-10-02 10:38:29 +1000
commit38de7930a078da0b69e5803ef7003fe809bf67b1 (patch)
tree100ad1c40a4fd83fef153061aaa33f209cc69e3d /core
parent2558bb220e7939c1f1e4258d8e07225870c1fd30 (diff)
downloadblackbird-skiboot-38de7930a078da0b69e5803ef7003fe809bf67b1.tar.gz
blackbird-skiboot-38de7930a078da0b69e5803ef7003fe809bf67b1.zip
hmi: decode_malfunction fixes
Fix for nodes > 0. No need to map to node and local chip id. Just pass i as chip id. Remove unneccessary braces. In set_capp_recoverable, return not recovered if phb not found. Found by Milton Miller. Signed-off-by: Ryan Grimm <grimm@linux.vnet.ibm.com> Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Diffstat (limited to 'core')
-rw-r--r--core/hmi.c18
1 files changed, 7 insertions, 11 deletions
diff --git a/core/hmi.c b/core/hmi.c
index dce45c92..45fc89bc 100644
--- a/core/hmi.c
+++ b/core/hmi.c
@@ -153,7 +153,7 @@ static int is_capp_recoverable(int chip_id)
return (reg & PPC_BIT(0)) != 0;
}
-static void handle_capp_recoverable(int chip_id)
+static int handle_capp_recoverable(int chip_id)
{
struct dt_node *np;
u64 phb_id;
@@ -171,8 +171,10 @@ static void handle_capp_recoverable(int chip_id)
phb->ops->lock(phb);
phb->ops->set_capp_recovery(phb);
phb->ops->unlock(phb);
+ return 1;
}
}
+ return 0;
}
static int decode_one_malfunction(int flat_chip_id, struct OpalHMIEvent *hmi_evt)
@@ -181,7 +183,8 @@ static int decode_one_malfunction(int flat_chip_id, struct OpalHMIEvent *hmi_evt
hmi_evt->type = OpalHMI_ERROR_MALFUNC_ALERT;
if (is_capp_recoverable(flat_chip_id)) {
- handle_capp_recoverable(flat_chip_id);
+ if (handle_capp_recoverable(flat_chip_id) == 0)
+ return 0;
hmi_evt->severity = OpalHMI_SEV_NO_ERROR;
hmi_evt->type = OpalHMI_ERROR_CAPP_RECOVERY;
@@ -194,23 +197,16 @@ static int decode_one_malfunction(int flat_chip_id, struct OpalHMIEvent *hmi_evt
static int decode_malfunction(struct OpalHMIEvent *hmi_evt)
{
int i;
- int node;
- int chip;
- int flat_chip_id;
int recover = -1;
uint64_t malf_alert;
xscom_read(this_cpu()->chip_id, 0x2020011, &malf_alert);
- for (i = 0; i < 64; i++) {
+ for (i = 0; i < 64; i++)
if (malf_alert & PPC_BIT(i)) {
- chip = i % 8;
- node = i / 7;
- flat_chip_id = chip * node;
- recover = decode_one_malfunction(flat_chip_id, hmi_evt);
+ recover = decode_one_malfunction(i, hmi_evt);
xscom_write(this_cpu()->chip_id, 0x02020011, ~PPC_BIT(i));
}
- }
return recover;
}
OpenPOWER on IntegriCloud