iommu.lists.linux-foundation.org archive mirror
 help / color / mirror / Atom feed
From: Steven Price <steven.price@arm.com>
To: Boris Brezillon <boris.brezillon@collabora.com>,
	Neil Armstrong <narmstrong@baylibre.com>,
	tomeu.vizoso@collabora.com
Cc: robh@kernel.org, khilman@baylibre.com,
	Robin Murphy <robin.murphy@arm.com>,
	dri-devel@lists.freedesktop.org,
	iommu@lists.linux-foundation.org,
	alyssa.rosenzweig@collabora.com,
	linux-amlogic@lists.infradead.org, will@kernel.org,
	linux-arm-kernel@lists.infradead.org, jbrunet@baylibre.com
Subject: Re: [PATCH 3/3] arm64: dts: meson: Describe G12b GPU as coherent
Date: Mon, 5 Oct 2020 09:34:06 +0100	[thread overview]
Message-ID: <21de320b-0c32-b15b-a97b-d9799cd5ca44@arm.com> (raw)
In-Reply-To: <20201005101517.020c411a@collabora.com>

On 05/10/2020 09:15, Boris Brezillon wrote:
> Hi Robin, Neil,
> 
> On Wed, 16 Sep 2020 10:26:43 +0200
> Neil Armstrong <narmstrong@baylibre.com> wrote:
> 
>> Hi Robin,
>>
>> On 16/09/2020 01:51, Robin Murphy wrote:
>>> According to a downstream commit I found in the Khadas vendor kernel,
>>> the GPU on G12b is wired up for ACE-lite, so (now that Panfrost knows
>>> how to handle this properly) we should describe it as such. Otherwise
>>> the mismatch leads to all manner of fun with mismatched attributes and
>>> inadvertently snooping stale data from caches, which would account for
>>> at least some of the brokenness observed on this platform.
>>>
>>> Signed-off-by: Robin Murphy <robin.murphy@arm.com>
>>> ---
>>>   arch/arm64/boot/dts/amlogic/meson-g12b.dtsi | 4 ++++
>>>   1 file changed, 4 insertions(+)
>>>
>>> diff --git a/arch/arm64/boot/dts/amlogic/meson-g12b.dtsi b/arch/arm64/boot/dts/amlogic/meson-g12b.dtsi
>>> index 9b8548e5f6e5..ee8fcae9f9f0 100644
>>> --- a/arch/arm64/boot/dts/amlogic/meson-g12b.dtsi
>>> +++ b/arch/arm64/boot/dts/amlogic/meson-g12b.dtsi
>>> @@ -135,3 +135,7 @@ map1 {
>>>   		};
>>>   	};
>>>   };
>>> +
>>> +&mali {
>>> +	dma-coherent;
>>> +};
>>>    
>>
>> Thanks a lot for digging, I'll run a test to confirm it fixes the issue !
> 
> Sorry for the late reply. I triggered a dEQP run with this patch applied
> and I see a bunch of "panfrost ffe40000.gpu: matching BO is not heap type"
> errors (see below for a full backtrace). That doesn't seem to happen when
> we drop this dma-coherent property.
> 
> [  690.945731] ------------[ cut here ]------------
> [  690.950003] panfrost ffe40000.gpu: matching BO is not heap type (GPU VA = 319a000)
> [  690.950051] WARNING: CPU: 0 PID: 120 at drivers/gpu/drm/panfrost/panfrost_mmu.c:465 panfrost_mmu_irq_handler_thread+0x47c/0x650
> [  690.968854] Modules linked in:
> [  690.971878] CPU: 0 PID: 120 Comm: irq/27-panfrost Tainted: G        W         5.9.0-rc5-02434-g7d8109ec5a42 #784
> [  690.981964] Hardware name: Khadas VIM3 (DT)
> [  690.986107] pstate: 60000005 (nZCv daif -PAN -UAO BTYPE=--)
> [  690.991627] pc : panfrost_mmu_irq_handler_thread+0x47c/0x650
> [  690.997232] lr : panfrost_mmu_irq_handler_thread+0x47c/0x650
> [  691.002836] sp : ffff800011bcbcd0
> [  691.006114] x29: ffff800011bcbcf0 x28: ffff0000f3fe3800
> [  691.011375] x27: ffff0000ceaf5350 x26: ffff0000ca5fc500
> [  691.016636] x25: ffff0000f32409c0 x24: 0000000000000001
> [  691.021897] x23: ffff0000f3240880 x22: ffff0000f3e3a800
> [  691.027159] x21: 0000000000000000 x20: 0000000000000000
> [  691.032420] x19: 0000000000010001 x18: 0000000000000020
> [  691.037681] x17: 0000000000000000 x16: 0000000000000000
> [  691.042942] x15: ffff0000f3fe3c70 x14: ffffffffffffffff
> [  691.048204] x13: ffff8000116c2428 x12: ffff8000116c2086
> [  691.053466] x11: ffff800011bcbcd0 x10: ffff800011bcbcd0
> [  691.058727] x9 : 00000000fffffffe x8 : 0000000000000000
> [  691.063988] x7 : 7420706165682074 x6 : ffff8000116c1816
> [  691.069249] x5 : 0000000000000000 x4 : 0000000000000000
> [  691.074510] x3 : 00000000ffffffff x2 : ffff8000e348c000
> [  691.079771] x1 : f1b91ff9af2df000 x0 : 0000000000000000
> [  691.085033] Call trace:
> [  691.087452]  panfrost_mmu_irq_handler_thread+0x47c/0x650
> [  691.092712]  irq_thread_fn+0x2c/0xa0
> [  691.096246]  irq_thread+0x184/0x208
> [  691.099699]  kthread+0x140/0x160
> [  691.102890]  ret_from_fork+0x10/0x34
> [  691.106424] ---[ end trace b5dd8c2dfada8236 ]---
> 

