From patchwork Fri Sep 5 10:10:04 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: wangyijing X-Patchwork-Id: 36806 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-yh0-f69.google.com (mail-yh0-f69.google.com [209.85.213.69]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 1D330202E4 for ; Fri, 5 Sep 2014 09:55:02 +0000 (UTC) Received: by mail-yh0-f69.google.com with SMTP id a41sf2424206yho.0 for ; Fri, 05 Sep 2014 02:55:01 -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:date:message-id:in-reply-to :references:mime-version:cc:subject:precedence:list-id :list-unsubscribe:list-post:list-help:list-subscribe:sender :errors-to:x-original-sender:x-original-authentication-results :mailing-list:list-archive:content-type:content-transfer-encoding; bh=zR84FQar7htgxhGxluXaOUgtJJ1QmsAvnrBf4GlUd5w=; b=FEn8WlLLwxREpDlb2CmBKs2aTdNa8mkSMjeWdW9bikaIxe2LOznnPFg/N6C1sW/Ucd +DzKU/pY9DUZGc7gChZCBv8gkVo/SpHA3PakGtLg5moDBYPikPyA9lwrThexRm+MXHQN gpVmh+JMJrjpudnwV543GomLCS9rS7y8pkCy+AvjE8BgJyaZn2MU6+abyJfF/CdytYy9 +i+0/AsAOqXUKoC1nYAcDG6uq+Q6P89Zrm+1lnkBB+jIlrXGKUOjfokJF7lOXoXnCFzj 7upzoXRhLTxhGAWgryOAiPMGg1ho1buAj0PSY96MOFhWFCx1b4afEp5iSbsfOxdTQnIm 0vhg== X-Gm-Message-State: ALoCoQmeMHnxrTNFSA2F2KhAuAPxLV9cBlqh5gbuJu1IDKNB/WHgwEpOhtMaeK0+s1ZTY1A/KQyA X-Received: by 10.236.63.197 with SMTP id a45mr6859623yhd.9.1409910901936; Fri, 05 Sep 2014 02:55:01 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.23.201 with SMTP id 67ls606439qgp.45.gmail; Fri, 05 Sep 2014 02:55:01 -0700 (PDT) X-Received: by 10.52.129.165 with SMTP id nx5mr6918768vdb.25.1409910901823; Fri, 05 Sep 2014 02:55:01 -0700 (PDT) Received: from mail-vc0-f176.google.com (mail-vc0-f176.google.com [209.85.220.176]) by mx.google.com with ESMTPS id gs5si841650vdc.69.2014.09.05.02.55.01 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 05 Sep 2014 02:55:01 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.220.176 as permitted sender) client-ip=209.85.220.176; Received: by mail-vc0-f176.google.com with SMTP id ik5so11933920vcb.21 for ; Fri, 05 Sep 2014 02:55:01 -0700 (PDT) X-Received: by 10.221.23.198 with SMTP id rb6mr9335174vcb.19.1409910901742; Fri, 05 Sep 2014 02:55:01 -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.221.45.67 with SMTP id uj3csp57259vcb; Fri, 5 Sep 2014 02:55:01 -0700 (PDT) X-Received: by 10.220.172.8 with SMTP id j8mr566803vcz.32.1409910901331; Fri, 05 Sep 2014 02:55:01 -0700 (PDT) Received: from lists.xen.org (lists.xen.org. [50.57.142.19]) by mx.google.com with ESMTPS id ca9si886959vdc.27.2014.09.05.02.55.00 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Fri, 05 Sep 2014 02:55:01 -0700 (PDT) Received-SPF: none (google.com: xen-devel-bounces@lists.xen.org does not designate permitted sender hosts) client-ip=50.57.142.19; Received: from localhost ([127.0.0.1] helo=lists.xen.org) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1XPqD0-0007Hw-VH; Fri, 05 Sep 2014 09:53:34 +0000 Received: from mail6.bemta3.messagelabs.com ([195.245.230.39]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1XPqCz-0007FF-Eh for xen-devel@lists.xenproject.org; Fri, 05 Sep 2014 09:53:33 +0000 Received: from [85.158.137.68:14596] by server-3.bemta-3.messagelabs.com id B7/7E-22751-C1889045; Fri, 05 Sep 2014 09:53:32 +0000 X-Env-Sender: wangyijing@huawei.com X-Msg-Ref: server-13.tower-31.messagelabs.com!1409910808!12740357!1 X-Originating-IP: [119.145.14.64] X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: VHJ1c3RlZCBJUDogMTE5LjE0NS4xNC42NCA9PiA4MDE5MQ==\n X-StarScan-Received: X-StarScan-Version: 6.11.3; banners=-,-,- X-VirusChecked: Checked Received: (qmail 18117 invoked from network); 5 Sep 2014 09:53:31 -0000 Received: from szxga01-in.huawei.com (HELO szxga01-in.huawei.com) (119.145.14.64) by server-13.tower-31.messagelabs.com with RC4-SHA encrypted SMTP; 5 Sep 2014 09:53:31 -0000 Received: from 172.24.2.119 (EHLO szxeml419-hub.china.huawei.com) ([172.24.2.119]) by szxrg01-dlp.huawei.com (MOS 4.3.7-GA FastPath queued) with ESMTP id CBG93478; Fri, 05 Sep 2014 17:46:06 +0800 (CST) Received: from localhost.localdomain (10.175.100.166) by szxeml419-hub.china.huawei.com (10.82.67.158) with Microsoft SMTP Server id 14.3.158.1; Fri, 5 Sep 2014 17:45:58 +0800 From: Yijing Wang To: Bjorn Helgaas Date: Fri, 5 Sep 2014 18:10:04 +0800 Message-ID: <1409911806-10519-20-git-send-email-wangyijing@huawei.com> X-Mailer: git-send-email 1.7.1 In-Reply-To: <1409911806-10519-1-git-send-email-wangyijing@huawei.com> References: <1409911806-10519-1-git-send-email-wangyijing@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.175.100.166] X-CFilter-Loop: Reflected Cc: linux-mips@linux-mips.org, linux-ia64@vger.kernel.org, linux-pci@vger.kernel.org, Bharat.Bhushan@freescale.com, Yijing Wang , sparclinux@vger.kernel.org, linux-arch@vger.kernel.org, linux-s390@vger.kernel.org, Russell King , Joerg Roedel , x86@kernel.org, Sebastian Ott , Benjamin Herrenschmidt , xen-devel@lists.xenproject.org, arnab.basu@freescale.com, Arnd Bergmann , Chris Metcalf , Thomas Gleixner , linux-arm-kernel@lists.infradead.org, Xinwei Hu , Tony Luck , Ralf Baechle , iommu@lists.linux-foundation.org, Wuyun , linuxppc-dev@lists.ozlabs.org, "David S. Miller" Subject: [Xen-devel] [PATCH v1 19/21] Sparc/MSI: Use MSI chip framework to configure MSI/MSI-X irq X-BeenThere: xen-devel@lists.xen.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Post: , List-Help: , List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.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.220.176 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-Archive: 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/sparc/kernel/pci.c | 14 ++++++++++++-- 1 files changed, 12 insertions(+), 2 deletions(-) diff --git a/arch/sparc/kernel/pci.c b/arch/sparc/kernel/pci.c index b36365f..2a89ee2 100644 --- a/arch/sparc/kernel/pci.c +++ b/arch/sparc/kernel/pci.c @@ -905,7 +905,7 @@ int pci_domain_nr(struct pci_bus *pbus) EXPORT_SYMBOL(pci_domain_nr); #ifdef CONFIG_PCI_MSI -int arch_setup_msi_irq(struct pci_dev *pdev, struct msi_desc *desc) +int sparc_setup_msi_irq(struct pci_dev *pdev, struct msi_desc *desc) { struct pci_pbm_info *pbm = pdev->dev.archdata.host_controller; unsigned int irq; @@ -916,7 +916,7 @@ int arch_setup_msi_irq(struct pci_dev *pdev, struct msi_desc *desc) return pbm->setup_msi_irq(&irq, pdev, desc); } -void arch_teardown_msi_irq(unsigned int irq) +void sparc_teardown_msi_irq(unsigned int irq) { struct msi_desc *entry = irq_get_msi_desc(irq); struct pci_dev *pdev = entry->dev; @@ -925,6 +925,16 @@ void arch_teardown_msi_irq(unsigned int irq) if (pbm->teardown_msi_irq) pbm->teardown_msi_irq(irq, pdev); } + +static struct msi_chip sparc_msi_chip = { + .setup_irq = sparc_setup_msi_irq, + .teardown_irq = sparc_teardown_msi_irq, +}; + +struct msi_chip *arch_find_msi_chip(struct pci_dev *dev) +{ + return &sparc_msi_chip; +} #endif /* !(CONFIG_PCI_MSI) */ static void ali_sound_dma_hack(struct pci_dev *pdev, int set_bit)