Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp1584916imm; Thu, 14 Jun 2018 00:01:13 -0700 (PDT) X-Google-Smtp-Source: ADUXVKKP37bkE6EY+CmR7CIGAQG0KSsNo5ZYHd1NLDZowKJvL160H8UBMf/lfB5XGWg0rNIes3p8 X-Received: by 2002:a17:902:8a95:: with SMTP id p21-v6mr1588043plo.325.1528959672992; Thu, 14 Jun 2018 00:01:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1528959672; cv=none; d=google.com; s=arc-20160816; b=lGwPPCQ2CliynoU0aOk8I3i/me1wLYP033VnEowG2e6nBXao4cT4siREsrt7vdLKdJ wG9nrJlklfyHhq/axIP7wAJA8GcDlZ+s1Fkk3Q0AAYv3pvZKNTaVRITlg2MyPr9DszUu l35ews6jm5xsaGuCt7bCQra3J/VxPxMVHGMvBt8sg59GzKJ4uHBg3E98vga6vZhODY2Z /MMPwOl3Ps244g9fPs4APc04TbtSufpG7qdGZHBYn5gAmQJtsev+IGgIXWfQP5rodt+M uekVtSkpbOwKp0lSTo9aWjIQd62EvRyCjVfAthYfiqC5qaH0EpNuCa18MjIw3dHSUI4f zAZA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:spamdiagnosticmetadata :spamdiagnosticoutput:content-language:content-transfer-encoding :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject:dkim-signature:arc-authentication-results; bh=mJuTHErVGUgiN/ghGdx8GwlU9m6hNKgewMg6qTApTjs=; b=zP+iADo60q7RLXtLVtrhLFWjXfJmrJZ/9YXdW/gyN0spwDolBLadWuQ1rFkt2W607o 8rmmFDMyPfvl9oRyLkyign98pS37436oQEeqLuS9XhZGtwm5dBdmLEXNZdXIE7w9V2P5 JPv4QGLj+slLnCDdt/1+dMfvrV1Bx/5z5BTCuTJvfqRI7wAzv+CVC9yYL7diPGg25Jkf +wXycDCdbQC3klgJblsobmLN6LRLEGoRcXN63gRc5PLqS+2QQx6BnbRyGHEKhFkicPdU 0N7AnM91RquNTO897Lm7hlGPfDuBPA6MwDkNVX0lPQ/1/5lF/8ocH/tda54bmOllFKAp pVcA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@epam.com header.s=selector1 header.b=PG2YRjE3; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=epam.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id j24-v6si4481181pfn.281.2018.06.14.00.00.58; Thu, 14 Jun 2018 00:01:12 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@epam.com header.s=selector1 header.b=PG2YRjE3; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=epam.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754607AbeFNHAc (ORCPT + 99 others); Thu, 14 Jun 2018 03:00:32 -0400 Received: from mail-eopbgr00045.outbound.protection.outlook.com ([40.107.0.45]:54912 "EHLO EUR02-AM5-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752781AbeFNHAa (ORCPT ); Thu, 14 Jun 2018 03:00:30 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=epam.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=mJuTHErVGUgiN/ghGdx8GwlU9m6hNKgewMg6qTApTjs=; b=PG2YRjE3nD9PH92mR3rZhx+GUjWaa/swQeiL6hNFtT55ytAnvs6H0vdXbDYKeDQ2mV0ZdM+i+9sgNvJIzV6owfptmWfrMRzQU706kPPLa1kx5Sw6INJKJcwMWH+sQ2nW8KNPe7Tw+uOXiOpH20FoiwCbvCrSqQqZKIL11d4oqPA= Received: from [10.17.182.9] (85.223.209.53) by AM0PR0302MB3204.eurprd03.prod.outlook.com (2603:10a6:208:9::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.841.18; Thu, 14 Jun 2018 07:00:26 +0000 Subject: Re: [PATCH v3 5/9] xen/gntdev: Allow mappings for DMA buffers To: Oleksandr Andrushchenko , xen-devel@lists.xenproject.org, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-media@vger.kernel.org, jgross@suse.com, boris.ostrovsky@oracle.com, konrad.wilk@oracle.com Cc: daniel.vetter@intel.com, dongwon.kim@intel.com, matthew.d.roper@intel.com References: <20180612134200.17456-1-andr2000@gmail.com> <20180612134200.17456-6-andr2000@gmail.com> From: Oleksandr Andrushchenko Message-ID: <58836503-87be-2693-4665-4b0a55a170d3@epam.com> Date: Thu, 14 Jun 2018 10:00:22 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.8.0 MIME-Version: 1.0 In-Reply-To: <20180612134200.17456-6-andr2000@gmail.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US X-Originating-IP: [85.223.209.53] X-ClientProxiedBy: AM5PR0402CA0010.eurprd04.prod.outlook.com (2603:10a6:203:90::20) To AM0PR0302MB3204.eurprd03.prod.outlook.com (2603:10a6:208:9::23) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 9d4b4993-f4bc-40fb-33ae-08d5d1c48218 X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:(7020095)(4652020)(5600026)(711020)(4534165)(7168020)(4627221)(201703031133081)(201702281549075)(2017052603328)(7153060)(7193020);SRVR:AM0PR0302MB3204; X-Microsoft-Exchange-Diagnostics: 1;AM0PR0302MB3204;3:aoUHuXytalT+lcD61pTrekw7/IHcCJQiv6QGuqc5oNXGbN83G9dnK5UdaP/Yf3cA9F8fhKRRoCaZ/3RJXZHPdG/mogSrhW39UL0VrAZJ1TQ+o9s9xSJMObX/VsqxWmSSEWZyyZ79I3AUyNul7ylUbD3A2pxnGhKANAoh+GdMx4NQcpaIi3BaMiky4Lv1Yzlhq0Zxr4LyS3qIWT1ubIL5y/vic+N/3yFybq/kYqC04Mu1WXSeGuSptnujl4hk8YD3;25:FdDYIqV4Fgyk4rlM9IKvmGbi5iQuqe7j5PJpOmp4x6qgiVvMOzQpaZAXCCQ7OWwJ3pzy//affmGe+1Dr7VCkBYHww8a481jZQd3fnccAjZ7Hih1wYfTHCbdH8e2VmvKsbHJt/zW4lZLJ1LyC6f/W4evNt+Le11Kz7Ntr+8oZu/m04OCpQrtrznzyohrQEP/BsE/e4RrUWZhFcjm9Min92ncDttPtvwJPY4YX0YFvTA9lmhXtxNOp38ttyMTytfyKyaimj5wv+nxjWWt3mWcJ8zpbAUynK8lY8A18xAnWhaIJ5Xr/g+dLus6vDNs4w+ANiSk58QHckAOobKO6FwpDlA==;31:yX9qz3dKF+hW1RzsnhaqxRuDXaIAJA0ywAUYB3/nR97WnIMvnspSDZjCpFkWSUXzIFROMgeAtx7ZS/L2ZKGB4IzJnYYgZSydLu38sVlm4m9UAySA5+uEpcO3W2fgwzrzv9tEqchcKgn+qENm9hMcUFYcmcTc6H4y3r9OQoiK3jVgt3L8vAHy8fOpWnM1xceSfKospwWWgOvp3FC7IKDgifOGO5CmMCX68xsH7gCEPOI= X-MS-TrafficTypeDiagnostic: AM0PR0302MB3204: Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Oleksandr_Andrushchenko@epam.com; X-Microsoft-Exchange-Diagnostics: 1;AM0PR0302MB3204;20:Z2kEVOtl7ocAPwSYIcLfuIdGisAe6xTWyOUMlO06vx6+M7cy92bQ59YspF3VlIiGVhjzNPng66moRJ4DE8m6+mBDyjP5XNqOt5Sbki+c6+QcvoSldo6AerZplSDI9mvgvntV19Mqcv88EhXKCHL3CJ7CZC21RstVVE8QvE0nXoHxaRCAUCdmBHwJPs4I8n9qoDyxdZmJ7HEV3pfyZV16afYhAHQ4lKNFeH+yf8WqPKWqWuL3FYJV8SDq06qqTHayc6FPnbLgXz56e6Z1dmxGbHV8XFTTmzNgof9hgW92rehSKxhqyDzDHhHfdXBUCu6FW05tLxL4a5qYHN8CtvQe0QcyqGYP4qDEExjBPdoarsTD41+1Zg1+ff7BntWeQt71dprMApC4HWXsuwBnBEkRuRZbLMyhPK0pBZEXTKYded/refJtxd+vJHyQUDl6i52Wuyg5fRV3I4w37f3M8pw+Wgi/Ps31LUU7ZaadaXjZwhZjjfFx+4KfkiEbBdFYmmFE;4:dsdIsv/vvB5jvndBOyoh2plE6+YHdQDLS/y+7qsw3UhQlDyyk2DPoN2qHXTk/ZaRzNh8K9QXBQ+sOhJXsspxnoHJAUCpPAiZYHz4C+09rI9WMP5jzYOB4Lm52y+sdUFqagK82clNI8O/NxSvNIvMh+vioaITX6jr/5FZ1orRQbCnUgArpK8rsAjYXNC+zf7rA54596IB0wb0o4W/9ad8qVZf/++Yoyy/hF+zyYlk5LKH6augXlc1VC9oJEw/mh7taXI+FmEwQNoeo3atH5Ejc+qlHYIXC8WNSnPRuJOjRx470KsdomSIbmWvkuozHBzN X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(84791874153150); X-MS-Exchange-SenderADCheck: 1 X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(8211001083)(6040522)(2401047)(5005006)(8121501046)(10201501046)(3231254)(944501410)(52105095)(3002001)(93006095)(93001095)(149027)(150027)(6041310)(20161123562045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123558120)(20161123564045)(20161123560045)(6072148)(201708071742011)(7699016);SRVR:AM0PR0302MB3204;BCL:0;PCL:0;RULEID:;SRVR:AM0PR0302MB3204; X-Forefront-PRVS: 0703B549E4 X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10009020)(6049001)(346002)(366004)(39860400002)(376002)(39380400002)(396003)(189003)(199004)(52146003)(6486002)(52116002)(80792005)(68736007)(86362001)(47776003)(5660300001)(97736004)(65826007)(64126003)(7416002)(186003)(6116002)(65806001)(446003)(77096007)(67846002)(66066001)(956004)(16526019)(23676004)(3846002)(31696002)(229853002)(2486003)(36756003)(65956001)(11346002)(6666003)(316002)(39060400002)(966005)(81166006)(81156014)(72206003)(8936002)(4326008)(25786009)(7736002)(50466002)(16576012)(230700001)(478600001)(6246003)(476003)(106356001)(58126008)(26005)(6306002)(2906002)(53936002)(305945005)(486006)(55236004)(8676002)(386003)(76176011)(31686004)(105586002)(2616005);DIR:OUT;SFP:1101;SCL:1;SRVR:AM0PR0302MB3204;H:[10.17.182.9];FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;MX:1;A:1; Received-SPF: None (protection.outlook.com: epam.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?utf-8?B?MTtBTTBQUjAzMDJNQjMyMDQ7MjM6UCtqaXl5cCtUZjU5elRJN1pLajJ2eGtK?= =?utf-8?B?MHBHMWNFUVk2d0VlT0xZN3BQN0VGZ29pQjZ6TTRRQzlmNEJEM2o5clNGZHho?= =?utf-8?B?SWNERU5wZWVQZHIzZ0p4eTB4YVdrclVMMklLbGQ5d3g1eVk2b0RESVRCU1Fo?= =?utf-8?B?U1YyY3ZkcGV0emovbmhtaFZzT0F2RmZReGZMM2FqMi82WmJkb3ZYZ3hvNmlX?= =?utf-8?B?UEZ0bnRmc1pCcFlzbFlRUk1xWExJbkxoekVjaGN3a2JScVhHT2N3Um5vVW1h?= =?utf-8?B?S2JKWnkwN1lDSHpia1lHYTdXTmJUWjRjYzRVZ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bdaMFwes2NhZhuW8bYJlW+k5EH+bOJeSTz7VtkKqI2Voq+sFmwlq2nVUgeeqCQrFcjXBJUG39qHR1PGSggViIsTnlnDR1R+X0xxtTW0n/bOln3sOmLBGU1xwhycQou344xwnaP7u0G2HqRRL9F3AeLsAASJV8VY8rj/M87FYwoKOiqdlBScDwN6VEFDnhVMmylYvPtapWW/XvXDQGRXFC0LpxeNwplSzgAa1mxmUqwk X-OriginatorOrg: epam.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 14 Jun 2018 07:00:26.2888 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 9d4b4993-f4bc-40fb-33ae-08d5d1c48218 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: b41b72d0-4e9f-4c26-8a69-f949f367c91d X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM0PR0302MB3204 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org @@ -548,6 +632,17 @@ static int gntdev_open(struct inode *inode, struct file *flip) > } > > flip->private_data = priv; > +#ifdef CONFIG_XEN_GRANT_DMA_ALLOC > + priv->dma_dev = gntdev_miscdev.this_device; > + > + /* > + * The device is not spawn from a device tree, so arch_setup_dma_ops > + * is not called, thus leaving the device with dummy DMA ops. > + * Fix this call of_dma_configure() with a NULL node to set > + * default DMA ops. > + */ > + of_dma_configure(priv->dma_dev, NULL); Please note, that the code above will need a change while applying to the mainline kernel because of API changes [1]. Unfortunately, current Xen tip kernel tree is v4.17-rc5 based, so I cannot make the change in this patch now. The change is trivial and requires: -of_dma_configure(priv->dma_dev, NULL); +of_dma_configure(priv->dma_dev, NULL, true); > +#endif > pr_debug("priv %p\n", priv); > > return 0; > [1] https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=3d6ce86ee79465e1b1b6e287f8ea26b553fc768e