From patchwork Mon Oct 24 04:31:30 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sinan Kaya X-Patchwork-Id: 9391369 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 B4466607D0 for ; Mon, 24 Oct 2016 04:32:28 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A9D9D28C2C for ; Mon, 24 Oct 2016 04:32:28 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 9DE4F28C25; Mon, 24 Oct 2016 04:32:28 +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 3E56028C25 for ; Mon, 24 Oct 2016 04:32:28 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751606AbcJXEbq (ORCPT ); Mon, 24 Oct 2016 00:31:46 -0400 Received: from smtp.codeaurora.org ([198.145.29.96]:50045 "EHLO smtp.codeaurora.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751137AbcJXEbn (ORCPT ); Mon, 24 Oct 2016 00:31:43 -0400 Received: by smtp.codeaurora.org (Postfix, from userid 1000) id 16A0861B29; Mon, 24 Oct 2016 04:31:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1477283502; bh=R6fRid3vOSGKbQkkM+ZffWweN7ulbKK634No/WlbbdQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=iIYDGh+E4bWcLPXbuiUTFWTLAbeUbVhS8kYES/zQdyVTbGHvoJPnlUTllPCuY2dvz CvNj0YeME3uvOqtKUyI8pgb4whIZXOzYtVU2P4s6yEBb9s/wMzsX2ryR4IWwmE1pzu 6K8EfzKOypIp3tx5LNK37/BGhcUEbHzTOzxK37Cc= 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 5533C61AF5; Mon, 24 Oct 2016 04:31:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1477283501; bh=R6fRid3vOSGKbQkkM+ZffWweN7ulbKK634No/WlbbdQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=mp9Z3hHjeT8/fQWdz1t0ugi5JKTeUzdGyjE9OIOjhL1258z1nMKQjm2VsXUOr+acE sypjS8KgRAKVJ1rzVz9T4MiAwGcMopeP/9/4nyCtcsAwFKb/hw1E7iJEATJGv9u1Q7 jgwK8BLYJV98rq/t7Sk3NLL/L+kVlspbD8arXQXQ= DMARC-Filter: OpenDMARC Filter v1.3.1 smtp.codeaurora.org 5533C61AF5 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: net147@gmail.com, 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 V5 1/3] ACPI, PCI, IRQ: assign ISA IRQ directly during early boot stages Date: Mon, 24 Oct 2016 00:31:30 -0400 Message-Id: <1477283492-26657-2-git-send-email-okaya@codeaurora.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1477283492-26657-1-git-send-email-okaya@codeaurora.org> References: <1477283492-26657-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 We do not want to store the SCI penalty in the acpi_isa_irq_penalty[] table because acpi_isa_irq_penalty[] only holds ISA IRQ penalties and there's no guarantee that the SCI is an ISA IRQ. We add in the SCI penalty as a special case in acpi_irq_get_penalty(). But if we called acpi_penalize_isa_irq() or acpi_irq_penalty_update() for an SCI that happened to be an ISA IRQ, they stored the SCI penalty (part of the acpi_irq_get_penalty() return value) in acpi_isa_irq_penalty[]. Subsequent calls to acpi_irq_get_penalty() returned a penalty that included *two* SCI penalties. Signed-off-by: Sinan Kaya Acked-by: Bjorn Helgaas Tested-by: Jonathan Liu --- drivers/acpi/pci_link.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/acpi/pci_link.c b/drivers/acpi/pci_link.c index c983bf7..6229b02 100644 --- a/drivers/acpi/pci_link.c +++ b/drivers/acpi/pci_link.c @@ -849,7 +849,7 @@ static int __init acpi_irq_penalty_update(char *str, int used) continue; if (used) - new_penalty = acpi_irq_get_penalty(irq) + + new_penalty = acpi_isa_irq_penalty[irq] + PIRQ_PENALTY_ISA_USED; else new_penalty = 0; @@ -871,7 +871,7 @@ static int __init acpi_irq_penalty_update(char *str, int used) void acpi_penalize_isa_irq(int irq, int active) { if ((irq >= 0) && (irq < ARRAY_SIZE(acpi_isa_irq_penalty))) - acpi_isa_irq_penalty[irq] = acpi_irq_get_penalty(irq) + + acpi_isa_irq_penalty[irq] += (active ? PIRQ_PENALTY_ISA_USED : PIRQ_PENALTY_PCI_USING); }