aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStewart Smith <stewart@linux.vnet.ibm.com>2014-02-17 17:57:45 +1100
committerWang Sen <wangsen@linux.vnet.ibm.com>2014-02-19 16:36:15 +0800
commitf828c7322e1e42f979e66acd7590f1819fd0398f (patch)
tree2af4c0d0d055f9d531f8e645f5b62ba8ce543017
parent1c4933e08bb8e04483b4acc7ea7dabd138aaf9fa (diff)
downloadpowerkvm-f828c7322e1e42f979e66acd7590f1819fd0398f.tar.gz
powernv: don't attempt to refetch the FSP dump until the user has explicitly acked it.
This fixes a bug where we would get two events from OPAL with DUMP_AVAIL set (which is valid for OPAL to do) and in the second run of extract_dump() we would fail to free the memory previously allocated for the dump (leaking ~6MB+) as well as on the second dump_read_data() call OPAL would not retrieve the dump, leaving us with a dump in linux that was the correct size but all zeros. Changes since v1: fixed typo Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com> Acked-by: Benjamin Herrenschmidt <benh@kernel.crashing.org> LTC-Bugzilla: #104211
-rw-r--r--arch/powerpc/platforms/powernv/opal-dump.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/arch/powerpc/platforms/powernv/opal-dump.c b/arch/powerpc/platforms/powernv/opal-dump.c
index 444702769e6eb9..53c26756559b35 100644
--- a/arch/powerpc/platforms/powernv/opal-dump.c
+++ b/arch/powerpc/platforms/powernv/opal-dump.c
@@ -238,6 +238,14 @@ static int extract_dump(void)
{
int rc;
+ /* We can get notified that a dump is available multiple times
+ * (dump_read_info clears the bit in the event from OPAL).
+ * But we should not re-read the dump from OPAL as we
+ * don't get the next dump until we've explicitly acked this one.
+ */
+ if (dump_avail)
+ return OPAL_SUCCESS;
+
/* Get dump ID, size */
rc = dump_read_info();
if (rc != OPAL_SUCCESS)