From patchwork Wed Jun 29 08:27:37 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sinan Kaya X-Patchwork-Id: 9204395 X-Patchwork-Delegate: bhelgaas@google.com Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 3514760757 for ; Wed, 29 Jun 2016 08:29:38 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 25BDB28635 for ; Wed, 29 Jun 2016 08:29:38 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 1A52328648; Wed, 29 Jun 2016 08:29:38 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8C75928635 for ; Wed, 29 Jun 2016 08:29:37 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751391AbcF2I2L (ORCPT ); Wed, 29 Jun 2016 04:28:11 -0400 Received: from smtp.codeaurora.org ([198.145.29.96]:51308 "EHLO smtp.codeaurora.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750995AbcF2I2I (ORCPT ); Wed, 29 Jun 2016 04:28:08 -0400 Received: by smtp.codeaurora.org (Postfix, from userid 1000) id D50D4613B0; Wed, 29 Jun 2016 08:28:07 +0000 (UTC) Received: from drakthul.qualcomm.com (global_nat1_iad_fw.qualcomm.com [129.46.232.65]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) (Authenticated sender: okaya@smtp.codeaurora.org) by smtp.codeaurora.org (Postfix) with ESMTPSA id C773761377; Wed, 29 Jun 2016 08:28:05 +0000 (UTC) From: Sinan Kaya To: linux-acpi@vger.kernel.org, timur@codeaurora.org, cov@codeaurora.org, jcm@redhat.com, alex.williamson@redhat.com, eric.auger@redhat.com Cc: linux-pci@vger.kernel.org, agross@codeaurora.org, linux-arm-msm@vger.kernel.org, linux-arm-kernel@lists.infradead.org, wim@djo.tudelft.nl, perex@perex.cz, tiwai@suse.com, Sinan Kaya , "Rafael J. Wysocki" , Len Brown , linux-kernel@vger.kernel.org Subject: [PATCH V2 3/4] ACPI,PCI,IRQ: separate ISA penalty calculation Date: Wed, 29 Jun 2016 04:27:37 -0400 Message-Id: <1467188859-28188-4-git-send-email-okaya@codeaurora.org> X-Mailer: git-send-email 1.8.2.1 In-Reply-To: <1467188859-28188-1-git-send-email-okaya@codeaurora.org> References: <1467188859-28188-1-git-send-email-okaya@codeaurora.org> Sender: linux-pci-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Since commit 103544d86976 ("ACPI,PCI,IRQ: reduce resource requirements") the penalty values are calculated on the fly rather than boot time. This works fine for PCI interrupts but not so well for the ISA interrupts. Whether an ISA interrupt is in use or not information is not available inside the pci_link.c file. This information gets sent externally via acpi_penalize_isa_irq function. If active is true, then the IRQ is in use by ISA. Otherwise, IRQ is in use by PCI. Since the current code relies on PCI Link object for determination of penalties, we are factoring in the PCI penalty twice after acpi_penalize_isa_irq function is called. This change is limiting the newly added functionality to just PCI interrupts so that old behavior is still maintained. Signed-off-by: Sinan Kaya --- drivers/acpi/pci_link.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/acpi/pci_link.c b/drivers/acpi/pci_link.c index 714ba4d..8c08971 100644 --- a/drivers/acpi/pci_link.c +++ b/drivers/acpi/pci_link.c @@ -496,9 +496,6 @@ static int acpi_irq_get_penalty(int irq) { int penalty = 0; - if (irq < ACPI_MAX_ISA_IRQS) - penalty += acpi_isa_irq_penalty[irq]; - /* * Penalize IRQ used by ACPI SCI. If ACPI SCI pin attributes conflict * with PCI IRQ attributes, mark ACPI SCI as ISA_ALWAYS so it won't be @@ -513,6 +510,9 @@ static int acpi_irq_get_penalty(int irq) penalty += PIRQ_PENALTY_PCI_USING; } + if (irq < ACPI_MAX_ISA_IRQS) + return penalty + acpi_isa_irq_penalty[irq]; + penalty += acpi_irq_pci_sharing_penalty(irq); return penalty; }