From patchwork Fri Sep 5 10:09:50 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: wangyijing X-Patchwork-Id: 36809 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-pd0-f198.google.com (mail-pd0-f198.google.com [209.85.192.198]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 6446F202E4 for ; Fri, 5 Sep 2014 09:59:48 +0000 (UTC) Received: by mail-pd0-f198.google.com with SMTP id fp1sf65949541pdb.9 for ; Fri, 05 Sep 2014 02:59:44 -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=BROW2x6Ym2ilPyRzaiRoqS5p0Fpm3irjjmVWuSZAdjg=; b=fNj3fLQphXwDM3SEj7Xk+WgNQHRzO6IzofGa5X39lvCXO8AoJzTcaBa3NtOV6ELBGy WX74rvK/w9BgWYfTGKgxVhtwV2QNBetU7AWew/1XHE3oRxLx/Jl7eG0/gBT71cYL0thX fIfCUZIulGXmjMQl7ILEuzvt5V8UdY9KXRvlt1R7jm4j0tHf27oG1+bQBr6+Hrib+2Vy DzvlDnxoNvuMGDufcsonFEt4709MjpcrPckmQaYkw5eB2ZB6TCqybN9uvsYHi/VyDyPG MBwCBCQ6+K2Y2ANdJJJhfdse/ZaPaKr9zIozHhim9dR/MUajr6mxEWF5NZeCHQQmRHP+ q+Kg== X-Gm-Message-State: ALoCoQks6Cty24PuQRN9GkCxirVRbbGgsmoqrqM9DSTdGvPpdn4BmDqKaHp6uwOGg4Lw2Trn/0PE X-Received: by 10.66.248.232 with SMTP id yp8mr6133834pac.22.1409911183826; Fri, 05 Sep 2014 02:59:43 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.40.180 with SMTP id x49ls648878qgx.97.gmail; Fri, 05 Sep 2014 02:59:43 -0700 (PDT) X-Received: by 10.220.163.69 with SMTP id z5mr9425084vcx.10.1409911183696; Fri, 05 Sep 2014 02:59:43 -0700 (PDT) Received: from mail-vc0-f175.google.com (mail-vc0-f175.google.com [209.85.220.175]) by mx.google.com with ESMTPS id n3si245086vcj.92.2014.09.05.02.59.43 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 05 Sep 2014 02:59:43 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.220.175 as permitted sender) client-ip=209.85.220.175; Received: by mail-vc0-f175.google.com with SMTP id lf12so12067777vcb.34 for ; Fri, 05 Sep 2014 02:59:43 -0700 (PDT) X-Received: by 10.52.137.2 with SMTP id qe2mr7842194vdb.11.1409911183602; Fri, 05 Sep 2014 02:59:43 -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 uj3csp57679vcb; Fri, 5 Sep 2014 02:59:43 -0700 (PDT) X-Received: by 10.221.68.66 with SMTP id xx2mr9350409vcb.1.1409911183221; Fri, 05 Sep 2014 02:59:43 -0700 (PDT) Received: from lists.xen.org (lists.xen.org. [50.57.142.19]) by mx.google.com with ESMTPS id p9si854349vdv.59.2014.09.05.02.59.42 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Fri, 05 Sep 2014 02:59:43 -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 1XPqHk-0000cp-Cu; Fri, 05 Sep 2014 09:58:28 +0000 Received: from mail6.bemta4.messagelabs.com ([85.158.143.247]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1XPqHi-0000c8-JM for xen-devel@lists.xenproject.org; Fri, 05 Sep 2014 09:58:26 +0000 Received: from [85.158.143.35:25276] by server-3.bemta-4.messagelabs.com id DC/71-06192-14989045; Fri, 05 Sep 2014 09:58:25 +0000 X-Env-Sender: wangyijing@huawei.com X-Msg-Ref: server-12.tower-21.messagelabs.com!1409911101!11867072!1 X-Originating-IP: [119.145.14.66] X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: VHJ1c3RlZCBJUDogMTE5LjE0NS4xNC42NiA9PiA4NTI3\n X-StarScan-Received: X-StarScan-Version: 6.11.3; banners=-,-,- X-VirusChecked: Checked Received: (qmail 18864 invoked from network); 5 Sep 2014 09:58:25 -0000 Received: from szxga03-in.huawei.com (HELO szxga03-in.huawei.com) (119.145.14.66) by server-12.tower-21.messagelabs.com with RC4-SHA encrypted SMTP; 5 Sep 2014 09:58:25 -0000 Received: from 172.24.2.119 (EHLO szxeml419-hub.china.huawei.com) ([172.24.2.119]) by szxrg03-dlp.huawei.com (MOS 4.4.3-GA FastPath queued) with ESMTP id ATY92835; Fri, 05 Sep 2014 17:45:43 +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:33 +0800 From: Yijing Wang To: Bjorn Helgaas Date: Fri, 5 Sep 2014 18:09:50 +0800 Message-ID: <1409911806-10519-6-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 X-Mirapoint-Virus-RAPID-Raw: score=unknown(0), refid=str=0001.0A020209.5409864A.0158,ss=1,re=0.000,fgs=0, ip=0.0.0.0, so=2013-05-26 15:14:31, dmn=2011-05-27 18:58:46 X-Mirapoint-Loop-Id: 39fd2aad392f9628d870828a9aad7b37 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 05/21] PCI/MSI: Introduce weak arch_find_msi_chip() to find MSI chip 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.175 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: Introduce weak arch_find_msi_chip() to find the match msi_chip. Currently, MSI chip associates pci bus to msi_chip. Because in ARM platform, there may be more than one MSI controller in system. Associate pci bus to msi_chip help pci device to find the match msi_chip and setup MSI/MSI-X irq correctly. But in other platform, like in x86. we only need one MSI chip, because all device use the same MSI address/data and irq etc. So it's no need to associate pci bus to MSI chip, just use a arch function, arch_find_msi_chip() to return the MSI chip for simplicity. The default weak arch_find_msi_chip() used in ARM platform, find the MSI chip by pci bus. Signed-off-by: Yijing Wang --- drivers/pci/msi.c | 7 ++++++- 1 files changed, 6 insertions(+), 1 deletions(-) diff --git a/drivers/pci/msi.c b/drivers/pci/msi.c index a77e7f7..539c11d 100644 --- a/drivers/pci/msi.c +++ b/drivers/pci/msi.c @@ -29,9 +29,14 @@ static int pci_msi_enable = 1; /* Arch hooks */ +struct msi_chip * __weak arch_find_msi_chip(struct pci_dev *dev) +{ + return dev->bus->msi; +} + int __weak arch_setup_msi_irq(struct pci_dev *dev, struct msi_desc *desc) { - struct msi_chip *chip = dev->bus->msi; + struct msi_chip *chip = arch_find_msi_chip(dev); int err; if (!chip || !chip->setup_irq)