Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp2981332pxu; Sun, 29 Nov 2020 10:52:44 -0800 (PST) X-Google-Smtp-Source: ABdhPJwf/aRCvBKXroUii5Lx8hZekMclbZKMAfLmx0m5uBk3wE5o1aYQq8pQM8bQ9/3q8S4IiW9A X-Received: by 2002:a50:d6c6:: with SMTP id l6mr18168084edj.80.1606675964752; Sun, 29 Nov 2020 10:52:44 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1606675964; cv=none; d=google.com; s=arc-20160816; b=eHazYyQ5ykkCxQ1gjT/3LHSu9XmE89YLw/Yp2N8wIywRHr0KSnqe2bXsJINTifcuHY F9btcUxZ+v7wvr65uQE4ANjZuxeXxlLHGMLUtg6pVFUROoEi036VaQ/z6Surj4tWp65N pc59za1bMSTNM0BHyF7ourko6p6ei49JEFx+TRiPMK9VriAQab2/TXFeF11B/fuNj1U3 +iZBzbG18bqDS3HP7NapCspCPL2Dty0VmuUznjzsjWtTSGUGstG1222jc5cOLpUM/SOS lZMeFvFzlsuG4p09kPi/PoRw40XVBHmxXyxKIDH0DqPTaFpoBY0+Xx48HblKIHyiApat OFJw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=petcPUQfIRyJlrRZlAI0FgPTCAYAYb5D8vFYqV6fJS4=; b=PmF9CVSFEeWr5KyKDqQwOfwbTbMFFUngTz6YcVPyqoLg43QpnyslfVEUXU7jCrOxC0 7jvgEVSiFG1q4eYWouksTyHcyFPoru/++FjQCpnB1AOv4/+eLPW98HuGzKJzN3/ZzJvq nM3Gk0sbr5nzT/dLhKheoeZ9ZWYI9vxzc6zBO+vOg4CVpqusBLCAxfzWvPDvFRKaGTol S/pddPyzscwXtFjw1twrUfIrb8EP+yxxPjKlU3b0chuWFj+hfMWOJMX30ocauY+kP0+S c8DU+BOZpd4kRWyw7tQrIgJ8IG8CEnVbr/A5l5tdJ16uylR4xAhpp7Rw+zbNMpFEiRi/ T3dg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=ogjbEGaQ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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. [23.128.96.18]) by mx.google.com with ESMTP id v14si1615973eje.178.2020.11.29.10.52.21; Sun, 29 Nov 2020 10:52:44 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=ogjbEGaQ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 S1728598AbgK2St7 (ORCPT + 99 others); Sun, 29 Nov 2020 13:49:59 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35822 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727556AbgK2St6 (ORCPT ); Sun, 29 Nov 2020 13:49:58 -0500 Received: from mail-wr1-x443.google.com (mail-wr1-x443.google.com [IPv6:2a00:1450:4864:20::443]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7E84DC0613CF; Sun, 29 Nov 2020 10:49:18 -0800 (PST) Received: by mail-wr1-x443.google.com with SMTP id p8so12247736wrx.5; Sun, 29 Nov 2020 10:49:18 -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=petcPUQfIRyJlrRZlAI0FgPTCAYAYb5D8vFYqV6fJS4=; b=ogjbEGaQGYFsXqlHh1P0WS0AU3ixlshfX58TVjLOx0LamwLoTVbtshlHNVbw88PewR 0bo1cboPkh3dSl/fn9jmjTBz9LaQZjdaLHTb6cbkok4u8mhDRZil1RA9YnYq6fKGwLct fxy4OvmBZy/29dG2X2I8qT9qkAc+6B3rH6Gp4VhpWp5I72tTTPzcYjOfijM6ELMrHfV3 sNPsjpFXVy/0FhUk4/iM4KGBQtbZcZq2KRcUWto/4ie4pvK9rcNCTi0TZ6wzq560OBcC ZBoc4nwXDh0jwmb/p/4n02rg0zg1YWwGU89FysHb08J1c9fYoan9VxoXZ29uTeU6927P HLvg== 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=petcPUQfIRyJlrRZlAI0FgPTCAYAYb5D8vFYqV6fJS4=; b=agexaCiYJq3QM++lYBOTzXhfho4x2UfR9mgURAn7mHTuSavXqTt8eJGNfVH2FGkMLJ J2g46haFBb+28/lwMBGjpdCCGgkD3B4gbl6lAST44C7MoWRpUH/U38xSkDi2HvCBoZu9 sQ6Opr8sc4Z2Rf/PbA+vqn7zq8T9tOZLru8GzviM7FrjlM/2sTsNJBBROIqgv8uEFGcD 0CMmtQlxp713KCD6UzNmSInB26PAXKKlGqD/aeBtnt3XKRZP/gJ2dtuQYW30q6PDgHAT T3XrHQsub9BLtwoBzyprqLtd40YHUp0M2eTEjXnQrbpNLpBy8GQZDOcqY/wDxofIFldG LMxg== X-Gm-Message-State: AOAM531tT3EAxuCfvnFnDX8dnOxDOZYv8n7i4iN4ww5xKH3m+Z8f2EMq rjO29+CQr8D15jG3FzhYYLLcV9LCMULx24QWuJg= X-Received: by 2002:adf:a3c1:: with SMTP id m1mr24450474wrb.28.1606675757086; Sun, 29 Nov 2020 10:49:17 -0800 (PST) MIME-Version: 1.0 References: <20201114151717.5369-1-jonathan@marek.ca> <20201114151717.5369-5-jonathan@marek.ca> <20201114162406.GC24411@lst.de> <50ddcadb-c630-2ef6-cdc4-724d9823fba7@marek.ca> <20201116173346.GA24173@lst.de> In-Reply-To: From: Rob Clark Date: Sun, 29 Nov 2020 10:51:08 -0800 Message-ID: Subject: Re: [RESEND PATCH v2 4/5] drm/msm: add DRM_MSM_GEM_SYNC_CACHE for non-coherent cache maintenance To: Jonathan Marek Cc: Christoph Hellwig , Jordan Crouse , freedreno , Sean Paul , David Airlie , Daniel Vetter , "open list:DRM DRIVER FOR MSM ADRENO GPU" , "open list:DRM DRIVER FOR MSM ADRENO GPU" , open list Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Nov 16, 2020 at 9:55 AM Jonathan Marek wrote: > > On 11/16/20 12:50 PM, Rob Clark wrote: > > On Mon, Nov 16, 2020 at 9:33 AM Christoph Hellwig wrote: > >> > >> On Sat, Nov 14, 2020 at 03:07:20PM -0500, Jonathan Marek wrote: > >>> qcom's vulkan driver has nonCoherentAtomSize=1, and it looks like > >>> dma_sync_single_for_cpu() does deal in some way with the partial cache line > >>> case, although I'm not sure that means we can have a nonCoherentAtomSize=1. > >> > >> No, it doesn't. You need to ensure ownership is managed at > >> dma_get_cache_alignment() granularity. > > > > my guess is nonCoherentAtomSize=1 only works in the case of cache > > coherent buffers > > > > nonCoherentAtomSize doesn't apply to coherent memory (as the name > implies), I guess qcom's driver is just wrong about having > nonCoherentAtomSize=1. > > Jordan just mentioned there is at least one conformance test for this, I > wonder if it just doesn't test it well enough, or just doesn't test the > non-coherent memory type? I was *assuming* (but could be wrong) that Jordan was referring to an opencl cts test? At any rate, it is sounding like you should add a `MSM_PARAM_CACHE_ALIGNMENT` type of param that returns dma_get_cache_alignment(), and then properly implement offset/end BR, -R