Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp2550737imu; Thu, 29 Nov 2018 06:46:09 -0800 (PST) X-Google-Smtp-Source: AFSGD/VqnE7+1qKaLdruNTyHDDZ+k7MW41CIJ7/HIOtXot7MSF8IH6OGWXk+zihJ4dOlE58Fp92i X-Received: by 2002:a63:495b:: with SMTP id y27mr1494241pgk.32.1543502769440; Thu, 29 Nov 2018 06:46:09 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1543502769; cv=none; d=google.com; s=arc-20160816; b=BzXeQLUIoucHD8Xs9cKx8l/+VtOyzODhl7a8oianN8+icvn7kgbIdkW/CRgLtvJX7e mgUix6EQK1pyyfzngnKVR/1Kvsj5ejcjPugqY5Xv41dFjTScDWBhWWFShhfNxFALc+3P deG4btw8k8i3PVedUOWi7fznPnZQtG59qaXNIMgXsaCKM8+csPlorU/Umc0G0aKOdZ/i WCKRZca1TTQAnWs6iSORWZk62flDkY8gEGrHhexFGlhWx2/6NIGFebDtmFvbvH0+zq1Z b5bxQKZXw03pSBSjhXlCcq6pRd8ibyFSyNKyMFHz955/Am8kzIuNVEArsZAwSCvB0ZDU DTzw== 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=xtP/0UQTRbEGOB413kDSGEnCVvA72PfoDC03K2Vf8hc=; b=sZhI59l1yAAzl5GYi+k/VnTDmT8K1jyyqC6/RxOFBcx0B8z1LTWaurCQ1OzePA71dp VS1D+1y0QJaaXbO8lPUdnika1OGMKeVOCwZwcP+LV0pBYiFtSuzA1L/sx1mXB0OWceuj D4JM/8sT62uqqgUBSmvIquz5VnDWgeue5rm7P3Xez4Ar0aHl3Hqm7r7amwVetBCNu9ki 14IEvPur9Tr+0YHZ+2Ob6HqljrHNfF9l9DuZy9tc61JXoej31Y4lAZGYDzkAyu5TPFe6 VJbJX0JWsDoG95Wr5aYytpVfwUxEjrD8rkHruVA+0dwaKQFJroQirwJCZR63t+Cw0Iy0 51uw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ffwll.ch header.s=google header.b=LNmgepoN; 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 c11si2146136pgj.255.2018.11.29.06.45.54; Thu, 29 Nov 2018 06:46:09 -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=@ffwll.ch header.s=google header.b=LNmgepoN; 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 S2387944AbeK3Btk (ORCPT + 99 others); Thu, 29 Nov 2018 20:49:40 -0500 Received: from mail-io1-f66.google.com ([209.85.166.66]:43913 "EHLO mail-io1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2387910AbeK3Bti (ORCPT ); Thu, 29 Nov 2018 20:49:38 -0500 Received: by mail-io1-f66.google.com with SMTP id g8so1730869iop.10 for ; Thu, 29 Nov 2018 06:44:03 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ffwll.ch; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=xtP/0UQTRbEGOB413kDSGEnCVvA72PfoDC03K2Vf8hc=; b=LNmgepoNtkIqJ4emeW2Ee30TrKufeP64dVRIkTcBmc1aG6vC/eX5omP3q8ZLLwMsuQ 8prre5DuDbWmT+FQC4H1GGg5KOdvFFrzAWPLjtoLYeV0hPZgZHqjfosFN8Dtur2v7wnA IDZQMS13TNrfshODKb/zvPUuTnHZtxRC2Mmd4= 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=xtP/0UQTRbEGOB413kDSGEnCVvA72PfoDC03K2Vf8hc=; b=JImfJuVfJssphoTcI6Aizn9OKZh31E9V/DX5lF3Zu4V1Nc+PW6RpKeYLYZ8/8T+4AR FQcMJ1L58xxbkXhsF/d78a/mw4IMTHz15dfUUIN1FfsTOpDmQ6ncTJd8jEVaYq2oS+7G uXahLbE7+X5VyVC0PtXlogeG0kstz+TUDi7HLHuoN2Py3BhJ/RoHAwdc1tHyqek6pmzx Q8HTE1UU8rKl8WfSE3k04u6JpenGzlDNSYQE1u6oMtL3TjMF9l9PyFe0CuP4LWkv/xc1 WhPcmipGO+IqZ/18oOpkFN/++afZRFAUz1NKuLVqllzooEX1TksSVRWu6CeS/UgsPwg8 WGTw== X-Gm-Message-State: AA+aEWa1kBSpbONZtrUJJ0DtLtY8YteFJDCa3osveByzoUJeRFYxWbAZ ey+2qQJDXpUW8l0RqbHyaViRXHfcZVA0pMmib+qvcg== X-Received: by 2002:a5d:959a:: with SMTP id a26mr1432213ioo.278.1543502642608; Thu, 29 Nov 2018 06:44:02 -0800 (PST) MIME-Version: 1.0 References: <20181129140315.28476-1-vivek.gautam@codeaurora.org> <20181129141429.GA22638@lst.de> In-Reply-To: From: Daniel Vetter Date: Thu, 29 Nov 2018 15:43:50 +0100 Message-ID: Subject: Re: [PATCH v3 1/1] drm: msm: Replace dma_map_sg with dma_sync_sg* To: "Clark, Rob" Cc: Christoph Hellwig , Dave Airlie , linux-arm-msm , Linux Kernel Mailing List , dri-devel , Tomasz Figa , Sean Paul , vivek.gautam@codeaurora.org, freedreno , Robin Murphy 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 3:26 PM Rob Clark wrote: > > 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. Yeah we had patches to add manual cache management code to drm, so we don't have to abuse the dma streaming api anymore. Got shouted down. Abusing the dma streaming api also gets shouted down. It's a gpu, any idea of these drivers actually being platform independent is out of the window from the start anyway, so we're ok with tying this to platforms. -Daniel -- Daniel Vetter Software Engineer, Intel Corporation +41 (0) 79 365 57 48 - http://blog.ffwll.ch