From patchwork Sat Oct 15 04:31:05 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sinan Kaya X-Patchwork-Id: 9377699 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 53620607FD for ; Sat, 15 Oct 2016 04:42:23 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4367A2A2CE for ; Sat, 15 Oct 2016 04:42:23 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 366F82A2DC; Sat, 15 Oct 2016 04:42:23 +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.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID 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 AF43B2A2CE for ; Sat, 15 Oct 2016 04:42:22 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752804AbcJOEl6 (ORCPT ); Sat, 15 Oct 2016 00:41:58 -0400 Received: from smtp.codeaurora.org ([198.145.29.96]:48908 "EHLO smtp.codeaurora.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750823AbcJOElk (ORCPT ); Sat, 15 Oct 2016 00:41:40 -0400 Received: by smtp.codeaurora.org (Postfix, from userid 1000) id 5946A617C4; Sat, 15 Oct 2016 04:31:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1476505878; bh=AVU1x6nFGWBPXf0x8bYp/52aKHAHgFnFaO6cRnTURzA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ARWQPp5wyARkN1/Prue+6ByxamegzFZA0saE8mV8KhFR2EhhfS2Joty+Ctfl6TaON l2xX94zMdJ8iccXlozNURBoyXMuqug0q0DiE3FVBrYs0V1g51HzQjDqt09FvJYv3dY 3pJNHjGpfn47u9vO+SpEt30S9xqJpvAbEN4iyAmY= Received: from drakthul.qualcomm.com (global_nat1_iad_fw.qualcomm.com [129.46.232.65]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: okaya@smtp.codeaurora.org) by smtp.codeaurora.org (Postfix) with ESMTPSA id A2EE76170F; Sat, 15 Oct 2016 04:31:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1476505877; bh=AVU1x6nFGWBPXf0x8bYp/52aKHAHgFnFaO6cRnTURzA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=FTJ3Y5C1RptPf8Wrhajxv7lZWeBhedtUNfSbVjYxdfevhi1lwJ/sa4XUZSje1hxJf eIE5jcHDR5O2YVTPr5bjuF8pxEuGZxTaikienjZcAyQW0oOAO7SYzfYpQVvtnwyDsU NqtjlZI+QTr93eXY+B+mOuVpxNLxfnpBm4XeK9TU= DMARC-Filter: OpenDMARC Filter v1.3.1 smtp.codeaurora.org A2EE76170F Authentication-Results: pdx-caf-mail.web.codeaurora.org; dmarc=none header.from=codeaurora.org Authentication-Results: pdx-caf-mail.web.codeaurora.org; spf=pass smtp.mailfrom=okaya@codeaurora.org From: Sinan Kaya To: linux-acpi@vger.kernel.org, rjw@rjwysocki.net, bhelgaas@google.com, ravikanth.nalla@hpe.com, linux@rainbow-software.org, timur@codeaurora.org, cov@codeaurora.org, jcm@redhat.com, alex.williamson@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, Sinan Kaya , Len Brown , linux-kernel@vger.kernel.org Subject: [PATCH V3 1/3] ACPI, PCI IRQ: add PCI_USING penalty for ISA interrupts Date: Sat, 15 Oct 2016 00:31:05 -0400 Message-Id: <1476505867-24599-2-git-send-email-okaya@codeaurora.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1476505867-24599-1-git-send-email-okaya@codeaurora.org> References: <1476505867-24599-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 The change introduced in commit 103544d86976 ("ACPI,PCI,IRQ: reduce resource requirements") removed PCI_USING penalty from acpi_pci_link_allocate function as there is no longer a fixed size penalty array for both PCI interrupts greater than 16. The array size has been reduced to 16 and array name got prefixed as ISA since it only is accountable for the ISA interrupts. The original change in commit 103544d86976 ("ACPI,PCI,IRQ: reduce resource requirements") removed penalty assignment in the code for PCI thinking that we will add the penalty later in acpi_irq_pci_sharing_penalty function. However, this function only gets called if the IRQ number is greater than 16 and acpi_irq_get_penalty function gets called before ACPI start in acpi_isa_irq_available and acpi_penalize_isa_irq functions. We can't rely on iterating the link list. We need to add the PCI_USING penalty for ISA interrupts too if the link is in use and matches our ISA IRQ number. Signed-off-by: Sinan Kaya Acked-by: Bjorn Helgaas --- drivers/acpi/pci_link.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/acpi/pci_link.c b/drivers/acpi/pci_link.c index c983bf7..a212709 100644 --- a/drivers/acpi/pci_link.c +++ b/drivers/acpi/pci_link.c @@ -619,6 +619,10 @@ static int acpi_pci_link_allocate(struct acpi_pci_link *link) acpi_device_bid(link->device)); return -ENODEV; } else { + if (link->irq.active < ACPI_MAX_ISA_IRQS) + acpi_isa_irq_penalty[link->irq.active] += + PIRQ_PENALTY_PCI_USING; + printk(KERN_WARNING PREFIX "%s [%s] enabled at IRQ %d\n", acpi_device_name(link->device), acpi_device_bid(link->device), link->irq.active);