Received: by 2002:ad5:4acb:0:0:0:0:0 with SMTP id n11csp2270152imw; Wed, 6 Jul 2022 03:05:35 -0700 (PDT) X-Google-Smtp-Source: AGRyM1sHi5scKUleOPmfmjciWG9EJnuOxr3H2aj0CFy5EF/5VhLvvsBmuQ3nEINlM9S9d5h3b6CM X-Received: by 2002:a17:902:b186:b0:16b:d762:6d81 with SMTP id s6-20020a170902b18600b0016bd7626d81mr21798912plr.88.1657101935280; Wed, 06 Jul 2022 03:05:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1657101935; cv=none; d=google.com; s=arc-20160816; b=qRsifNuRzckqrzrKwYIkEUDQ7CgGLszRt/2Lr1ryY3gBDTWjUJMBYFNVQSGORLf7JH fZCVxkOjPNVeeZEG48WJnXShZSm1Oc97Z16lyo+cneovy1BhtOspo8Vz2sxYP3qRB3nL Bmgyy1hrgfAOE2trLAu7J0w4lWWG0Ez/z+Xl1ADGK7l0DMbFW06ok4E2XVw9x/5au3CF 4ijNIrnpJ6P4bokQOjuVTvI6oKJotZzRXKdqgjqklD+1Llxcfpvu3uLNxN0vmo/63cIf PuDJ/Na6BO0hkTfsXq70b0SkMYRpCaebCI/ywsulcUtlRAcWyI1xOvX5DR+EXbhCFkub 86xw== 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=rhagRzaQRUTOiHZd0U64/0KYR8jqebrq9BMCYZjcLVw=; b=QVuPLttSG4T7dpMIuP64wYtDxInx8I6CcixyHpAQSkOn5j8v4F98+M2mypDtrhLr2P G2Imf483rPiuCB8W0hTSbGYOC7nCfBmmaryhZhC+/W8hXn/1+2g/c1eOjTVoX4Yg7Qxr jSGCbhAcYjA6pHLdw3imUu4ql+Aupv/n27obSKPBfS+taxYY7NB+/s7ar/dg3e9pg+uu wfsZYbfRf/Ue/QEHPuB7w6V2oEIX2is2C3b5lJY+er4r4e9YntZbHqlGLE3SsujHWWX5 l3pO2cOITNnE9rlLKPrSTx/tU/6AFP1jKdMEDVDmb4r72J341VCX9O9u6iZ+Pl0v96/7 OlwQ== 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 l9-20020a17090b078900b001e270b50269si25488714pjz.104.2022.07.06.03.05.23; Wed, 06 Jul 2022 03:05:35 -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 S232433AbiGFJyi (ORCPT + 99 others); Wed, 6 Jul 2022 05:54:38 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33294 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231791AbiGFJxx (ORCPT ); Wed, 6 Jul 2022 05:53:53 -0400 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id B3F301ED; Wed, 6 Jul 2022 02:53:21 -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 CBE8AD6E; Wed, 6 Jul 2022 02:53:21 -0700 (PDT) Received: from [10.57.40.86] (unknown [10.57.40.86]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 30D7F3F66F; Wed, 6 Jul 2022 02:53:19 -0700 (PDT) Message-ID: <35de3948-d8f2-c2da-05f9-995eecf275ce@arm.com> Date: Wed, 6 Jul 2022 11:52:56 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.9.1 Subject: Re: [PATCH RESEND v1 1/2] ACPI/PCI: Make _SRS optional for link device Content-Language: en-US To: Bjorn Helgaas Cc: linux-kernel@vger.kernel.org, Bjorn Helgaas , "Rafael J. Wysocki" , Len Brown , linux-pci@vger.kernel.org, linux-acpi@vger.kernel.org References: <20220705172931.GA71865@bhelgaas> From: Pierre Gondois In-Reply-To: <20220705172931.GA71865@bhelgaas> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00,NICE_REPLY_A, RCVD_IN_DNSWL_HI,SPF_HELO_NONE,SPF_NONE,T_SCC_BODY_TEXT_LINE 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 7/5/22 19:29, Bjorn Helgaas wrote: > On Fri, Jul 01, 2022 at 06:16:23PM +0200, Pierre Gondois wrote: >> From: Pierre Gondois >> >> In ACPI 6.4, s6.2.13 "_PRT (PCI Routing Table)", PCI legacy >> interrupts can be described though a link device (first model). >> From s6.2.16 "_SRS (Set Resource Settings)": >> "This optional control method [...]" >> >> Make it optional to have a _SRS method for link devices. > > I think it would be helpful to outline the reason for wanting these > changes in the commit log. Otherwise we don't know the benefit and > it's harder to justify making the change since it's not an obvious > cleanup. > > IIRC from [1] there *is* a good reason: you need to use Interrupt Link > devices so you can specify "level triggered, active high". > > Without an Interrupt Link, you would get the default "level triggered, > active low" setting, which apparently isn't compatible with GICv2. > > I assume this fixes a device that previously didn't work correctly, > but I don't see the details of that in the bugzilla. I'm a little > confused about this. Isn't GICv2 widely used already? How are things > working now? Or are there just a lot of broken devices? It was unsure which of the 2 models described in ACPI 6.4, s6.2.13 "_PRT (PCI Routing Table)" would be used for UEFI for kvmtool. Remainder: The first model allows to accurately describe interrupts: level/edge triggered and active high/low. Interrupts are also configurable with _CRS/_PRS/_SRS/_DIS methods The second model allows to describe hardwired interrupts, and are by default level triggered, active low. The kernel is aware that GivV2 interrupts are active high, so there was actually no need to accurately describe them. Thus the second model was used. While experimenting, we temporarily had a configuration using the first model, and only had a _CRS method (no _PRS/_SRS), which triggered some warnings. So these patches are not fixes for existing platforms, but merely to make _PRS/_SRS methods optional. In [1] I said I would submit patches to change that. If you think this is not necessary as the configuration is non-existing, I am perfectly fine to drop the patches. Also as Rafael noted, the _DIS method should also be taken into consideration if _PRS/_SRS are made optional. Regards, Pierre > > [1] https://lore.kernel.org/r/e2ae06ba-de8f-2cae-60fa-fe9a215d779b@arm.com > >> Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=215560 >> Signed-off-by: Pierre Gondois >> --- >> drivers/acpi/pci_link.c | 7 +++++++ >> 1 file changed, 7 insertions(+) >> >> diff --git a/drivers/acpi/pci_link.c b/drivers/acpi/pci_link.c >> index 58647051c948..129e3e7e80ee 100644 >> --- a/drivers/acpi/pci_link.c >> +++ b/drivers/acpi/pci_link.c >> @@ -288,6 +288,13 @@ static int acpi_pci_link_set(struct acpi_pci_link *link, int irq) >> if (!irq) >> return -EINVAL; >> >> + if (!acpi_has_method(handle, METHOD_NAME__SRS)) { >> + if (link->irq.active == irq) >> + return 0; >> + acpi_handle_err(handle, "Unable to set IRQ %d: No _SRS.\n", irq); >> + return -ENODEV; >> + } >> + >> resource = kzalloc(sizeof(*resource) + 1, irqs_disabled() ? GFP_ATOMIC: GFP_KERNEL); >> if (!resource) >> return -ENOMEM; >> -- >> 2.25.1 >>