From patchwork Mon Oct 27 13:22:17 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: wangyijing X-Patchwork-Id: 39622 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-la0-f71.google.com (mail-la0-f71.google.com [209.85.215.71]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 10EA72118A for ; Mon, 27 Oct 2014 12:45:40 +0000 (UTC) Received: by mail-la0-f71.google.com with SMTP id gi9sf4043153lab.10 for ; Mon, 27 Oct 2014 05:45:39 -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:subject:date:message-id :in-reply-to:references:mime-version:cc:precedence:list-id :list-unsubscribe:list-archive:list-post:list-help:list-subscribe :sender:errors-to:x-original-sender :x-original-authentication-results:mailing-list:content-type :content-transfer-encoding; bh=Xtd7k0WCrxX9GTr+z6rVnLo/6ua7vjdUPk9FPkEkJNI=; b=FD7u2YdcdvRIzDX2KPyYl9ROQKvHBcoQKWdpwS9Pb19bDJlXZqUZXzvuVkADWYjcaG kcSUo6GcGKpsvfoEM8c/szHsql5prPPh6PD91qr7K5ZBZSGV5nMcvZpxjgqlpawuYawa 7EwMgqdklFu3MGFS30TRkOG5Sjy46KzDfSlu8g2wjBiqtMMESuepxqHoiOkEyVv75/yx p0AqPN8eMHcWFcNo/euCkPKO8j5IXWhaxh6ATGjMYhKKXdWz3UYstmGoxdThxe4zB8VO sLjO0vzCgr2fXx945E1udkW1h+FQPmzW5mfKbYk0snPMNyNwwJH5Zzpg9ja0RzXzwLhx cKrg== X-Gm-Message-State: ALoCoQmOgFpewzLl6hk9NV7Xeig9MhBPu9s3IKhr3j3h8IRHgL3StbqDGj7UrsWCgF1vEBRpB+Nt X-Received: by 10.112.225.135 with SMTP id rk7mr5466210lbc.6.1414413939525; Mon, 27 Oct 2014 05:45:39 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.207.67 with SMTP id lu3ls335058lac.50.gmail; Mon, 27 Oct 2014 05:45:39 -0700 (PDT) X-Received: by 10.152.43.97 with SMTP id v1mr13066872lal.3.1414413939363; Mon, 27 Oct 2014 05:45:39 -0700 (PDT) Received: from mail-lb0-f182.google.com (mail-lb0-f182.google.com. [209.85.217.182]) by mx.google.com with ESMTPS id gl1si19855973lbc.11.2014.10.27.05.45.39 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 27 Oct 2014 05:45:39 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.182 as permitted sender) client-ip=209.85.217.182; Received: by mail-lb0-f182.google.com with SMTP id f15so4714465lbj.13 for ; Mon, 27 Oct 2014 05:45:39 -0700 (PDT) X-Received: by 10.112.189.10 with SMTP id ge10mr23216832lbc.23.1414413939264; Mon, 27 Oct 2014 05:45:39 -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.84.229 with SMTP id c5csp282213lbz; Mon, 27 Oct 2014 05:45:38 -0700 (PDT) X-Received: by 10.68.110.1 with SMTP id hw1mr17259304pbb.7.1414413937493; Mon, 27 Oct 2014 05:45:37 -0700 (PDT) Received: from bombadil.infradead.org (bombadil.infradead.org. [2001:1868:205::9]) by mx.google.com with ESMTPS id vr2si10459772pab.95.2014.10.27.05.45.36 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 27 Oct 2014 05:45:37 -0700 (PDT) Received-SPF: none (google.com: linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org does not designate permitted sender hosts) client-ip=2001:1868:205::9; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1XijeG-0004yC-GK; Mon, 27 Oct 2014 12:43:48 +0000 Received: from szxga02-in.huawei.com ([119.145.14.65]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1XijeD-0004pH-2g for linux-arm-kernel@lists.infradead.org; Mon, 27 Oct 2014 12:43:45 +0000 Received: from 172.24.2.119 (EHLO szxeml404-hub.china.huawei.com) ([172.24.2.119]) by szxrg02-dlp.huawei.com (MOS 4.3.7-GA FastPath queued) with ESMTP id CBJ49248; Mon, 27 Oct 2014 20:41:39 +0800 (CST) Received: from localhost.localdomain (10.175.100.166) by szxeml404-hub.china.huawei.com (10.82.67.59) with Microsoft SMTP Server id 14.3.158.1; Mon, 27 Oct 2014 20:41:30 +0800 From: Yijing Wang To: Bjorn Helgaas Subject: [PATCH 11/16] s390/MSI: Use MSI controller framework to configure MSI/MSI-X irq Date: Mon, 27 Oct 2014 21:22:17 +0800 Message-ID: <1414416142-31239-12-git-send-email-wangyijing@huawei.com> X-Mailer: git-send-email 1.7.1 In-Reply-To: <1414416142-31239-1-git-send-email-wangyijing@huawei.com> References: <1414416142-31239-1-git-send-email-wangyijing@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.175.100.166] X-CFilter-Loop: Reflected X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20141027_054345_473672_0364578B X-CRM114-Status: GOOD ( 13.49 ) X-Spam-Score: -1.3 (-) X-Spam-Report: SpamAssassin version 3.4.0 on bombadil.infradead.org summary: Content analysis details: (-1.3 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/, low trust [119.145.14.65 listed in list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record -0.6 RP_MATCHES_RCVD Envelope sender domain matches handover relay domain Cc: linux-mips@linux-mips.org, linux-ia64@vger.kernel.org, linux-pci@vger.kernel.org, Xinwei Hu , Yijing Wang , Thierry Reding , sparclinux@vger.kernel.org, linux-s390@vger.kernel.org, Russell King , Michael Ellerman , Joerg Roedel , x86@kernel.org, Sebastian Ott , Benjamin Herrenschmidt , xen-devel@lists.xenproject.org, Konrad Rzeszutek Wilk , Chris Metcalf , Thomas Gleixner , linux-arm-kernel@lists.infradead.org, Thomas Petazzoni , Tony Luck , Sergei Shtylyov , linux-kernel@vger.kernel.org, Ralf Baechle , iommu@lists.linux-foundation.org, David Vrabel , Wuyun , linuxppc-dev@lists.ozlabs.org, "David S. Miller" , Lucas Stach X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: , List-Help: , List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.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.182 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 Use MSI controller 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: Sebastian Ott --- arch/s390/include/asm/pci.h | 1 + arch/s390/pci/pci.c | 19 +++++++++++++++++-- 2 files changed, 18 insertions(+), 2 deletions(-) diff --git a/arch/s390/include/asm/pci.h b/arch/s390/include/asm/pci.h index c030900..bf14da2 100644 --- a/arch/s390/include/asm/pci.h +++ b/arch/s390/include/asm/pci.h @@ -88,6 +88,7 @@ struct zpci_dev { u32 uid; /* user defined id */ u8 util_str[CLP_UTIL_STR_LEN]; /* utility string */ + struct msi_controller *msi_ctrl; /* IRQ stuff */ u64 msi_addr; /* MSI address */ struct airq_iv *aibv; /* adapter interrupt bit vector */ diff --git a/arch/s390/pci/pci.c b/arch/s390/pci/pci.c index 552b990..beed5ab 100644 --- a/arch/s390/pci/pci.c +++ b/arch/s390/pci/pci.c @@ -358,7 +358,15 @@ static void zpci_irq_handler(struct airq_struct *airq) } } -int arch_setup_msi_irqs(struct pci_dev *pdev, int nvec, int type) +struct msi_controller *pcibios_msi_controller(struct pci_bus *bus) +{ + struct zpci_dev *zpci = bus->sysdata; + + return zpci->msi_ctrl; +} + +static int zpci_setup_msi_irqs(struct msi_controller *ctrl, + struct pci_dev *pdev, int nvec, int type) { struct zpci_dev *zdev = get_zdev(pdev); unsigned int hwirq, msi_vecs; @@ -434,7 +442,8 @@ out: return rc; } -void arch_teardown_msi_irqs(struct pci_dev *pdev) +static void zpci_teardown_msi_irqs(struct msi_controller *ctrl, + struct pci_dev *pdev) { struct zpci_dev *zdev = get_zdev(pdev); struct msi_desc *msi; @@ -464,6 +473,11 @@ void arch_teardown_msi_irqs(struct pci_dev *pdev) airq_iv_free_bit(zpci_aisb_iv, zdev->aisb); } +static struct msi_controller zpci_msi_ctrl = { + .setup_irqs = zpci_setup_msi_irqs, + .teardown_irqs = zpci_teardown_msi_irqs, +}; + static void zpci_map_resources(struct zpci_dev *zdev) { struct pci_dev *pdev = zdev->pdev; @@ -749,6 +763,7 @@ static int zpci_scan_bus(struct zpci_dev *zdev) if (ret) return ret; + zdev->msi_ctrl = &zpci_msi_ctrl; zdev->bus = pci_scan_root_bus(NULL, ZPCI_BUS_NR, &pci_root_ops, zdev, &resources); if (!zdev->bus) {