]> git.baikalelectronics.ru Git - kernel.git/commit
drm/amdgpu: request reg_val_offs each kiq read reg
authorYintian Tao <yttao@amd.com>
Wed, 22 Apr 2020 11:58:22 +0000 (19:58 +0800)
committerAlex Deucher <alexander.deucher@amd.com>
Thu, 23 Apr 2020 19:06:41 +0000 (15:06 -0400)
commit2b09f35f1e7e823774e2a4d35bc4cf977f84537d
tree2c564fd31c90532a224aa643f6e8a762c28631ff
parentd7a8612f429bb8edac3ea42838be8144e7b3e413
drm/amdgpu: request reg_val_offs each kiq read reg

According to the current kiq read register method,
there will be race condition when using KIQ to read
register if multiple clients want to read at same time
just like the expample below:
1. client-A start to read REG-0 throguh KIQ
2. client-A poll the seqno-0
3. client-B start to read REG-1 through KIQ
4. client-B poll the seqno-1
5. the kiq complete these two read operation
6. client-A to read the register at the wb buffer and
   get REG-1 value

Therefore, use amdgpu_device_wb_get() to request reg_val_offs
for each kiq read register.

v2: fix the error remove
v3: fix the print typo
v4: remove unused variables

Signed-off-by: Yintian Tao <yttao@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/amdgpu/amdgpu.h
drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c
drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.h
drivers/gpu/drm/amd/amdgpu/amdgpu_ring.h
drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c
drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c
drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c