RE: [PATCH] drm/amdgpu: Fix style issues in amdgpu_psp.c

2023-07-28 Thread SHANMUGAM, SRINIVASAN
[Public] Reviewed-by: Srinivasan Shanmugam -Original Message- From: amd-gfx On Behalf Of Praful Swarnakar Sent: Thursday, July 27, 2023 9:17 AM To: Koenig, Christian ; Deucher, Alexander ; Chen, Guchun Cc: Swarnakar, Praful ; amd-gfx@lists.freedesktop.org Subject: [PATCH]

Re: [PATCH] drm/amdkfd: avoid unmap dma address when svm_ranges are split

2023-07-28 Thread Felix Kuehling
On 2023-07-28 17:41, Alex Sierra wrote: DMA address reference within svm_ranges should be unmapped only after the memory has been released from the system. In case of range splitting, the DMA address information should be copied to the corresponding range after this has split. But leaving dma

[PATCH] drm/amd/display: Fix a regression on Polaris cards

2023-07-28 Thread Mario Limonciello
DCE products don't define a `remove_stream_from_ctx` like DCN ones do. This means that when compute_mst_dsc_configs_for_state() is called it always returns -EINVAL which causes MST to fail to setup. Cc: sta...@vger.kernel.org # 6.4.y Cc: Harry Wentland Reported-by: klaus.kus...@computerix.info

[pull] amdgpu, amdkfd, radeon drm-next-6.6

2023-07-28 Thread Alex Deucher
Hi Dave, Daniel, New stuff for 6.6. The following changes since commit 6725f33228077902ddac2a05e0ab361dee36e4ba: Merge tag 'drm-misc-next-fixes-2023-07-06' of git://anongit.freedesktop.org/drm/drm-misc into drm-next (2023-07-07 11:05:16 +1000) are available in the Git repository at:

[PATCH] drm/amdkfd: avoid unmap dma address when svm_ranges are split

2023-07-28 Thread Alex Sierra
DMA address reference within svm_ranges should be unmapped only after the memory has been released from the system. In case of range splitting, the DMA address information should be copied to the corresponding range after this has split. But leaving dma mapping intact. Signed-off-by: Alex Sierra

Re: [PATCH v3] drm/amdgpu: Add EXT_COHERENT memory allocation flags

2023-07-28 Thread Felix Kuehling
On 2023-07-28 15:39, David Francis wrote: These flags (for GEM and SVM allocations) allocate memory that allows for system-scope atomic semantics. On GFX943 these flags cause caches to be avoided on non-local memory. On all other ASICs they are identical in functionality to the equivalent

[PATCH v3] drm/amdgpu: Add EXT_COHERENT memory allocation flags

2023-07-28 Thread David Francis
These flags (for GEM and SVM allocations) allocate memory that allows for system-scope atomic semantics. On GFX943 these flags cause caches to be avoided on non-local memory. On all other ASICs they are identical in functionality to the equivalent COHERENT flags. Corresponding Thunk patch is at

[PATCH v3 7/7] drm/amdgpu/vcn: change end doorbell index for vcn_v4_0_3

2023-07-28 Thread Samir Dhume
For sriov, doorbell index for vcn0 for AID needs to be on 32 byte boundary so we need to move the vcn end doorbell Signed-off-by: Samir Dhume --- drivers/gpu/drm/amd/amdgpu/amdgpu_doorbell.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git

[PATCH v3 6/7] drm/amdgpu/jpeg: mmsch_v3_0_4 requires doorbell on 32 byte boundary

2023-07-28 Thread Samir Dhume
BASE: VCN0 unified (32 byte boundary) BASE+4: MJPEG0 BASE+5: MJPEG1 BASE+6: MJPEG2 BASE+7: MJPEG3 BASE+12: MJPEG4 BASE+13: MJPEG5 BASE+14: MJPEG6 BASE+15: MJPEG7 Signed-off-by: Samir Dhume --- drivers/gpu/drm/amd/amdgpu/jpeg_v4_0_3.c | 17 ++--- 1 file changed, 14 insertions(+), 3

