From patchwork Thu Sep 25 03:14:26 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: wangyijing X-Patchwork-Id: 37892 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-ee0-f71.google.com (mail-ee0-f71.google.com [74.125.83.71]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id A443720063 for ; Thu, 25 Sep 2014 02:53:38 +0000 (UTC) Received: by mail-ee0-f71.google.com with SMTP id b57sf4505862eek.2 for ; Wed, 24 Sep 2014 19:53:37 -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=STuamonSpuLg6Np42qDVf9smjy5w0WcLjsKPAIrDCNc=; b=AkmvR/lriGolAwWtbuA35nIjd4cG/Slkg5fltqYqe/RCBC5f942YBsS7E4/yyLCcR0 pzCDjN1SU9OhZ2T7p3q0GKG1ruSeC+ajYl1mFul0xvlFw5iQ5rp1iMFYNokYA7B96RKI IxO8UY5+IHjY4SjsPvuT2TA0lDPQsGjH4uTBFXbswWQzA+jIwKqR6MkxdSpC8APSiEwm Q9TfgPRChARabbazc2hORHv0uM2pqdGnohVuk6qb7bLK3g/TIFdsewYkEjuFDE66SWVl gH91bWGhPLOm/12v68yaCm478sfo2xIS9vuir3wv83sXuzqWUa+UplUxC4gprPo4G382 ha3A== X-Gm-Message-State: ALoCoQl0J/o1Lai8OeSU2FqeHmkxpmwAP73Pq/+FS9VBxuhuW5znVS7N5YAUb/xZObTNilcdxqfI X-Received: by 10.152.2.97 with SMTP id 1mr285750lat.6.1411613617184; Wed, 24 Sep 2014 19:53:37 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.87.175 with SMTP id az15ls222922lab.96.gmail; Wed, 24 Sep 2014 19:53:36 -0700 (PDT) X-Received: by 10.112.202.1 with SMTP id ke1mr9656088lbc.33.1411613616763; Wed, 24 Sep 2014 19:53:36 -0700 (PDT) Received: from mail-lb0-f171.google.com (mail-lb0-f171.google.com [209.85.217.171]) by mx.google.com with ESMTPS id j8si1104382lag.57.2014.09.24.19.53.36 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 24 Sep 2014 19:53:36 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.171 as permitted sender) client-ip=209.85.217.171; Received: by mail-lb0-f171.google.com with SMTP id l4so11725517lbv.2 for ; Wed, 24 Sep 2014 19:53:36 -0700 (PDT) X-Received: by 10.112.130.68 with SMTP id oc4mr9448570lbb.41.1411613616451; Wed, 24 Sep 2014 19:53:36 -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.130.169 with SMTP id of9csp683381lbb; Wed, 24 Sep 2014 19:53:35 -0700 (PDT) X-Received: by 10.67.30.200 with SMTP id kg8mr14068671pad.35.1411613614912; Wed, 24 Sep 2014 19:53:34 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id ss8si1402939pab.0.2014.09.24.19.53.33 for ; Wed, 24 Sep 2014 19:53:34 -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 S1753457AbaIYCxb (ORCPT + 27 others); Wed, 24 Sep 2014 22:53:31 -0400 Received: from szxga03-in.huawei.com ([119.145.14.66]:62179 "EHLO szxga03-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752602AbaIYCu6 (ORCPT ); Wed, 24 Sep 2014 22:50:58 -0400 Received: from 172.24.2.119 (EHLO szxeml409-hub.china.huawei.com) ([172.24.2.119]) by szxrg03-dlp.huawei.com (MOS 4.4.3-GA FastPath queued) with ESMTP id AUU79144; Thu, 25 Sep 2014 10:50:53 +0800 (CST) Received: from localhost.localdomain (10.175.100.166) by szxeml409-hub.china.huawei.com (10.82.67.136) with Microsoft SMTP Server id 14.3.158.1; Thu, 25 Sep 2014 10:50:43 +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" , Yijing Wang Subject: [PATCH v2 16/22] Powerpc/MSI: Use MSI chip framework to configure MSI/MSI-X irq Date: Thu, 25 Sep 2014 11:14:26 +0800 Message-ID: <1411614872-4009-17-git-send-email-wangyijing@huawei.com> X-Mailer: git-send-email 1.7.1 In-Reply-To: <1411614872-4009-1-git-send-email-wangyijing@huawei.com> References: <1411614872-4009-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.5423830D.0090, 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: 3e65dd5cf40bdcae690e26bb4f085116 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.171 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 Acked-by: Michael Ellerman --- arch/powerpc/kernel/msi.c | 14 ++++++++++++-- 1 files changed, 12 insertions(+), 2 deletions(-) diff --git a/arch/powerpc/kernel/msi.c b/arch/powerpc/kernel/msi.c index 71bd161..01781a4 100644 --- a/arch/powerpc/kernel/msi.c +++ b/arch/powerpc/kernel/msi.c @@ -13,7 +13,7 @@ #include -int arch_setup_msi_irqs(struct pci_dev *dev, int nvec, int type) +static int ppc_setup_msi_irqs(struct pci_dev *dev, int nvec, int type) { if (!ppc_md.setup_msi_irqs || !ppc_md.teardown_msi_irqs) { pr_debug("msi: Platform doesn't provide MSI callbacks.\n"); @@ -27,7 +27,17 @@ int arch_setup_msi_irqs(struct pci_dev *dev, int nvec, int type) return ppc_md.setup_msi_irqs(dev, nvec, type); } -void arch_teardown_msi_irqs(struct pci_dev *dev) +static void ppc_teardown_msi_irqs(struct pci_dev *dev) { ppc_md.teardown_msi_irqs(dev); } + +static struct msi_chip ppc_msi_chip = { + .setup_irqs = ppc_setup_msi_irqs, + .teardown_irqs = ppc_teardown_msi_irqs, +}; + +struct msi_chip *arch_find_msi_chip(struct pci_dev *dev) +{ + return &ppc_msi_chip; +}