Received: by 2002:ac0:946b:0:0:0:0:0 with SMTP id j40csp503503imj; Thu, 7 Feb 2019 07:34:28 -0800 (PST) X-Google-Smtp-Source: AHgI3IYajrX7LK+8jJsMdo/Y2rXqtTbECbYXHTFikIC9khgHkzryIUi/Zhnn8IYdLk3i/LHyszmT X-Received: by 2002:a17:902:6b83:: with SMTP id p3mr16920958plk.118.1549553668090; Thu, 07 Feb 2019 07:34:28 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1549553668; cv=none; d=google.com; s=arc-20160816; b=rU7cR0Dis8FcHymlDgc5bijHLjhZmpVImQVE580ssz6iRBM/eD9xLPQOt/mvuHQyJI x3GcLa6tpHoxtgLbB9sqjjkyKr3m2se0ruYVa17dGUbCiUu+2ffcnngY8JDfnfNQnXPC EfzHuJolE+nYUVRS6PrqarZnGz4LjqHqnoX0hKFiH74Bw2GJ/Gbw6QziFTlYz8NBuOfs VsfHAFkhxuORfJsG0vroFriKkrC8NKvEQenGjoWSsBL+VC50o+cMf9MnyZu1uwTC5ZCf JnJwfiBMLSsR8I3Rio9T0XCBrvoLOtWkmKg1elmm7jnYQo8nILT3Cu4GHNIGcIrbs/Tr tjBw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=NtuwhjcSa9WVQeIYC9YHkLkUJWc3nvD6vkG9KV6JWdY=; b=MqEPQ0Lbya2QsrA1qMATj0mMyRuQ0+WmSLLMzg44CD9fDOVJOKgjfNDU1m79VpFod4 bz2wO8oO40lsVWY+1Fc9c1wx357mlA3DNL8GTAIRH3GWwm3Zs/VRJMdG1G061qcNhG9N RWh4ST+ukpxP8rJsRmbTDON1h5Sif41MVwis/Iauktf12ebP86dqJfvtwrVHQzEaWA4E jKCGTealGWfmzmqotsoyU0UyI/tFROPx84aPOc0Io//GCoGaXbPTzB7KX4fRJldkFR7T uadzdn4KBH8ppMdeQhdKKV3AqN4iWdebtMmp5UWAJAd6GP+2GQf8Q+vnT6pNeCy4vObv 1JzQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=pRtYtlJg; 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 y7si8786176pga.296.2019.02.07.07.34.10; Thu, 07 Feb 2019 07:34:28 -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=pRtYtlJg; 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 S1726622AbfBGPdx (ORCPT + 99 others); Thu, 7 Feb 2019 10:33:53 -0500 Received: from mail-wm1-f66.google.com ([209.85.128.66]:52412 "EHLO mail-wm1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726048AbfBGPdw (ORCPT ); Thu, 7 Feb 2019 10:33:52 -0500 Received: by mail-wm1-f66.google.com with SMTP id m1so301554wml.2 for ; Thu, 07 Feb 2019 07:33:50 -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:content-transfer-encoding; bh=NtuwhjcSa9WVQeIYC9YHkLkUJWc3nvD6vkG9KV6JWdY=; b=pRtYtlJgtzYwAmX0OMJSPoXh1rSAMRchSEO52oFCMher2tyZO7fEQ8Dnaf/XY64gT9 Oxfd12yOrNyFC4LKNqi+VljU4XtPdWVqI560CPpyhXV2PfK23yBAdUJpL0QTLQxGuLUy 2y5+VDdZ8cmtc/ZOgxNXtypsZ0hEkWo5NzRE0/VUe3tiuAbYStRW5vnyXAXscbKI+iBl 14zoKXHWWyc4db/xBQKmchFivYoGAm5KxAwpZusoLqFW0usotQI8uGL/uT+/aT7nkgil bzp9gwbyZpZ8zNorFcjDwo9psu39He2ZFwi2N8sniGALFYPsm/HnLniiZvuB3Fz6gTpq eO+A== 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:content-transfer-encoding; bh=NtuwhjcSa9WVQeIYC9YHkLkUJWc3nvD6vkG9KV6JWdY=; b=eGzc1j5gHLspTLDL/szfJ6HIwarnzp0D9fV3J+/zCkfdh61JNFeWxdK1JhuLQ19leZ fmuGqky8/vugOPCrorY9cRFqtRopY4FAYeRFlYdW+DMrcD6LZ6Aenq2ZUT7LHJjzWy90 agvYXIWpePR/rA2KsTZFTgf5ytsYSZTwCEEwwdFvOdBCgWwpwPzzEuan4WwEe9jpXnDz u18DYwRgPlfzfQhIUULNLOYVsbrQmemobElmAN2Meh0YK1wziVmLu8uoUMkbVphnWejj qKmVXFR2b+wLHPfxukDd7GOnBmkJQmgKR6Bpy9Iiqo62Gx7q5kicamxN6VegvTRVZmz/ e7eg== X-Gm-Message-State: AHQUAuaTrGxF+G7DCPPaW9joKKUKFyDju57wH7HVAV0kWlgnoJWXS6td v0RHTpx/+6VPjwqn0GbNET1LjYkeyCwQrjmvook= X-Received: by 2002:a1c:9e4a:: with SMTP id h71mr8129497wme.82.1549553629575; Thu, 07 Feb 2019 07:33:49 -0800 (PST) MIME-Version: 1.0 References: <20190124120658.30288-1-ard.biesheuvel@linaro.org> <3cca35a9-c71c-a100-b29d-31ba0d1d10b1@amd.com> <961e758d-b0a0-8f6c-a8fa-c3047e058706@gmail.com> In-Reply-To: From: Alex Deucher Date: Thu, 7 Feb 2019 10:33:37 -0500 Message-ID: Subject: Re: [PATCH] drm: enable uncached DMA optimization for ARM and arm64 To: Ard Biesheuvel Cc: "Koenig, Christian" , Will Deacon , Carsten Haitzler , Maxime Ripard , Michael Ellerman , David Airlie , "Daenzer, Michel" , "linux-kernel@vger.kernel.org" , dri-devel , Christoph Hellwig , "Zhang, Jerry" , "Huang, Ray" , amd-gfx list , "Deucher, Alexander" , Sean Paul , "linux-arm-kernel@lists.infradead.org" , Robin Murphy Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Feb 7, 2019 at 10:20 AM Ard Biesheuvel wrote: > > On Wed, 6 Feb 2019 at 19:38, Christian K=C3=B6nig > wrote: > > > > Am 06.02.19 um 18:23 schrieb Ard Biesheuvel: > > > On Fri, 25 Jan 2019 at 11:35, Ard Biesheuvel wrote: > > >> On Fri, 25 Jan 2019 at 12:30, Christian K=C3=B6nig > > >> wrote: > > >>> Am 25.01.19 um 09:43 schrieb Ard Biesheuvel: > > >>>> On Thu, 24 Jan 2019 at 15:01, Alex Deucher = wrote: > > >>>>> On Thu, Jan 24, 2019 at 9:00 AM Ard Biesheuvel > > >>>>> wrote: > > >>>>>> On Thu, 24 Jan 2019 at 13:31, Koenig, Christian > > >>>>>> wrote: > > >>>>>>> Am 24.01.19 um 13:06 schrieb Ard Biesheuvel: > > >>>>>>>> The DRM driver stack is designed to work with cache coherent d= evices > > >>>>>>>> only, but permits an optimization to be enabled in some cases,= where > > >>>>>>>> for some buffers, both the CPU and the GPU use uncached mappin= gs, > > >>>>>>>> removing the need for DMA snooping and allocation in the CPU c= aches. > > >>>>>>>> > > >>>>>>>> The use of uncached GPU mappings relies on the correct impleme= ntation > > >>>>>>>> of the PCIe NoSnoop TLP attribute by the platform, otherwise t= he GPU > > >>>>>>>> will use cached mappings nonetheless. On x86 platforms, this d= oes not > > >>>>>>>> seem to matter, as uncached CPU mappings will snoop the caches= in any > > >>>>>>>> case. However, on ARM and arm64, enabling this optimization on= a > > >>>>>>>> platform where NoSnoop is ignored results in loss of coherency= , which > > >>>>>>>> breaks correct operation of the device. Since we have no way o= f > > >>>>>>>> detecting whether NoSnoop works or not, just disable this > > >>>>>>>> optimization entirely for ARM and arm64. > > >>>>>>>> > > >>>>>>>> Cc: Christian Koenig > > >>>>>>>> Cc: Alex Deucher > > >>>>>>>> Cc: David Zhou > > >>>>>>>> Cc: Huang Rui > > >>>>>>>> Cc: Junwei Zhang > > >>>>>>>> Cc: Michel Daenzer > > >>>>>>>> Cc: David Airlie > > >>>>>>>> Cc: Daniel Vetter > > >>>>>>>> Cc: Maarten Lankhorst > > >>>>>>>> Cc: Maxime Ripard > > >>>>>>>> Cc: Sean Paul > > >>>>>>>> Cc: Michael Ellerman > > >>>>>>>> Cc: Benjamin Herrenschmidt > > >>>>>>>> Cc: Will Deacon > > >>>>>>>> Cc: Christoph Hellwig > > >>>>>>>> Cc: Robin Murphy > > >>>>>>>> Cc: amd-gfx list > > >>>>>>>> Cc: dri-devel > > >>>>>>>> Reported-by: Carsten Haitzler > > >>>>>>>> Signed-off-by: Ard Biesheuvel > > >>>>>>> The subject line should probably read "disable uncached...". > > >>>>>>> > > >>>>>> Ugh, of course ... > > >>>>>> > > >>>>>>> With that fixed the patch is Reviewed-by: Christian K=C3=B6nig > > >>>>>>> . > > >>>>>>> > > >>>>> Same: > > >>>>> Reviewed-by: Alex Deucher > > >>>>> > > >>>> Thanks all > > >>>> > > >>>> Should I resend the patch with the subject corrected? > > >>> I will update the subject line and push it upstream through > > >>> drm-misc-next if nobody objects. > > >>> > > >> Wonderful, thanks. > > > Hi Christian, > > > > > > Are you still planning to merge this for v5.1? > > > > My bad, only pushed this to our internal branch, but forgot out > > drm-misc-next. > > > > Fixed now, thanks for the reminder. > > > > Thanks, > > Does anyone mind if I propose this patch for backporting to v4.19 or > earlier once it gets merged for v5.1? Go for it. I was going to suggest that this should probably go to stable. Alex