[PATCH v3 5/7] drm/amdgpu/jpeg: sriov support for jpeg_v4_0_3

2023-07-28 Thread Samir Dhume
initialization table handshake with mmsch Signed-off-by: Samir Dhume --- drivers/gpu/drm/amd/amdgpu/jpeg_v4_0_3.c | 174 --- 1 file changed, 153 insertions(+), 21 deletions(-) diff --git a/drivers/gpu/drm/amd/amdgpu/jpeg_v4_0_3.c b/drivers/gpu/drm/amd/amdgpu/jpeg_v4_0_3.c

[PATCH v3 3/7] drm/amdgpu/vcn: sriov support for vcn_v4_0_3

2023-07-28 Thread Samir Dhume
initialization table handshake with mmsch Signed-off-by: Samir Dhume --- drivers/gpu/drm/amd/amdgpu/vcn_v4_0_3.c | 257 +--- 1 file changed, 233 insertions(+), 24 deletions(-) diff --git a/drivers/gpu/drm/amd/amdgpu/vcn_v4_0_3.c b/drivers/gpu/drm/amd/amdgpu/vcn_v4_0_3.c

[PATCH v3 4/7] drm/amdgpu/vcn: mmsch_v3_0_4 requires doorbell on 32 byte boundary

2023-07-28 Thread Samir Dhume
Signed-off-by: Samir Dhume --- drivers/gpu/drm/amd/amdgpu/vcn_v4_0_3.c | 13 ++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/amd/amdgpu/vcn_v4_0_3.c b/drivers/gpu/drm/amd/amdgpu/vcn_v4_0_3.c index b978265b2d77..7cd5ca204317 100644 ---

[PATCH v3 2/7] drm/amdgpu/vcn : Skip vcn power-gating change for sriov

2023-07-28 Thread Samir Dhume
Signed-off-by: Samir Dhume --- drivers/gpu/drm/amd/amdgpu/vcn_v4_0_3.c | 9 + 1 file changed, 9 insertions(+) diff --git a/drivers/gpu/drm/amd/amdgpu/vcn_v4_0_3.c b/drivers/gpu/drm/amd/amdgpu/vcn_v4_0_3.c index 550ac040b4be..411c1d802823 100644 ---

[PATCH v3 1/7] drm/amdgpu/vcn: Add MMSCH v4_0_3 support for sriov

2023-07-28 Thread Samir Dhume
The structures are the same as v4_0 except for the init header Signed-off-by: Samir Dhume --- drivers/gpu/drm/amd/amdgpu/mmsch_v4_0_3.h | 37 +++ 1 file changed, 37 insertions(+) create mode 100644 drivers/gpu/drm/amd/amdgpu/mmsch_v4_0_3.h diff --git

Re: [PATCH 2/4] drm/amdkfd: disable IOMMUv2 support for KV/CZ

2023-07-28 Thread Felix Kuehling
There are some APU-specific code paths for Kaveri and Carrizo in the device queue manager and MQD manager. I think a minimal fix would be to change device_queue_manager_init to call device_queue_manager_init_cik_hawaii for Kaveri and device_queue_manager_init_vi_tonga for Carrizo to use the

[PATCH] drm/amdgpu: Report Missing MES Firmware Versions with Sysfs

2023-07-28 Thread Ori Messinger
Added missing MES firmware versions to the 'fw_version' sysfs directory, they should now exist as a files named "mes_fw_version" and "mes_kiq_fw_version" found at: /sys/class/drm/cardX/device/fw_version/mes_fw_version /sys/class/drm/cardX/device/fw_version/mes_kiq_fw_version Where X is the card

Re: [PATCH 28/29] drm/amdkfd: Refactor migrate init to support partition switch

