Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp3936846ybb; Mon, 23 Mar 2020 10:23:28 -0700 (PDT) X-Google-Smtp-Source: ADFU+vufygIlMhx9DyjVzmjSRhe0Y/UOypI94JA4/33erudLUDLvbUlevJquxjtzIyCcUd5Bo3nr X-Received: by 2002:aca:aa0a:: with SMTP id t10mr313995oie.38.1584984208445; Mon, 23 Mar 2020 10:23:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1584984208; cv=none; d=google.com; s=arc-20160816; b=o3kWU+R8W9OMzhvhH9Q2dZrgA2/QkU1jZiqwhcEgEEAWLAGILUWjrpjXTnITZzmwZ4 a3pFoLozUrv1dTkEWMA+jbYdLcxYTJtVGnwt54Om2WBJHe1T9pbiepCFkON9KJE6yGiB Sx6g9H1xMXxZ/oZjM8n2VS0zI6m4HXC1sKcu7p8tqDUuT5qoeJnnf9fgYClE2CqSbACD 7UOaL8p2JwBUp1yOKXd02KMijyNWXPPxj5s3mZfNfHcGmrja/WazwxWcZ3GRQlhWvwzZ lvH4qnoXpHkfnriozmRAtc23o3i6Hgbc9gwG/uYKH4pofEwULPhf2YlsZQC/YMvynE6m bh0w== 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=3tC1H+SfAhkrU8CwpnukqoEsQSYMkMl2b/JdIaQ84IM=; b=K3sU0iHg8iMcXwAZclKOVJYRLfbhtTmduZH0SW2EXHAXrAL6WvBlQwAl/npWlZT332 w6hcB50ZOVX/8iQxuSFHgvkAHzL2MYX52fAs7O2D7SdVEwJs6txaMik96SaHl4Giq+4s Fy93MRUF6SMHKcLZXDOwKrmkhPqfYHthefXd89JDH6bJqetSVI3iwB0kSCSPDIQ17dVz Tc6nyYQsHa9xRJBc+r2JqVu9lnaxf5LGSKX9xdErwji0h1IUDH4Sgygjhc1UpWj1l2bu NLwCexH2H9EH5s2RWrOyVC1MMAnO/Lr22o5RL7tEP9eHwpJf05t7CivEws6jRSuFDldz TobA== 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 g22si8092965otn.291.2020.03.23.10.23.15; Mon, 23 Mar 2020 10:23:28 -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; 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 S1727496AbgCWRXA (ORCPT + 99 others); Mon, 23 Mar 2020 13:23:00 -0400 Received: from verein.lst.de ([213.95.11.211]:59662 "EHLO verein.lst.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727194AbgCWRXA (ORCPT ); Mon, 23 Mar 2020 13:23:00 -0400 Received: by verein.lst.de (Postfix, from userid 2407) id EDCC068BEB; Mon, 23 Mar 2020 18:22:56 +0100 (CET) Date: Mon, 23 Mar 2020 18:22:56 +0100 From: Christoph Hellwig To: "Aneesh Kumar K.V" Cc: Christoph Hellwig , Alexey Kardashevskiy , iommu@lists.linux-foundation.org, linuxppc-dev@lists.ozlabs.org, Lu Baolu , Greg Kroah-Hartman , Joerg Roedel , Robin Murphy , linux-kernel@vger.kernel.org Subject: Re: [PATCH 1/2] dma-mapping: add a dma_ops_bypass flag to struct device Message-ID: <20200323172256.GB31269@lst.de> References: <20200320141640.366360-1-hch@lst.de> <20200320141640.366360-2-hch@lst.de> <2f31d0dd-aa7e-8b76-c8a1-5759fda5afc9@ozlabs.ru> <20200323083705.GA31245@lst.de> <20200323085059.GA32528@lst.de> <87sghz2ibh.fsf@linux.ibm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <87sghz2ibh.fsf@linux.ibm.com> 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 Mon, Mar 23, 2020 at 09:07:38PM +0530, Aneesh Kumar K.V wrote: > > This is what I was trying, but considering I am new to DMA subsystem, I > am not sure I got all the details correct. The idea is to look at the > cpu addr and see if that can be used in direct map fashion(is > bus_dma_limit the right restriction here?) if not fallback to dynamic > IOMMU mapping. I don't think we can throw all these complications into the dma mapping code. At some point I also wonder what the point is, especially for scatterlist mappings, where the iommu can coalesce.