Received: by 2002:ac0:946b:0:0:0:0:0 with SMTP id j40csp490096imj; Thu, 7 Feb 2019 07:22:53 -0800 (PST) X-Google-Smtp-Source: AHgI3Iaorzb9of4WXtFnlNy4sD5HYuVjcH2zV5KfHrL2ozp6A3BM5C/Gd91eNsf77fpoYTP6piqV X-Received: by 2002:a65:608d:: with SMTP id t13mr15585883pgu.129.1549552973817; Thu, 07 Feb 2019 07:22:53 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1549552973; cv=none; d=google.com; s=arc-20160816; b=K8bFfmMNnoRjlgyRqs9yXdz7x7Nqu6rC//gh5ZXaKWgrgOL6gKYVeGTe97sRRHZj3o FiP2S4fkb5JowkuCqBhc17kVoiO8LKsb80/yOQvaPh9ziJOcYdCPRoWbZwAmerMKrqFl JZ6eMuSC8ZiYYmat//qTIcBwXdDBekQr4ufQEMbY624eoJpO9FQr5ax+rT/6RNceg0JP lRz22LtFZB1uL9rTDV99fbp8eFua/fsCS/MTpu65A6v1VbCJ/1qd22I0iHz7+AbKk6+B 8KpH3EdDm1bOfPDUoy34fEyPHbqiXFRUUCKX1Vsis6HmlgyUp8z7ZtLJLPzZIt6jAjJM TSWQ== 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=MKDXKLcR+dgm5MI2YZ/T4TCWzgNhPAx4ZCKQPhJuB2g=; b=y672gMI7fXZ8Gb36VGczNvYvCRDYnBblycv8TGh00duaR5B/loAxurBOPemJUiFAih jtfOCwVeZvjUOzxgh5HqhtMV83TF3ls4qZA2ThwEhbaKW+ddKE8HrFwxlQ9QsXziDlYV Ann5KZUhMZIuxtxHV26qsL7Dsg2eaC4JzId5LjHpCVT9QkwCu0bPmUo/jb+O8+WI793J QBnJvvbiYbt4x07iN4WzGiju+NYuUz0pkUHxFKa34kVw+bAnb861oHiuOPxSglIS1SCi 2PClARcMoZg/RgrEzeUN5Cpo7Kc6D912pGyszqQjXNC5a+sjI7fs/pZq2jj30y/xpfMe BdOA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=YAMQIaQE; 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=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id n59si9526768plb.388.2019.02.07.07.22.38; Thu, 07 Feb 2019 07:22:53 -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=@linaro.org header.s=google header.b=YAMQIaQE; 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=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727076AbfBGPUl (ORCPT + 99 others); Thu, 7 Feb 2019 10:20:41 -0500 Received: from mail-it1-f195.google.com ([209.85.166.195]:37369 "EHLO mail-it1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726651AbfBGPUl (ORCPT ); Thu, 7 Feb 2019 10:20:41 -0500 Received: by mail-it1-f195.google.com with SMTP id b5so559574iti.2 for ; Thu, 07 Feb 2019 07:20:40 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=MKDXKLcR+dgm5MI2YZ/T4TCWzgNhPAx4ZCKQPhJuB2g=; b=YAMQIaQE5AOr3L1/X81vBik20FmLQtGeKiRlSt6wCNh5V4ulFSO+b+BRLUtqOU/czu NqPdh/JmLST2wpJXdnDD8Wja05ebvWVEoYZgkmimKaJLUcfCnbtBWHUOKbsaCxjDfIr9 BnKUHb9iKS+3OC42v5XCWuQ4MOf63M42VYHlkQPzfC9CGqEjSe2xf9fQfEdVV1Qcl9mV 2Eb4lo4ZkILMSsj3Y1MKLRHLsUC0hOvHMLAOxgoyIGq3eXm6767rhVKZtM7+8zuEcV4c IY0H9LfGIoawhATxWXrwo5V89UsIfsvyLcIX7rQOVDMLz7XKpU4h1hW8VA0yto9qm16r tvAg== 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=MKDXKLcR+dgm5MI2YZ/T4TCWzgNhPAx4ZCKQPhJuB2g=; b=ovFiA+oomqQdtPELaccOh3tjsbOfIQ7TOA6w4MjDdRACfnG4ZtWk0cL/5uxaoS73UP BTvkx2zYsBr0qBH2okl/xN5QMMcX9tnZre+teaatxR2DGasE8TnCgcVCsdF1JeGURJ1k X4cs/XLqG8oQB9xgmhvEyijdzZPNG5A3r5fD6Ff1IixzAwEuCNzbacE3bKtx5U0eg3ar nOD8h2GKgc8dGwovJ1Swin1eXNwIC73X9JnwwPYFOEq1sVwOdg7rnFX7WcjfsgkeOBkP MmfQ6JfOD3OXbd1q6yYHNr9KxzihItHW8TBl3KPFxY4KEBF14TfjdxIKIGzlwe0RsGfy zDFw== X-Gm-Message-State: AHQUAuYBPpKOhGyjiMOXbsCyItPX12+zVpbTv1V8eKLn9cVrilZO0syP KkCxERkbh/f1D1Twi45f1FPZ+hRqu1v0CdvIf+7pZw== X-Received: by 2002:a5e:9704:: with SMTP id w4mr1849417ioj.60.1549552839866; Thu, 07 Feb 2019 07:20:39 -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: Ard Biesheuvel Date: Thu, 7 Feb 2019 16:20:27 +0100 Message-ID: Subject: Re: [PATCH] drm: enable uncached DMA optimization for ARM and arm64 To: "Koenig, Christian" Cc: 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 , Alex Deucher , "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 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 w= rote: > >>>>> 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 dev= ices > >>>>>>>> only, but permits an optimization to be enabled in some cases, w= here > >>>>>>>> for some buffers, both the CPU and the GPU use uncached mappings= , > >>>>>>>> removing the need for DMA snooping and allocation in the CPU cac= hes. > >>>>>>>> > >>>>>>>> The use of uncached GPU mappings relies on the correct implement= ation > >>>>>>>> of the PCIe NoSnoop TLP attribute by the platform, otherwise the= GPU > >>>>>>>> will use cached mappings nonetheless. On x86 platforms, this doe= s not > >>>>>>>> seem to matter, as uncached CPU mappings will snoop the caches i= n 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 of > >>>>>>>> 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?