Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp2823067imu; Thu, 29 Nov 2018 10:47:36 -0800 (PST) X-Google-Smtp-Source: AFSGD/WJoe12uut/Al7U2j6HiXRkxomtKV6tPY3WRJDfpFNdW5p68vLQgrWUz1IHNmNP9SCJAcO1 X-Received: by 2002:a62:1d8f:: with SMTP id d137mr2475100pfd.11.1543517256375; Thu, 29 Nov 2018 10:47:36 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1543517256; cv=none; d=google.com; s=arc-20160816; b=HP5qFGh1SmOv9hPNldXwK1k+25RCKoODuZZtcRw1KiSzVmGXbQCBu3H3oZyUsR9FJY Y2UITsQhsi5dD7X0uYlNnvgzINfuMIO6KIGSAGBqffxoiSmxPOwjrUNHom1M2vCvb121 YGaiLZSITPr59RIL7vQb0I3odSKr8Ru93pvchex12VTGf6VDZ9CZtAzKTi3qM7lKIJB5 DSKQyvZnygkzfCLP0G3keFmLJr7nsMh9QbdB0ukVeY8hx8tEbE44Gojm8qEeOkbUGbO+ uoQKxVEm67IPhtkaJGdKLUbFXUVzfKxWSRnpnQo4ia7yM29U7NuzuAx9B9FQn+kI9hEn 24LQ== 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=T85+V7fV7D9T9Si5UaSFHIjTnoRzo77Sa3hzqbBI7c8=; b=s2zVenzmKjZ25cMtAfkJI5LJZYbmdY9GaIzBuTR5SU3Fc77k7WdwZJZUXISCJ4AAcV mwURjwAKc4k2DletRoFoNR6FwR8O83MgVIIGkI/Pp9WSF7jk1LY62PAqCIyQrHnbogAZ O6Xn7xGZyY27o7hQt0rauBZkWnCqQCXlr3T9zLaFJeseHg2imIoFZpt1qh9UN12T6WLE auGrXO0iZCRYCrhTBfIn+TPtoVGUjUFmntKrmQlE4eUJujVCSgFRR2/AcB4T5pOcaC64 UNwFZx1Ysl9s/R6nIzhrrwIjbF5hzLwI+M2dhjhwhXtYcyZ4UD+HJzuaO6xa/y/hxzuY vCfg== 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 c37si2589691pgm.156.2018.11.29.10.47.21; Thu, 29 Nov 2018 10:47:36 -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 S1726883AbeK3FlZ (ORCPT + 99 others); Fri, 30 Nov 2018 00:41:25 -0500 Received: from verein.lst.de ([213.95.11.211]:45508 "EHLO newverein.lst.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725928AbeK3FlZ (ORCPT ); Fri, 30 Nov 2018 00:41:25 -0500 Received: by newverein.lst.de (Postfix, from userid 2407) id 5FE3368BDF; Thu, 29 Nov 2018 19:35:06 +0100 (CET) Date: Thu, 29 Nov 2018 19:35:06 +0100 From: Christoph Hellwig To: Tomasz Figa Cc: Daniel Vetter , Christoph Hellwig , Rob Clark , David Airlie , linux-arm-msm , Linux Kernel Mailing List , dri-devel , Sean Paul , Vivek Gautam , freedreno , Robin Murphy , Marek Szyprowski Subject: Re: [PATCH v3 1/1] drm: msm: Replace dma_map_sg with dma_sync_sg* Message-ID: <20181129183506.GC30281@lst.de> References: <20181129140315.28476-1-vivek.gautam@codeaurora.org> <20181129141429.GA22638@lst.de> <20181129155758.GC26537@lst.de> <20181129162807.GL21184@phenom.ffwll.local> <20181129165715.GA27786@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 Thu, Nov 29, 2018 at 09:24:17AM -0800, Tomasz Figa wrote: > Whether the cache maintenance operation needs to actually do anything > or not is a function of `dev`. We can have some devices that are > coherent with CPU caches, and some that are not, on the same system. Yes, but that part is not decided by these low-level helpers but their callers in the DMA code (or maybe IOMMU code as well in the future). > There is also the use case of using CMA with device-specific pools of > memory reusable by the system when not used by the device and those > would have to somehow get the pool to allocate from, but I wonder if > struct device is the right way to pass such information. I'd see the > pool given explicitly like cma_alloc(struct cma_pool *, size, flags) > and perhaps a wrapper cma_alloc_default(size, flags) that is just a > simple macro calling cma_alloc(&cma_pool_default, size, flags). Yes, the cma APIs have quite a few warts that need addressing. I have a few of those things on my todo list, but help is always welcome.