2023-07-28 Thread Alex Deucher
On Fri, Jul 28, 2023 at 1:19 PM Michel Dänzer wrote: > > On 7/28/23 18:43, Alex Deucher wrote: > > On Fri, Jul 28, 2023 at 10:25 AM Michel Dänzer wrote: > >> On 7/28/23 11:30, Michel Dänzer wrote: > >>> On 7/28/23 03:38, Zhang, Jesse(Jie) wrote: > > Could you try the patch again ?

Re: [PATCH 28/29] drm/amdkfd: Refactor migrate init to support partition switch

2023-07-28 Thread Michel Dänzer
On 7/28/23 18:43, Alex Deucher wrote: > On Fri, Jul 28, 2023 at 10:25 AM Michel Dänzer wrote: >> On 7/28/23 11:30, Michel Dänzer wrote: >>> On 7/28/23 03:38, Zhang, Jesse(Jie) wrote: Could you try the patch again ? That work for me.

Re: [PATCH 28/29] drm/amdkfd: Refactor migrate init to support partition switch

2023-07-28 Thread Alex Deucher
On Fri, Jul 28, 2023 at 10:25 AM Michel Dänzer wrote: > > On 7/28/23 11:30, Michel Dänzer wrote: > > On 7/28/23 03:38, Zhang, Jesse(Jie) wrote: > >> > >> Could you try the patch again ? That work for me. > >> > >> https://patchwork.freedesktop.org/patch/549605/ > >>

[PATCH 1/4] drm/amdkfd: ignore crat by default

2023-07-28 Thread Alex Deucher
We are dropping the IOMMUv2 path, so no need to enable this. It's often buggy on consumer platforms anyway. Signed-off-by: Alex Deucher --- drivers/gpu/drm/amd/amdkfd/kfd_crat.c | 4 1 file changed, 4 deletions(-) diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_crat.c

[PATCH 4/4] drm/amdkfd: drop IOMMUv2 support

2023-07-28 Thread Alex Deucher
Now that we use the dGPU path for all APUs, drop the IOMMUv2 support. Signed-off-by: Alex Deucher --- drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.c| 10 - drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.h| 7 - drivers/gpu/drm/amd/amdgpu/amdgpu_device.c| 9 -

[PATCH 3/4] drm/amdkfd: disable IOMMUv2 support for Raven

2023-07-28 Thread Alex Deucher
Use the dGPU path instead. There were a lot of platform issues with IOMMU in general on these chips due to windows not enabling IOMMU at the time. The dGPU path has been used for a long time with newer APUs and works fine. This also paves the way to simplify the driver significantly.

[PATCH 2/4] drm/amdkfd: disable IOMMUv2 support for KV/CZ

2023-07-28 Thread Alex Deucher
Use the dGPU path instead. There were a lot of platform issues with IOMMU in general on these chips due to windows not enabling IOMMU at the time. The dGPU path has been used for a long time with newer APUs and works fine. This also paves the way to simplify the driver significantly.

[PATCH v4] drm/amd/pm: check whether smu is idle in sriov case

2023-07-28 Thread Danijel Slivka
Why: If the reg mmMP1_SMN_C2PMSG_90 is being programed to 0x0 before guest initialization, then modprobe amdgpu will fail at smu hw_init. (the default mmMP1_SMN_C2PMSG_90 at a clean guest environment is 0x1). How to fix: this patch is to check whether smu is idle by sending a test message to smu.

RE: [PATCH] drm/amdgpu: Report Missing MES Firmware Versions with Sysfs

2023-07-28 Thread Russell, Kent
[AMD Official Use Only - General] > -Original Message- > From: amd-gfx On Behalf Of Ori > Messinger > Sent: Friday, July 28, 2023 12:00 PM > To: amd-gfx@lists.freedesktop.org > Cc: Messinger, Ori > Subject: [PATCH] drm/amdgpu: Report Missing MES Firmware Versions with Sysfs > > Added

Re: [PATCH] drm/amdkfd: avoid unmap dma address when svm_ranges are split

