From patchwork Tue Aug 12 07:26:11 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: wangyijing X-Patchwork-Id: 35231 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-yh0-f72.google.com (mail-yh0-f72.google.com [209.85.213.72]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 76DBC21137 for ; Tue, 12 Aug 2014 07:04:50 +0000 (UTC) Received: by mail-yh0-f72.google.com with SMTP id f73sf31067895yha.7 for ; Tue, 12 Aug 2014 00:04:50 -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=Q6nL6AGfFtiaqawUohDouTlqZNAtqUIT1iUf/ct4z4w=; b=hFHlUD8rt3opAB7fbFffAv6Hyi6ZKFkv3jhIF5eTSgo0hXM+5fL4yNrcm2OEgiLrH5 wMxqxmlRjfScCKHc0qotstxIX+9xGdowTIZiDAU+PXV8gZkZ24KWPSm1qwUBlfs5e9Fj 8q6j6O5PsXCc6KPg7PCvlLtETePfak7/xe4o0hQDuRu/I+u4XOk2frSMIslTe6ArNQZz +/BkFxAE9I8guqUAdO3BLrLnT5UArt2FqyysVwi5LZQhDxvC4uCjk4CtcKJnUsFiL7WS wgKYbWxpLeAplLjb6MSXMeS68aeMoUnv0sl3aTVhhcNZq6ddxtexHmloSwI3Sy80MTHL OGyg== X-Gm-Message-State: ALoCoQlNIYEi3vZrjsrn/qgqcHTpZaWDBpiwkIbe6iDkdOj+QFj54w06TwBl98IwQ0rRW8t5QqQj X-Received: by 10.236.180.202 with SMTP id j50mr5231yhm.51.1407827090309; Tue, 12 Aug 2014 00:04:50 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.91.40 with SMTP id y37ls18985qgd.2.gmail; Tue, 12 Aug 2014 00:04:50 -0700 (PDT) X-Received: by 10.52.98.201 with SMTP id ek9mr22076288vdb.35.1407827090198; Tue, 12 Aug 2014 00:04:50 -0700 (PDT) Received: from mail-vc0-f179.google.com (mail-vc0-f179.google.com [209.85.220.179]) by mx.google.com with ESMTPS id t10si6605764vcj.42.2014.08.12.00.04.50 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 12 Aug 2014 00:04:50 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.220.179 as permitted sender) client-ip=209.85.220.179; Received: by mail-vc0-f179.google.com with SMTP id hq11so12855135vcb.38 for ; Tue, 12 Aug 2014 00:04:50 -0700 (PDT) X-Received: by 10.52.61.136 with SMTP id p8mr22103626vdr.15.1407827090115; Tue, 12 Aug 2014 00:04:50 -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 tc5csp224570vcb; Tue, 12 Aug 2014 00:04:49 -0700 (PDT) X-Received: by 10.66.155.167 with SMTP id vx7mr125819pab.141.1407827089019; Tue, 12 Aug 2014 00:04:49 -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.48 for ; Tue, 12 Aug 2014 00:04:49 -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 S1754329AbaHLHEo (ORCPT + 26 others); Tue, 12 Aug 2014 03:04:44 -0400 Received: from szxga01-in.huawei.com ([119.145.14.64]:42454 "EHLO szxga01-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753813AbaHLHD3 (ORCPT ); Tue, 12 Aug 2014 03:03:29 -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 CAE07912; Tue, 12 Aug 2014 15:03:01 +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:53 +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 18/20] Sparc/MSI: Use msi_chip instead of arch func to configure MSI/MSI-X Date: Tue, 12 Aug 2014 15:26:11 +0800 Message-ID: <1407828373-24322-19-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.179 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 sparc_msi_chip instead of weak arch functions to configure MSI/MSI-X. Signed-off-by: Yijing Wang --- arch/sparc/kernel/pci.c | 18 ++++++++++++++---- 1 files changed, 14 insertions(+), 4 deletions(-) diff --git a/arch/sparc/kernel/pci.c b/arch/sparc/kernel/pci.c index 857ad77..9eabd22 100644 --- a/arch/sparc/kernel/pci.c +++ b/arch/sparc/kernel/pci.c @@ -839,18 +839,18 @@ int pci_domain_nr(struct pci_bus *pbus) EXPORT_SYMBOL(pci_domain_nr); #ifdef CONFIG_PCI_MSI -int arch_setup_msi_irq(struct pci_dev *pdev, struct msi_desc *desc) +int sparc_setup_msi_irq(struct device *dev, struct msi_desc *desc) { - struct pci_pbm_info *pbm = pdev->dev.archdata.host_controller; + struct pci_pbm_info *pbm = dev->archdata.host_controller; unsigned int irq; if (!pbm->setup_msi_irq) return -EINVAL; - return pbm->setup_msi_irq(&irq, pdev, desc); + return pbm->setup_msi_irq(&irq, to_pci_dev(dev), desc); } -void arch_teardown_msi_irq(unsigned int irq) +void sparc_teardown_msi_irq(unsigned int irq) { struct msi_desc *entry = irq_get_msi_desc(irq); struct pci_dev *pdev = entry->dev; @@ -859,6 +859,16 @@ void arch_teardown_msi_irq(unsigned int irq) if (pbm->teardown_msi_irq) pbm->teardown_msi_irq(irq, pdev); } + +struct msi_chip sparc_msi_chip = { + .setup_irq = sparc_setup_msi_irq, + .teardown_irq = sparc_teardown_msi_irq, +}; + +struct msi_chip *arch_get_match_msi_chip(struct device *dev) +{ + return &sparc_msi_chip; +} #endif /* !(CONFIG_PCI_MSI) */ static void ali_sound_dma_hack(struct pci_dev *pdev, int set_bit)