Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp4996109pxb; Mon, 15 Feb 2021 06:58:20 -0800 (PST) X-Google-Smtp-Source: ABdhPJyAll5N9Jgwc5aUupdD5sePMgY+o8TXfLIhV64swm98ThWoAQGAwMaJe8JPFBEwQKBU86XB X-Received: by 2002:a17:906:ccd6:: with SMTP id ot22mr2325790ejb.165.1613401099834; Mon, 15 Feb 2021 06:58:19 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1613401099; cv=none; d=google.com; s=arc-20160816; b=pok5TdCRQKe0SA41rkrCyfk5Ih4IcTBMuS8/5BdN2YqYZERPjAPII+SteSPU+bPoAX 0sz8ZPwmjdB8o3k19S2OIlusTlMtHP/j3iTMpP4R2habD7fxYD2DvDME9WegDQmPTwmM Ar3Sk6jcxO4Vfq3fRMgr89E4B5CI2Wa9J5bV8GBCzM6Rqb622Y7RMmZ9UYoeuHZ7NYJN dR8dbW3JbZCsJbpaaZ8g8zYDwdSK5XouofSLGAEBsJRQ/kPy/acVqzd6xPD4pvkefe8e TlnXYhfMS2+t7+WEYD/8TnzD+JwAVTjhSHr3WaDeLjN+ANUyC0qdn6OyeLaBGo3tWjNo 4Fhg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-language:content-transfer-encoding :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject:dkim-signature; bh=vVdEfWSlmLCjTZzZsqvvIxgWNNo8H9xjhu0/9T9YVpU=; b=W2cVos8d/fvnfinZCY5Xt45rnlvektIcJyKNqFGrzAPQf/CBlzPMO58jTKOcCISGXf dG6KJ7pN4umBxd9dqgL+cVioXKAcCc+TpeJxWepbnw132OS7kvEuWeaIFSaV3lVpG7IF l8/zMuWkVQKy6qqOUT3WPl9bmRZgIOrOa18HS+AwWD8aXsmm7NA19eTyAsvOFJsw+zFE hAd4Dcq7GKrw3+Imvd8HkGXri+Vpu+SXNFHxPPvPQwBRRi5cgHdQubiLIB+xZdptnrhj Jw7zcFGRBrQOHmD6tZUJWlbmdvDGWngBLp4htLYNVKvz9x4s1HZQSYyuzsGZsiswkM7a 6Jag== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b="XlIog/eM"; 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 jv10si12392483ejc.625.2021.02.15.06.57.56; Mon, 15 Feb 2021 06:58:19 -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="XlIog/eM"; 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 S230019AbhBOOzb (ORCPT + 99 others); Mon, 15 Feb 2021 09:55:31 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59178 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229970AbhBOOz0 (ORCPT ); Mon, 15 Feb 2021 09:55:26 -0500 Received: from mail-ej1-x62a.google.com (mail-ej1-x62a.google.com [IPv6:2a00:1450:4864:20::62a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D8028C061756; Mon, 15 Feb 2021 06:54:45 -0800 (PST) Received: by mail-ej1-x62a.google.com with SMTP id jj19so11615180ejc.4; Mon, 15 Feb 2021 06:54:45 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-transfer-encoding:content-language; bh=vVdEfWSlmLCjTZzZsqvvIxgWNNo8H9xjhu0/9T9YVpU=; b=XlIog/eMeAk3If6nDNMJc83j9eaD9nfSoxl0yxZ4R4Xq3lypZ8xHagLCcVTP7/DuRo rl65fgWOqlyAcRN9WjoOI3SNfk1bKQSD64aK5ernmrZdVqDxF6yfj2B6mkbbkEfys+QJ fx6ngTmXggNrbsiBUHyK/Zq2I6yGWzajmCtxhCV5K3WibSWKws1CHCc4onZBYLnxDiyA nv48s2MBsHnGyYZUblPQwk9KTsfRQxXLB8P1z74f+PYG5A5MCPbdKJXu8JPBa6tbBBAC 7wvyRyuLf6nVbeuWvHapgwZsCvNyWzdxEkKK7Q459rL2C/5lS31JL+CBBLaZneUTEWid DafA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding :content-language; bh=vVdEfWSlmLCjTZzZsqvvIxgWNNo8H9xjhu0/9T9YVpU=; b=o4wJKnsT/CpQ/DwSIDET5DkXq1wZSgtMmhj5O5K0eagMlhDgJMaCg2G3ePsdjaEOWj lU0yBEZF/NeHKG9ZBJghPpYLwsB4agVKlmewOVD2AOpZ0J2DnJdEdQ/mNI7/PC9iLsUa 2KDkJBCrBiVv2LOFd4/R6RVZJrsFMBIEdawrIiX0vHkBWTOz/yRG6qNrZ3BspiIqdCOe WSgBOCCmIIjWd615AlS0WMknLhwwCrOrNnvGLyZgrrVShjYvuoy0v06QfeRjCqM6/kZk +3qUtmavTmtIRRI8atMzy34EoyvrSk07Yah1l5skDR+Np+KvQrAvJV5+1a+QhkuQNYAp CL0Q== X-Gm-Message-State: AOAM533R1gx9VD0HTV9BWhMeghQp84BKFfEW1f0ZpJtoG3YNaKapsHcy GVU7gBnucUw0xVACZta9uek= X-Received: by 2002:a17:906:3412:: with SMTP id c18mr2583106ejb.146.1613400884593; Mon, 15 Feb 2021 06:54:44 -0800 (PST) Received: from ?IPv6:2a02:908:1252:fb60:83c6:b72d:87bd:4259? ([2a02:908:1252:fb60:83c6:b72d:87bd:4259]) by smtp.gmail.com with ESMTPSA id q20sm10743492ejs.17.2021.02.15.06.54.43 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 15 Feb 2021 06:54:44 -0800 (PST) Subject: Re: [Linaro-mm-sig] DMA-buf and uncached system memory To: David Laight , =?UTF-8?B?J0NocmlzdGlhbiBLw7ZuaWcn?= , Lucas Stach , Simon Ser Cc: "linaro-mm-sig@lists.linaro.org" , linux-media , lkml , dri-devel , "Sharma, Shashank" References: <91ff0bbb-ea3a-2663-3453-dea96ccd6dd8@amd.com> <8d23f1ca6fe76d8971365bf54ca71ba71698980d.camel@pengutronix.de> <7ecf008d-a1f5-ddff-c8ac-8e7bfaf9c680@amd.com> From: =?UTF-8?Q?Christian_K=c3=b6nig?= Message-ID: <33ffa837-a88a-db1c-7861-c70d67557665@gmail.com> Date: Mon, 15 Feb 2021 15:54:43 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-US Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Am 15.02.21 um 15:41 schrieb David Laight: > From: Christian König >> Sent: 15 February 2021 12:05 > ... >> Snooping the CPU caches introduces some extra latency, so what can >> happen is that the response to the PCIe read comes to late for the >> scanout. The result is an underflow and flickering whenever something is >> in the cache which needs to be flushed first. > Aren't you going to get the same problem if any other endpoints are > doing memory reads? The PCIe device in this case is part of the SoC, so we have a high priority channel to memory. Because of this the hardware designer assumed they have a guaranteed memory latency. > Possibly even ones that don't require a cache snoop and flush. > > What about just the cpu doing a real memory transfer? > > Or a combination of the two above happening just before your request. > > If you don't have a big enough fifo you'll lose. > > I did 'fix' a similar(ish) issue with video DMA latency on an embedded > system based the on SA1100/SA1101 by significantly reducing the clock > to the VGA panel whenever the cpu was doing 'slow io'. > (Interleaving an uncached cpu DRAM write between the slow io cycles > also fixed it.) > But the video was the only DMA device and that was an embedded system. > Given the application note about video latency didn't mention what was > actually happening, I'm not sure how many people actually got it working! Yeah, I'm also not sure if AMD doesn't solve this with deeper fifos or more prefetching in future designs. But you gave me at least one example where somebody had similar problems. Thanks for the feedback, Christian. > > David > > - > Registered Address Lakeside, Bramley Road, Mount Farm, Milton Keynes, MK1 1PT, UK > Registration No: 1397386 (Wales) > _______________________________________________ > Linaro-mm-sig mailing list > Linaro-mm-sig@lists.linaro.org > https://lists.linaro.org/mailman/listinfo/linaro-mm-sig