From patchwork Wed Oct 15 03:07:07 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: wangyijing X-Patchwork-Id: 38747 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wi0-f200.google.com (mail-wi0-f200.google.com [209.85.212.200]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 205DE20C85 for ; Wed, 15 Oct 2014 02:30:50 +0000 (UTC) Received: by mail-wi0-f200.google.com with SMTP id h11sf267954wiw.11 for ; Tue, 14 Oct 2014 19:30:49 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:sender:precedence:list-id :x-original-sender:x-original-authentication-results:mailing-list :list-post:list-help:list-archive:list-unsubscribe:content-type; bh=+No0zrgBNRLj2emCJuvP8hP2jN9aiH4We4C4E+ufiyo=; b=OKduoCb7lOQZRIRHbQDtm4hEqffUMZBUj0m3b8ICNqbfuKXnkG7hNpPKvte9YM7e8L FBLgs0DXnJjsXnp/Yhq757KrI/DDdeEAT3NXyaI9/h+z2cECseKOan8BusRJJTntCVlD B+vmYpwEJO6KVPKWwCaNlLpcINF5IbktQoV07F1R1Tn8/G4UJbnx9MYI013CtgfnauIH eK5BqKKE81fwatJh1PKkAZ3nRz1yurWasCmvuol/ISMqKK01pHjC/KTNVMgkRP3uUUxX +uzCw9bDDAbo83Ux1aEKoz4U53lNVgT/61aCNiWNlVBOMgoluAI60yDP3NDQg7rLjGYD 0Y/A== X-Gm-Message-State: ALoCoQlluRnEabQVioHII6syRBGGtFemSl9HtPNl+v/AScFvt/f+VAcL9nKBj0GZUGCnsyLkVdUW X-Received: by 10.112.95.133 with SMTP id dk5mr121364lbb.3.1413340249321; Tue, 14 Oct 2014 19:30:49 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.19.227 with SMTP id i3ls8045lae.28.gmail; Tue, 14 Oct 2014 19:30:48 -0700 (PDT) X-Received: by 10.152.20.132 with SMTP id n4mr9324820lae.50.1413340248949; Tue, 14 Oct 2014 19:30:48 -0700 (PDT) Received: from mail-lb0-f178.google.com (mail-lb0-f178.google.com [209.85.217.178]) by mx.google.com with ESMTPS id j4si28599509lbn.98.2014.10.14.19.30.48 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 14 Oct 2014 19:30:48 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.178 as permitted sender) client-ip=209.85.217.178; Received: by mail-lb0-f178.google.com with SMTP id w7so245058lbi.23 for ; Tue, 14 Oct 2014 19:30:48 -0700 (PDT) X-Received: by 10.112.45.228 with SMTP id q4mr9200705lbm.35.1413340248862; Tue, 14 Oct 2014 19:30:48 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.112.84.229 with SMTP id c5csp517632lbz; Tue, 14 Oct 2014 19:30:48 -0700 (PDT) X-Received: by 10.68.143.226 with SMTP id sh2mr9478897pbb.62.1413340246844; Tue, 14 Oct 2014 19:30:46 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id dd3si14574235pdb.47.2014.10.14.19.30.46 for ; Tue, 14 Oct 2014 19:30:46 -0700 (PDT) Received-SPF: none (google.com: linux-kernel-owner@vger.kernel.org does not designate permitted sender hosts) client-ip=209.132.180.67; Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756096AbaJOCaj (ORCPT + 27 others); Tue, 14 Oct 2014 22:30:39 -0400 Received: from szxga03-in.huawei.com ([119.145.14.66]:56331 "EHLO szxga03-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932772AbaJOC0F (ORCPT ); Tue, 14 Oct 2014 22:26:05 -0400 Received: from 172.24.2.119 (EHLO szxeml412-hub.china.huawei.com) ([172.24.2.119]) by szxrg03-dlp.huawei.com (MOS 4.4.3-GA FastPath queued) with ESMTP id AVO63802; Wed, 15 Oct 2014 10:25:59 +0800 (CST) Received: from localhost.localdomain (10.175.100.166) by szxeml412-hub.china.huawei.com (10.82.67.91) with Microsoft SMTP Server id 14.3.158.1; Wed, 15 Oct 2014 10:25:48 +0800 From: Yijing Wang To: Bjorn Helgaas CC: , , Xinwei Hu , Wuyun , , Russell King , , , , , Arnd Bergmann , Thomas Gleixner , "Konrad Rzeszutek Wilk" , , Joerg Roedel , , , Benjamin Herrenschmidt , , , Sebastian Ott , "Tony Luck" , , "David S. Miller" , , Chris Metcalf , Ralf Baechle , Lucas Stach , David Vrabel , "Sergei Shtylyov" , Michael Ellerman , Thierry Reding , "Thomas Petazzoni" , Liviu Dudau , Yijing Wang Subject: [PATCH v3 19/27] MIPS/Xlp/MSI: Use MSI chip framework to configure MSI/MSI-X irq Date: Wed, 15 Oct 2014 11:07:07 +0800 Message-ID: <1413342435-7876-20-git-send-email-wangyijing@huawei.com> X-Mailer: git-send-email 1.7.1 In-Reply-To: <1413342435-7876-1-git-send-email-wangyijing@huawei.com> References: <1413342435-7876-1-git-send-email-wangyijing@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.175.100.166] X-CFilter-Loop: Reflected X-Mirapoint-Virus-RAPID-Raw: score=unknown(0), refid=str=0001.0A020209.543DDB37.00B8, ss=1, re=0.000, recu=0.000, reip=0.000, cl=1, cld=1, fgs=0, ip=0.0.0.0, so=2013-05-26 15:14:31, dmn=2013-03-21 17:37:32 X-Mirapoint-Loop-Id: 0054f166a817865d82e6391a1024f9e5 Sender: linux-kernel-owner@vger.kernel.org Precedence: list List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: wangyijing@huawei.com X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.178 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , Use MSI chip framework instead of arch MSI functions to configure MSI/MSI-X IRQ. So we can manage MSI/MSI-X irq in a unified framework. Signed-off-by: Yijing Wang --- arch/mips/include/asm/netlogic/xlp-hal/pcibus.h | 1 + arch/mips/pci/msi-xlp.c | 11 +++++++++-- arch/mips/pci/pci-xlp.c | 3 +++ 3 files changed, 13 insertions(+), 2 deletions(-) diff --git a/arch/mips/include/asm/netlogic/xlp-hal/pcibus.h b/arch/mips/include/asm/netlogic/xlp-hal/pcibus.h index 91540f4..90646ad 100644 --- a/arch/mips/include/asm/netlogic/xlp-hal/pcibus.h +++ b/arch/mips/include/asm/netlogic/xlp-hal/pcibus.h @@ -103,6 +103,7 @@ #ifdef CONFIG_PCI_MSI void xlp_init_node_msi_irqs(int node, int link); +extern struct msi_chip xlp_chip; #else static inline void xlp_init_node_msi_irqs(int node, int link) {} #endif diff --git a/arch/mips/pci/msi-xlp.c b/arch/mips/pci/msi-xlp.c index e469dc7..cca2257 100644 --- a/arch/mips/pci/msi-xlp.c +++ b/arch/mips/pci/msi-xlp.c @@ -245,7 +245,8 @@ static struct irq_chip xlp_msix_chip = { .irq_unmask = unmask_msi_irq, }; -void arch_teardown_msi_irq(unsigned int irq) +static void xlp_teardown_msi_irq(struct msi_chip *chip, + unsigned int irq) { } @@ -450,7 +451,8 @@ static int xlp_setup_msix(uint64_t lnkbase, int node, int link, return 0; } -int arch_setup_msi_irq(struct pci_dev *dev, struct msi_desc *desc) +static int xlp_setup_msi_irq(struct msi_chip *chip, + struct pci_dev *dev, struct msi_desc *desc) { struct pci_dev *lnkdev; uint64_t lnkbase; @@ -472,6 +474,11 @@ int arch_setup_msi_irq(struct pci_dev *dev, struct msi_desc *desc) return xlp_setup_msi(lnkbase, node, link, desc); } +struct msi_chip xlp_chip = { + .setup_irq = xlp_setup_msi_irq, + .teardown_irq = xlp_teardown_msi_irq, +}; + void __init xlp_init_node_msi_irqs(int node, int link) { struct nlm_soc_info *nodep; diff --git a/arch/mips/pci/pci-xlp.c b/arch/mips/pci/pci-xlp.c index 7babf01..5d7b6a0 100644 --- a/arch/mips/pci/pci-xlp.c +++ b/arch/mips/pci/pci-xlp.c @@ -174,6 +174,9 @@ struct pci_controller nlm_pci_controller = { .mem_offset = 0x00000000UL, .io_resource = &nlm_pci_io_resource, .io_offset = 0x00000000UL, +#ifdef CONFIG_PCI_MSI + .msi_chip = &xlp_chip, +#endif }; struct pci_dev *xlp_get_pcie_link(const struct pci_dev *dev)