Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp3727727imm; Mon, 6 Aug 2018 09:33:22 -0700 (PDT) X-Google-Smtp-Source: AAOMgpezbt+L/HflMhJLOXIZf2gbgc7sbK//brNzxSFOizCxq4fPCOUqCj1jfE8RJibubcr5xA2G X-Received: by 2002:a62:401:: with SMTP id 1-v6mr17834019pfe.28.1533573202646; Mon, 06 Aug 2018 09:33:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1533573202; cv=none; d=google.com; s=arc-20160816; b=04CymYVlgaz/kV2oqeYzLmW+MUc8q7jLOECaycS4MkDzl73NVKkyx/qlHsix6cUFEm AHwtVUlTNZe7OXKaEHR9UDOjsneuefICXxfcve26+IP0wsuq/j/F1GFVrZfWexxbGfK1 c4M+szmw4Ag1ubDy+XxyfKQulfr3eVH4pLC4/EcGbjHd3IQee6+cZOZVEZK9KCelZ0VN 2Lb6u3PAIbjp2Fhz3IIUsPdPb1a7v/XPbcoXGZoV/liodzS1WXi4203W4UL1qozd3wva TCJmFaniDC+TWau1D3L3jOkigDWWbVs4caUqz64yd7bjz7BpS8kbadPm8I0AD9j1iyum Yp6A== 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:arc-authentication-results; bh=L0G6oMYYhD0NxNhpbcFNQ4gfl9x0Q4SL5Gu+ZGMDyi0=; b=DB8ZvGWPq3d1IitCWJ/XOo+H2ZzHCd13Ts20F0gX63Mjah0nkJrPie1138i/vuf13d ZDZnERwp15zSYwdyCPkCJKq8koWOf5S0yjPrC7SbObfJugL/vBkEd0SKCwXVWsY2j4Fu AQs3EgzYygS15IXueQDIwGwmERbrGAxxNc4pjmGa58JCE8TottQmDizC+fID5EXSnJGk pJc0FfrlN1w8pLmAp/g3kcR53iLLGo8Kxmqv0p/1OAXL34f4o9AAvbxU1XdbC/JyVwd4 jeRaEkGntizygRlbWz/5L/vBKb8F0POQjJUa3GfMszpp1O6JPMoe2qFmmSiM5tfcwe3V R3xg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@semihalf-com.20150623.gappssmtp.com header.s=20150623 header.b=IlKdP9NO; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id b5-v6si13851643pfa.116.2018.08.06.09.33.07; Mon, 06 Aug 2018 09:33:22 -0700 (PDT) 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=@semihalf-com.20150623.gappssmtp.com header.s=20150623 header.b=IlKdP9NO; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731483AbeHFPu5 (ORCPT + 99 others); Mon, 6 Aug 2018 11:50:57 -0400 Received: from mail-io0-f177.google.com ([209.85.223.177]:46806 "EHLO mail-io0-f177.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730899AbeHFPu5 (ORCPT ); Mon, 6 Aug 2018 11:50:57 -0400 Received: by mail-io0-f177.google.com with SMTP id i18-v6so11007528ioj.13 for ; Mon, 06 Aug 2018 06:41:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=semihalf-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=L0G6oMYYhD0NxNhpbcFNQ4gfl9x0Q4SL5Gu+ZGMDyi0=; b=IlKdP9NOR+27FOl5X6DjKR1Jas98ynFaCVebwxEMtsg+X5hZP7UdcJI1I2tVQTrrtL 9dv3Zvgtd7+y1GoZh4E0RAQ4V4O/FlZvEsmNOxxiRWLFFRR4fXHazLQOqomhgmn/X3lh dQPrPf/VI5XV2hZfCU1j8jgSJMnH7FOsC7fkexhLrSM9rmHrdlx6la6d1TMGaJICR0WP YqRKx6BNs5AoGAy73EOYhCU6OWW+8zkMcTq3kZvNv5zNLvMeKRegI7sSNnW5L1px9qPr BtDHrE6YAxDcbnXKa8QtDln5uVcHgX/8Z3BOjgizdQwvY01WGFr/jOcISqOXS5MWR1g3 k3pQ== 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=L0G6oMYYhD0NxNhpbcFNQ4gfl9x0Q4SL5Gu+ZGMDyi0=; b=GM2ARHHLU2M5i3lHVbMc2qI8e/lpv72WJknoUD/IfU3lJwMnXpMHGkDk9crm+twAuP fik2WnBGk4CLAdaKZW3ZWrJHxEgiehZm7pvEMCG7eX7/MQpWT7FFbSj+GuZ7bXvJggPa uvodVDbtBAp+1+78SqtboWs0y9sMkSu9kIaRMX5u79R22iWvQQvN1PQfrleotxmafLFZ Q76qtO/abJyNbtPSqDj2YhSIMvMj69+d7ZoG49+sz39mRkHbbNbLjnV2PQDyTNr2m6Sr gTjCiRlE2iI1Us16qt6OvBpOS8ZyjqfhdxKcA6H8EjGD4R6a781zlmXT3rsMztIvK34g bIdA== X-Gm-Message-State: AOUpUlE3vvK32diX7fIcjbaw80OgeSa2fn6F4Y7iN/0c59+xlo1wy23Z e588zQabEBk6g3rs9FRtZA6cDVMkCuc1lenjuiZ85Q== X-Received: by 2002:a5e:c60c:: with SMTP id f12-v6mr15916104iok.108.1533562906924; Mon, 06 Aug 2018 06:41:46 -0700 (PDT) MIME-Version: 1.0 References: <20180803094129.GB17798@arm.com> <99fff4fe-afa9-f12f-a518-472a9dd1c530@arm.com> In-Reply-To: <99fff4fe-afa9-f12f-a518-472a9dd1c530@arm.com> From: Marcin Wojtas Date: Mon, 6 Aug 2018 15:41:34 +0200 Message-ID: Subject: Re: framebuffer corruption due to overlapping stp instructions on arm64 To: mpatocka@redhat.com Cc: Ard Biesheuvel , Robin Murphy , Thomas Petazzoni , Joao Pinto , Catalin Marinas , linux-pci@vger.kernel.org, Will Deacon , Russell King - ARM Linux , Linux Kernel Mailing List , Matt Sealey , Jingoo Han , linux-arm-kernel@lists.infradead.org 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 Hi Mikulas, pon., 6 sie 2018 o 14:42 Robin Murphy napisa=C5=82(a= ): > > On 06/08/18 11:25, Mikulas Patocka wrote: > [...] > >> None of this explains why some transactions fail to make it across > >> entirely. The overlapping writes in question write the same data to > >> the memory locations that are covered by both, and so the ordering in > >> which the transactions are received should not affect the outcome. > > > > You're right that the corruption couldn't be explained just by reorderi= ng > > writes. My hypothesis is that the PCIe controller tries to disambiguate > > the overlapping writes, but the disambiguation logic was not tested and= it > > is buggy. If there's a barrier between the overlapping writes, the PCIe > > controller won't see any overlapping writes, so it won't trigger the > > faulty disambiguation logic and it works. > > > > Could the ARM engineers look if there's some chicken bit in Cortex-A72 > > that could insert barriers between non-cached writes automatically? > > I don't think there is, and even if there was I imagine it would have a > pretty hideous effect on non-coherent DMA buffers and the various other > places in which we have Normal-NC mappings of actual system RAM. > > > I observe these kinds of corruptions: > > - failing to write a few bytes > > That could potentially be explained by the reordering/atomicity issues > Matt mentioned, i.e. the load is observing part of the store, before the > store has fully completed. > > > - writing a few bytes that were written 16 bytes before > > - writing a few bytes that were written 16 bytes after > > Those sound more like the interconnect or root complex ignoring the byte > strobes on an unaligned burst, of which I think the simplistic view > would be "it's broken". > > FWIW I stuck my old Nvidia 7600GT card in my Arm Juno r2 board (2x > Cortex-A72), built your test program natively with GCC 8.1.1 at -O2, and > it's still happily flickering pixels in the corner of the console after > nearly an hour (in parallel with some iperf3 just to ensure plenty of > PCIe traffic). I would strongly suspect this issue is particular to > Armada 8k, so its' probably one for the Marvell folks to take a closer > look at - I believe some previous interconnect issues on those SoCs were > actually fixable in firmware. > > On my Macchiato I use GT630 card (nuveau driver) + debian + xfce desktop and in dual monitor mode, I could run a couple of 1080p streams. All smooth and I've never noticed any image corruption whatsoever (I spent a lot of time in front of such setup). Just to be on a safe side, can you send me a bootlog and your board revision? I'd like to see your firware version and type. Thanks, Marcin