Received: by 2002:ac0:946b:0:0:0:0:0 with SMTP id j40csp532813imj; Thu, 7 Feb 2019 08:02:28 -0800 (PST) X-Google-Smtp-Source: AHgI3IaNHY7D0Uq0f8XhOSsgLaFyyM+xbdiA6ZfjXvsyI+8FxGwNrxM0TGQHWAu+T5YCprTWbEjF X-Received: by 2002:a63:990a:: with SMTP id d10mr15458877pge.279.1549555348015; Thu, 07 Feb 2019 08:02:28 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1549555348; cv=none; d=google.com; s=arc-20160816; b=rMFGrJLdWBKA804/4lsXv7Sw82HKopt0rzy6AaOfRl45hitu+Zvvtj5Gz7e6zTbZ3+ 85TVCxk23JF92Cb6FopcmYjbRJZMiDB3uW67vuJHH3iZOgRQa1WEFoDjdBR/E12crDzN HR5LsVUnAlZZ9wByaKesyKpFsLw5CK8KHR71fsJM2/6xtBtNLRqffJ+QDOk9mwzRw2Ro zqr0yo+cvK0c2EzzbLkbE1Iv3SnIyah4BwnqpFO93/I7OflJPZKEKmW1iQ5AYNyR42kC fWA2rSU6TDSfAs1VX8YeFvZXpZhp/LgxFFVZEipsaAjog3KxF+tPrM9vP97wmUt56CXw iA5w== 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=hjrkLDzbw59klMBWTcg66mkyzILll1t5jSDgHKiAU20=; b=OqXoRH4zd0QON+zJkT83gqVwkSKmu6k5sEukrjg1lYT1CUAWgy2k9uNbmLk9wY9g77 hpFMnH1CeZACeDGHArpVXgO4eh2T7ge6wJJZbl9N213foDJz9BQIW9q/erTmWAdX3jw7 8UbNBhvXHn3CzL3qdYW9Z5YccJC7qY3BBq6aPeMVxGUT2Pn6rDtSmnzZPMaMYSIhVxzu t/oX8zU/mliVeJQF4J84HJDE/RB4SRwJn8OgmPFC7gF/xlK/pCrkKRsV7dQpSVThsZM4 M47EbSuJhaDmEy+vdfe1wNnt2ZwdGh8zFdNzv4IHPndPPl/l+Jdv7mXzVhmjdNMiJkqP AYGw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=m0bZv4kP; 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 n17si2661478pgv.485.2019.02.07.08.02.08; Thu, 07 Feb 2019 08:02:27 -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=m0bZv4kP; 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 S1726650AbfBGQBk (ORCPT + 99 others); Thu, 7 Feb 2019 11:01:40 -0500 Received: from mail-it1-f194.google.com ([209.85.166.194]:51612 "EHLO mail-it1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726171AbfBGQBk (ORCPT ); Thu, 7 Feb 2019 11:01:40 -0500 Received: by mail-it1-f194.google.com with SMTP id w18so943487ite.1 for ; Thu, 07 Feb 2019 08:01:39 -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=hjrkLDzbw59klMBWTcg66mkyzILll1t5jSDgHKiAU20=; b=m0bZv4kPOj47D9JHiEJ2ntQTsppLxm2MnJCmL6ke+PVDfiuj6Lhkntz8vAFTP52acS qfNNoxCjbn+yfKDNkwdhK/0NPI/t4VhRkwaFQGBsp8Rh/IyN9KxjJTW2Buq2EPkcHxSr 1nc1wj0M8u/ZqzcdNKzkd3Hva+zRJPdDNx76zkV76v0SzI6POZa2Xgo1eJ/ZOJxTvPKY FJuUnnja6OuV2Rzi7qL5Wnav5PZ77WRUuK5aRtY+GF4ysOSVikGTrKFa7dnIAeMP2B2X SAiv1DdQ/iSc2wYlx7UeRoVsWEkHGAVMo8GzsDV6g6Ksrz8I3muL50r8j1JhNisusKHd TYrw== 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=hjrkLDzbw59klMBWTcg66mkyzILll1t5jSDgHKiAU20=; b=DTDAlFj1vivBtcNNjF7MaQORqjkKq65Jd1vHOXBkOKNFVpCalC/jUlSd+Jv75bDwXw mUSD/zMD8o4j3tNaEovd5j8sYb7AOMMslpzREq2LFNEa7d850MKAadcRTkHalIo1LQa9 bFXbseNbSadVhA6BdK/peLSSllfLvcUEJDOSDBvubp0I/5OidZ1cSSi6vOqkI3u+vCNE JOowR+HFBBkLCdsKdPHnw9pstGwwFW+smNJQAop4QhXLHXj7HrADgQihmBEjvm8e6BMH ZR5v+s+mUBYDawgUHswXYOCjP7tgfIeUJRDCHfMCe0Nz3F8cM/D6xBuFTlsQjX1tTrkp Mguw== X-Gm-Message-State: AHQUAuYvHaY0iuZ2EPOmEksxuuc4K2KcNpJVyxzF+lG5TN+cnT5QOeyZ v6RWA0DhViNEk9qfVXU5etiXSqeCLM9CaguRXGdLag== X-Received: by 2002:a05:660c:4b:: with SMTP id p11mr5920881itk.71.1549555298620; Thu, 07 Feb 2019 08:01:38 -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 17:01:26 +0100 Message-ID: Subject: Re: [PATCH] drm: enable uncached DMA optimization for ARM and arm64 To: Alex Deucher 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, 7 Feb 2019 at 16:33, Alex Deucher wrote: > > 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= devices > > > >>>>>>>> only, but permits an optimization to be enabled in some case= s, where > > > >>>>>>>> for some buffers, both the CPU and the GPU use uncached mapp= ings, > > > >>>>>>>> removing the need for DMA snooping and allocation in the CPU= caches. > > > >>>>>>>> > > > >>>>>>>> The use of uncached GPU mappings relies on the correct imple= mentation > > > >>>>>>>> of the PCIe NoSnoop TLP attribute by the platform, otherwise= the GPU > > > >>>>>>>> will use cached mappings nonetheless. On x86 platforms, this= does not > > > >>>>>>>> seem to matter, as uncached CPU mappings will snoop the cach= es in any > > > >>>>>>>> case. However, on ARM and arm64, enabling this optimization = on a > > > >>>>>>>> platform where NoSnoop is ignored results in loss of coheren= cy, 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=B6ni= g > > > >>>>>>> . > > > >>>>>>> > > > >>>>> 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= . > Excellent. Note that I actually prefer sending it manually rather than let Greg or Sasha pick it up automatically, given that they are usually a bit trigger happy, i.e., patches tend to get backported before anyone has had a chance to actually check that it doesn't break anything in mainline. In other words, please don't add a cc -stable or fixes tag. I will track it myself instead. Thanks, Ard.