From patchwork Mon Oct 27 13:22:10 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: wangyijing X-Patchwork-Id: 39628 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 CC2992118A for ; Mon, 27 Oct 2014 12:47:30 +0000 (UTC) Received: by mail-wi0-f198.google.com with SMTP id n3sf2875846wiv.5 for ; Mon, 27 Oct 2014 05:47:30 -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=IGMGUgxScrsFBCJg49b7Ps3O0IHKBfELJ+rj2WhqAkw=; b=Ukh8q0eoF7vQe56UZ/HKklH1e2ul+U0eLRPExAST7eS1ax9xciSY358Z63mFYiqCOp Ff5qQat2JJJaZiRc+i58jLiTDfmwGeGb7/y2Eh/PghImM+YMcwHHYMXNdWv1i7XmBQ3T CQDQ6oyIGZK0+3ZWGscnoN3+uwi5QNPzJah0CXBWbnblaxJyntc/cFpL2UeBf6JYbJfy jHzk3+Kd4S+sYkHCDtZOvvPU7y5grSCOgAAo9RykQiKxuz85OUZI4q1K0xZvHykVUwj3 VysS0B9FBorOutW28n60LL/mShASK6Qnm9XAYKOQydpg4I93flQczLMGKr5Xk9PO1yyv 7mMQ== X-Gm-Message-State: ALoCoQkoFfUgv5Qf32Iuvl+LXLhijIdQCNI7105yEuEaF0ESYM9llc8g8TWIf9WSrVsiTM9H/2m5 X-Received: by 10.180.90.115 with SMTP id bv19mr3853356wib.1.1414414050036; Mon, 27 Oct 2014 05:47:30 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.153.11.132 with SMTP id ei4ls704310lad.109.gmail; Mon, 27 Oct 2014 05:47:29 -0700 (PDT) X-Received: by 10.112.77.74 with SMTP id q10mr23238648lbw.66.1414414049843; Mon, 27 Oct 2014 05:47:29 -0700 (PDT) Received: from mail-la0-f50.google.com (mail-la0-f50.google.com. [209.85.215.50]) by mx.google.com with ESMTPS id bf9si19744198lab.114.2014.10.27.05.47.29 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 27 Oct 2014 05:47:29 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.50 as permitted sender) client-ip=209.85.215.50; Received: by mail-la0-f50.google.com with SMTP id s18so5780780lam.37 for ; Mon, 27 Oct 2014 05:47:29 -0700 (PDT) X-Received: by 10.152.5.38 with SMTP id p6mr23263749lap.44.1414414049485; Mon, 27 Oct 2014 05:47:29 -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 c5csp282468lbz; Mon, 27 Oct 2014 05:47:28 -0700 (PDT) X-Received: by 10.68.197.4 with SMTP id iq4mr1497182pbc.137.1414414047735; Mon, 27 Oct 2014 05:47:27 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id fl3si10454323pab.106.2014.10.27.05.47.27 for ; Mon, 27 Oct 2014 05:47: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 S1753142AbaJ0MrP (ORCPT + 26 others); Mon, 27 Oct 2014 08:47:15 -0400 Received: from szxga02-in.huawei.com ([119.145.14.65]:28069 "EHLO szxga02-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752468AbaJ0Mlr (ORCPT ); Mon, 27 Oct 2014 08:41:47 -0400 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 CBJ49234; Mon, 27 Oct 2014 20:41:30 +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:19 +0800 From: Yijing Wang To: Bjorn Helgaas CC: , , Xinwei Hu , Wuyun , , Russell King , , 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 04/16] Irq_remapping/MSI: Use MSI controller framework to configure MSI/MSI-X irq Date: Mon, 27 Oct 2014 21:22:10 +0800 Message-ID: <1414416142-31239-5-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 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.50 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 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 --- 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 74a1767..6db1459 100644 --- a/drivers/iommu/irq_remapping.c +++ b/drivers/iommu/irq_remapping.c @@ -140,8 +140,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_controller *ctrl, + struct pci_dev *dev, int nvec, int type) { if (type == PCI_CAP_ID_MSI) return do_setup_msi_irqs(dev, nvec); @@ -149,6 +149,11 @@ static int irq_remapping_setup_msi_irqs(struct pci_dev *dev, return do_setup_msix_irqs(dev, nvec); } +static struct msi_controller remap_msi_ctrl = { + .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) { /* @@ -166,9 +171,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_ctrl = &remap_msi_ctrl; } static __init int setup_nointremap(char *str)