2023-07-28 Thread Felix Kuehling
On 2023-07-27 19:43, Alex Sierra wrote: DMA address reference within svm_ranges should be unmapped only after the memory has been released from the system. In case of range splitting, the DMA address information should be copied to the corresponding range after this has split. But leaving dma

[PATCH] drm/amdgpu: Report Missing MES Firmware Versions with Sysfs

2023-07-28 Thread Ori Messinger
Added missing MES firmware versions to the 'fw_version' sysfs directory, they should now exist as a files named "mes_fw_version" and "mes_kiq_fw_version" found at: /sys/class/drm/cardX/device/fw_version/mes_fw_version /sys/class/drm/cardX/device/fw_version/mes_kiq_fw_version Where X is the card

[PATCH] drm/amdgpu: fix possible UAF in amdgpu_cs_pass1()

2023-07-28 Thread Alex Deucher
Since the gang_size check is outside of chunk parsing loop, we need to reset i before we free the chunk data. Signed-off-by: Alex Deucher --- drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c

Re: [PATCH] iommu/amd: fix the address translation issue when do detach

2023-07-28 Thread Vasant Hegde
On 7/27/2023 3:25 PM, Jesse Zhang wrote: > From: Jesse Zhang > > iGpu driver fail to read/write register by iommu when start X. > kernel: [ 433.296634] audit: type=1400 audit(1690403823.130:64): > apparmor="DENIED" operation="capable" class="cap" >

Re: [PATCH v3 0/5] drm/amdgpu: Add new reset option and rework coredump

2023-07-28 Thread André Almeida
Hi Christian, gently ping here Em 14/07/2023 13:11, André Almeida escreveu: Hi, The goal of this patchset is to improve debugging device resets on amdgpu. The first patch creates a new module parameter to disable soft recoveries, ensuring every recovery go through the full device reset,

[PATCH] drm/radeon: Prefer 'unsigned int' to bare use of 'unsigned'

2023-07-28 Thread 孙冉
WARNING: Prefer 'unsigned int' to bare use of 'unsigned' Signed-off-by: Ran Sun --- drivers/gpu/drm/radeon/radeon_object.h | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/gpu/drm/radeon/radeon_object.h b/drivers/gpu/drm/radeon/radeon_object.h index

[PATCH] drm/radeon: Prefer 'unsigned int' to bare use of 'unsigned'

2023-07-28 Thread 孙冉
WARNING: Prefer 'unsigned int' to bare use of 'unsigned' Signed-off-by: Ran Sun --- drivers/gpu/drm/radeon/radeon_object.h | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/gpu/drm/radeon/radeon_object.h b/drivers/gpu/drm/radeon/radeon_object.h index

Re: [PATCH 28/29] drm/amdkfd: Refactor migrate init to support partition switch

2023-07-28 Thread Michel Dänzer
On 7/28/23 11:30, Michel Dänzer wrote: > On 7/28/23 03:38, Zhang, Jesse(Jie) wrote: >> >> Could you try the patch again ?  That work for me. >> >> https://patchwork.freedesktop.org/patch/549605/ >> > > This patch fixes the symptoms described in

Re: [PATCH v2] drm/amd/display: Use root connector's colorspace property for MST

2023-07-28 Thread Michel Dänzer
On 7/14/23 18:52, Michel Dänzer wrote: > On 7/13/23 21:58, Harry Wentland wrote: >> After driver init we shouldn't create new properties. Doing so >> will lead to a warning storm from __drm_mode_object_add. >> >> We don't really need to create the property for MST connectors. >> Re-using the

RE: [PATCH] drm/amdpgu: Fix printk() should include KERN_ in 'amdgpu_atpx_verify_interface'

