Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp2142548imu; Fri, 14 Dec 2018 06:28:16 -0800 (PST) X-Google-Smtp-Source: AFSGD/WioWl0dB2PyobyiCCQiyf3txcLS+REQd1IKvppvARdEdSxgs2hgEWGXEHNoOdEjkUlhVwl X-Received: by 2002:a17:902:e20b:: with SMTP id ce11mr2951482plb.251.1544797696002; Fri, 14 Dec 2018 06:28:16 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1544797695; cv=none; d=google.com; s=arc-20160816; b=fLiFXRulWP3NN08/1yMqrJ23eyqNbLOh5qd9BxLQBAmoWQ0z3kiOMQTcr6hA92imH5 ACNfRU+IMK/+IKkLfMf77w5p6wi7QWxW6jO/ds0/+dwbmOEPX3Yzt0mEYjv1a1Jdyf6I blS0KjnA7Vt4CnpIiuW03cWoqNBkSOUTk9ZboMyG4BlVeAVXkQQ3WrS/FnQzLWDQZe+M uKcsoRhfoJPwWuNoR1RWfwsOHy4WkDeYCuCWeSM4sew/yGyMoG5Mg8PoRbeOEn62tQN9 eCZ4Y2toEnzJsPQUISYSNuxtX3yOeUnvV0A4iNVeIVAAINZlZA1r1lu6wV7+cQ5oghTy d8ug== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=GvGuX/HyAnFgVqnvTUxNrjdsnRVO+lkjbJCB0/CDyBo=; b=njoo/Y35DOq9y7DyeOvbua4Sl4/VOQPCz8Vptr0FGBYmyU0kOv0QWCJrGtUY7kKVWp bEt9HengL2PtzSMowffusVh+rZ0Unaeq5EIxzvZFa1Q8gOAQvaemA4H+0uYw19bd03pm SPcxlt8GUf4l8G11N+/PzFQFc69FXN8U3UUvAfA4uGy+W8qEjHYwOP1jIOACuseINeQ1 gbNdETgYXHaOqHbAJqvDiiH0f/O5kPekKYNkIZ1kWza4PlftUYw1HAhSPCXrOD/v39yD MO8q2J7SUxdeeG/NZOi3M4NzS3/9t80vpPlH7y9+hJzcpzYlOKBwM0E4qL6TCggjkCgX sFGQ== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a35si4122008pla.226.2018.12.14.06.27.49; Fri, 14 Dec 2018 06:28:15 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730235AbeLNOYi (ORCPT + 99 others); Fri, 14 Dec 2018 09:24:38 -0500 Received: from verein.lst.de ([213.95.11.211]:47771 "EHLO newverein.lst.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729684AbeLNOYh (ORCPT ); Fri, 14 Dec 2018 09:24:37 -0500 Received: by newverein.lst.de (Postfix, from userid 2407) id 565AA68DF5; Fri, 14 Dec 2018 15:24:35 +0100 (CET) Date: Fri, 14 Dec 2018 15:24:35 +0100 From: Christoph Hellwig To: Marek Szyprowski Cc: Christoph Hellwig , iommu@lists.linux-foundation.org, Linus Torvalds , Jesper Dangaard Brouer , Tariq Toukan , Ilias Apalodimas , Toke =?iso-8859-1?Q?H=F8iland-J=F8rgensen?= , 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 Subject: Re: [PATCH 15/15] dma-mapping: bypass indirect calls for dma-direct Message-ID: <20181214142435.GA18448@lst.de> References: <20181207190720.18517-1-hch@lst.de> <20181207190720.18517-16-hch@lst.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.17 (2007-11-01) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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? 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,