Received: by 2002:a25:b794:0:0:0:0:0 with SMTP id n20csp3988463ybh; Tue, 6 Aug 2019 04:39:56 -0700 (PDT) X-Google-Smtp-Source: APXvYqxfcaY0ZJI4CgSQuUufjVQzLQqXH4sThA4YI7kzselXQCCmAfImvtFCe7GpYZSH87bPfmSy X-Received: by 2002:a63:dd16:: with SMTP id t22mr2708215pgg.140.1565091596487; Tue, 06 Aug 2019 04:39:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1565091596; cv=none; d=google.com; s=arc-20160816; b=cm6WNl+Vphvc4ON54aZMK70lqf3TDSIId5yXfbK84+ums4v98VfV7DSdknCMAb6KhQ YoWI7L1eQlRpUP5TwIGaauXUzXzAZqiWODjtxIN3EM5Y7L5ImZ9IbXP9FQZGRcYaHt24 +VHUbVcGXsEFwoDm9LYshnDKJbFcc2o+Hb6/vi/OnBxVlZPqgCUhINDp8IkJnnNYXIIB ZoyrDh64lNHSXXmcEMpnt6Nnt1grEjnfK2qqVSjfXZ2K2S8+PvFUNArBdRVW7iHAN5ZA Lnq0oOQ282d/seYqApOEuNAfjSwMQhSIG7Cmzmie06Ysq93eFDu2N2OHZBRXeEX3He58 DV8Q== 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:to :from:date; bh=jqCATckxa8dsUpTIBGwZI0s/WDODuTZHaT9vbeLEJoQ=; b=0gig/CC0ISEQnwcoOe0odBWMRj+ugiio8VW9+V9O2IJK7yPqJmFKdwk81OYuC20NPj phqIfEooxMPB3qxD5Q/AofIajytzL42Hj0iGg1ulNXktR2rbSlogkpuPcF4AHxvUGgwB Tb59uMDzNsswOf5MY6+7fCcpQxUNHC3bVOMCJ9LtT/fjt4LOrQk/ElsFO7mUQMCyYCVc 3kABRQx1NlAFwfi1j/+zZxtU7Ittot2h+ImSIoxVhtFKxm2kIHvsLh/PomqLBnETHp0b WUKqaAPPgAx1Y5vVajbi7UJHL2gr0N5h7nYU8psn4iQoizrC3UWzjYQBQVJ9BWqFdqzN UOzA== 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 i17si14808312pju.96.2019.08.06.04.39.40; Tue, 06 Aug 2019 04:39:56 -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 S1732758AbfHFLiy (ORCPT + 99 others); Tue, 6 Aug 2019 07:38:54 -0400 Received: from verein.lst.de ([213.95.11.211]:55736 "EHLO verein.lst.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726783AbfHFLix (ORCPT ); Tue, 6 Aug 2019 07:38:53 -0400 Received: by verein.lst.de (Postfix, from userid 2407) id B5702227A81; Tue, 6 Aug 2019 13:38:48 +0200 (CEST) Date: Tue, 6 Aug 2019 13:38:48 +0200 From: Christoph Hellwig To: Christoph Hellwig , Rob Clark , dri-devel@lists.freedesktop.org, Rob Clark , Catalin Marinas , Will Deacon , Maarten Lankhorst , Maxime Ripard , Sean Paul , David Airlie , Allison Randal , Greg Kroah-Hartman , Thomas Gleixner , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 1/2] drm: add cache support for arm64 Message-ID: <20190806113848.GB20215@lst.de> References: <20190805211451.20176-1-robdclark@gmail.com> <20190806084821.GA17129@lst.de> <20190806093816.GY7444@phenom.ffwll.local> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190806093816.GY7444@phenom.ffwll.local> 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 Tue, Aug 06, 2019 at 11:38:16AM +0200, Daniel Vetter wrote: > I just read through all the arch_sync_dma_for_device/cpu functions and > none seem to use the struct *dev argument. Iirc you've said that's on the > way out? Not actively on the way out yet, but now that we support all architectures it becomes pretty clear we don't need it. So yes, we could eventually remove it. But.. > That dev parameter is another holdup for the places where we do not yet > know what the new device will be (e.g. generic dma-buf exporters like > vgem). And sprinkling a fake dev or passing NULL is a bit silly. This is where it becomes interesting. Because while we don't need the dev argument for the low-level arch API, we do need it at the driver API level, given that in some systems both dma coherent and non-coherent devices exist, and we need to decide based on that. > Add a HAVE_ARCH_SYNC_DMA and the above refactor (assuming it's ok to roll > out everywhere) and we should indeed be able to use this. We still need to > have all the others for x86 and all that. Plus I guess we should roll out > the split into invalidate and flush. Well, we'll still need a defined API for buffer ownership vs device. Just exporting arch_sync_dma_for_{device,cpu} is not the right abstraction level. Note that these two functions are always present, just stubbed out for architectures that do not support non-cache coherent devices (plus the arm false negative that is easily fixable).