All of lore.kernel.org
 help / color / mirror / Atom feed
* [BUG] Data race when use PACKET3_DMA_DATA?
@ 2021-06-02 12:39 Chen Lei
  2021-06-02 13:37 ` Alex Deucher
  0 siblings, 1 reply; 7+ messages in thread
From: Chen Lei @ 2021-06-02 12:39 UTC (permalink / raw)
  To: amd-gfx


[-- Attachment #1.1: Type: text/plain, Size: 872 bytes --]

Hi, I noticed that there are two ways to do DMA for amd gpu: the SDMA copy packet and the PM4 dma packet.

I had tested the PM4 dma packet:  PACKET3_DMA_DATA. In most of time, it works. 

But when I launch an OpenCL kernel followed by a host-to-gpu DMA packet, it seems that the OpenCL kernel read the new value written by the following DMA packet. 

Both the OpenCL kernel and the PM4 dma packet are submitted using the amdgpu_cs_ioctl, and they are submitted to the same ring.

I was not family with the hardware details. According to my understanding, because the ring is FIFO, there is no need for any explicit synchronization between the OpenCL kernel launch packet and the dma packet. So the result looked weird. And when I add the synchronization(i.e. amdgpu_cs_wait_ioctl) before the dma packet, everything is OK.

Was it a hardware bug or did I miss something?

 

[-- Attachment #1.2: Type: text/html, Size: 1225 bytes --]

[-- Attachment #2: Type: text/plain, Size: 154 bytes --]

_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2021-06-04 13:00 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-06-02 12:39 [BUG] Data race when use PACKET3_DMA_DATA? Chen Lei
2021-06-02 13:37 ` Alex Deucher
2021-06-03  0:29   ` Chen Lei
2021-06-03  2:11     ` Alex Deucher
2021-06-03  3:37       ` Chen Lei
2021-06-04  7:40         ` Christian König
2021-06-04 13:00           ` Chen Lei

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.