From patchwork Tue Aug 12 07:26:05 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: wangyijing X-Patchwork-Id: 35225 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-qc0-f198.google.com (mail-qc0-f198.google.com [209.85.216.198]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 45546203C5 for ; Tue, 12 Aug 2014 07:03:29 +0000 (UTC) Received: by mail-qc0-f198.google.com with SMTP id r5sf9887512qcx.5 for ; Tue, 12 Aug 2014 00:03:29 -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=qcazOVciUR/0KXrCUR57hVE1+DkOiTqyEFPQMLIrnVc=; b=MKU/C4SHR6PofZAV8VQnYfQoGP/FnfntjauIYuIjQdERyTGDBnlGkfBTDTR7A+IyLI 7I7lo2XxnuXP1vR2u+9wu4Vz13zQrEDoj646mj8Q6+RapJP0Xvo9RDWK6K5HtTSanKvh +4Z4Ho0rsDt8JQN1SXBJu98Yjf+/iTRRU6Iv/vvOqFt+mVynFBkWbSeBB2WnZyih2L/c OZCZYdHU63vMQAk31Fh7+Tz0HwvaWj33nWGPjRA3n8cZ0QrcgJ3oSNmuOUtN/EOr5Pc9 kEFwgGrPSOWP6IIdeFGHrCkU/NMNN+XZh3OYpxrknYxDSYrnUlR6TiRrCC396LkkdSwP F7DA== X-Gm-Message-State: ALoCoQlvWA66J+Ogyz2qXinhKSnkgOeK4gIfIXvq7FiuHsQpX1RVshW2cG/9zCXraHr2BvyhYNH9 X-Received: by 10.224.29.1 with SMTP id o1mr1697163qac.0.1407827009131; Tue, 12 Aug 2014 00:03:29 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.23.137 with SMTP id 9ls4435qgp.68.gmail; Tue, 12 Aug 2014 00:03:29 -0700 (PDT) X-Received: by 10.52.61.136 with SMTP id p8mr22099507vdr.15.1407827009054; Tue, 12 Aug 2014 00:03:29 -0700 (PDT) Received: from mail-vc0-f173.google.com (mail-vc0-f173.google.com [209.85.220.173]) by mx.google.com with ESMTPS id vw2si7762912vcb.54.2014.08.12.00.03.29 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 12 Aug 2014 00:03:29 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.220.173 as permitted sender) client-ip=209.85.220.173; Received: by mail-vc0-f173.google.com with SMTP id hy10so12820765vcb.32 for ; Tue, 12 Aug 2014 00:03:29 -0700 (PDT) X-Received: by 10.220.167.9 with SMTP id o9mr2205643vcy.8.1407827008983; Tue, 12 Aug 2014 00:03:28 -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.37.5 with SMTP id tc5csp224490vcb; Tue, 12 Aug 2014 00:03:28 -0700 (PDT) X-Received: by 10.66.136.48 with SMTP id px16mr2651990pab.10.1407827008005; Tue, 12 Aug 2014 00:03:28 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id rl10si15307540pbc.161.2014.08.12.00.03.27 for ; Tue, 12 Aug 2014 00:03:27 -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 S1753770AbaHLHDU (ORCPT + 26 others); Tue, 12 Aug 2014 03:03:20 -0400 Received: from szxga02-in.huawei.com ([119.145.14.65]:51257 "EHLO szxga02-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753282AbaHLHDP (ORCPT ); Tue, 12 Aug 2014 03:03:15 -0400 Received: from 172.24.2.119 (EHLO szxeml421-hub.china.huawei.com) ([172.24.2.119]) by szxrg02-dlp.huawei.com (MOS 4.3.7-GA FastPath queued) with ESMTP id BYA39924; Tue, 12 Aug 2014 15:02:53 +0800 (CST) Received: from localhost.localdomain (10.175.100.166) by szxeml421-hub.china.huawei.com (10.82.67.160) with Microsoft SMTP Server id 14.3.158.1; Tue, 12 Aug 2014 15:02:42 +0800 From: Yijing Wang To: Bjorn Helgaas CC: , Xinwei Hu , Wuyun , , Marc Zyngier , , Russell King , , , "Arnd Bergmann" , Thomas Gleixner , "H. Peter Anvin" , Konrad Rzeszutek Wilk , , Joerg Roedel , , , "Benjamin Herrenschmidt" , , , Sebastian Ott , "Tony Luck" , , "David S. Miller" , , Chris Metcalf , Yijing Wang Subject: [RFC PATCH 12/20] MIPS/Xlp/MSI: Use msi_chip instead of arch func to configure MSI/MSI-X Date: Tue, 12 Aug 2014 15:26:05 +0800 Message-ID: <1407828373-24322-13-git-send-email-wangyijing@huawei.com> X-Mailer: git-send-email 1.7.1 In-Reply-To: <1407828373-24322-1-git-send-email-wangyijing@huawei.com> References: <1407828373-24322-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.220.173 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: , Introduce a new struct msi_chip xlp_chip instead of weak arch functions to configure MSI/MSI-X. Signed-off-by: Yijing Wang --- arch/mips/pci/msi-xlp.c | 15 +++++++++++++-- 1 files changed, 13 insertions(+), 2 deletions(-) diff --git a/arch/mips/pci/msi-xlp.c b/arch/mips/pci/msi-xlp.c index fa374fe..6c27346 100644 --- a/arch/mips/pci/msi-xlp.c +++ b/arch/mips/pci/msi-xlp.c @@ -245,7 +245,7 @@ static struct irq_chip xlp_msix_chip = { .irq_unmask = unmask_msi_irq, }; -void arch_teardown_msi_irq(unsigned int irq) +void xlp_teardown_msi_irq(unsigned int irq) { } @@ -452,11 +452,12 @@ 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) +int xlp_setup_msi_irq(struct device *d, struct msi_desc *desc) { struct pci_dev *lnkdev; uint64_t lnkbase; int node, link, slot; + struct pci_dev *dev = to_pci_dev(d); lnkdev = xlp_get_pcie_link(dev); if (lnkdev == NULL) { @@ -474,6 +475,16 @@ 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, +}; + +struct msi_chip *arch_get_match_msi_chip(struct device *dev) +{ + return &xlp_chip; +} + void __init xlp_init_node_msi_irqs(int node, int link) { struct nlm_soc_info *nodep;