From patchwork Tue Aug 12 07:26:02 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: wangyijing X-Patchwork-Id: 35234 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-vc0-f199.google.com (mail-vc0-f199.google.com [209.85.220.199]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id F25E6203C5 for ; Tue, 12 Aug 2014 07:05:43 +0000 (UTC) Received: by mail-vc0-f199.google.com with SMTP id la4sf27796105vcb.2 for ; Tue, 12 Aug 2014 00:05:43 -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=ddDoUvZRL9igGvl/M8Ri8hboxPrprM2PzYZT7/HECwQ=; b=fwy+FzRS80eVbnGhNQ1X29Iw4atmd6Glif3ZI/NNTr2gkN0QAWzCiLJ0hmxHApLsuc d3jwusDf/cT6NnNv/5E6x3zFQzyjhLAaJLDeyI0gS1+r4IBMme+0bHn6+xPNZvbTjkWC BFqCgi39pzB6To043J8EQ5jN1mNIXaqJ0EK1VpaCKXzv5/62WAOoK1ZxjQGeuteJRXHW n9yHsZfnJl1g12TJvOfmHZOVhpaEwSDOMy1CWNr0RIJtPBwR1crwZMJqn0GGP0UEhDAP sRQ2BXK5P/PAqXe6FOr8ZGcZP7xXa6/CPNOi1rBa3bjo8Eqdnz8ITayx/AQ32hp0s31t 1r8Q== X-Gm-Message-State: ALoCoQleqoFtEPSb6WUrSXEdloTloQARRlKP/QueQk3VNc/XO91AC/UB46PPPNw8wpDgeId2P3+8 X-Received: by 10.236.63.197 with SMTP id a45mr18302322yhd.9.1407827143747; Tue, 12 Aug 2014 00:05:43 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.83.209 with SMTP id j75ls3591qgd.80.gmail; Tue, 12 Aug 2014 00:05:43 -0700 (PDT) X-Received: by 10.220.130.131 with SMTP id t3mr2198239vcs.30.1407827143630; Tue, 12 Aug 2014 00:05:43 -0700 (PDT) Received: from mail-vc0-f176.google.com (mail-vc0-f176.google.com [209.85.220.176]) by mx.google.com with ESMTPS id o2si7761049vca.94.2014.08.12.00.05.43 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 12 Aug 2014 00:05:43 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.220.176 as permitted sender) client-ip=209.85.220.176; Received: by mail-vc0-f176.google.com with SMTP id id10so12810705vcb.35 for ; Tue, 12 Aug 2014 00:05:43 -0700 (PDT) X-Received: by 10.52.245.66 with SMTP id xm2mr22044756vdc.36.1407827143540; Tue, 12 Aug 2014 00:05:43 -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 tc5csp224627vcb; Tue, 12 Aug 2014 00:05:42 -0700 (PDT) X-Received: by 10.66.196.131 with SMTP id im3mr2615466pac.21.1407827142181; Tue, 12 Aug 2014 00:05:42 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id wo9si15309183pbc.214.2014.08.12.00.05.41 for ; Tue, 12 Aug 2014 00:05:42 -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 S1754433AbaHLHFj (ORCPT + 26 others); Tue, 12 Aug 2014 03:05:39 -0400 Received: from szxga02-in.huawei.com ([119.145.14.65]:51417 "EHLO szxga02-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753282AbaHLHDX (ORCPT ); Tue, 12 Aug 2014 03:03:23 -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 BYA39920; 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:37 +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 09/20] irq_remapping/MSI: Use msi_chip instead of arch func to configure MSI/MSI-X Date: Tue, 12 Aug 2014 15:26:02 +0800 Message-ID: <1407828373-24322-10-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.176 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 remap_msi_chip instead of weak arch functions to configure irq remapping MSI/MSI-X in x86. Signed-off-by: Yijing Wang --- drivers/iommu/irq_remapping.c | 13 +++++++++---- 1 files changed, 9 insertions(+), 4 deletions(-) diff --git a/drivers/iommu/irq_remapping.c b/drivers/iommu/irq_remapping.c index 33c4395..f494b51 100644 --- a/drivers/iommu/irq_remapping.c +++ b/drivers/iommu/irq_remapping.c @@ -139,15 +139,20 @@ error: return ret; } -static int irq_remapping_setup_msi_irqs(struct pci_dev *dev, +static int irq_remapping_setup_msi_irqs(struct device *dev, int nvec, int type) { if (type == PCI_CAP_ID_MSI) - return do_setup_msi_irqs(dev, nvec); + return do_setup_msi_irqs(to_pci_dev(dev), nvec); else - return do_setup_msix_irqs(dev, nvec); + return do_setup_msix_irqs(to_pci_dev(dev), nvec); } +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)