From patchwork Tue Aug 12 07:26:06 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: wangyijing X-Patchwork-Id: 35237 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-oi0-f72.google.com (mail-oi0-f72.google.com [209.85.218.72]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id B67A9203C5 for ; Tue, 12 Aug 2014 07:06:59 +0000 (UTC) Received: by mail-oi0-f72.google.com with SMTP id a141sf38039918oig.11 for ; Tue, 12 Aug 2014 00:06:59 -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=kXcWFzGosz6jbPhdTWEJr2MkNRcrI7c7N3xsZWUKlls=; b=GcQZVF/XjkZAuo1pA8kWZjaTCxGol1fWYFdxDaiYh895vtoqiz1yYSctS+t4TnCTXa u7iMWjI0MSlA9KwTq8IRtCyA5bhFOlqTrkTQalAy/4j68HFdmDx3mHO8CGfxXviiGhCd PYxsWqdeV9EoW/BtBkeZnLwA2khS4tUDFjsJdwWXnNvcHnczADjOuu3lQLMnsXmoysrm SM62+LnBt9Q2MNjXC0xkUB0Wd5UUWDuMFoOymrHcz0aU1LufLs1WSGGBlhQswJ8Adubf puGdifEgrh2YznZI53ssVVwTuCmh2yC+2TpVSyzrx9nEYrRtfPRmbC639dXMxMGfgGLe 5BXw== X-Gm-Message-State: ALoCoQkYzBPEjn/ArKxocNHNSmRwnma+TxwCSUPT4g6Mj3VgxZ58NALO8hMJ1FI03azJcrfo6K81 X-Received: by 10.43.28.197 with SMTP id rv5mr16998688icb.23.1407827219349; Tue, 12 Aug 2014 00:06:59 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.105.202 with SMTP id c68ls2406qgf.99.gmail; Tue, 12 Aug 2014 00:06:59 -0700 (PDT) X-Received: by 10.52.146.194 with SMTP id te2mr1883709vdb.4.1407827219242; Tue, 12 Aug 2014 00:06:59 -0700 (PDT) Received: from mail-vc0-f178.google.com (mail-vc0-f178.google.com [209.85.220.178]) by mx.google.com with ESMTPS id sj4si5428277vcb.33.2014.08.12.00.06.59 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 12 Aug 2014 00:06:59 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.220.178 as permitted sender) client-ip=209.85.220.178; Received: by mail-vc0-f178.google.com with SMTP id la4so12971282vcb.9 for ; Tue, 12 Aug 2014 00:06:59 -0700 (PDT) X-Received: by 10.52.61.136 with SMTP id p8mr22110037vdr.15.1407827219149; Tue, 12 Aug 2014 00:06:59 -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 tc5csp224700vcb; Tue, 12 Aug 2014 00:06:58 -0700 (PDT) X-Received: by 10.70.20.34 with SMTP id k2mr2674805pde.98.1407827218223; Tue, 12 Aug 2014 00:06:58 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id gy1si15344674pbd.29.2014.08.12.00.06.57 for ; Tue, 12 Aug 2014 00:06:58 -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 S932105AbaHLHGz (ORCPT + 26 others); Tue, 12 Aug 2014 03:06:55 -0400 Received: from szxga02-in.huawei.com ([119.145.14.65]:51357 "EHLO szxga02-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753505AbaHLHDR (ORCPT ); Tue, 12 Aug 2014 03:03:17 -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 BYA39922; 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:44 +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 13/20] MIPS/xlr/MSI: Use msi_chip instead of arch func to configure MSI/MSI-X Date: Tue, 12 Aug 2014 15:26:06 +0800 Message-ID: <1407828373-24322-14-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.178 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 xlr_msi_chip instead of weak arch functions to configure MSI/MSI-X. Signed-off-by: Yijing Wang --- arch/mips/pci/pci-xlr.c | 19 +++++++++++++++---- 1 files changed, 15 insertions(+), 4 deletions(-) diff --git a/arch/mips/pci/pci-xlr.c b/arch/mips/pci/pci-xlr.c index 0dde803..6eef164 100644 --- a/arch/mips/pci/pci-xlr.c +++ b/arch/mips/pci/pci-xlr.c @@ -214,11 +214,11 @@ static int get_irq_vector(const struct pci_dev *dev) } #ifdef CONFIG_PCI_MSI -void arch_teardown_msi_irq(unsigned int irq) +void xlr_teardown_msi_irq(unsigned int irq) { } -int arch_setup_msi_irq(struct pci_dev *dev, struct msi_desc *desc) +int xlr_setup_msi_irq(struct device *dev, struct msi_desc *desc) { struct msi_msg msg; struct pci_dev *lnk; @@ -233,7 +233,7 @@ int arch_setup_msi_irq(struct pci_dev *dev, struct msi_desc *desc) * Enable MSI on the XLS PCIe controller bridge which was disabled * at enumeration, the bridge MSI capability is at 0x50 */ - lnk = xls_get_pcie_link(dev); + lnk = xls_get_pcie_link(to_pci_dev(dev)); if (lnk == NULL) return 1; @@ -243,7 +243,7 @@ int arch_setup_msi_irq(struct pci_dev *dev, struct msi_desc *desc) pci_write_config_word(lnk, 0x50 + PCI_MSI_FLAGS, val); } - irq = get_irq_vector(dev); + irq = get_irq_vector(to_pci_dev(dev)); if (irq <= 0) return 1; @@ -263,6 +263,17 @@ int arch_setup_msi_irq(struct pci_dev *dev, struct msi_desc *desc) write_msi_msg(irq, &msg); return 0; } + +struct msi_chip xlr_msi_chip = { + .setup_irq = xlr_setup_msi_irq, + .teardown_irq = xlr_teardown_msi_irq, +}; + +struct msi_chip *arch_get_match_msi_chip(struct device *dev) +{ + return &xlr_msi_chip; +} + #endif /* Extra ACK needed for XLR on chip PCI controller */