Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp2151829imu; Fri, 14 Dec 2018 06:36:22 -0800 (PST) X-Google-Smtp-Source: AFSGD/WIJQ3oEXtuJ06HwNYb82KZQe3f1mR7f7v4g1SBM1XMwH09SYNTYkUwzXzAoJLtb+Lhpgzz X-Received: by 2002:a62:8e19:: with SMTP id k25mr3063047pfe.185.1544798182160; Fri, 14 Dec 2018 06:36:22 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1544798182; cv=none; d=google.com; s=arc-20160816; b=qHndllYfLcFOxIFeuZYJEVU54QV99yHGn0Qns/Aq9dOvojNqooKet5j7wxiXBuNeFZ ZZnWOL2mdLyZYraTBYrph9Ux1d3+wclU0x++uvZvdW1OopaJom65df3PVtxAVMmNMR2U tda4AwGM5MDebsFHab5GjmOPID0dMc43r4oAa2ilyf6efPeyu1VJHNmjCAVY5jYvuMv8 ndSaXcNLI1O89H5Ivnk1mCZqZNmPsR0SDO9ygudfpdU7Pzsf+N/kFxhf8iQfmtD1LgqE 0rCcgK/MCBuUWA+JF/8FltSpTN38GTn+olaOgEJpX3cEejxEUs0SiNAFgegCb1vrihgT yoag== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:cms-type:content-language :content-transfer-encoding:in-reply-to:mime-version:user-agent:date :message-id:from:cc:to:subject:dkim-signature:dkim-filter; bh=sj04uWSIW75nN0BNvGMyFx823Dac7VELrVPqgsRW6Dk=; b=Y89avCBlS0avWF205oFHR6+i4c48+t2OdRctyEamVEuDmhZ1h63cjNMORQDGQaciM9 ZaWfIuIdqiO28IBe7L7FY+uR+cxcXmAU49kGy5YIeoE3tGa1DfTyH1eAqPuc5t+5SK65 JN2PUgWsE3UWRfwZYV+CqiGGrMbr93bCD/sBR6XGFGU3kwgL00FdBJIdDqUJ8uE8xViS tUsxphdJseHQZvbjPTIevO2FStS0Hts85XLtF2ndj+pYsz1hUs/aVbIyD/bArhpHQV/m FiNmilPelKlrWQLO025jyFbZVXSo8Q2Rhq9J9TWOq2tETI1EmXDai49bjUYbkpOMyUdk E6xg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@samsung.com header.s=mail20170921 header.b=BsEDjYVy; 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=NONE sp=NONE dis=NONE) header.from=samsung.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id q20si4044355pgl.268.2018.12.14.06.35.47; Fri, 14 Dec 2018 06:36:22 -0800 (PST) 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=@samsung.com header.s=mail20170921 header.b=BsEDjYVy; 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=NONE sp=NONE dis=NONE) header.from=samsung.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730165AbeLNOct (ORCPT + 99 others); Fri, 14 Dec 2018 09:32:49 -0500 Received: from mailout1.w1.samsung.com ([210.118.77.11]:38763 "EHLO mailout1.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729935AbeLNOct (ORCPT ); Fri, 14 Dec 2018 09:32:49 -0500 Received: from eucas1p2.samsung.com (unknown [182.198.249.207]) by mailout1.w1.samsung.com (KnoxPortal) with ESMTP id 20181214143247euoutp0149f94f5644506a1dca7b8b09cbb96ee2~wOZEsY37f0243002430euoutp01L for ; Fri, 14 Dec 2018 14:32:47 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout1.w1.samsung.com 20181214143247euoutp0149f94f5644506a1dca7b8b09cbb96ee2~wOZEsY37f0243002430euoutp01L DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1544797967; bh=sj04uWSIW75nN0BNvGMyFx823Dac7VELrVPqgsRW6Dk=; h=Subject:To:Cc:From:Date:In-Reply-To:References:From; b=BsEDjYVyfxewQssGJ6bcI/IsQSryNhUGPw0mRipw1ccpnkiQiNbuaOIyYX2xfFXwb pUufP1yU63E+XwuUB8xGk1xx5X7y5vpSa4u/dcePnZA+5sdCebCV62QSenqd2V/Sc5 DWc9Fztou2WZoZ/TXVdc6qDtAMt+3rP5tYA1c2DY= Received: from eusmges1new.samsung.com (unknown [203.254.199.242]) by eucas1p1.samsung.com (KnoxPortal) with ESMTP id 20181214143246eucas1p1c107c17fd69434dda6e5ce8e842376a2~wOZDh4Qg72879328793eucas1p1A; Fri, 14 Dec 2018 14:32:46 +0000 (GMT) Received: from eucas1p2.samsung.com ( [182.198.249.207]) by eusmges1new.samsung.com (EUCPMTA) with SMTP id E2.DD.04441.E0FB31C5; Fri, 14 Dec 2018 14:32:46 +0000 (GMT) Received: from eusmtrp2.samsung.com (unknown [182.198.249.139]) by eucas1p2.samsung.com (KnoxPortal) with ESMTPA id 20181214143245eucas1p22e0c6976b5e9ae3cb3244b67fc4958f7~wOZCobIoo2112921129eucas1p20; Fri, 14 Dec 2018 14:32:45 +0000 (GMT) Received: from eusmgms2.samsung.com (unknown [182.198.249.180]) by eusmtrp2.samsung.com (KnoxPortal) with ESMTP id 20181214143245eusmtrp217df2ccb42f453f0cf3562115e46c99a~wOZCYM7AA1860818608eusmtrp2o; Fri, 14 Dec 2018 14:32:45 +0000 (GMT) X-AuditID: cbfec7f2-5e3ff70000001159-62-5c13bf0ed34c Received: from eusmtip1.samsung.com ( [203.254.199.221]) by eusmgms2.samsung.com (EUCPMTA) with SMTP id 47.A2.04128.D0FB31C5; Fri, 14 Dec 2018 14:32:45 +0000 (GMT) Received: from [106.116.147.30] (unknown [106.116.147.30]) by eusmtip1.samsung.com (KnoxPortal) with ESMTPA id 20181214143244eusmtip19382af90672e2f93fcec1efd2d1a220b~wOZBowl0i0905109051eusmtip1E; Fri, 14 Dec 2018 14:32:44 +0000 (GMT) Subject: Re: [PATCH 15/15] dma-mapping: bypass indirect calls for dma-direct To: Christoph Hellwig Cc: iommu@lists.linux-foundation.org, Linus Torvalds , Jesper Dangaard Brouer , Tariq Toukan , Ilias Apalodimas , =?UTF-8?Q?Toke_H=c3=b8iland-J=c3=b8rgensen?= , Robin Murphy , Konrad Rzeszutek Wilk , Tony Luck , Fenghua Yu , Keith Busch , Jonathan Derrick , linux-pci@vger.kernel.org, linux-ia64@vger.kernel.org, x86@kernel.org, linux-kernel@vger.kernel.org From: Marek Szyprowski Message-ID: Date: Fri, 14 Dec 2018 15:32:43 +0100 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:60.0) Gecko/20100101 Thunderbird/60.3.3 MIME-Version: 1.0 In-Reply-To: <20181214142435.GA18448@lst.de> Content-Transfer-Encoding: 7bit Content-Language: en-US X-Brightmail-Tracker: H4sIAAAAAAAAA02Se0hTYRjG+3bOzo7D2fHM8s2uDAwMtaT++MySDIkDRQRFkAm19KCWU9vJ yqJSLC/L7IrZENOkvI0y765QnK5VYjrFspuFTitpurK7YbkdLP/7vc/7PLzfAx9NsH+kPnRc wiFem6COV1Fysv7Bz64AjxZl5KpJM4tbb5yV4oy8MFxeaZbgc6cnCVzUEoKLGgZleMD8RYJv lQwj7Mgak+JeYwGFOwstFG512KT4V65JguvGy2T4Y/cAiQdz7TL8o2pIusGTMxQaEFdy/4OE q67IprhXT+9T3MP8SZK73F+KuHvPUylu5GqbhPs0/ILkxpv7KK7WZKW4ieol29wj5Oui+fi4 w7x2ZeheeWxlWi9Ksrsf/VGbjlKRUa5DbjQwa6DJdEWiQ3KaZcoQjHSlycThC4Lm9jFCHCYQ 5DwbI2ci974ZKCezTCmC8iZ/0TSOIONJpWuhZLZA8Tsz4WQvRgXDo53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I5GJomrv3vAOtgEDCW63oKM4uTgFbCTuLRvDVg3 i4CqxKkPv4BqODhEBWIkni2ohigRlDg58wkLiM0poCOx/O5ysIuYBdQl/sy7xAxhy0tsfzsH yhaXuPVkPtMERqFZSNpnIWmZhaRlFpKWBYwsqxhFUkuLc9Nzi430ihNzi0vz0vWS83M3MQKT w7ZjP7fsYOx6F3yIUYCDUYmH98AUoRgh1sSy4srcQ4wSHMxKIrxhrcIxQrwpiZVVqUX58UWl OanFhxhNgX6byCwlmpwPTFx5JfGGpobmFpaG5sbmxmYWSuK85w0qo4QE0hNLUrNTUwtSi2D6 mDg4pRoY2y7y5q69IvAyy+Lw7jkct/+/e3P4bsZM8UMVy+xvOL6a3Xdyo35hpa6HRpZzWWC1 x7722QWc09awRO/7xDBlGgtj3NZvtREX9A6vu3J3Qf/tH3POr2Z7+Cz49Jbbd648fm2auVlS e1nIGqOVU6z/WVt1XXDar+I31+cLhzXHZlO32arWPxp3RCqxFGckGmoxFxUnAgA15o2oJAMA AA== X-CMS-MailID: 20181214143245eucas1p22e0c6976b5e9ae3cb3244b67fc4958f7 X-Msg-Generator: CA Content-Type: text/plain; charset="utf-8" X-RootMTR: 20181207190927epcas1p457ae0498c01d1730723889bc7c9ed40d X-EPHeader: CA CMS-TYPE: 201P X-CMS-RootMailID: 20181207190927epcas1p457ae0498c01d1730723889bc7c9ed40d References: <20181207190720.18517-1-hch@lst.de> <20181207190720.18517-16-hch@lst.de> <20181214142435.GA18448@lst.de> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Christoph, On 2018-12-14 15:24, Christoph Hellwig wrote: > On Fri, Dec 14, 2018 at 03:11:37PM +0100, Marek Szyprowski wrote: >> Hi Christoph, >> >> On 2018-12-07 20:07, Christoph Hellwig wrote: >>> Avoid expensive indirect calls in the fast path DMA mapping >>> operations by directly calling the dma_direct_* ops if we are using >>> the directly mapped DMA operations. >>> >>> Signed-off-by: Christoph Hellwig >> This breaks direct DMA on ARM64 (also todays linux-next). NULL >> dev->dma_ops fallbacks to get_arch_dma_ops(), which in turn returns >> non-functional &dma_dummy_ops on ARM64... > Yeah, fallback from direct (NULL) dev->dma_ops to something else won't > work with NULL as the indicator. > > Fortunately we shouldn't even need that thanks to the patch from Robin > that explicitly set the dummy ops where needed. > > Can you try the patch below? Yes, it fixes the problem. > diff --git a/arch/arm64/include/asm/dma-mapping.h b/arch/arm64/include/asm/dma-mapping.h > index 273e778f7de2..95dbf3ef735a 100644 > --- a/arch/arm64/include/asm/dma-mapping.h > +++ b/arch/arm64/include/asm/dma-mapping.h > @@ -26,11 +26,7 @@ > > static inline const struct dma_map_ops *get_arch_dma_ops(struct bus_type *bus) > { > - /* > - * We expect no ISA devices, and all other DMA masters are expected to > - * have someone call arch_setup_dma_ops at device creation time. > - */ > - return &dma_dummy_ops; > + return NULL; > } > > void arch_setup_dma_ops(struct device *dev, u64 dma_base, u64 size, > > Best regards -- Marek Szyprowski, PhD Samsung R&D Institute Poland