2023-07-28 Thread Chen, Guchun
[Public] Reviewed-by: Guchun Chen Regards, Guchun > -Original Message- > From: SHANMUGAM, SRINIVASAN > Sent: Friday, July 28, 2023 2:01 PM > To: Koenig, Christian ; Deucher, Alexander > ; Chen, Guchun > Cc: amd-gfx@lists.freedesktop.org; SHANMUGAM, SRINIVASAN > > Subject: [PATCH]

RE: [PATCH] drm/amdgpu: Fix printk_ratelimit() with DRM_ERROR_RATELIMITED in 'amdgpu_cs_ioctl'

2023-07-28 Thread Chen, Guchun
[Public] Reviewed-by: Guchun Chen Regards, Guchun > -Original Message- > From: SHANMUGAM, SRINIVASAN > Sent: Thursday, July 27, 2023 10:33 AM > To: Koenig, Christian ; Deucher, Alexander > ; Chen, Guchun > Cc: amd-gfx@lists.freedesktop.org; SHANMUGAM, SRINIVASAN > > Subject: [PATCH]

Re: [PATCH 28/29] drm/amdkfd: Refactor migrate init to support partition switch

2023-07-28 Thread Michel Dänzer
On 7/28/23 03:38, Zhang, Jesse(Jie) wrote: > > Could you try the patch again ?  That work for me. > > https://patchwork.freedesktop.org/patch/549605/ > This patch fixes the symptoms described in

Re: [PATCH v2] drm/amdgpu: refine amdgpu_bo_create_kernel_at()

2023-07-28 Thread Lang Yu
On 07/28/ , Christian König wrote: > Am 28.07.23 um 09:00 schrieb Lazar, Lijo: > > > > > > On 7/28/2023 11:34 AM, Lang Yu wrote: > > > Use amdgpu_bo_create_reserved() to create a BO in VRAM > > > domain would fail if requested VRAM size is large(>128MB) > > > on APU which usually has a default

Re: [PATCH v2] drm/amdgpu: refine amdgpu_bo_create_kernel_at()

2023-07-28 Thread Christian König
Am 28.07.23 um 09:00 schrieb Lazar, Lijo: On 7/28/2023 11:34 AM, Lang Yu wrote: Use amdgpu_bo_create_reserved() to create a BO in VRAM domain would fail if requested VRAM size is large(>128MB) on APU which usually has a default 512MB VRAM. That's because VRAM is framgented after several

[PATCH v3 2/4] drm/amdkfd: use vma_is_initial_stack() and vma_is_initial_heap()

2023-07-28 Thread Kefeng Wang
Use the helpers to simplify code. Cc: Felix Kuehling Cc: Alex Deucher Cc: "Christian König" Cc: "Pan, Xinhui" Cc: David Airlie Cc: Daniel Vetter Reviewed-by: David Hildenbrand Reviewed-by: Felix Kuehling Signed-off-by: Kefeng Wang --- drivers/gpu/drm/amd/amdkfd/kfd_svm.c | 5 + 1

[PATCH v3 4/4] perf/core: use vma_is_initial_stack() and vma_is_initial_heap()

2023-07-28 Thread Kefeng Wang
Use the helpers to simplify code, also kill unneeded goto cpy_name. Cc: Peter Zijlstra Cc: Arnaldo Carvalho de Melo Reviewed-by: David Hildenbrand Signed-off-by: Kefeng Wang --- kernel/events/core.c | 33 +++-- 1 file changed, 11 insertions(+), 22 deletions(-)

[PATCH v3 1/4] mm: factor out VMA stack and heap checks

2023-07-28 Thread Kefeng Wang
Factor out VMA stack and heap checks and name them vma_is_initial_stack() and vma_is_initial_heap() for general use. Cc: Christian Göttsche Cc: David Hildenbrand Reviewed-by: David Hildenbrand Signed-off-by: Kefeng Wang --- fs/proc/task_mmu.c | 24

[PATCH v3 0/4] mm: convert to vma_is_initial_heap/stack()

