From patchwork Tue Aug 12 07:26:12 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: wangyijing X-Patchwork-Id: 35230 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-oi0-f69.google.com (mail-oi0-f69.google.com [209.85.218.69]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id E0843203C5 for ; Tue, 12 Aug 2014 07:04:49 +0000 (UTC) Received: by mail-oi0-f69.google.com with SMTP id h136sf38032270oig.0 for ; Tue, 12 Aug 2014 00:04:49 -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=z5c5cc3Xhh7eu/iGkf3hvJLyA7PkD0Hgc7v382gV4K8=; b=eylfqYXT2uxDJ5BcZAa+17JXRzlByBk00raRClCaeEnKgGD7G6w0grfSx/o+9tEb20 BOplcvRYXm7vKwHAv7RE7sR9G2McUlejTlRldTxrrj8gupIUfdZ8t1d1bwP7DfLdM6Et zWs4oNZcQDp6Dh1ApDs3x58iDhnh+bh/YkOAfVMkg+WrosW6OjFJeNOBDWKsNaPOJ3+V 5FpoWXbec09es9HwZzJd6ChJbFNi9Gqc/Nv2/69sBCjG+G4b0k7rqJEnFnknu9ula7w9 NoVnH+RISq7kxtjSWJkbAShTdJ1TfdcJUYePoyg+nxlMgWAkKxLcJE2UzTx87ZLBieVC UdPw== X-Gm-Message-State: ALoCoQkYO9ELjex8lxykHRZPrCn4sPs6AHcbjSHnIJhlxpeqPeiuxmJJUSuKB0xQpKZm6IQyjnyj X-Received: by 10.42.118.200 with SMTP id y8mr17137910icq.4.1407827089462; Tue, 12 Aug 2014 00:04:49 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.49.83 with SMTP id p77ls4169qga.97.gmail; Tue, 12 Aug 2014 00:04:49 -0700 (PDT) X-Received: by 10.52.106.198 with SMTP id gw6mr22122257vdb.23.1407827089316; Tue, 12 Aug 2014 00:04:49 -0700 (PDT) Received: from mail-vc0-f172.google.com (mail-vc0-f172.google.com [209.85.220.172]) by mx.google.com with ESMTPS id iq6si7754488vcb.100.2014.08.12.00.04.49 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 12 Aug 2014 00:04:49 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.220.172 as permitted sender) client-ip=209.85.220.172; Received: by mail-vc0-f172.google.com with SMTP id im17so12946309vcb.3 for ; Tue, 12 Aug 2014 00:04:49 -0700 (PDT) X-Received: by 10.52.243.10 with SMTP id wu10mr4340255vdc.45.1407827089202; Tue, 12 Aug 2014 00:04:49 -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 tc5csp224567vcb; Tue, 12 Aug 2014 00:04:48 -0700 (PDT) X-Received: by 10.68.244.40 with SMTP id xd8mr2684300pbc.24.1407827088266; Tue, 12 Aug 2014 00:04:48 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id su7si15287475pbc.251.2014.08.12.00.04.44 for ; Tue, 12 Aug 2014 00:04:48 -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 S1754005AbaHLHD3 (ORCPT + 26 others); Tue, 12 Aug 2014 03:03:29 -0400 Received: from szxga01-in.huawei.com ([119.145.14.64]:42426 "EHLO szxga01-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753775AbaHLHDZ (ORCPT ); Tue, 12 Aug 2014 03:03:25 -0400 Received: from 172.24.2.119 (EHLO szxeml421-hub.china.huawei.com) ([172.24.2.119]) by szxrg01-dlp.huawei.com (MOS 4.3.7-GA FastPath queued) with ESMTP id CAE07917; Tue, 12 Aug 2014 15:03:02 +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:54 +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 19/20] tile/MSI: Use msi_chip instead of arch func to configure MSI/MSI-X Date: Tue, 12 Aug 2014 15:26:12 +0800 Message-ID: <1407828373-24322-20-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.172 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 tile_msi_chip instead of weak arch functions to configure MSI/MSI-X. Signed-off-by: Yijing Wang --- arch/tile/kernel/pci_gx.c | 20 +++++++++++++++----- 1 files changed, 15 insertions(+), 5 deletions(-) diff --git a/arch/tile/kernel/pci_gx.c b/arch/tile/kernel/pci_gx.c index e39f9c5..d1f308c 100644 --- a/arch/tile/kernel/pci_gx.c +++ b/arch/tile/kernel/pci_gx.c @@ -1485,7 +1485,7 @@ static struct irq_chip tilegx_msi_chip = { /* TBD: support set_affinity. */ }; -int arch_setup_msi_irq(struct pci_dev *pdev, struct msi_desc *desc) +int tile_setup_msi_irq(struct device *dev, struct msi_desc *desc) { struct pci_controller *controller; gxio_trio_context_t *trio_context; @@ -1510,7 +1510,7 @@ int arch_setup_msi_irq(struct pci_dev *pdev, struct msi_desc *desc) * Most PCIe endpoint devices do support 64-bit message addressing. */ if (desc->msi_attrib.is_64 == 0) { - dev_printk(KERN_INFO, &pdev->dev, + dev_printk(KERN_INFO, dev, "64-bit MSI message address not supported, " "falling back to legacy interrupts.\n"); @@ -1549,7 +1549,7 @@ int arch_setup_msi_irq(struct pci_dev *pdev, struct msi_desc *desc) /* SQ regions are out, allocate from map mem regions. */ mem_map = gxio_trio_alloc_memory_maps(trio_context, 1, 0, 0); if (mem_map < 0) { - dev_printk(KERN_INFO, &pdev->dev, + dev_printk(KERN_INFO, dev, "%s Mem-Map alloc failure. " "Failed to initialize MSI interrupts. " "Falling back to legacy interrupts.\n", @@ -1580,7 +1580,7 @@ int arch_setup_msi_irq(struct pci_dev *pdev, struct msi_desc *desc) mem_map, mem_map_base, mem_map_limit, trio_context->asid); if (ret < 0) { - dev_printk(KERN_INFO, &pdev->dev, "HV MSI config failed.\n"); + dev_printk(KERN_INFO, dev, "HV MSI config failed.\n"); goto hv_msi_config_failure; } @@ -1604,7 +1604,17 @@ is_64_failure: return ret; } -void arch_teardown_msi_irq(unsigned int irq) +void tile_teardown_msi_irq(unsigned int irq) { irq_free_hwirq(irq); } + +struct msi_chip tile_msi_chip = { + .setup_irq = tile_setup_msi_irq, + .teardown_irq = tile_teardown_msi_irq, +}; + +struct msi_chip *arch_get_match_msi_chip(struct device *dev) +{ + return &tile_msi_chip; +}