Re: [PATCH v2 3/6] drm/amdxcp: introduce new API amdgpu_xcp_drm_dev_free()

2025-01-05 Thread Lazar, Lijo
On 1/5/2025 8:15 AM, Jiang Liu wrote: > Introduce new interface amdgpu_xcp_drm_dev_free() to free a specific > drm_device crreated by amdgpu_xcp_drm_dev_alloc(), which will be used > to do error recovery. > > Signed-off-by: Jiang Liu > --- > drivers/gpu/drm/amd/amdgpu/amdgpu_xcp.c | 11 ++

RE: [PATCH] drm/amdkfd: Fix partial migrate issue

2025-01-05 Thread Deng, Emily
[AMD Official Use Only - AMD Internal Distribution Only] >-Original Message- >From: Kuehling, Felix >Sent: Saturday, January 4, 2025 7:10 AM >To: Deng, Emily ; amd-gfx@lists.freedesktop.org >Subject: Re: [PATCH] drm/amdkfd: Fix partial migrate issue > > >On 2025-01-02 19:06, Emily Deng wr

RE: [PATCH v2] drm/amdgpu: Fix the looply call svm_range_restore_pages issue

2025-01-05 Thread Deng, Emily
[AMD Official Use Only - AMD Internal Distribution Only] >-Original Message- >From: Kuehling, Felix >Sent: Saturday, January 4, 2025 7:18 AM >To: Deng, Emily ; amd-gfx@lists.freedesktop.org; Yang, >Philip ; Koenig, Christian >Subject: Re: [PATCH v2] drm/amdgpu: Fix the looply call svm_ra

Re: [PATCH v2 0/5] drm/connector: make mode_valid() callback accept const mode pointer

2025-01-05 Thread Laurent Pinchart
On Mon, Jan 06, 2025 at 12:47:07AM +0200, Dmitry Baryshkov wrote: > On Sat, Dec 14, 2024 at 03:37:04PM +0200, Dmitry Baryshkov wrote: > > While working on the generic mode_valid() implementation for the HDMI > > Connector framework I noticed that unlike other DRM objects > > drm_connector accepts n

Re: [PATCH] drm/amd/display: add CEC notifier to amdgpu driver

2025-01-05 Thread Mario Limonciello
On 12/30/2024 02:15, Kun Liu wrote: This patch adds the cec_notifier feature to amdgpu driver. The changes will allow amdgpu driver code to notify EDID and HPD changes to an eventual CEC adapter. Signed-off-by: Kun Liu --- drivers/gpu/drm/amd/display/Kconfig | 2 + .../gpu/drm/amd

Re: amdgpu 4k@120Hz / HDMI 2.1

2025-01-05 Thread Mario Limonciello
On 12/31/2024 06:42, Mischa Baars wrote: Hi Mario, Although unconfirmed by their website, the rumour goes that the HDMI Forum will release a 2.2 specification somewhere in Januari. Do you think that an open source 2.1 implementation will be allowed soon after? When new specifications are made

[PATCH 1/2] drm/amdgpu: fix incorrect active RB bitmap in setup RBs

2025-01-05 Thread Tim Huang
The RB bitmap width per SA may be 0x1 for some ASICs. Use the actual bitmap of SA instead of 0x3 to determine the active RB bitmap. Signed-off-by: Tim Huang --- drivers/gpu/drm/amd/amdgpu/gfx_v11_0.c | 5 - 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/amd/amdg

[PATCH 2/2] drm/amdgpu/gfx12: implement kgq reset via mmio

2025-01-05 Thread jesse.zh...@amd.com
replace MES kgq reset with MMIO. Signed-off-by: Jesse Zhang --- drivers/gpu/drm/amd/amdgpu/gfx_v12_0.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/amd/amdgpu/gfx_v12_0.c b/drivers/gpu/drm/amd/amdgpu/gfx_v12_0.c index 69941442f00b..ba2ab9296eb4 100644

[PATCH 1/2] drm/amdgpu: enable gfx12 queue reset flag

2025-01-05 Thread jesse.zh...@amd.com
Enable the kcg and kcq queue reset flag Signed-off-by: Jesse Zhang --- drivers/gpu/drm/amd/amdgpu/gfx_v12_0.c | 10 +- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/amd/amdgpu/gfx_v12_0.c b/drivers/gpu/drm/amd/amdgpu/gfx_v12_0.c index 3aa34c4d..6994144

RE: [PATCH 1/2] drm/amdgpu: enable gfx12 queue reset flag

2025-01-05 Thread Huang, Tim
[Public] Hi Jesse, > -Original Message- > From: jesse.zh...@amd.com > Sent: Monday, January 6, 2025 3:17 PM > To: amd-gfx@lists.freedesktop.org > Cc: Deucher, Alexander ; Koenig, Christian > ; Huang, Tim ; Zhu, > Jiadong ; Zhang, Jesse(Jie) > Subject: [PATCH 1/2] drm/amdgpu: enable gfx1

[PATCH 2/2] drm/amdgpu: fix incorrect number of active RBs for gfx12

2025-01-05 Thread Tim Huang
The RB bitmap should be global active RB bitmap & active RB bitmap based on active SA. Signed-off-by: Tim Huang --- drivers/gpu/drm/amd/amdgpu/gfx_v12_0.c | 7 +-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/amd/amdgpu/gfx_v12_0.c b/drivers/gpu/drm/amd/amdg

