From patchwork Thu Sep 25 03:14:30 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: wangyijing X-Patchwork-Id: 37888 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-we0-f198.google.com (mail-we0-f198.google.com [74.125.82.198]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 3DBB120063 for ; Thu, 25 Sep 2014 02:52:02 +0000 (UTC) Received: by mail-we0-f198.google.com with SMTP id t60sf4145848wes.1 for ; Wed, 24 Sep 2014 19:52: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: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=rW+DoeaNyZ+JAq+grUE7hzB6Rr0meWyM1Oc6uUIw4QQ=; b=MmBudVP0fVGIjh/p3S1UaOAf0FPd2316ShRUp1eSjbiQPsGLC11FWSohEFxdhwIOAg HPcuM8uPCMVkiP20aMdcUFUmoZHToAYwqx015kY5dm50HAAmaI64R8bJFk6eBlkwkUVN CxA8kHpvvmqbkiI5Oz42qEWlpSvEmKbjfbxCzMortHJuH67Zw3QT1p757Np8WY72Y9OG eTRtEv9mTohcINudBIu1nuDlduKksRABb+piQHKLpudFNBGoITbkB0Awm5cXylkWcki2 heI4Il4xdCL+PG4SLy7XGEbDg+zTj3DZAxIHE7DQ/wvunypDJxBTEcE8m8hIDf1Ka1kO 94Qg== X-Gm-Message-State: ALoCoQnb5HqWEXZcxuZMga8vuMy0f44q+RVGkYplxYj8jV7QjnPveyQpbekAryBp0nk/g+kKvaxV X-Received: by 10.180.160.169 with SMTP id xl9mr4650855wib.7.1411613521377; Wed, 24 Sep 2014 19:52:01 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.153.6.38 with SMTP id cr6ls200221lad.17.gmail; Wed, 24 Sep 2014 19:52:01 -0700 (PDT) X-Received: by 10.152.197.35 with SMTP id ir3mr10378936lac.82.1411613521196; Wed, 24 Sep 2014 19:52:01 -0700 (PDT) Received: from mail-lb0-f172.google.com (mail-lb0-f172.google.com [209.85.217.172]) by mx.google.com with ESMTPS id se3si1154255lbb.22.2014.09.24.19.52.01 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 24 Sep 2014 19:52:01 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.172 as permitted sender) client-ip=209.85.217.172; Received: by mail-lb0-f172.google.com with SMTP id p9so11294889lbv.3 for ; Wed, 24 Sep 2014 19:52:01 -0700 (PDT) X-Received: by 10.112.130.68 with SMTP id oc4mr9443407lbb.41.1411613521112; Wed, 24 Sep 2014 19:52: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.112.130.169 with SMTP id of9csp683268lbb; Wed, 24 Sep 2014 19:52:00 -0700 (PDT) X-Received: by 10.70.53.202 with SMTP id d10mr18613953pdp.60.1411613519620; Wed, 24 Sep 2014 19:51:59 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id uf6si1383994pac.6.2014.09.24.19.51.58 for ; Wed, 24 Sep 2014 19:51:59 -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 S1753086AbaIYCvT (ORCPT + 27 others); Wed, 24 Sep 2014 22:51:19 -0400 Received: from szxga01-in.huawei.com ([119.145.14.64]:37207 "EHLO szxga01-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752968AbaIYCvJ (ORCPT ); Wed, 24 Sep 2014 22:51:09 -0400 Received: from 172.24.2.119 (EHLO szxeml409-hub.china.huawei.com) ([172.24.2.119]) by szxrg01-dlp.huawei.com (MOS 4.3.7-GA FastPath queued) with ESMTP id CCC72764; Thu, 25 Sep 2014 10:50:57 +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:49 +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 20/22] Sparc/MSI: Use MSI chip framework to configure MSI/MSI-X irq Date: Thu, 25 Sep 2014 11:14:30 +0800 Message-ID: <1411614872-4009-21-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 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.172 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/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)