From: "Christian König" <christian.koenig@amd.com>
To: Icenowy Zheng <uwu@icenowy.me>,
Alex Deucher <alexander.deucher@amd.com>,
Pan Xinhui <Xinhui.Pan@amd.com>,
David Airlie <airlied@gmail.com>, Daniel Vetter <daniel@ffwll.ch>,
Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>,
Huacai Chen <chenhuacai@kernel.org>,
WANG Xuerui <kernel@xen0n.name>
Cc: amd-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org,
linux-kernel@vger.kernel.org, loongarch@lists.linux.dev
Subject: Re: [PATCH 1/2] drm/amdgpu: make duplicated EOP packet for GFX7/8 have real content
Date: Mon, 17 Jun 2024 17:07:14 +0200 [thread overview]
Message-ID: <50573575-31a1-4ba6-8064-64399a5eac0f@amd.com> (raw)
In-Reply-To: <977af3daf5f7eb048eed0310bc93a321728b6106.camel@icenowy.me>
[-- Attachment #1: Type: text/plain, Size: 2815 bytes --]
Am 17.06.24 um 16:57 schrieb Icenowy Zheng:
> 在 2024-06-17星期一的 16:42 +0200,Christian König写道:
>> Am 17.06.24 um 16:30 schrieb Icenowy Zheng:
>>> 在 2024-06-17星期一的 15:59 +0200,Christian König写道:
>>>> Am 17.06.24 um 15:43 schrieb Icenowy Zheng:
>>>>> 在 2024-06-17星期一的 15:09 +0200,Christian König写道:
>>>>>> ...
>>>>> In this case shouldn't we write seq-1 before any work, and then
>>>>> write
>>>>> seq after work, like what is done in Mesa?
>>>> No. This hw workaround requires that two consecutive write
>>>> operations
>>>> happen directly behind each other on the PCIe bus with two
>>>> different
>>>> values.
>>> Well to be honest the workaround code in Mesa seems to not be
>>> working
>>> in this way ...
>> Mesa doesn't have any workaround for that hw issue, the code there
>> uses
>> a quite different approach.
> Ah? Commit bf26da927a1c ("drm/amdgpu: add cache flush workaround to
> gfx8 emit_fence") says "Both PAL and Mesa use it for gfx8 too, so port
> this commit to gfx_v8_0_ring_emit_fence_gfx", so maybe the workaround
> should just be not necessary here?
What I meant was that Mesa doesn't have a hack like writing seq - 1 and
then seq.
I haven't checked the code, but it uses a different approach with 64bit
values as far as I know.
>>>> To make the software logic around that work without any changes
>>>> we
>>>> use
>>>> the values seq - 1 and seq because those are guaranteed to be
>>>> different
>>>> and not trigger any unwanted software behavior.
>>>>
>>>> Only then we can guarantee that we have a coherent view of system
>>>> memory.
>>> Any more details about it?
>> No, sorry. All I know is that it's a bug in the cache flush logic
>> which
>> can be worked around by issuing two write behind each other to the
>> same
>> location.
> So the issue is that the first EOP write does not properly flush the
> cache? Could EVENT_WRITE be used instead of EVENT_WRITE_EOP in this
> workaround to properly flush it without hurting the fence value?
No, EVENT_WRITE is executed at a different time in the pipeline.
>>> ...
>> Well to be honest on a platform where even two consecutive writes to
>> the
>> same location doesn't work I would have strong doubts that it is
>> stable
>> in general.
> Well I think the current situation is that the IRQ triggered by the
> second EOP packet arrives before the second write is finished, not the
> second write is totally dropped.
Well that sounds like the usual re-ordering problems we have seen
patches for on Loongson multiple times now.
And I can only repeat what I've wrote before: We don't accept
workarounds in drivers for problems cause by severely platform issues.
Especially when that is clearly against any PCIe specification.
Regards,
Christian.
>
>> Regards,
>> Christian.
[-- Attachment #2: Type: text/html, Size: 5209 bytes --]
next prev parent reply other threads:[~2024-06-17 15:07 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-06-17 10:58 [PATCH 0/2] Fixes of AMD GFX7/8 hang on Loongson platforms Icenowy Zheng
2024-06-17 10:58 ` [PATCH 1/2] drm/amdgpu: make duplicated EOP packet for GFX7/8 have real content Icenowy Zheng
2024-06-17 12:35 ` Christian König
2024-06-17 13:03 ` Icenowy Zheng
2024-06-17 13:09 ` Christian König
2024-06-17 13:43 ` Icenowy Zheng
2024-06-17 13:59 ` Christian König
2024-06-17 14:30 ` Icenowy Zheng
2024-06-17 14:42 ` Christian König
2024-06-17 14:57 ` Icenowy Zheng
2024-06-17 15:07 ` Christian König [this message]
2024-06-17 15:35 ` Xi Ruoyao
2024-06-17 15:53 ` Christian König
2024-06-17 16:09 ` Icenowy Zheng
2024-06-18 6:20 ` Christian König
2024-06-17 10:58 ` [PATCH 2/2] drm/radeon: repeat the same EOP packet for EOP workaround on CIK Icenowy Zheng
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=50573575-31a1-4ba6-8064-64399a5eac0f@amd.com \
--to=christian.koenig@amd.com \
--cc=Xinhui.Pan@amd.com \
--cc=airlied@gmail.com \
--cc=alexander.deucher@amd.com \
--cc=amd-gfx@lists.freedesktop.org \
--cc=chenhuacai@kernel.org \
--cc=daniel@ffwll.ch \
--cc=dri-devel@lists.freedesktop.org \
--cc=kernel@xen0n.name \
--cc=linux-kernel@vger.kernel.org \
--cc=loongarch@lists.linux.dev \
--cc=pierre-eric.pelloux-prayer@amd.com \
--cc=uwu@icenowy.me \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.