Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753141AbdDKBOg (ORCPT ); Mon, 10 Apr 2017 21:14:36 -0400 Received: from esa4.hgst.iphmx.com ([216.71.154.42]:65320 "EHLO esa4.hgst.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752835AbdDKBOe (ORCPT ); Mon, 10 Apr 2017 21:14:34 -0400 X-IronPort-AV: E=Sophos;i="5.37,184,1488816000"; d="scan'208";a="10094225" From: Bart Van Assche To: Stefano Stabellini CC: "boris.ostrovsky@oracle.com" , "jgross@suse.com" , "benh@kernel.crashing.org" , "dwmw2@infradead.org" , "hpa@zytor.com" , "mingo@redhat.com" , "linux@armlinux.org.uk" , "linux-arch@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "x86@kernel.org" , "julien.grall@arm.com" Subject: Re: "Consolidate get_dma_ops" breaks Xen on ARM Thread-Topic: "Consolidate get_dma_ops" breaks Xen on ARM Thread-Index: AQHSslsHh7IRQQnwSE20JUn1iIdV7A== Date: Tue, 11 Apr 2017 01:14:29 +0000 Message-ID: References: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: kernel.org; dkim=none (message not signed) header.d=none;kernel.org; dmarc=none action=none header.from=sandisk.com; x-originating-ip: [76.102.111.178] x-microsoft-exchange-diagnostics: 1;CY1PR0401MB1533;7:NhzlUFofB7gieGdvZ2nbWpWAtU6HUPR+EWBB2jOWKbCo0wSn+V0O+uWvw1/GtRuh9yovk5g4OCfAWR76kj+3jPitirDsFtvTLSaE5XcxIQeg6A0xGsLxBhrr4hWGwb5w6yRMV7SyPwuSLbQUFUx94er/TDtGmT9pntlu66+PyrBQjmGoQpMpMs0vTzgvTv8KGgIUs7WAIN0uZKWHn/A86q/oi3B8xMCZEJT+Wh5g8n7FyP39urLdEQk5jQ+I4pG9OelrqksZB6WV8MSNz9FHvzNoxfTS7QJowHxs8xE3MLQfSkLby2Ei5nO160r9YVWoeeZTnixv36TeeanKLFyAZQ==;20:TiBeBQCkUEtFG0nZFlLdEi5zzXQ3c13775A/nK7Ou5RGDtHkEb2n/AmlivajdfgTo1iztXH3PMR5xOof/vwerwvDQr8s5huTtxTzVZAkoRtf2i4Zdo5dFb5MOJRsGt67XQjlXXVVaBbWDT8mg/ubwZVC/Qabjp7traV1gMBZud0= x-ms-office365-filtering-correlation-id: 16fc4d4d-0775-4ac8-60c0-08d480781a6c x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:(22001)(2017030254075)(48565401081)(201703131423075)(201703031133081)(201702281549075);SRVR:CY1PR0401MB1533; wdcipoutbound: EOP-TRUE x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:; x-exchange-antispam-report-cfa-test: BCL:0;PCL:0;RULEID:(6040450)(601004)(2401047)(8121501046)(5005006)(93006095)(93001095)(10201501046)(3002001)(6055026)(6041248)(201703131423075)(201702281528075)(201703061421075)(20161123564025)(20161123560025)(20161123555025)(20161123562025)(6072148);SRVR:CY1PR0401MB1533;BCL:0;PCL:0;RULEID:;SRVR:CY1PR0401MB1533; x-forefront-prvs: 0274272F87 x-forefront-antispam-report: SFV:NSPM;SFS:(10019020)(6009001)(39840400002)(39850400002)(39450400003)(39860400002)(39410400002)(39400400002)(24454002)(6116002)(3846002)(102836003)(7416002)(122556002)(74316002)(5660300001)(305945005)(25786009)(53546009)(4326008)(86362001)(229853002)(189998001)(38730400002)(110136004)(66066001)(53936002)(7736002)(99286003)(3660700001)(8676002)(55016002)(6436002)(33656002)(6506006)(3280700002)(9686003)(6246003)(8936002)(81166006)(6916009)(7696004)(77096006)(54356999)(76176999)(54906002)(50986999);DIR:OUT;SFP:1102;SCL:1;SRVR:CY1PR0401MB1533;H:CY1PR0401MB1536.namprd04.prod.outlook.com;FPR:;SPF:None;MLV:sfv;LANG:en; spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 X-OriginatorOrg: sandisk.com X-MS-Exchange-CrossTenant-originalarrivaltime: 11 Apr 2017 01:14:29.2042 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: b61c8803-16f3-4c35-9b17-6f65f441df86 X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY1PR0401MB1533 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by mail.home.local id v3B1EevM003994 Content-Length: 924 Lines: 24 On 04/10/17 17:31, Stefano Stabellini wrote: > I think the reason is that, as you can see, if (dev && dev->dma_ops), > dev->dma_ops is returned, while before this changes, xen_dma_ops was > returned on Xen on ARM. > > Unfortunately DMA cannot work properly without using the appropriate > xen_dma_ops. See drivers/xen/swiotlb-xen.c and arch/arm/xen/mm.c for > more details. (The problem is easy to spot, but I wasn't CC'ed on the > patch.) > > I don't know how to solve this problem without introducing some sort of > if (xen()) in include/linux/dma-mapping.h. Sorry but I don't have access to an ARM development system. Does your comment apply to dev == NULL only, dev != NULL only or perhaps to both? If your comment applies to dev != NULL only, can you check whether adding something like set_dma_ops(dev, get_arch_dma_ops(NULL)) to the appropriate ARM arch_setup_dma_ops() function is sufficient? Thanks, Bart.