From patchwork Tue Mar 7 22:56:53 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bart Van Assche X-Patchwork-Id: 9609961 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 2F0A46046A for ; Tue, 7 Mar 2017 22:58:58 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 10F1228581 for ; Tue, 7 Mar 2017 22:58:58 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 0415328584; Tue, 7 Mar 2017 22:58:58 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2D7CE28581 for ; Tue, 7 Mar 2017 22:58:56 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756410AbdCGW64 (ORCPT ); Tue, 7 Mar 2017 17:58:56 -0500 Received: from esa3.hgst.iphmx.com ([216.71.153.141]:35275 "EHLO esa3.hgst.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756391AbdCGW6v (ORCPT ); Tue, 7 Mar 2017 17:58:51 -0500 X-IronPort-AV: E=Sophos;i="5.36,260,1486396800"; d="scan'208";a="1430394" Received: from mail-dm3nam03lp0022.outbound.protection.outlook.com (HELO NAM03-DM3-obe.outbound.protection.outlook.com) ([207.46.163.22]) by ob1.hgst.iphmx.com with ESMTP; 08 Mar 2017 06:57:01 +0800 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sharedspace.onmicrosoft.com; s=selector1-sharedspace-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=aFePgD56wXyjksYq4eFDOezQcyTBz3iHCmVSTuhl9zM=; b=ZPkNT2jTdJfarNzNgwGdEMvmSuudI93IZpgRUnJfMWvn+gFYs6WErxrKzRNA+RePiEqsNxD3/efT1NB8hDA0RDe2nWLYpIWotm8+eFdy5j7OqR9qQwL984QHW5Oiv2L99XHAgVf4ceVddtfc/K5r/pF06foKKKh4Y+Vc1IFChoU= Received: from BY2PR04CA0079.namprd04.prod.outlook.com (10.255.247.47) by BLUPR04MB515.namprd04.prod.outlook.com (10.141.29.25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.933.12; Tue, 7 Mar 2017 22:56:59 +0000 Received: from SN1NAM04FT027.eop-NAM04.prod.protection.outlook.com (2a01:111:f400:7e4c::209) by BY2PR04CA0079.outlook.office365.com (2a01:111:e400:2c16::47) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.947.12 via Frontend Transport; Tue, 7 Mar 2017 22:56:59 +0000 Authentication-Results: spf=pass (sender IP is 74.221.232.55) smtp.mailfrom=sandisk.com; redhat.com; dkim=none (message not signed) header.d=none;redhat.com; dmarc=bestguesspass action=none header.from=sandisk.com; Received-SPF: Pass (protection.outlook.com: domain of sandisk.com designates 74.221.232.55 as permitted sender) receiver=protection.outlook.com; client-ip=74.221.232.55; helo=sacsmgep15.sandisk.com; Received: from sacsmgep15.sandisk.com (74.221.232.55) by SN1NAM04FT027.mail.protection.outlook.com (10.152.88.165) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.947.7 via Frontend Transport; Tue, 7 Mar 2017 22:56:58 +0000 X-AuditID: ac1c2134-817ff70000005688-a8-58bf3ab799ef Received: from SACCASIP04.sdcorp.global.sandisk.com (Unknown_Domain [172.28.1.254]) (using TLS with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by (Symantec Messaging Gateway) with SMTP id C8.6A.22152.7BA3FB85; Tue, 7 Mar 2017 14:56:58 -0800 (PST) Received: from ULS-OP-MBXIP03.sdcorp.global.sandisk.com ([fe80::f9ec:1e1b:1439:62d8]) by SACCASIP04.sdcorp.global.sandisk.com ([::1]) with mapi id 14.03.0319.002; Tue, 7 Mar 2017 14:56:54 -0800 From: Bart Van Assche To: Doug Ledford CC: Sebastian Ott , Parav Pandit , "linux-rdma@vger.kernel.org" Subject: [PATCH] IB/core: Restore I/O MMU, s390 and powerpc support Thread-Topic: [PATCH] IB/core: Restore I/O MMU, s390 and powerpc support Thread-Index: AdKXlhzioTrmuC/3RZGdWF8b/Unz2g== Date: Tue, 7 Mar 2017 22:56:53 +0000 Message-ID: <1D08B61A9CF0974AA09887BE32D889DA0DBFCB@ULS-OP-MBXIP03.sdcorp.global.sandisk.com> Accept-Language: nl-NL, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.181.8.64] MIME-Version: 1.0 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFvrOLMWRmVeSWpSXmKPExsWyRobxn+4uq/0RBrs+M1m8PP+B1eLZoV4W i+arf1ksTnUdZnRg8XhwaDOLx7Pph5k83u+7yubxeZNcAEsUl01Kak5mWWqRvl0CV0bLhS9s BXdtKzas+cDawPjHqIuRk0NCwETi0+p2xi5GLg4hgSVMEufWnmeHcI4ySixcsIodpIpNwEhi 9oQ9LCC2iICaxKZXi8CKmAX6GSV2H1rDCpIQFnCWeL3jIjtEkYfExsMn2SBsPYn29lfMIDaL gIrE9hNbgGo4OHgFYiUWTOcDMRkFZCVaXnODVDALiEvcejKfCeI4AYkle84zQ9iiEi8f/2MF KZcQkJe4ftoOolxHYsHuT2wQtrbEsoWvwcp5BQQlTs58wjKBUXgWkqmzkLTMQtIyC0nLAkaW VYxixYnJxbnpqQWGpnrFiXkpmcXZesn5uZsYwdGhaLKDsWOj+yFGAQ5GJR5ej7P7IoRYE8uK K3MPMUpwMCuJ8J4V3h8hxJuSWFmVWpQfX1Sak1p8iFGag0VJnHep9tQIIYH0xJLU7NTUgtQi mCwTB6dUA2P9nO8dj/0eztj3TWDSnwXXPoUy7dosFhSummFwZ0J6eFX29As8CRN2ePhYJQSt t7rh81hx6wunk3cTD5zWPXRpRZ8Fi8K3SSy205UOVf2MdFEUd1Tsjw/xrw1X0K3eL2J4YdHW gJTz7Csnyd007Q0yP9D29WVWeaIwz4vDu6XNPqn7NrtXzVRiKc5INNRiLipOBADQehEyigIA AA== X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-HT: Tenant X-Forefront-Antispam-Report: CIP:74.221.232.55; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10019020)(6009001)(39860400002)(39850400002)(39410400002)(39840400002)(39450400003)(2980300002)(438002)(199003)(189002)(9170700003)(356003)(5250100002)(7736002)(2900100001)(8746002)(2270400002)(47776003)(8676002)(53936002)(2930100002)(55846006)(2920100001)(81166006)(54906002)(3846002)(6116002)(5660300001)(102836003)(38730400002)(2906002)(97756001)(33656002)(55016002)(305945005)(46406003)(54356999)(50986999)(23726003)(189998001)(8936002)(6916009)(4326008)(7696004)(86362001)(50466002)(106466001)(110136004)(7099028); DIR:OUT; SFP:1102; SCL:1; SRVR:BLUPR04MB515; H:sacsmgep15.sandisk.com; FPR:; SPF:Pass; MLV:sfv; A:1; MX:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; SN1NAM04FT027; 1:1+OBfYl9sxB+ruxoCdjWq1/zUUVCaLG9Jg+sCi3nGTT8yQOVh5NYc7vYRFf5BlEwIOKpIjk25kgv3MW3Y80hnYL4IswHPRLq+N7rz/yvKEC1da5iA/cbsp5b7HJg61gqnKTgvyCVT9dEnsYAnSj59ePt1R4aEpF7uiOxhfC9d1QEOFU2QGtuq7aJrkPUoG9b7i1wYgFjYKnbEoH3J89YsTDVEkB4P44uinhgFT0Ir5b4jTodoFiJEWcjcjzwSdEn4uLgWF5UUywJvqrbXqulta0myuF+Qz1qFDdrh036q6tDrktqF1XQRfg/C0jsrahF1LaSDjuDhBqSy1bqdd1AqWqGm28uwsBv6AzkA0EQGd65prWIs1w2i42KHkUTAuo9B4wuHyK2aCvEncDO0DtEpk9Rd/RN82P/O/pPiPcAjSnXBkPTdEiET16GeaUG4Yr05XOcYaVO0OUlRVPHkucab/GuURKE7J6F8DDmCA1Nf0jdidZpxP/vNYOjaeetguv0DXWDbMBBO5vmq16+7HSqLCcf9z2d5SF2xTc5dPOoeVgjWsGk4DJ3bK3gRLsrV69Y X-MS-Office365-Filtering-Correlation-Id: 25930331-0828-407b-5ed9-08d465ad428c X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(8251501002); SRVR:BLUPR04MB515; X-Microsoft-Exchange-Diagnostics: 1; BLUPR04MB515; 3:Q490/oZdOkmDXzJmOvgFjSjO7Unt94/ZvEdJCaQ3NhHeLT1jgjnhy4v1QUgy5g0jJDPE5L9s1xSvtPBnS3xOggHmoF0mxY2ZJAbfYRt1XqflZi9pwUmQzLxpDanLALDpmThhrjjcdhTYprvbQM7BAF9T/IHI9UO+Wwl0J8IiTIW5JDzEZiiUy9jZruGt/KQrTb7t3/WwSIdO42qVhQ0EJASM11wZdgDfEMD6E6A1tVq1gBk+blZOCksPC+wwOhJ6rpv8L8SrTD8Q663f5w66MdaVcdIlwK18bkP2UMfyFueLYg0G403vdjjW/FV2DOkCyJMDTRjx6oe/MJWCPpfPpEv3Tr9FpqiwW/Ayggmv4uh3oeIoZTCRmHowT9cGtITYg/Qc2jGxPxMCmbDgfakXGw==; 25:zLSh/Txe7WuPT/BoyhvSdUqoQ9xpcLCd5Ocxb4ALCa4Yysfan7IpICymsWNvsdls+TZn+BKjSjVPx94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vXSTUvyTl3vY7HAaZ1JX0C83g1Oa+dOSjRCNp+tWWnImCHpFor2ADuhkMBRFPhdmuNgCz4maHMbiUA0g5SfrSNhIpmfLLJOcjkqQzUM+77rnS77g2w4i9FzCPGO6Hpr79roOzwieygrsAPmjzXc5iY WDCIPOUTBOUND: EOP-TRUE X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(104084551191319)(42932892334569); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040375)(601004)(2401047)(5005006)(8121501046)(13017025)(13015025)(13023025)(13024025)(13018025)(10201501046)(3002001)(6055026)(6041248)(20161123555025)(20161123558025)(20161123560025)(20161123564025)(20161123562025)(6072148); SRVR:BLUPR04MB515; BCL:0; PCL:0; RULEID:; SRVR:BLUPR04MB515; X-Microsoft-Exchange-Diagnostics: 1; BLUPR04MB515; 4:J6MQtS8p8A1U7WV0TTCgX1jrejY9Yn0vGzCwY/86vBQzHWXDDQUEQT49l1BAdAQVWlXchYP6T3o6WeOGDyMrc49UjJL3R9O5uoFejl/BS5yLVnDOKZF9jwbBP1U0Rpa5O3KWRD74htw2XoCPtPDWUoKNRBeJhQaTzpAuYiW+6IArfEHAJZBNC6UUks/xM4T4YrvXJ87mH4Dh/tNccbKejVsibZf25q0a+vgPdSDIdxmU/bzIRFg4eKBAOvHmEKSb6dr5nFHkhGVlbsrFZPeKs7LTGK5WLcVVoDlrU85r7eKq/n38QJdn1duV2mJqokujJ3uCLQXiT5I2XLaKCrbgyNiSqaqwQrUPVoQq5CQ8ltUpD6L/2exkZadK5nfel7w3NE40Yhb4QajvyjBzsVtOlJuUsBw2o50qslMqjMfanltkf6LTUvv9MD2IzT0tDhvvUw8I+bO28lcOS3tOGXtUZD50zKJb5ZRm7bnATr5RmPDCHIvM+dXD8HMhqFn2wOvMb5XsWE3Gv5QeI/9rIvFPPA40R76upJ9sMg2GFvGg6/K1wVpPy4MutnF8OBFDgjOhwPEhTc9rFYb8llfNaDIwOZDopFpMsF9rND0L1Vh4cyHUsDUMDO9zmhG7MDd9qZGhej+xI9hzjE3+gJYekOHXQhD4mMXYb9ttW8Z4SFj8BFdWIpK6neBTr9/SgcKV9j/NT/49OFDG1rR7l+XwhPe8AvnuUPQZDM9GUrrt8SlVNgt713i5qFuZO49ak6rljdvzU2tLZ60ULu2cezQSb7pS3c6gl7YHyF4UAVbSfSbalEY= X-Forefront-PRVS: 0239D46DB6 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; BLUPR04MB515; 23:B/rtvXDca942qG1ZRGQcwKm3FeBVhFBKUuoQYLR50q?= =?us-ascii?Q?niq/ypAdsqRvE+dC5EpPeMn6f2e2g+LCSCHUvyFIWxKVzZqT2p75bl9rJYFM?= =?us-ascii?Q?TEay82E1z0zgGFa0KLkxvGj8Nz38Uiwq113+2qnO/jI4VueLKWatUhiN2o37?= =?us-ascii?Q?IgRBMMv4qOtF1R4eSu93e/6bBnAV98S8XwmXbTOuDMgcRRv5KV9uQ8PTsnoH?= =?us-ascii?Q?1STEsQbZ2afdVYMFShWCgk084atg0qUrDAknpvqVWli8wCeyJfS6z+SPYhAU?= =?us-ascii?Q?8Z2Bi4oJd6NyTMO0yQnUX9cknF4CMXdvf9cMuQ+lnPdjWRsAnGIso05yH8VY?= =?us-ascii?Q?X3mm3NxTIBWpqtNH/DKR8hWbImfYyTcRsq8mPEKkCkeosGUUwRZp4klGXRfD?= =?us-ascii?Q?DT2mVhXVKjZhZlZq/jl8J6QtMOWFc84pgZWeZHvcC5Gf5s3db1a2zZ+A9x8/?= =?us-ascii?Q?OYTS9iKuI1CTM8ExPFyAt3M8AZQK3uDtT391OS5yWlDP63gWy2P71y12s8jY?= =?us-ascii?Q?T+tqh3AgloB73TpMxWd5/M/agvTtt12IX5EmLQGujbaTOdGJ0vZ7svaNTcDr?= =?us-ascii?Q?z39xfCbB54V0CD884IxU7MQQ4xeKs+hT3Lse7MieCypWJU2AHqPG83timcu9?= =?us-ascii?Q?ZsJFw+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te5YaakQzozHTmuRuyubz+qYpG0hcOb5GktGLnYLqJ/rDXa6xyqjhJ4iaV4GE4nSsGIgdZqjcr5rdIOkdP6/PV+lHFn+8=; 5:sde6fLY3fapfSDQHBFPMizBUcEgsAsGGE+grmPY+xrx/hEmyhnWrG9o5PNzwqjXvv51L7/xHrxBaUlBxVBUam3VVhtRgitBdIQDwbMpGpBql5W7BdMjO8O5rH/IzXtAu54LpNbCX7NC++08v9/f8kaFwgKeOXwKq8rI1aF6Z/q4=; 24:dTH7qi7Foy9p7Cz6f4joLcM0+gIWfLN97a8dLMF6w9o0F89xasw8gA5FPh8Tvaj3QXtE1ScCIAYg/bIA2hk7B831dgHyvE5S63Rgh3Y0x8Q= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; BLUPR04MB515; 7:wF8VtK72/Sv0NAJGNO0nQ2X2MKQ0+GoU3PJbeWsLUb0zCNs3zwxJjE0d2KOCHlyzY+Bk+piUs+SbAs1j/4a1NEVKHt5czB6/dNN67A4e9jvIhMsjQ4LRMifGoENKEUm8jw8W4pS6CxYM0Z+j7GrcDxE0028w9z8og54Yokb/zb2OIS+aDmd6ierwcozhqVLJKn49DVeEgmO8SHm46ymOxMTx/YlyJFeF5oEvsVFW12wqDlf5hg1EExdMJ2jK4NhBRE96CLxgzY3X6EFiEQsQ9zvtE5rdU7ais6TTgbXBuClAXq3nOwqXlhOcPE3hsNkua733arRWzDfZaAdSQTsJ3A==; 20:bJVGHDSur+tG7duIaz6vXmbM7Uppc/tYYAUuqFeC6Z/fHWcceBJ/5jASMZc8loXTifdzJBJ6COl7IFHyUFzouB8YlHPmbzlW2L1ginguusPRXD/8S59H70diGmaSdPEvCUZCFeuQ9Cd7/B/rWBEMwGzqZhk8pph83Yv3nWL3I34= X-OriginatorOrg: sandisk.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Mar 2017 22:56:58.2263 (UTC) X-MS-Exchange-CrossTenant-Id: b61c8803-16f3-4c35-9b17-6f65f441df86 X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=b61c8803-16f3-4c35-9b17-6f65f441df86; Ip=[74.221.232.55]; Helo=[sacsmgep15.sandisk.com] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BLUPR04MB515 Sender: linux-rdma-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Avoid that the following error message is reported on the console while loading an RDMA driver with I/O MMU support enabled: DMAR: Allocating domain for mlx5_0 failed Ensure that DMA mapping operations that use to_pci_dev() to access to struct pci_dev see the correct PCI device. E.g. the s390 and powerpc DMA mapping operations use to_pci_dev() even with I/O MMU support disabled. This patch preserves the following changes of the DMA mapping updates patch series: - Introduction of dma_virt_ops. - Removal of ib_device.dma_ops. - Removal of struct ib_dma_mapping_ops. - Removal of an if-statement from each ib_dma_*() operation. - IB HW drivers no longer set dma_device directly. Reported-by: Sebastian Ott Reported-by: Parav Pandit Fixes: commit 99db9494035f ("IB/core: Remove ib_device.dma_device") Signed-off-by: Bart Van Assche Reviewed-by: parav@mellanox.com Tested-by: parav@mellanox.com Reviewed-by: Leon Romanovsky --- drivers/infiniband/core/device.c | 26 ++++++++++++++++++++------ include/rdma/ib_verbs.h | 30 +++++++++++++++++------------- 2 files changed, 37 insertions(+), 19 deletions(-) diff --git a/drivers/infiniband/core/device.c b/drivers/infiniband/core/device.c index 593d2ce6ec7c..addf869045cc 100644 --- a/drivers/infiniband/core/device.c +++ b/drivers/infiniband/core/device.c @@ -336,12 +336,26 @@ int ib_register_device(struct ib_device *device, struct device *parent = device->dev.parent; WARN_ON_ONCE(!parent); - if (!device->dev.dma_ops) - device->dev.dma_ops = parent->dma_ops; - if (!device->dev.dma_mask) - device->dev.dma_mask = parent->dma_mask; - if (!device->dev.coherent_dma_mask) - device->dev.coherent_dma_mask = parent->coherent_dma_mask; + WARN_ON_ONCE(device->dma_device); + if (device->dev.dma_ops) { + /* + * The caller provided custom DMA operations. Copy the + * DMA-related fields that are used by e.g. dma_alloc_coherent() + * into device->dev. + */ + device->dma_device = &device->dev; + if (!device->dev.dma_mask) + device->dev.dma_mask = parent->dma_mask; + if (!device->dev.coherent_dma_mask) + device->dev.coherent_dma_mask = + parent->coherent_dma_mask; + } else { + /* + * The caller did not provide custom DMA operations. Use the + * DMA mapping operations of the parent device. + */ + device->dma_device = parent; + } mutex_lock(&device_mutex); diff --git a/include/rdma/ib_verbs.h b/include/rdma/ib_verbs.h index 0f1813c13687..99e4423eb2b8 100644 --- a/include/rdma/ib_verbs.h +++ b/include/rdma/ib_verbs.h @@ -1863,6 +1863,9 @@ struct ib_port_immutable { }; struct ib_device { + /* Do not access @dma_device directly from ULP nor from HW drivers. */ + struct device *dma_device; + char name[IB_DEVICE_NAME_MAX]; struct list_head event_handler_list; @@ -3007,7 +3010,7 @@ static inline int ib_req_ncomp_notif(struct ib_cq *cq, int wc_cnt) */ static inline int ib_dma_mapping_error(struct ib_device *dev, u64 dma_addr) { - return dma_mapping_error(&dev->dev, dma_addr); + return dma_mapping_error(dev->dma_device, dma_addr); } /** @@ -3021,7 +3024,7 @@ static inline u64 ib_dma_map_single(struct ib_device *dev, void *cpu_addr, size_t size, enum dma_data_direction direction) { - return dma_map_single(&dev->dev, cpu_addr, size, direction); + return dma_map_single(dev->dma_device, cpu_addr, size, direction); } /** @@ -3035,7 +3038,7 @@ static inline void ib_dma_unmap_single(struct ib_device *dev, u64 addr, size_t size, enum dma_data_direction direction) { - dma_unmap_single(&dev->dev, addr, size, direction); + dma_unmap_single(dev->dma_device, addr, size, direction); } /** @@ -3052,7 +3055,7 @@ static inline u64 ib_dma_map_page(struct ib_device *dev, size_t size, enum dma_data_direction direction) { - return dma_map_page(&dev->dev, page, offset, size, direction); + return dma_map_page(dev->dma_device, page, offset, size, direction); } /** @@ -3066,7 +3069,7 @@ static inline void ib_dma_unmap_page(struct ib_device *dev, u64 addr, size_t size, enum dma_data_direction direction) { - dma_unmap_page(&dev->dev, addr, size, direction); + dma_unmap_page(dev->dma_device, addr, size, direction); } /** @@ -3080,7 +3083,7 @@ static inline int ib_dma_map_sg(struct ib_device *dev, struct scatterlist *sg, int nents, enum dma_data_direction direction) { - return dma_map_sg(&dev->dev, sg, nents, direction); + return dma_map_sg(dev->dma_device, sg, nents, direction); } /** @@ -3094,7 +3097,7 @@ static inline void ib_dma_unmap_sg(struct ib_device *dev, struct scatterlist *sg, int nents, enum dma_data_direction direction) { - dma_unmap_sg(&dev->dev, sg, nents, direction); + dma_unmap_sg(dev->dma_device, sg, nents, direction); } static inline int ib_dma_map_sg_attrs(struct ib_device *dev, @@ -3102,7 +3105,8 @@ static inline int ib_dma_map_sg_attrs(struct ib_device *dev, enum dma_data_direction direction, unsigned long dma_attrs) { - return dma_map_sg_attrs(&dev->dev, sg, nents, direction, dma_attrs); + return dma_map_sg_attrs(dev->dma_device, sg, nents, direction, + dma_attrs); } static inline void ib_dma_unmap_sg_attrs(struct ib_device *dev, @@ -3110,7 +3114,7 @@ static inline void ib_dma_unmap_sg_attrs(struct ib_device *dev, enum dma_data_direction direction, unsigned long dma_attrs) { - dma_unmap_sg_attrs(&dev->dev, sg, nents, direction, dma_attrs); + dma_unmap_sg_attrs(dev->dma_device, sg, nents, direction, dma_attrs); } /** * ib_sg_dma_address - Return the DMA address from a scatter/gather entry @@ -3152,7 +3156,7 @@ static inline void ib_dma_sync_single_for_cpu(struct ib_device *dev, size_t size, enum dma_data_direction dir) { - dma_sync_single_for_cpu(&dev->dev, addr, size, dir); + dma_sync_single_for_cpu(dev->dma_device, addr, size, dir); } /** @@ -3167,7 +3171,7 @@ static inline void ib_dma_sync_single_for_device(struct ib_device *dev, size_t size, enum dma_data_direction dir) { - dma_sync_single_for_device(&dev->dev, addr, size, dir); + dma_sync_single_for_device(dev->dma_device, addr, size, dir); } /** @@ -3182,7 +3186,7 @@ static inline void *ib_dma_alloc_coherent(struct ib_device *dev, dma_addr_t *dma_handle, gfp_t flag) { - return dma_alloc_coherent(&dev->dev, size, dma_handle, flag); + return dma_alloc_coherent(dev->dma_device, size, dma_handle, flag); } /** @@ -3196,7 +3200,7 @@ static inline void ib_dma_free_coherent(struct ib_device *dev, size_t size, void *cpu_addr, dma_addr_t dma_handle) { - dma_free_coherent(&dev->dev, size, cpu_addr, dma_handle); + dma_free_coherent(dev->dma_device, size, cpu_addr, dma_handle); } /**