Re: [PATCH] drm/amdgpu: remove unreachable code

2021-05-24 Thread Christian König
Am 24.05.21 um 12:46 schrieb Jiapeng Chong: In the function amdgpu_uvd_cs_msg(), every branch in the switch statement will have a return, so the code below the switch statement will not be executed. Eliminate the follow smatch warning: drivers/gpu/drm/amd/amdgpu/amdgpu_uvd.c:845 amdgpu_uvd_cs_m

[PATCH] drm/amdgpu: refine amdgpu_fru_get_product_info

2021-05-24 Thread Jiansong Chen
1. eliminate potential array index out of bounds. 2. return meaningful value for failure. Signed-off-by: Jiansong Chen Change-Id: I9be36eb2e42ee46cd00464b0f2c35a4e4ea213e3 --- .../gpu/drm/amd/amdgpu/amdgpu_fru_eeprom.c| 42 ++- 1 file changed, 23 insertions(+), 19 deletions(-

RE: [PATCH] drm/amdgpu: refine amdgpu_fru_get_product_info

2021-05-24 Thread Chen, Jiansong (Simon)
[AMD Official Use Only] Please ignore the patch, will resend after removing multiple assignments. -Original Message- From: Jiansong Chen Sent: Tuesday, May 25, 2021 2:17 PM To: amd-gfx@lists.freedesktop.org Cc: Chen, Jiansong (Simon) Subject: [PATCH] drm/amdgpu: refine amdgpu_fru_get_pr

[PATCH] drm/amdgpu: refine amdgpu_fru_get_product_info

2021-05-24 Thread Jiansong Chen
1. eliminate potential array index out of bounds. 2. return meaningful value for failure. Signed-off-by: Jiansong Chen Change-Id: I9be36eb2e42ee46cd00464b0f2c35a4e4ea213e3 --- .../gpu/drm/amd/amdgpu/amdgpu_fru_eeprom.c| 69 ++- 1 file changed, 35 insertions(+), 34 deletions(-

[PATCH] drm/amdgpu: add judgement for dc support

2021-05-24 Thread Asher Song
Drop DC initialization when DCN is harvested in VBIOS. The way doesn't affect virtual display ip initialization. Signed-off-by: Likun Gao Signed-off-by: Asher Song --- drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/

[PATCH] drm/amd/pm: bypass the internal power limit cache for Aldebaran

2021-05-24 Thread Evan Quan
As out-of-band interface may be used to update the power limits. Thus to make sure the power limit of our driver always reflects the correct value, the internal cache must be bypassed. Change-Id: I63450ab75ec6ceb7f345bd3704295a28db23b881 Signed-off-by: Evan Quan --- drivers/gpu/drm/amd/pm/inc/am

Regression: bisected: AMDGPU causes Kernel Bad page state OOPS starting with kernels 5.11.x, 5.12.x, 5.13-rc

2021-05-24 Thread Luís Mendes
Hi, AMDGPU was working fine on my armhf systems with 5.10.x and previous kernels and a RX550 card. Unfortunately I have only now tested kernels 5.11.x, 5.12.x and 5.13-rc and all are now showing problems like this one: May 10 20:23:14 picolo kernel: [ 18.967626] BUG: Bad page state in process gn

Re: [PATCH] drm/amdgpu: fix typo

2021-05-24 Thread Alex Deucher
Applied. Thanks! Alex On Mon, May 24, 2021 at 3:45 AM wrote: > > From: "tony.huang_cp" > > change 'interupt' to 'interrupt' > > Signed-off-by: tony.huang_cp > --- > drivers/gpu/drm/amd/amdgpu/uvd_v3_1.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/drivers/gpu/

Re: [PATCH] drm/amdgpu: remove unreachable code

2021-05-24 Thread Alex Deucher
Applied. Thanks! Alex On Mon, May 24, 2021 at 6:47 AM Jiapeng Chong wrote: > > In the function amdgpu_uvd_cs_msg(), every branch in the switch > statement will have a return, so the code below the switch statement > will not be executed. > > Eliminate the follow smatch warning: > > drivers/gpu/

Re: [PATCH -next] drm/amdgpu: fix error return code in amdgpu_acpi_init()

2021-05-24 Thread Alex Deucher
On Mon, May 24, 2021 at 9:25 AM Wei Yongjun wrote: > > Fix to return a negative error code from the error handling > case instead of 0, as done elsewhere in this function. I don't see any other cases in this function where we return an error. It could arguably be made a void. All of these APCI m

[PATCH AUTOSEL 4.4 16/16] drm/amdgpu: Fix a use-after-free

2021-05-24 Thread Sasha Levin
From: xinhui pan [ Upstream commit 1e5c37385097c35911b0f8a0c67ffd10ee1af9a2 ] looks like we forget to set ttm->sg to NULL. Hit panic below [ 1235.844104] general protection fault, probably for non-canonical address 0x6b6b6b6b6b6b7b4b: [#1] SMP DEBUG_PAGEALLOC NOPTI [ 1235.989074] Call Tra

[PATCH AUTOSEL 4.9 19/19] drm/amdgpu: Fix a use-after-free

2021-05-24 Thread Sasha Levin
From: xinhui pan [ Upstream commit 1e5c37385097c35911b0f8a0c67ffd10ee1af9a2 ] looks like we forget to set ttm->sg to NULL. Hit panic below [ 1235.844104] general protection fault, probably for non-canonical address 0x6b6b6b6b6b6b7b4b: [#1] SMP DEBUG_PAGEALLOC NOPTI [ 1235.989074] Call Tra

[PATCH AUTOSEL 4.14 21/21] drm/amdgpu: Fix a use-after-free

2021-05-24 Thread Sasha Levin
From: xinhui pan [ Upstream commit 1e5c37385097c35911b0f8a0c67ffd10ee1af9a2 ] looks like we forget to set ttm->sg to NULL. Hit panic below [ 1235.844104] general protection fault, probably for non-canonical address 0x6b6b6b6b6b6b7b4b: [#1] SMP DEBUG_PAGEALLOC NOPTI [ 1235.989074] Call Tra

[PATCH AUTOSEL 4.19 23/25] drm/amd/display: Disconnect non-DP with no EDID

2021-05-24 Thread Sasha Levin
From: Chris Park [ Upstream commit 080039273b126eeb0185a61c045893a25dbc046e ] [Why] Active DP dongles return no EDID when dongle is connected, but VGA display is taken out. Current driver behavior does not remove the active display when this happens, and this is a gap between dongle DTP and dong

[PATCH AUTOSEL 4.19 24/25] drm/amd/amdgpu: fix refcount leak

2021-05-24 Thread Sasha Levin
From: Jingwen Chen [ Upstream commit fa7e6abc75f3d491bc561734312d065dc9dc2a77 ] [Why] the gem object rfb->base.obj[0] is get according to num_planes in amdgpufb_create, but is not put according to num_planes [How] put rfb->base.obj[0] in amdgpu_fbdev_destroy according to num_planes Signed-off-

[PATCH AUTOSEL 4.19 25/25] drm/amdgpu: Fix a use-after-free

2021-05-24 Thread Sasha Levin
From: xinhui pan [ Upstream commit 1e5c37385097c35911b0f8a0c67ffd10ee1af9a2 ] looks like we forget to set ttm->sg to NULL. Hit panic below [ 1235.844104] general protection fault, probably for non-canonical address 0x6b6b6b6b6b6b7b4b: [#1] SMP DEBUG_PAGEALLOC NOPTI [ 1235.989074] Call Tra

[PATCH AUTOSEL 5.4 51/52] drm/amdgpu: Fix a use-after-free

2021-05-24 Thread Sasha Levin
From: xinhui pan [ Upstream commit 1e5c37385097c35911b0f8a0c67ffd10ee1af9a2 ] looks like we forget to set ttm->sg to NULL. Hit panic below [ 1235.844104] general protection fault, probably for non-canonical address 0x6b6b6b6b6b6b7b4b: [#1] SMP DEBUG_PAGEALLOC NOPTI [ 1235.989074] Call Tra

[PATCH AUTOSEL 5.4 50/52] drm/amd/amdgpu: fix refcount leak

2021-05-24 Thread Sasha Levin
From: Jingwen Chen [ Upstream commit fa7e6abc75f3d491bc561734312d065dc9dc2a77 ] [Why] the gem object rfb->base.obj[0] is get according to num_planes in amdgpufb_create, but is not put according to num_planes [How] put rfb->base.obj[0] in amdgpu_fbdev_destroy according to num_planes Signed-off-

[PATCH AUTOSEL 5.4 52/52] drm/amd/amdgpu: fix a potential deadlock in gpu reset

2021-05-24 Thread Sasha Levin
From: Lang Yu [ Upstream commit 9c2876d56f1ce9b6b2072f1446fb1e8d1532cb3d ] When amdgpu_ib_ring_tests failed, the reset logic called amdgpu_device_ip_suspend twice, then deadlock occurred. Deadlock log: [ 805.655192] amdgpu :04:00.0: amdgpu: ib ring test failed (-110). [ 806.290952] [drm]

[PATCH AUTOSEL 5.4 49/52] drm/amd/display: Disconnect non-DP with no EDID

2021-05-24 Thread Sasha Levin
From: Chris Park [ Upstream commit 080039273b126eeb0185a61c045893a25dbc046e ] [Why] Active DP dongles return no EDID when dongle is connected, but VGA display is taken out. Current driver behavior does not remove the active display when this happens, and this is a gap between dongle DTP and dong

[PATCH AUTOSEL 5.10 58/62] drm/amd/amdgpu: fix a potential deadlock in gpu reset

2021-05-24 Thread Sasha Levin
From: Lang Yu [ Upstream commit 9c2876d56f1ce9b6b2072f1446fb1e8d1532cb3d ] When amdgpu_ib_ring_tests failed, the reset logic called amdgpu_device_ip_suspend twice, then deadlock occurred. Deadlock log: [ 805.655192] amdgpu :04:00.0: amdgpu: ib ring test failed (-110). [ 806.290952] [drm]

[PATCH AUTOSEL 5.10 59/62] drm/amdgpu: stop touching sched.ready in the backend

2021-05-24 Thread Sasha Levin
From: Christian König [ Upstream commit a2b4785f01280a4291edb9fda69032fc2e4bfd3f ] This unfortunately comes up in regular intervals and breaks GPU reset for the engine in question. The sched.ready flag controls if an engine can't get working during hw_init, but should never be set to false duri

[PATCH AUTOSEL 5.10 57/62] drm/amdgpu: Fix a use-after-free

2021-05-24 Thread Sasha Levin
From: xinhui pan [ Upstream commit 1e5c37385097c35911b0f8a0c67ffd10ee1af9a2 ] looks like we forget to set ttm->sg to NULL. Hit panic below [ 1235.844104] general protection fault, probably for non-canonical address 0x6b6b6b6b6b6b7b4b: [#1] SMP DEBUG_PAGEALLOC NOPTI [ 1235.989074] Call Tra

[PATCH AUTOSEL 5.10 56/62] drm/amd/amdgpu: fix refcount leak

2021-05-24 Thread Sasha Levin
From: Jingwen Chen [ Upstream commit fa7e6abc75f3d491bc561734312d065dc9dc2a77 ] [Why] the gem object rfb->base.obj[0] is get according to num_planes in amdgpufb_create, but is not put according to num_planes [How] put rfb->base.obj[0] in amdgpu_fbdev_destroy according to num_planes Signed-off-

[PATCH AUTOSEL 5.10 55/62] drm/amd/display: Disconnect non-DP with no EDID

2021-05-24 Thread Sasha Levin
From: Chris Park [ Upstream commit 080039273b126eeb0185a61c045893a25dbc046e ] [Why] Active DP dongles return no EDID when dongle is connected, but VGA display is taken out. Current driver behavior does not remove the active display when this happens, and this is a gap between dongle DTP and dong

[PATCH AUTOSEL 5.12 60/63] drm/amdgpu: stop touching sched.ready in the backend

2021-05-24 Thread Sasha Levin
From: Christian König [ Upstream commit a2b4785f01280a4291edb9fda69032fc2e4bfd3f ] This unfortunately comes up in regular intervals and breaks GPU reset for the engine in question. The sched.ready flag controls if an engine can't get working during hw_init, but should never be set to false duri

[PATCH AUTOSEL 5.12 59/63] drm/amd/amdgpu: fix a potential deadlock in gpu reset

2021-05-24 Thread Sasha Levin
From: Lang Yu [ Upstream commit 9c2876d56f1ce9b6b2072f1446fb1e8d1532cb3d ] When amdgpu_ib_ring_tests failed, the reset logic called amdgpu_device_ip_suspend twice, then deadlock occurred. Deadlock log: [ 805.655192] amdgpu :04:00.0: amdgpu: ib ring test failed (-110). [ 806.290952] [drm]

[PATCH AUTOSEL 5.12 58/63] drm/amdgpu: Fix a use-after-free

2021-05-24 Thread Sasha Levin
From: xinhui pan [ Upstream commit 1e5c37385097c35911b0f8a0c67ffd10ee1af9a2 ] looks like we forget to set ttm->sg to NULL. Hit panic below [ 1235.844104] general protection fault, probably for non-canonical address 0x6b6b6b6b6b6b7b4b: [#1] SMP DEBUG_PAGEALLOC NOPTI [ 1235.989074] Call Tra

[PATCH AUTOSEL 5.12 57/63] drm/amd/amdgpu: fix refcount leak

2021-05-24 Thread Sasha Levin
From: Jingwen Chen [ Upstream commit fa7e6abc75f3d491bc561734312d065dc9dc2a77 ] [Why] the gem object rfb->base.obj[0] is get according to num_planes in amdgpufb_create, but is not put according to num_planes [How] put rfb->base.obj[0] in amdgpu_fbdev_destroy according to num_planes Signed-off-

[PATCH AUTOSEL 5.12 56/63] drm/amd/display: Disconnect non-DP with no EDID

2021-05-24 Thread Sasha Levin
From: Chris Park [ Upstream commit 080039273b126eeb0185a61c045893a25dbc046e ] [Why] Active DP dongles return no EDID when dongle is connected, but VGA display is taken out. Current driver behavior does not remove the active display when this happens, and this is a gap between dongle DTP and dong

[PATCH -next] drm/amdgpu: fix error return code in amdgpu_acpi_init()

2021-05-24 Thread Wei Yongjun
Fix to return a negative error code from the error handling case instead of 0, as done elsewhere in this function. Fixes: 77bf762f8b30 ("drm/amdgpu/acpi: unify ATCS handling (v3)") Reported-by: Hulk Robot Signed-off-by: Wei Yongjun --- drivers/gpu/drm/amd/amdgpu/amdgpu_acpi.c | 5 - 1 file

[PATCH] drm/amdgpu: remove unreachable code

2021-05-24 Thread Jiapeng Chong
In the function amdgpu_uvd_cs_msg(), every branch in the switch statement will have a return, so the code below the switch statement will not be executed. Eliminate the follow smatch warning: drivers/gpu/drm/amd/amdgpu/amdgpu_uvd.c:845 amdgpu_uvd_cs_msg() warn: ignoring unreachable code. Reporte

[PATCH] drm/amdgpu: fix metadata_size for ubo ioctl queries

2021-05-24 Thread Shiwu Zhang
Although the kfd_ioctl_get_dmabuf_info() still fail it will indicate the caller right metadat_size useful for the same kfd ioctl next time. v2: free the metadata buffer for sg type when to destroy BOs. Signed-off-by: Shiwu Zhang --- drivers/gpu/drm/amd/amdgpu/amdgpu_object.c | 7 --- 1 file

[PATCH] drm/amdgpu: fix typo

2021-05-24 Thread nswdhpyhwt
From: "tony.huang_cp" change 'interupt' to 'interrupt' Signed-off-by: tony.huang_cp --- drivers/gpu/drm/amd/amdgpu/uvd_v3_1.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/amd/amdgpu/uvd_v3_1.c b/drivers/gpu/drm/amd/amdgpu/uvd_v3_1.c index 284447d..6c