From patchwork Tue Aug 5 16:11:04 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matthew Minter X-Patchwork-Id: 4680331 X-Patchwork-Delegate: bhelgaas@google.com Return-Path: X-Original-To: patchwork-linux-pci@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 67707C0338 for ; Tue, 5 Aug 2014 16:12:13 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 8B62F2017A for ; Tue, 5 Aug 2014 16:12:12 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id BBC722017D for ; Tue, 5 Aug 2014 16:12:11 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755094AbaHEQMJ (ORCPT ); Tue, 5 Aug 2014 12:12:09 -0400 Received: from mail-wg0-f43.google.com ([74.125.82.43]:61764 "EHLO mail-wg0-f43.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754797AbaHEQME (ORCPT ); Tue, 5 Aug 2014 12:12:04 -0400 Received: by mail-wg0-f43.google.com with SMTP id l18so1205528wgh.2 for ; Tue, 05 Aug 2014 09:11:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=myport.ac.uk; s=google-20130730; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=eKN8wnTG3L2z/Hj3/bB3gxJNGeIb8VQvvFQvMzZdXWA=; b=Q1nf4KkxqiN/Js0mt2Eut5W4Lqbk3rm3mWL+kopXbqKrUIQpvjSiS8tOM9bR4DKKma T87kCm2cV45MIveG4h8zgNzom7AkoLobGWNlho7c4vXl1T6mx7Auri+JQvxlKc0Wa7o1 ikcRAYqbbunJ/vawu07hz9JEV23Cw2TsWkb5I= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references; bh=eKN8wnTG3L2z/Hj3/bB3gxJNGeIb8VQvvFQvMzZdXWA=; b=iW2JjKxFq+bVf1X1pZB3YIgsCUK276x0DoWDQUTN4ebEmBe31s0e1IO88LZv+K8hvm 9od7rHBdShGTDnXjh/WoykpVC99oMvbZsgSnvdusViqMzez3CbzTIXLsLMerLwL5d9+P DfNWJb8cgm1B3i9JYHuiU/i8NX1PmQ3QUaTd6ryb4Yz81bfW79dHmUzrBfSj3CZQSJkw qRU6wX3659EpJ7+djR5Xk2eJmxzXM1NRq5g5TtjDV2QawGDSWVfiZyTG9mKT4kSoJ2tN nTHk8iybBTthhbgAJqpu1WQ6lDhlpcfZuQDViGFwIsTaa1ta1wQ6n17Xt5Hhi1+dCKqu Y+LQ== X-Gm-Message-State: ALoCoQlfsTCxWJPAuHu1vAbPq+hhQzQmKZgVxE5au+cxOJbsDvB8UC2MGq+PZN7x2e15WjJW3Dk0 X-Received: by 10.194.23.8 with SMTP id i8mr7213840wjf.104.1407255119120; Tue, 05 Aug 2014 09:11:59 -0700 (PDT) Received: from localhost.xy01.xyratex.com (xyratex195.xyratex.com. [194.131.166.195]) by mx.google.com with ESMTPSA id e3sm5169369wjp.4.2014.08.05.09.11.58 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Tue, 05 Aug 2014 09:11:58 -0700 (PDT) From: matthew_minter@xyratex.com To: bhelgaas@google.com, linux-pci@vger.kernel.org Cc: matthew_minter Subject: [PATCH 03/22] Added (untested) support to powerpc initialisation to fix pci irq changes Date: Tue, 5 Aug 2014 17:11:04 +0100 Message-Id: <1407255083-9356-4-git-send-email-matthew_minter@xyratex.com> X-Mailer: git-send-email 2.0.4 In-Reply-To: <1407255083-9356-1-git-send-email-matthew_minter@xyratex.com> References: <1407255083-9356-1-git-send-email-matthew_minter@xyratex.com> Sender: linux-pci-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org X-Spam-Status: No, score=-7.5 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,RP_MATCHES_RCVD,T_DKIM_INVALID,UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: matthew_minter --- arch/powerpc/kernel/pci-common.c | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/arch/powerpc/kernel/pci-common.c b/arch/powerpc/kernel/pci-common.c index b49c72f..ed4bd53 100644 --- a/arch/powerpc/kernel/pci-common.c +++ b/arch/powerpc/kernel/pci-common.c @@ -226,7 +226,7 @@ struct pci_controller* pci_find_hose_for_OF_device(struct device_node* node) * If the interrupt is used, then gets the interrupt line from the * openfirmware and sets it in the pci_dev and pci_config line. */ -static int pci_read_irq_line(struct pci_dev *pci_dev) +static int pci_read_irq_line(struct pci_dev *pci_dev, u8 pin) { struct of_phandle_args oirq; unsigned int virq; @@ -238,7 +238,7 @@ static int pci_read_irq_line(struct pci_dev *pci_dev) #endif /* Try to get a mapping from the device-tree */ if (of_irq_parse_pci(pci_dev, &oirq)) { - u8 line, pin; + u8 line; /* If that fails, lets fallback to what is in the config * space and map that through the default controller. We @@ -247,10 +247,6 @@ static int pci_read_irq_line(struct pci_dev *pci_dev) * either provide a proper interrupt tree or don't use this * function. */ - if (pci_read_config_byte(pci_dev, PCI_INTERRUPT_PIN, &pin)) - return -1; - if (pin == 0) - return -1; if (pci_read_config_byte(pci_dev, PCI_INTERRUPT_LINE, &line) || line == 0xff || line == 0) { return -1; @@ -275,9 +271,16 @@ static int pci_read_irq_line(struct pci_dev *pci_dev) pr_debug(" Mapped to linux irq %d\n", virq); - pci_dev->irq = virq; + return virq; +} - return 0; +int pci_map_irq(struct pci_dev *dev, u8 slot, u8 pin) +{ + /* Read default IRQs and fixup if necessary */ + int irq = pci_read_irq_line(dev, pin); + if (ppc_md.pci_irq_fixup) + ppc_md.pci_irq_fixup(dev); + return irq; } /* @@ -775,6 +778,8 @@ int pci_proc_domain(struct pci_bus *bus) int pcibios_root_bridge_prepare(struct pci_host_bridge *bridge) { + bridge->swizzle_irq = NULL; + bridge->map_irq = pci_map_irq; if (ppc_md.pcibios_root_bridge_prepare) return ppc_md.pcibios_root_bridge_prepare(bridge); @@ -977,11 +982,6 @@ static void pcibios_setup_device(struct pci_dev *dev) /* Additional platform DMA/iommu setup */ if (ppc_md.pci_dma_dev_setup) ppc_md.pci_dma_dev_setup(dev); - - /* Read default IRQs and fixup if necessary */ - pci_read_irq_line(dev); - if (ppc_md.pci_irq_fixup) - ppc_md.pci_irq_fixup(dev); } int pcibios_add_device(struct pci_dev *dev)