From patchwork Tue Aug 12 07:26:07 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: wangyijing X-Patchwork-Id: 35227 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-qg0-f70.google.com (mail-qg0-f70.google.com [209.85.192.70]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id D9870203C5 for ; Tue, 12 Aug 2014 07:03:53 +0000 (UTC) Received: by mail-qg0-f70.google.com with SMTP id z60sf27568754qgd.9 for ; Tue, 12 Aug 2014 00:03:53 -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=738TivBKbhee8XTVBHhGFBkm0MLh687vLimU9/+uEHg=; b=Iql7x1v7JbOnpjKFWiXN494GKEVZhfMT8KV/SpJj7oWzskGk9B8jj0sCu+3WlWz0L+ 8MHrM4oFWSf2/9LFKjCPtDlYaJBruu8pKN6bVqBWNRBgfDEPdWj4qDSBpCnKqmJnJfHm xATpj7l0MB/d/DrONRTEd1U2h05/7K5jIeqrDxgfEbBp9QBOMQcHr/IpRHGEH3CfJ69r TWhEdtMSSbfcT92gitDfkt/tjcE620OeX5L2gUivY5c6GYPqoMHoDHCD2wWHTeivflOw gl3l9Z5UJKfx1lrwzqXP/ZrTddNUirR/CAqpJXHmrlPr/arX9ERhNr2SOsNlaMCvaHqt EoKg== X-Gm-Message-State: ALoCoQkLL+43iE0//COoBkkPDID1U9/DODAiyuUiCFjRimqjFnJAi24r7xpDdLXX/DGNP3JRDc7i X-Received: by 10.224.29.1 with SMTP id o1mr1698122qac.0.1407827033721; Tue, 12 Aug 2014 00:03:53 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.25.148 with SMTP id 20ls2887qgt.86.gmail; Tue, 12 Aug 2014 00:03:53 -0700 (PDT) X-Received: by 10.52.146.17 with SMTP id sy17mr22259359vdb.29.1407827033593; Tue, 12 Aug 2014 00:03:53 -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 t1si7762832vcx.69.2014.08.12.00.03.53 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 12 Aug 2014 00:03:53 -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 hq11so12878093vcb.10 for ; Tue, 12 Aug 2014 00:03:53 -0700 (PDT) X-Received: by 10.221.44.69 with SMTP id uf5mr2179869vcb.4.1407827033526; Tue, 12 Aug 2014 00:03:53 -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 tc5csp224506vcb; Tue, 12 Aug 2014 00:03:52 -0700 (PDT) X-Received: by 10.68.253.34 with SMTP id zx2mr117075pbc.152.1407827032564; Tue, 12 Aug 2014 00:03:52 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id er15si15365361pad.106.2014.08.12.00.03.51 for ; Tue, 12 Aug 2014 00:03:52 -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 S1754239AbaHLHDt (ORCPT + 26 others); Tue, 12 Aug 2014 03:03:49 -0400 Received: from szxga01-in.huawei.com ([119.145.14.64]:42580 "EHLO szxga01-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753794AbaHLHDg (ORCPT ); Tue, 12 Aug 2014 03:03:36 -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 CAE07909; Tue, 12 Aug 2014 15:03:00 +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:46 +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 14/20] Powerpc/MSI: Use msi_chip instead of arch func to configure MSI/MSI-X Date: Tue, 12 Aug 2014 15:26:07 +0800 Message-ID: <1407828373-24322-15-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 ppc_msi_chip instead of weak arch functions to configure MSI/MSI-X. Signed-off-by: Yijing Wang --- arch/powerpc/kernel/msi.c | 23 +++++++++++++++++------ 1 files changed, 17 insertions(+), 6 deletions(-) diff --git a/arch/powerpc/kernel/msi.c b/arch/powerpc/kernel/msi.c index 8bbc12d..170b02c 100644 --- a/arch/powerpc/kernel/msi.c +++ b/arch/powerpc/kernel/msi.c @@ -13,7 +13,7 @@ #include -int arch_msi_check_device(struct pci_dev* dev, int nvec, int type) +int ppc_msi_check_device(struct device *dev, int nvec, int type) { if (!ppc_md.setup_msi_irqs || !ppc_md.teardown_msi_irqs) { pr_debug("msi: Platform doesn't provide MSI callbacks.\n"); @@ -26,18 +26,29 @@ int arch_msi_check_device(struct pci_dev* dev, int nvec, int type) if (ppc_md.msi_check_device) { pr_debug("msi: Using platform check routine.\n"); - return ppc_md.msi_check_device(dev, nvec, type); + return ppc_md.msi_check_device(to_pci_dev(dev), nvec, type); } return 0; } -int arch_setup_msi_irqs(struct pci_dev *dev, int nvec, int type) +int ppc_setup_msi_irqs(struct device *dev, int nvec, int type) { - return ppc_md.setup_msi_irqs(dev, nvec, type); + return ppc_md.setup_msi_irqs(to_pci_dev(dev), nvec, type); } -void arch_teardown_msi_irqs(struct pci_dev *dev) +void ppc_teardown_msi_irqs(struct device *dev) { - ppc_md.teardown_msi_irqs(dev); + ppc_md.teardown_msi_irqs(to_pci_dev(dev)); +} + +struct msi_chip ppc_msi_chip = { + .setup_irqs = ppc_setup_msi_irqs, + .teardown_irqs = ppc_teardown_msi_irqs, + .check_device = ppc_msi_check_device, +}; + +struct msi_chip *arch_get_match_msi_chip(struct device *dev) +{ + return &ppc_msi_chip; }