From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.1 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8264CC282C2 for ; Thu, 7 Feb 2019 16:01:42 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 45DBE2175B for ; Thu, 7 Feb 2019 16:01:42 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="m0bZv4kP" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726707AbfBGQBk (ORCPT ); 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-Google-Smtp-Source: AHgI3IaUiQacOJtk0xlnnQ5OR0YTYWZENiYJE5CdRWYiueuFdGanCsW3J27+9Tqsxku7T3nFrJx1oQj2HZ6LVhbBBU8= 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. From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.0 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 606D7C282C2 for ; Thu, 7 Feb 2019 16:01:54 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 2723D21872 for ; Thu, 7 Feb 2019 16:01:54 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="srH3eFVQ"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="m0bZv4kP" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 2723D21872 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:To:Subject:Message-ID:Date:From: In-Reply-To:References:MIME-Version:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=pUEmL8JrhIoIGzxBbjLinPuAei7nfLbyHkzymsElo9g=; b=srH3eFVQuXknyq TEDJYAXuptT/ueqM+hPM443jY4LVf++wdkQXSov6imAg6DPtDeYoc7y8DKWH0n5pXYlCwkSV0Brtl H/ltfEJJO9ZppyqJM6GH40E+LuHwg60KFUUktLHPUyTSrPL7Nr4fgza9UfJo/y/IarRtXrsaDu+pr vylCZlXT9HA79Vp1rYcfCfMVAtL8E26los9oM6JiSjslf389UGXYpD70S7qSL0nSN8RSzYx6yQwTJ BNeAmWNH3bSPJvqCPJ8vNCM/nw0B09e5KuDMm/RawoSeOaMasvqD/ntyTy6Wis0z0DMisZN2iKmY1 zPBf/oKQV2jmlqMj6DGQ==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1grm7U-0001vT-GD; Thu, 07 Feb 2019 16:01:44 +0000 Received: from mail-it1-x142.google.com ([2607:f8b0:4864:20::142]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1grm7P-0001rh-QR for linux-arm-kernel@lists.infradead.org; Thu, 07 Feb 2019 16:01:42 +0000 Received: by mail-it1-x142.google.com with SMTP id z7so965854iti.0 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=PMt3gl243BDyYpdZyIfqk8NH5nVYU3NFy28HsyuzlOVhEyFkvZNPw7J6fvJ5BZMMxj i/cxf0kACMWsDV/taSaC70DXc+FyewDPkcN5uBUvKnAtaZOh9v75V3e/oB6EujhCC5UT agv4PpnnGcwOzbZhGvY/SPQPpQ2YIyMdB5gTYFGGAACmBpoirfMHizeNc3MxhV3LiZHz FL0u+k/XSRGeYRwOQWU5BJv6AvSdhSa4gb86oSzeuTEunDkB5FGzvWKJ/k+1rJCwT48o ypALpFOah+rgH+mArt+qESBtgdbA8WQ6bYFG7cmdquevx9R44DZrQCJACtjfXCTrEQaK BerA== X-Gm-Message-State: AHQUAuZysywHNBo2Yd6X0HzCdv+GKVJTTw62YLE/TxQM0wizSh8HFl6L gfal1ROyqLX7SkODYo/2DKTomtiBlIa58J1w0N+SMw== X-Google-Smtp-Source: AHgI3IaUiQacOJtk0xlnnQ5OR0YTYWZENiYJE5CdRWYiueuFdGanCsW3J27+9Tqsxku7T3nFrJx1oQj2HZ6LVhbBBU8= 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 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190207_080140_090377_56C1F8C2 X-CRM114-Status: GOOD ( 24.05 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: "Daenzer, Michel" , Carsten Haitzler , Maxime Ripard , Michael Ellerman , Will Deacon , "linux-kernel@vger.kernel.org" , dri-devel , Christoph Hellwig , David Airlie , "Huang, Ray" , amd-gfx list , "Zhang, Jerry" , "Deucher, Alexander" , Sean Paul , "Koenig, Christian" , "linux-arm-kernel@lists.infradead.org" , Robin Murphy Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: base64 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org T24gVGh1LCA3IEZlYiAyMDE5IGF0IDE2OjMzLCBBbGV4IERldWNoZXIgPGFsZXhkZXVjaGVyQGdt YWlsLmNvbT4gd3JvdGU6Cj4KPiBPbiBUaHUsIEZlYiA3LCAyM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EBsaXN0cy5pbmZyYWRlYWQub3JnCmh0dHA6Ly9saXN0cy5pbmZyYWRlYWQub3Jn L21haWxtYW4vbGlzdGluZm8vbGludXgtYXJtLWtlcm5lbAo= From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ard Biesheuvel Subject: Re: [PATCH] drm: enable uncached DMA optimization for ARM and arm64 Date: Thu, 7 Feb 2019 17:01:26 +0100 Message-ID: References: <20190124120658.30288-1-ard.biesheuvel@linaro.org> <3cca35a9-c71c-a100-b29d-31ba0d1d10b1@amd.com> <961e758d-b0a0-8f6c-a8fa-c3047e058706@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Return-path: In-Reply-To: Sender: linux-kernel-owner@vger.kernel.org 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 List-Id: dri-devel@lists.freedesktop.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.