From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2AD1AEB64DD for ; Fri, 11 Aug 2023 08:43:55 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234160AbjHKIny (ORCPT ); Fri, 11 Aug 2023 04:43:54 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45774 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232228AbjHKInw (ORCPT ); Fri, 11 Aug 2023 04:43:52 -0400 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id E99652738 for ; Fri, 11 Aug 2023 01:43:51 -0700 (PDT) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 17A6FD75; Fri, 11 Aug 2023 01:44:34 -0700 (PDT) Received: from [10.163.54.13] (unknown [10.163.54.13]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 1370A3F59C; Fri, 11 Aug 2023 01:43:45 -0700 (PDT) Message-ID: <9d22520a-3450-0e75-59a2-035209f239e6@arm.com> Date: Fri, 11 Aug 2023 14:13:42 +0530 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.13.0 Subject: Re: [PATCH V4 1/4] arm_pmu: acpi: Refactor arm_spe_acpi_register_device() To: linux-arm-kernel@lists.infradead.org, suzuki.poulose@arm.com Cc: yangyicong@huawei.com, Sami Mujawar , Catalin Marinas , Will Deacon , Mark Rutland , Mike Leach , Leo Yan , Alexander Shishkin , James Clark , coresight@lists.linaro.org, linux-kernel@vger.kernel.org References: <20230808082247.383405-1-anshuman.khandual@arm.com> <20230808082247.383405-2-anshuman.khandual@arm.com> Content-Language: en-US From: Anshuman Khandual In-Reply-To: <20230808082247.383405-2-anshuman.khandual@arm.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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) {