Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp2515303imu; Thu, 29 Nov 2018 06:16:37 -0800 (PST) X-Google-Smtp-Source: AFSGD/VsQhOerT2IJRffQBZCo/9pXdx39m3CNmPxhh30IRZFceAwd8BgtACDFMhuDEJ9wtuccKIo X-Received: by 2002:a62:9f01:: with SMTP id g1mr1529980pfe.223.1543500997122; Thu, 29 Nov 2018 06:16:37 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1543500997; cv=none; d=google.com; s=arc-20160816; b=OgN+W+/7+aGBlqGrSESeOIM7qGhfw2D2oUG9pU14Ur/UWt/viYmX6MnoeSY8LDinHo v0CQ4XHwxQvkuccKkHtd0uu8dtkvsb6XOK/Yy3YyM9aJAW+iXLEm2YAl+jEVLtCgbHkE 8uWXeYIYCwI0K9WxkJgFzU2JpIQqCFCH0z51elXcUwG15DYYeOhvKCIAPLMczHX8rX2k J84Y1QzSvRbSlyChfhHaVUIdCvXxMIR5wceLAwUciFiAIfL017hKLpvHeC1l1NBlshs4 O3awZ6tgHlcqSLaZjoF0s7JtetmOABkeyz8cquTad/a2XSR0bI9YJ7mopGT7sQ/z7Fxa VhGw== 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=pFyI1wZ7EPFvBwlnSn1R1EqLQIH25S4wIDujiCLDiAc=; b=k5ogmsf0eYpqlOvSZ4v1t7ibZHt+l8u514usC3PsQaMEN6f2bJtq4Kj5kK/uvDQ+uR JCgeZ0uea1Kn07FbsvWTmFMHhJ7HVJytdyOpB/p45Fc3jNRi2MwH71yuGLfdzR5RLKVf w04/Bni6XRMyNc/id9ZNkRM2o3rBoKGRjl+lQjATMa3T/lmB/ABxFqtXtWrd8JRrgxZO yeROI5l4PD77VwHaHjlLwOKx0si/ZSNZJa+hC1mMK42/ywSXi1qu7nJhxbWwwI28ZQy4 acwM8rIFnX0oJ1xYZzyW+g/nTaAXzDe50ACuqNkvYfRKdBJZVFieo7Wjbr8/UPUw7NPg P/cA== 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 i5si2234808pfo.189.2018.11.29.06.15.57; Thu, 29 Nov 2018 06:16:37 -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 S1729236AbeK3BUC (ORCPT + 99 others); Thu, 29 Nov 2018 20:20:02 -0500 Received: from verein.lst.de ([213.95.11.211]:43248 "EHLO newverein.lst.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728334AbeK3BUB (ORCPT ); Thu, 29 Nov 2018 20:20:01 -0500 Received: by newverein.lst.de (Postfix, from userid 2407) id EC65068B02; Thu, 29 Nov 2018 15:14:29 +0100 (CET) Date: Thu, 29 Nov 2018 15:14:29 +0100 From: Christoph Hellwig To: Vivek Gautam Cc: airlied@linux.ie, robdclark@gmail.com, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, freedreno@lists.freedesktop.org, tfiga@chromium.org, architt@codeaurora.org, linux-arm-msm@vger.kernel.org, Christoph Hellwig , Robin Murphy , Jordan Crouse , Sean Paul Subject: Re: [PATCH v3 1/1] drm: msm: Replace dma_map_sg with dma_sync_sg* Message-ID: <20181129141429.GA22638@lst.de> References: <20181129140315.28476-1-vivek.gautam@codeaurora.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20181129140315.28476-1-vivek.gautam@codeaurora.org> 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 07:33:15PM +0530, Vivek Gautam wrote: > dma_map_sg() expects a DMA domain. However, the drm devices > have been traditionally using unmanaged iommu domain which > is non-dma type. Using dma mapping APIs with that domain is bad. > > Replace dma_map_sg() calls with dma_sync_sg_for_device{|cpu}() > to do the cache maintenance. As I told you before: hell no. If you spent the slightest amount of actually trying to understand what you are doing here you'd know this can't work. Just turn on dma debugging and this will blow up in your face. Either you use the DMA API properly, that is you use it to map and to sync, or you don't use it at all. Mix and match between iommu APIs and DMA APIs is simply not possible.