[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20210817224018.1013192-5-david.e.box@linux.intel.com>
Date: Tue, 17 Aug 2021 15:40:17 -0700
From: "David E. Box" <david.e.box@...ux.intel.com>
To: lee.jones@...aro.org, hdegoede@...hat.com, mgross@...ux.intel.com,
bhelgaas@...gle.com, srinivas.pandruvada@...el.com,
andy.shevchenko@...il.com
Cc: "David E. Box" <david.e.box@...ux.intel.com>,
linux-kernel@...r.kernel.org, platform-driver-x86@...r.kernel.org,
linux-pci@...r.kernel.org
Subject: [PATCH v2 4/5] platform/x86: intel_pmt_telemetry: Ignore zero sized entries
Some devices may expose non-functioning entries that are reserved for
future use. These entries have zero size. Ignore them during probe.
Signed-off-by: David E. Box <david.e.box@...ux.intel.com>
---
V2: New patch
drivers/platform/x86/intel/pmt/telemetry.c | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/drivers/platform/x86/intel/pmt/telemetry.c b/drivers/platform/x86/intel/pmt/telemetry.c
index 3559f6e7b388..d93d02672679 100644
--- a/drivers/platform/x86/intel/pmt/telemetry.c
+++ b/drivers/platform/x86/intel/pmt/telemetry.c
@@ -61,6 +61,14 @@ static int pmt_telem_header_decode(struct intel_pmt_entry *entry,
/* Size is measured in DWORDS, but accessor returns bytes */
header->size = TELEM_SIZE(readl(disc_table));
+ /*
+ * Some devices may expose non-functioning entries that are
+ * reserved for future use. They have zero size. Do not fail
+ * probe for these. Just ignore them.
+ */
+ if (header->size == 0)
+ return 1;
+
return 0;
}
--
2.25.1
Powered by blists - more mailing lists