Received: by 2002:a05:6359:6284:b0:131:369:b2a3 with SMTP id se4csp5228326rwb; Wed, 9 Aug 2023 00:11:34 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGXjBcYQpmw1xxt3xK4dNVsTWLI9KLwgU5T9V0OGSUA9YYmPIX59RFpj6+Uu7DzkCPxqTed X-Received: by 2002:a17:90b:681:b0:268:5c3b:6f28 with SMTP id m1-20020a17090b068100b002685c3b6f28mr1314456pjz.19.1691565094556; Wed, 09 Aug 2023 00:11:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1691565094; cv=none; d=google.com; s=arc-20160816; b=YSv5bUetqdpKE5XR1B1prHFLZW6CcjEreg3bpgVYp0IBQ+txzBRsQ+CPQCaFp068D4 zmrn/Xnf14J5NMz1ZtEFKzBCmLjkwUAvNXLlQRrA9tGPyw9BtTkGMmr5v7NUSa9ggKjj chFMrt1wiGHlSJcJEL9RF4ArihjdDKhXKdOJhbhbFgSD3i/skFCNY287jwwkT4czfTwF xqCLh1qI3j2pMRdVHiDNGuU7vBSd/Lyz0yT3AoftEnbTe9QGQU1I9ZVEiQ1k6Psq12WC 4v1Uf/DNSW+mhwFp9+LI7r1m/AUrTopsX2+3luRO0NjsC4+jTFV4aijDW0Ba8bKUB3at b0/Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id; bh=T6u0eSeI7CeOatih7JJh2bC5EfH+blUyZeanANX6WCU=; fh=ILnKRCBPtD9KPyQ34UcjgGtYcNsIzVpdseKzS4k6oE0=; b=pNWa0S0PjSLQ+CyiLqafgpASjuyCR9DlHRj2Y0XWZCLOcxGhDYZtr+mVPl0DjEb7UP lDzxafewz8yvXCsgMQJvsHFPkXbXER0c4ZtEIUNeQEa9jju/YTLJIQfqQdavYMaH4V1L qjwzHeEPusYKwBa6wpwajsCy1Xup3R/kW/N9tzNA+VkKjfXbQ4BDbqvXzZ3SGWCgkaUv BcwziBEC4Gziy5AjXBZnGWWSbr2sCxvG8bPHiliyhO41LqSz417Ez/wwoiRJuy7CUvKG sSbQNnshyjKdd7AS+9DEhn5jX/8g1AAHohf6n8A6QfnNW/2SbsKUoQjezUBdvY5iqF5c 3jUQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id q14-20020a17090a2dce00b00268cdfdf084si829583pjm.80.2023.08.09.00.11.22; Wed, 09 Aug 2023 00:11:34 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231223AbjHIHCE (ORCPT + 99 others); Wed, 9 Aug 2023 03:02:04 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42198 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229468AbjHIHCD (ORCPT ); Wed, 9 Aug 2023 03:02:03 -0400 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 0696919BC for ; Wed, 9 Aug 2023 00:02:01 -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 DC73211FB; Wed, 9 Aug 2023 00:02:43 -0700 (PDT) Received: from [10.163.54.83] (unknown [10.163.54.83]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 773AD3F64C; Wed, 9 Aug 2023 00:01:58 -0700 (PDT) Message-ID: Date: Wed, 9 Aug 2023 12:31:56 +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 V3 1/4] arm_pmu: acpi: Refactor arm_spe_acpi_register_device() Content-Language: en-US To: Will Deacon Cc: linux-arm-kernel@lists.infradead.org, suzuki.poulose@arm.com, Sami Mujawar , Catalin Marinas , Mark Rutland , Mike Leach , Alexander Shishkin , coresight@lists.linaro.org, linux-kernel@vger.kernel.org References: <20230803055652.1322801-1-anshuman.khandual@arm.com> <20230803055652.1322801-2-anshuman.khandual@arm.com> <89058c7c-1fed-60ea-7233-04187772a931@arm.com> <20230804163921.GE30679@willie-the-truck> <9b630f76-2f9e-fc42-012e-403f4b8c1dee@arm.com> <20230808132157.GB2369@willie-the-truck> From: Anshuman Khandual In-Reply-To: <20230808132157.GB2369@willie-the-truck> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-6.0 required=5.0 tests=BAYES_00,NICE_REPLY_A, RCVD_IN_DNSWL_MED,SPF_HELO_NONE,SPF_NONE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 8/8/23 18:51, Will Deacon wrote: > On Mon, Aug 07, 2023 at 11:03:40AM +0530, Anshuman Khandual wrote: >> On 8/4/23 22:09, Will Deacon wrote: >>> On Thu, Aug 03, 2023 at 11:43:27AM +0530, Anshuman Khandual wrote: >>>> On 8/3/23 11:26, 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; >>>> >>>> Moved parse_gsi() return code checking to its original place just to >>>> make it similar in semantics to existing 'gicc->header.length check'. >>>> If 'gsi' is valid i.e atleast a single cpu has been probed, return >>>> -ENXIO indicating mismatch, otherwise just return 0. >>> >>> Wouldn't that still be the case without the check in this hunk? We'd run >>> into the homogeneous check and return -ENXIO from there, no? >> Although the return code will be the same i.e -ENXIO, but not for the same reason. >> >> this_gsi = parse_gsi(gicc); >> if (!this_gsi) >> return gsi ? -ENXIO : 0; >> >> This returns 0 when IRQ could not be parsed for the first cpu, but returns -ENXIO >> for subsequent cpus. Although return code -ENXIO here still indicates IRQ parsing >> to have failed. >> >> } else if (hetid != this_hetid || gsi != this_gsi) { >> pr_warn("ACPI: %s: must be homogeneous\n", pdev->name); >> return -ENXIO; >> } >> >> This returns -ENXIO when there is a IRQ mismatch. But if the above check is not >> there, -ENXIO return code here could not be classified into IRQ parse problem or >> mismatch without looking into the IRQ value. > > Sorry, but I don't understand your point here. If any of this fails, there's > going to be some debugging needed to look at the ACPI tables; the only > difference with my suggestion is that you'll get a message indicating that > the devices aren't homogeneous, which I think is helpful. I dont have strong opinion either way. Hence will move 'this_gsi' check inside the !gsi conditional check like you had suggested earlier.