Re: [PATCH v2 0/5] drm/connector: make mode_valid() callback accept const mode pointer

2025-01-05 Thread Dmitry Baryshkov
On Sat, Dec 14, 2024 at 03:37:04PM +0200, Dmitry Baryshkov wrote: > While working on the generic mode_valid() implementation for the HDMI > Connector framework I noticed that unlike other DRM objects > drm_connector accepts non-const pointer to struct drm_display_mode, > while obviously mode_valid(

Re: [PATCH v2 1/6] amdgpu: fix possible resource leakage in kfd_cleanup_nodes()

2025-01-05 Thread Gerry Liu
> 2025年1月5日 13:22,Shuo Liu 写道: > > Hi Gerry, > > On Sun 5.Jan'25 at 10:45:29 +0800, Jiang Liu wrote: >> Fix possible resource leakage on error recovery path in function >> kgd2kfd_device_init(). >> >> Signed-off-by: Jiang Liu >> --- >> drivers/gpu/drm/amd/amdkfd/kfd_device.c | 9 + >

[PATCH v2 2/6] amdgpu: clear adev->in_suspend flag when fails to suspend

2025-01-05 Thread Jiang Liu
Clear adev->in_suspend flag when fails to suspend, otherwise it will cause too much warnings like: [ 1802.212027] [ cut here ] [ 1802.212028] WARNING: CPU: 97 PID: 11282 at drivers/gpu/drm/amd/amdgpu/amdgpu_object.c:452 amdgpu_bo_free_kernel+0xf9/0x120 [amdgpu] [ 1802.2121

[PATCH v2 3/6] drm/amdxcp: introduce new API amdgpu_xcp_drm_dev_free()

2025-01-05 Thread Jiang Liu
Introduce new interface amdgpu_xcp_drm_dev_free() to free a specific drm_device crreated by amdgpu_xcp_drm_dev_alloc(), which will be used to do error recovery. Signed-off-by: Jiang Liu --- drivers/gpu/drm/amd/amdgpu/amdgpu_xcp.c | 11 +++- drivers/gpu/drm/amd/amdgpu/amdgpu_xcp.h | 1 +

[PATCH v2 4/6] amdgpu: fix use after free bug related to amdgpu_driver_release_kms()

2025-01-05 Thread Jiang Liu
If some GPU device failed to probe, `rmmod amdgpu` will trigger a use after free bug related to amdgpu_driver_release_kms() as: 2024-12-26 16:17:45 [16002.085540] BUG: kernel NULL pointer dereference, address: 2024-12-26 16:17:45 [16002.093792] #PF: supervisor read access in kerne

Re: [PATCH v2 4/6] amdgpu: fix use after free bug related to amdgpu_driver_release_kms()

2025-01-05 Thread Shuo Liu
On Sun 5.Jan'25 at 10:45:32 +0800, Jiang Liu wrote: If some GPU device failed to probe, `rmmod amdgpu` will trigger a use after free bug related to amdgpu_driver_release_kms() as: 2024-12-26 16:17:45 [16002.085540] BUG: kernel NULL pointer dereference, address: 2024-12-26 16:17

Re: [PATCH v2 1/6] amdgpu: fix possible resource leakage in kfd_cleanup_nodes()

2025-01-05 Thread Shuo Liu
Hi Gerry, On Sun 5.Jan'25 at 10:45:29 +0800, Jiang Liu wrote: Fix possible resource leakage on error recovery path in function kgd2kfd_device_init(). Signed-off-by: Jiang Liu --- drivers/gpu/drm/amd/amdkfd/kfd_device.c | 9 + 1 file changed, 5 insertions(+), 4 deletions(-) diff --git

[PATCH v2 6/6] amdgpu: get rid of false warnings caused by amdgpu_irq_put()

2025-01-05 Thread Jiang Liu
If error happens before amdgpu_fence_driver_hw_init() gets called during device probe, it will trigger a false warning in amdgpu_irq_put() as below: [ 1209.300996] [ cut here ] [ 1209.301061] WARNING: CPU: 48 PID: 293 at /tmp/amd.Rc9jFrl7/amd/amdgpu/amdgpu_irq.c:633 amdgpu_

[PATCH v2 5/6] amdgpu: fix invalid memory access in amdgpu_fence_driver_sw_fini()

2025-01-05 Thread Jiang Liu
Function detects initialization status by checking sched->ops, so set sched->ops to non-NULL just before return in function drm_sched_init() to avoid possible invalid memory access on error recover path. Signed-off-by: Jiang Liu --- drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 1 + drivers/gpu/d

[PATCH v2 1/6] amdgpu: fix possible resource leakage in kfd_cleanup_nodes()

2025-01-05 Thread Jiang Liu
Fix possible resource leakage on error recovery path in function kgd2kfd_device_init(). Signed-off-by: Jiang Liu --- drivers/gpu/drm/amd/amdkfd/kfd_device.c | 9 + 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_device.c b/drivers/gpu/drm/amd

[PATCH v2 0/6] Fix several bugs in error handling during device probe

2025-01-05 Thread Jiang Liu
This patchset tries to fix several memory leakages/invalid memory accesses on error handling path during GPU driver loading/unloading. They applies to: https://gitlab.freedesktop.org/agd5f/linux.git amd-staging-drm-next v2: 1) rebased to https://gitlab.freedesktop.org/agd5f/linux.git branch amd