2023-07-28 Thread Kefeng Wang
Add vma_is_initial_stack() and vma_is_initial_heap() helper and use them to simplify code. v2: - add comment for heap helper and remove one more goto cpy_name, per David Hildenbrand - add RB v2: - address comments per David Hildenbrand and Christian Göttsche - fix selinux build Kefeng Wang

[PATCH v3 3/4] selinux: use vma_is_initial_stack() and vma_is_initial_heap()

2023-07-28 Thread Kefeng Wang
Use the helpers to simplify code. Cc: Paul Moore Cc: Stephen Smalley Cc: Eric Paris Acked-by: Paul Moore Reviewed-by: David Hildenbrand Signed-off-by: Kefeng Wang --- security/selinux/hooks.c | 7 ++- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git

Re: [PATCH v2] drm/amdgpu: refine amdgpu_bo_create_kernel_at()

2023-07-28 Thread Lazar, Lijo
On 7/28/2023 11:34 AM, Lang Yu wrote: Use amdgpu_bo_create_reserved() to create a BO in VRAM domain would fail if requested VRAM size is large(>128MB) on APU which usually has a default 512MB VRAM. That's because VRAM is framgented after several allocations. The approach is using

[PATCH 3/3] drm/amdgpu: Use nbio callback for nv and soc21

2023-07-28 Thread Lijo Lazar
Make the new ascis to follow nbio callback method to get pcie replay count. Signed-off-by: Lijo Lazar Reviewed-by: Hawking Zhang --- drivers/gpu/drm/amd/amdgpu/nv.c| 12 +--- drivers/gpu/drm/amd/amdgpu/soc21.c | 12 +--- 2 files changed, 2 insertions(+), 22 deletions(-)

[PATCH 2/3] drm/amdgpu: Add pci replay count to nbio v7.9

2023-07-28 Thread Lijo Lazar
Add implementation to get pcie replay count for nbio v7.9. Signed-off-by: Lijo Lazar Reviewed-by: Hawking Zhang --- drivers/gpu/drm/amd/amdgpu/nbio_v7_9.c | 20 drivers/gpu/drm/amd/amdgpu/soc15.c | 2 +- 2 files changed, 21 insertions(+), 1 deletion(-) diff --git

[PATCH 1/3] drm/amdgpu: Add pcie replay count callback to nbio

2023-07-28 Thread Lijo Lazar
Add a callback in nbio to get pcie replay count. Signed-off-by: Lijo Lazar Reviewed-by: Hawking Zhang --- drivers/gpu/drm/amd/amdgpu/amdgpu_nbio.c | 8 drivers/gpu/drm/amd/amdgpu/amdgpu_nbio.h | 3 +++ 2 files changed, 11 insertions(+) diff --git

[PATCH] drm/amdpgu: Cleanup amdgpu/amdgpu_cgs.c

2023-07-28 Thread Srinivasan Shanmugam
Fixes the below: ERROR: switch and case should be at the same indent WARNING: Prefer 'unsigned int' to bare use of 'unsigned' WARNING: Block comments use * on subsequent lines WARNING: Comparisons should place the constant on the right side of the test Cc: Christian König Cc: Alex Deucher

[PATCH v2] drm/amdgpu: refine amdgpu_bo_create_kernel_at()

2023-07-28 Thread Lang Yu
Use amdgpu_bo_create_reserved() to create a BO in VRAM domain would fail if requested VRAM size is large(>128MB) on APU which usually has a default 512MB VRAM. That's because VRAM is framgented after several allocations. The approach is using amdgpu_bo_create_reserved() to create a BO in CPU

[PATCH] drm/amdpgu: Fix printk() should include KERN_ in 'amdgpu_atpx_verify_interface'

2023-07-28 Thread Srinivasan Shanmugam
Prefer dev_err over printk variant so that we get better debug info when there are multiple GPUs in the system. Fixes the below: WARNING: printk() should include KERN_ facility level + printk("ATPX buffer is too small: %zu\n", size) Cc: Christian König Cc: Alex Deucher