It's quite possible this is caused by the GPU seeing a stale page table 
entry, so perhaps coherency isn't working as well as it should...

Do you get an "Unhandled Page fault" message after this? It might give 
some clues. Coherency issues are a pain to debug though and it's of 
course possible there are issues on this specific platform.

Steve
_______________________________________________
iommu mailing list
iommu@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/iommu

  reply	other threads:[~2020-10-05  8:34 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-09-15 23:51 [PATCH 0/3] drm: panfrost: Coherency support Robin Murphy
2020-09-15 23:51 ` [PATCH 1/3] iommu/io-pgtable-arm: Support coherency for Mali LPAE Robin Murphy
2020-09-21 17:57   ` Will Deacon
2020-09-21 21:53     ` Robin Murphy
2020-09-21 22:24       ` Will Deacon
2020-09-15 23:51 ` [PATCH 2/3] drm/panfrost: Support cache-coherent integrations Robin Murphy
2020-09-17 10:37   ` Steven Price
2020-09-15 23:51 ` [PATCH 3/3] arm64: dts: meson: Describe G12b GPU as coherent Robin Murphy
2020-09-16  8:26   ` Neil Armstrong
2020-10-05  8:15     ` Boris Brezillon
2020-10-05  8:34       ` Steven Price [this message]
2020-10-05  8:39         ` Boris Brezillon
2020-10-05 10:05           ` Steven Price
2020-09-16 14:54   ` Neil Armstrong
2020-09-16 14:54 ` [PATCH 0/3] drm: panfrost: Coherency support Neil Armstrong
2020-09-16 17:04   ` Alyssa Rosenzweig
2020-09-16 17:46     ` Rob Herring
2020-09-17 10:38       ` Steven Price
2020-09-17 10:51         ` Tomeu Vizoso
2020-09-17 11:00           ` Steven Price
2020-09-17 12:03         ` Alyssa Rosenzweig
2020-09-17 12:38       ` Robin Murphy

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=21de320b-0c32-b15b-a97b-d9799cd5ca44@arm.com \
    --to=steven.price@arm.com \
    --cc=alyssa.rosenzweig@collabora.com \
    --cc=boris.brezillon@collabora.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=iommu@lists.linux-foundation.org \
    --cc=jbrunet@baylibre.com \
    --cc=khilman@baylibre.com \
    --cc=linux-amlogic@lists.infradead.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=narmstrong@baylibre.com \
    --cc=robh@kernel.org \
    --cc=robin.murphy@arm.com \
    --cc=tomeu.vizoso@collabora.com \
    --cc=will@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).