Received: by 2002:ac0:cd04:0:0:0:0:0 with SMTP id w4csp76160imn; Fri, 1 Jul 2022 10:14:23 -0700 (PDT) X-Google-Smtp-Source: AGRyM1s3BggIlaEF0qt41ruDe6Y4UcAbiYtoYrgosJiJ+rKXfROkqmGQPB3wKnCx2vIJlLyo0/Mz X-Received: by 2002:a05:6a00:811:b0:525:50c2:4c2f with SMTP id m17-20020a056a00081100b0052550c24c2fmr22485991pfk.62.1656695663186; Fri, 01 Jul 2022 10:14:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1656695663; cv=none; d=google.com; s=arc-20160816; b=qO5QKY6FKq1ZZCpiR9B0S0YbdEDCa2gtDuzIc3xEu0MsI5bnyK0NQpstTYXtQqphGE uxC55m0vnarFz12TdZL17mSDjrAVgGU9TB4VGpzy9aMKwvg1/p7IHycYyIcBZEz41iBs YIkY92jvskLL/wlZIN626ggaFMn/qDml4tKdR/4SYdq9Vn5K00nALuidw+tvy74Rra3J srTSKlwwLQ99YgMs7nMG/Q9Z9jGBWoRDRwdCiqrieapsfVXYYVLi1GsQ5C0AHjDPy+wY ECJrddpjqTlIGpN1mrcBB6xPvS6dIeaJEa/GhoO7lFCf9V74WNIFaIsVmGAaY+Rah0H7 Ly9g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=uCwnoc/xCNbPP7lHg0owIUTQnDhnEC8PqPDSVbBZyrc=; b=L/IElPXGHsZmza7no4OgG/ijr680mCFrN1l6x28n751yU5LFP/th/grU9JDYV58sbY oqtnAj8IzG5THxXI7257PTmQnR9AoSeOLaZPM0Y88TEMu3wTk6FtwwzDhzQSr8B5kelp d5sND8PZvCZt8yW0JJ5bdWR2Y5Ub+35fHjmxBcR5FH6DVeu3eKz5lbF80bN7V8yccyS/ Hg+15BTb2OVH5xtsCq89heOQq8403ogUjGePD5we3UgoXUixjTDIuTGvvT5waMbrq4A7 KaYeRNw3yGuoPcIlf7drp9xFuab4PrLHgyjg+JRUp9zzpYXZBvZSKxFJMSLhnlcDBMON J4Dg== 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 p22-20020a17090a0e5600b001eaf4d29385si1291782pja.127.2022.07.01.10.14.02; Fri, 01 Jul 2022 10:14:23 -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 S231822AbiGAQRC (ORCPT + 99 others); Fri, 1 Jul 2022 12:17:02 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38856 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231775AbiGAQRA (ORCPT ); Fri, 1 Jul 2022 12:17:00 -0400 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id E4FA13BBF9; Fri, 1 Jul 2022 09:16:59 -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 F3633143D; Fri, 1 Jul 2022 09:16:59 -0700 (PDT) Received: from pierre123.home (unknown [172.31.20.19]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id D4A2A3F66F; Fri, 1 Jul 2022 09:16:57 -0700 (PDT) From: Pierre Gondois To: linux-kernel@vger.kernel.org Cc: Pierre Gondois , Bjorn Helgaas , "Rafael J. Wysocki" , Len Brown , linux-pci@vger.kernel.org, linux-acpi@vger.kernel.org Subject: [PATCH RESEND v1 1/2] ACPI/PCI: Make _SRS optional for link device Date: Fri, 1 Jul 2022 18:16:23 +0200 Message-Id: <20220701161624.2844305-2-pierre.gondois@arm.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220701161624.2844305-1-pierre.gondois@arm.com> References: <20220701161624.2844305-1-pierre.gondois@arm.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00,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 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. 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