[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <9d22520a-3450-0e75-59a2-035209f239e6@arm.com>
Date: Fri, 11 Aug 2023 14:13:42 +0530
From: Anshuman Khandual <anshuman.khandual@....com>
To: linux-arm-kernel@...ts.infradead.org, suzuki.poulose@....com
Cc: yangyicong@...wei.com, Sami Mujawar <sami.mujawar@....com>,
Catalin Marinas <catalin.marinas@....com>,
Will Deacon <will@...nel.org>,
Mark Rutland <mark.rutland@....com>,
Mike Leach <mike.leach@...aro.org>,
Leo Yan <leo.yan@...aro.org>,
Alexander Shishkin <alexander.shishkin@...ux.intel.com>,
James Clark <james.clark@....com>, coresight@...ts.linaro.org,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH V4 1/4] arm_pmu: acpi: Refactor
arm_spe_acpi_register_device()
On 8/8/23 13:52, Anshuman Khandual wrote:
> + /*
> + * Sanity check all the GICC tables for the same interrupt
> + * number. For now, only support homogeneous ACPI machines.
> + */
> + for_each_possible_cpu(cpu) {
> + struct acpi_madt_generic_interrupt *gicc;
> +
> + gicc = acpi_cpu_get_madt_gicc(cpu);
> + if (gicc->header.length < len)
> + return gsi ? -ENXIO : 0;
> +
> + this_gsi = parse_gsi(gicc);
> + if (!this_gsi)
> + return gsi ? -ENXIO : 0;
> +
> + this_hetid = find_acpi_cpu_topology_hetero_id(cpu);
> + if (!gsi) {
> + hetid = this_hetid;
> + gsi = this_gsi;
> + } else if (hetid != this_hetid || gsi != this_gsi) {
> + pr_warn("ACPI: %s: must be homogeneous\n", pdev->name);
> + return -ENXIO;
> + }
> + }
As discussed on the previous version i.e V3 thread, will move the
'this_gsi' check after parse_gsi(), inside if (!gsi) conditional
block. This will treat subsequent cpu parse_gsi()'s failure as a
mismatch thus triggering the pr_warn() message.
diff --git a/drivers/perf/arm_pmu_acpi.c b/drivers/perf/arm_pmu_acpi.c
index 845683ca7c64..6eae772d6298 100644
--- a/drivers/perf/arm_pmu_acpi.c
+++ b/drivers/perf/arm_pmu_acpi.c
@@ -98,11 +98,11 @@ arm_acpi_register_pmu_device(struct platform_device *pdev, u8 len,
return gsi ? -ENXIO : 0;
this_gsi = parse_gsi(gicc);
- if (!this_gsi)
- return gsi ? -ENXIO : 0;
-
this_hetid = find_acpi_cpu_topology_hetero_id(cpu);
if (!gsi) {
+ if (!this_gsi)
+ return 0;
+
hetid = this_hetid;
gsi = this_gsi;
} else if (hetid != this_hetid || gsi != this_gsi) {
Powered by blists - more mailing lists