summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2019-07-11 13:22:48 +0100
committerChris Wilson <chris@chris-wilson.co.uk>2019-07-12 19:16:01 +0100
commitbb4d55a02dd3e1971f2c091a13b6bd7f0b496e40 (patch)
treed86eb581e05684afa9dfd0f3c07ea7939e7b5d01 /tools
parent549e1cdc064c0491a9c4509f42d826ae0e752a07 (diff)
intel_l3_parity: Restore support for Ivybridge
With the fancy second slice of Haswell, we lost support for Ivybridge with its paltry single slice. Fixes: 8ddcfd6882a9 ("intel_l3_parity: slice support") Testcase: igt/tools_test/sysfs_l3_parity Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Diffstat (limited to 'tools')
-rw-r--r--tools/intel_l3_parity.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/tools/intel_l3_parity.c b/tools/intel_l3_parity.c
index d8c997af..4179c5ae 100644
--- a/tools/intel_l3_parity.c
+++ b/tools/intel_l3_parity.c
@@ -195,6 +195,12 @@ int main(int argc, char *argv[])
for_each_slice(i) {
fd[i] = openat(dir, path[i], O_RDWR);
+ if (fd[i] < 0) {
+ if (i == 0) /* at least one slice must be supported */
+ exit(77);
+ continue;
+ }
+
if (read(fd[i], l3logs[i], NUM_REGS * sizeof(uint32_t)) < 0) {
perror(path[i]);
exit(77);
@@ -333,6 +339,9 @@ int main(int argc, char *argv[])
/* Per slice operations */
for_each_slice(i) {
+ if (fd[i] < 0)
+ continue;
+
switch (action) {
case 'l':
dumpit(i);
@@ -374,6 +383,9 @@ int main(int argc, char *argv[])
exit(EXIT_SUCCESS);
for_each_slice(i) {
+ if (fd[i] < 0)
+ continue;
+
ret = write(fd[i], l3logs[i], NUM_REGS * sizeof(uint32_t));
if (ret == -1) {
perror("Writing sysfs");