Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp2555183imu; Thu, 29 Nov 2018 06:50:20 -0800 (PST) X-Google-Smtp-Source: AFSGD/WiV5Td+vnsZR4oz3kqxPbbQLdB9wfzxvUoJIBAM5kEJdTPWTozA7+sXtSMOQSwGjKoea+W X-Received: by 2002:a17:902:7e4f:: with SMTP id a15mr1710617pln.149.1543503020343; Thu, 29 Nov 2018 06:50:20 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1543503020; cv=none; d=google.com; s=arc-20160816; b=AzF5inqCcKkD8mcn2nxy+QFOohyd7B5vBNa5WHidkbRECWRTJzJUWQYiZHmGVUnKXc LWz4kO6EvCYt1Hm0ZswHMROt44Q9+OP2Eej0HJ3rkzAZkv32ag/sDKVDOAu7KnsOLiZ0 lYnBq2/FlHe7/PguOtYW3leraaCo/c+erJteaKBiQd5eax62o/91yrp9E6mCdqtC9GAn sGnh0CE6hJcvqzpCn49pJ488q5nmdttvsLxfNNHRRwLvO5pVyqbl4rq0xahZwNd780+u 1wqD+yO7vpWj1EkThIFf7z1GDLZb6/7a9CpMWcfRiCqqgXpsy8uGJ3quX0QkSPIJmVRi hipw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=FfZIvNThYDQ4IjcNKC7Fi3JYmBMBLzaJvVpeqITnlUo=; b=ohag92EMEK5aiOf2S1FV1w3U8PYmW1jz8IOEyGyayKovRQGvDbgYK/uMDyR8xhefYR eo8prwG2H4zGkaK1BQ7qrRsdc9FRFtpH2D+4atOtXjeNSNFcBKjhG9/PeVtpFx8QCK/4 JbNINiU5wBNsClwuXbBPk4TrCiM46CSOBVbZ+6qWgL2KEXaHKmu3Uv+71Ce6dFX1ST2B fOAsRL1n0CH1vJ85JvhpSQZa2vXogYsCGWgbU9CUCO9THBuRWP/kOaY+ElwlFI7kmx+9 Q9qKyRfA5Kl9oKjsBdrXVXTUYxp1vxsOzfVkP6hGbeOr+ivmYnMLDwS/37w+wLR6nMhF QpAg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=jqVKccPi; 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f95si2508308plb.60.2018.11.29.06.50.05; Thu, 29 Nov 2018 06:50:20 -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=@gmail.com header.s=20161025 header.b=jqVKccPi; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1733067AbeK3Bxm (ORCPT + 99 others); Thu, 29 Nov 2018 20:53:42 -0500 Received: from mail-it1-f193.google.com ([209.85.166.193]:53885 "EHLO mail-it1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731628AbeK3Bb2 (ORCPT ); Thu, 29 Nov 2018 20:31:28 -0500 Received: by mail-it1-f193.google.com with SMTP id g85so3786056ita.3; Thu, 29 Nov 2018 06:25:56 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=FfZIvNThYDQ4IjcNKC7Fi3JYmBMBLzaJvVpeqITnlUo=; b=jqVKccPiyYTDdRTZJOVfNOOb3Ky26TJ4HRIc8/n92OFxgtdmGaG0Fxiw2sx4Wb/FGV OEMV66aObSO30+8jZpKZBd5/bP+6QcP2+y5ZeYO/1PIDg2HaC7yKqsev0WjrwgOPjDtS QZl2F0CH3hCIy5hrCL5A+GS7ZLHy/CtYzdaheZVQqqzYEpy/Zng8+qbb2OWFYgDXv9nt t0S1i/VYsxtk0hY68F7cWAan140hPtqYIxnROpzt9CacE/iWRoMUUFcF+ea6fivcrpNT QQ+ZR61QW91r1l87myKv6nJW3EV0/tsZkC441/DgePd6Eo3aSxZ0Sl/Vf1rdsrHTsv5G 0Sug== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=FfZIvNThYDQ4IjcNKC7Fi3JYmBMBLzaJvVpeqITnlUo=; b=oiVQqd1N1sWq61rzasqYn9cHihwM5j/Vrswt/ZDlqg4QFn6PCdbG8eAv2aa4L5FJgh xooadFksJw0nEK6zBifFUHfnD5RIpQAeDJxz8eATHdt1LW+cJ9pJizK3bgVJuT03T25D 7kfeotBMfi2OznUYX9p+VJenQdLWShGyZjL9fJBvAIcXiHM2NjGCkyqKGH7dWRvbkJHl tKzRY7haGhkw/gyA1cPe2vCeUeqEs1WGgsNtJ4JNr3nvCFofPK1ZVEP072cNKkEQKwjS zf/XlTKMRkwT6vv5uWj7Bt2ZgCTassmR574WyeR5qX7lrJ+PB1dQXq87SdvH9rjR/XJA 6t0A== X-Gm-Message-State: AA+aEWbRqxxeYyZ/yMIdnjQN8I06106531yIbE874TD7HKbkY+DGfCiV aoJ6x97XfU445pfJQAb866zYeByPpwzNGs02NFE= X-Received: by 2002:a02:3da:: with SMTP id e87mr1309077jae.78.1543501556348; Thu, 29 Nov 2018 06:25:56 -0800 (PST) MIME-Version: 1.0 References: <20181129140315.28476-1-vivek.gautam@codeaurora.org> <20181129141429.GA22638@lst.de> In-Reply-To: <20181129141429.GA22638@lst.de> From: Rob Clark Date: Thu, 29 Nov 2018 09:25:43 -0500 Message-ID: Subject: Re: [PATCH v3 1/1] drm: msm: Replace dma_map_sg with dma_sync_sg* To: hch@lst.de Cc: Vivek Gautam , David Airlie , dri-devel , Linux Kernel Mailing List , freedreno , Tomasz Figa , Archit Taneja , linux-arm-msm , Robin Murphy , Jordan Crouse , Sean Paul Content-Type: text/plain; charset="UTF-8" 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 9:14 AM Christoph Hellwig wrote: > > 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. you can tone it down.. we weren't the ones who created the dma/iommu mess, we are just trying to find a way to work around it > 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. I'd *love* nothing more to not use the dma api.. but on arm there is no other way to do cache maint. BR, -R