From patchwork Tue Nov 19 05:17:10 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bharat Bhushan X-Patchwork-Id: 3200081 X-Patchwork-Delegate: bhelgaas@google.com Return-Path: X-Original-To: patchwork-linux-pci@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 602429F3A0 for ; Tue, 19 Nov 2013 05:25:38 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 8E58820348 for ; Tue, 19 Nov 2013 05:25:37 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id ED8002034C for ; Tue, 19 Nov 2013 05:25:35 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751766Ab3KSFY4 (ORCPT ); Tue, 19 Nov 2013 00:24:56 -0500 Received: from va3ehsobe006.messaging.microsoft.com ([216.32.180.16]:55665 "EHLO va3outboundpool.messaging.microsoft.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751858Ab3KSFYG (ORCPT ); Tue, 19 Nov 2013 00:24:06 -0500 Received: from mail215-va3-R.bigfish.com (10.7.14.249) by VA3EHSOBE002.bigfish.com (10.7.40.22) with Microsoft SMTP Server id 14.1.225.22; Tue, 19 Nov 2013 05:24:04 +0000 Received: from mail215-va3 (localhost [127.0.0.1]) by mail215-va3-R.bigfish.com (Postfix) with ESMTP id A9CACBA0959; Tue, 19 Nov 2013 05:24:04 +0000 (UTC) X-Forefront-Antispam-Report: CIP:70.37.183.190; KIP:(null); UIP:(null); IPV:NLI; H:mail.freescale.net; RD:none; EFVD:NLI X-SpamScore: 8 X-BigFish: VS8(zzzz1f42h2148h208ch1ee6h1de0h1fdah2073h2146h1202h1e76h1d1ah1d2ah1fc6h1082kz70kd2iz1de098h8275bh1de097hz2dh2a8h839he5bhf0ah107ah1288h12a5h12a9h12bdh12e5h137ah139eh13b6h1441h1504h1537h162dh1631h1758h1898h18e1h1946h19b5h1ad9h1b0ah1b2fh2222h224fh1fb3h1d0ch1d2eh1d3fh1dfeh1dffh1e1dh1e23h1fe8h1ff5h2218h2216h20cfi1155h) Received: from mail215-va3 (localhost.localdomain [127.0.0.1]) by mail215-va3 (MessageSwitch) id 1384838642522804_20841; Tue, 19 Nov 2013 05:24:02 +0000 (UTC) Received: from VA3EHSMHS021.bigfish.com (unknown [10.7.14.237]) by mail215-va3.bigfish.com (Postfix) with ESMTP id 7A3FC80124; Tue, 19 Nov 2013 05:24:02 +0000 (UTC) Received: from mail.freescale.net (70.37.183.190) by VA3EHSMHS021.bigfish.com (10.7.99.31) with Microsoft SMTP Server (TLS) id 14.16.227.3; Tue, 19 Nov 2013 05:23:55 +0000 Received: from az84smr01.freescale.net (10.64.34.197) by 039-SN1MMR1-001.039d.mgd.msft.net (10.84.1.13) with Microsoft SMTP Server (TLS) id 14.3.158.2; Tue, 19 Nov 2013 05:23:54 +0000 Received: from freescale.com ([10.232.15.72]) by az84smr01.freescale.net (8.14.3/8.14.0) with SMTP id rAJ5NmKP006217; Mon, 18 Nov 2013 22:23:49 -0700 Received: by freescale.com (sSMTP sendmail emulation); Tue, 19 Nov 2013 10:48:00 +0530 From: Bharat Bhushan To: , , , , , , , , , CC: Bharat Bhushan , Bharat Bhushan Subject: [PATCH 6/9 v2] powerpc: pci: Extend msi iova page setup to arch specific Date: Tue, 19 Nov 2013 10:47:10 +0530 Message-ID: <1384838233-24847-7-git-send-email-Bharat.Bhushan@freescale.com> X-Mailer: git-send-email 1.7.0.4 In-Reply-To: <1384838233-24847-1-git-send-email-Bharat.Bhushan@freescale.com> References: <1384838233-24847-1-git-send-email-Bharat.Bhushan@freescale.com> MIME-Version: 1.0 X-OriginatorOrg: freescale.com X-FOPE-CONNECTOR: Id%0$Dn%*$RO%0$TLS%0$FQDN%$TlsDn% X-FOPE-CONNECTOR: Id%0$Dn%FREESCALE.MAIL.ONMICROSOFT.COM$RO%1$TLS%0$FQDN%$TlsDn% Sender: linux-pci-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org X-Spam-Status: No, score=-6.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY, UNRESOLVED_TEMPLATE autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP This patch extend the interface to arch specific code for setting msi iova address for a msi page. Machine specific code is not yet implemented. Signed-off-by: Bharat Bhushan --- v2 - new patch arch/powerpc/include/asm/machdep.h | 2 ++ arch/powerpc/kernel/msi.c | 10 ++++++++++ 2 files changed, 12 insertions(+), 0 deletions(-) diff --git a/arch/powerpc/include/asm/machdep.h b/arch/powerpc/include/asm/machdep.h index 8d1b787..e87b806 100644 --- a/arch/powerpc/include/asm/machdep.h +++ b/arch/powerpc/include/asm/machdep.h @@ -132,6 +132,8 @@ struct machdep_calls { /* Returns the requested region's address and size */ int (*msi_get_region)(int region_num, struct msi_region *region); + int (*msi_set_iova)(struct pci_dev *pdev, int region_num, + dma_addr_t iova, bool set); #endif void (*restart)(char *cmd); diff --git a/arch/powerpc/kernel/msi.c b/arch/powerpc/kernel/msi.c index 1a67787..e2bd555 100644 --- a/arch/powerpc/kernel/msi.c +++ b/arch/powerpc/kernel/msi.c @@ -13,6 +13,16 @@ #include +int arch_msi_set_iova(struct pci_dev *pdev, int region_num, + dma_addr_t iova, bool set) +{ + if (ppc_md.msi_set_iova) { + pr_debug("msi: Using platform get_region_count routine.\n"); + return ppc_md.msi_set_iova(pdev, region_num, iova, set); + } + return 0; +} + int arch_msi_get_region_count(void) { if (ppc_md.msi_get_region_count) {