From patchwork Wed Oct 15 03:07:02 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: wangyijing X-Patchwork-Id: 38733 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wi0-f198.google.com (mail-wi0-f198.google.com [209.85.212.198]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 52BDC20973 for ; Wed, 15 Oct 2014 02:26:26 +0000 (UTC) Received: by mail-wi0-f198.google.com with SMTP id hi2sf263682wib.5 for ; Tue, 14 Oct 2014 19:26:25 -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=EsK5jjNdIBOcTuGwUPCeGPzA0/m7obyol/mKwS5gEjI=; b=b2MBoJkx3C4rQdsA2OWUYmSJ+ZCT+vEb1RxazxDFkad85SBcY0NjK3KfGvXeO2mPRm DsaMHFBLuodSGm5Me59PYIoXgHTQbwBZuBbajbt+uNaOW1XsicQXgfhDLfbeowAXH2RG nmIHGJM9BTzw8zd9HY/xva9JySxIYa/VxqYEV05efMasTANMZQoIAXuALF+MoQuVEryw kVmZjtWj9XemYWlGPQZ28eHv7gu6qkQCjCHiiL5365iDny0IRzbeVVr/LNlZ6Pisfaks fk4TYiV5Kr8LI2veOblAOPswG5BJASYs6+eVxoJNHXEyIXmNr0RoDDEijMyJ/MXR5nt6 eF5w== X-Gm-Message-State: ALoCoQk//OReopVcfqHtogEfZZ722RgNt5s+QNy8h+JOWlwYRAUs2WA4kwBYAI7Sc2jMVsUKDnlU X-Received: by 10.181.29.105 with SMTP id jv9mr1578258wid.1.1413339985458; Tue, 14 Oct 2014 19:26:25 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.43.1 with SMTP id s1ls11971lal.30.gmail; Tue, 14 Oct 2014 19:26:25 -0700 (PDT) X-Received: by 10.153.7.170 with SMTP id dd10mr9142171lad.45.1413339985265; Tue, 14 Oct 2014 19:26:25 -0700 (PDT) Received: from mail-la0-f43.google.com (mail-la0-f43.google.com [209.85.215.43]) by mx.google.com with ESMTPS id b6si28529213lae.131.2014.10.14.19.26.25 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 14 Oct 2014 19:26:25 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.43 as permitted sender) client-ip=209.85.215.43; Received: by mail-la0-f43.google.com with SMTP id mc6so264715lab.2 for ; Tue, 14 Oct 2014 19:26:25 -0700 (PDT) X-Received: by 10.152.30.33 with SMTP id p1mr9005477lah.78.1413339985169; Tue, 14 Oct 2014 19:26:25 -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 c5csp517309lbz; Tue, 14 Oct 2014 19:26:22 -0700 (PDT) X-Received: by 10.70.126.104 with SMTP id mx8mr6549268pdb.148.1413339981073; Tue, 14 Oct 2014 19:26:21 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id it5si14323808pbc.230.2014.10.14.19.26.20 for ; Tue, 14 Oct 2014 19:26:21 -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 S1756006AbaJOC0Q (ORCPT + 27 others); Tue, 14 Oct 2014 22:26:16 -0400 Received: from szxga02-in.huawei.com ([119.145.14.65]:39313 "EHLO szxga02-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932680AbaJOCZr (ORCPT ); Tue, 14 Oct 2014 22:25:47 -0400 Received: from 172.24.2.119 (EHLO szxeml412-hub.china.huawei.com) ([172.24.2.119]) by szxrg02-dlp.huawei.com (MOS 4.3.7-GA FastPath queued) with ESMTP id CAT35380; Wed, 15 Oct 2014 10:25:42 +0800 (CST) Received: from localhost.localdomain (10.175.100.166) by szxeml412-hub.china.huawei.com (10.82.67.91) with Microsoft SMTP Server id 14.3.158.1; Wed, 15 Oct 2014 10:25:36 +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" , Liviu Dudau , Yijing Wang Subject: [PATCH v3 14/27] Irq_remapping/MSI: Use MSI chip framework to configure MSI/MSI-X irq Date: Wed, 15 Oct 2014 11:07:02 +0800 Message-ID: <1413342435-7876-15-git-send-email-wangyijing@huawei.com> X-Mailer: git-send-email 1.7.1 In-Reply-To: <1413342435-7876-1-git-send-email-wangyijing@huawei.com> References: <1413342435-7876-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.215.43 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 --- drivers/iommu/irq_remapping.c | 11 ++++++++--- 1 files changed, 8 insertions(+), 3 deletions(-) diff --git a/drivers/iommu/irq_remapping.c b/drivers/iommu/irq_remapping.c index 33c4395..48d57e9 100644 --- a/drivers/iommu/irq_remapping.c +++ b/drivers/iommu/irq_remapping.c @@ -139,8 +139,8 @@ error: return ret; } -static int irq_remapping_setup_msi_irqs(struct pci_dev *dev, - int nvec, int type) +static int irq_remapping_setup_msi_irqs(struct msi_chip *chip, + struct pci_dev *dev, int nvec, int type) { if (type == PCI_CAP_ID_MSI) return do_setup_msi_irqs(dev, nvec); @@ -148,6 +148,11 @@ static int irq_remapping_setup_msi_irqs(struct pci_dev *dev, return do_setup_msix_irqs(dev, nvec); } +static struct msi_chip remap_msi_chip = { + .setup_irqs = irq_remapping_setup_msi_irqs, + .teardown_irq = native_teardown_msi_irq, +}; + static void eoi_ioapic_pin_remapped(int apic, int pin, int vector) { /* @@ -165,9 +170,9 @@ static void __init irq_remapping_modify_x86_ops(void) x86_io_apic_ops.set_affinity = set_remapped_irq_affinity; x86_io_apic_ops.setup_entry = setup_ioapic_remapped_entry; x86_io_apic_ops.eoi_ioapic_pin = eoi_ioapic_pin_remapped; - x86_msi.setup_msi_irqs = irq_remapping_setup_msi_irqs; x86_msi.setup_hpet_msi = setup_hpet_msi_remapped; x86_msi.compose_msi_msg = compose_remapped_msi_msg; + x86_msi_chip = &remap_msi_chip; } static __init int setup_nointremap(char *str)