RE: [PATCH 1/2] drm/amdgpu: The call to amdgpu_xgmi_remove_device needs to be earlier than psp_hw_fini

2022-08-15 Thread Chai, Thomas
[AMD Official Use Only - General] OK, I will update the patch. From: Zhang, Hawking Sent: Tuesday, August 16, 2022 11:51 AM To: Chai, Thomas ; amd-gfx@lists.freedesktop.org Cc: Wang, Yang(Kevin) Subject: Re: [PATCH 1/2] drm/amdgpu: The call to amdgpu_xgmi_remove_device needs to be earlier than

Re: [PATCH v6 1/6] drm/ttm: Add new callbacks to ttm res mgr

2022-08-15 Thread Arunpravin Paneer Selvam
On 8/15/2022 4:35 PM, Christian König wrote: Am 12.08.22 um 15:30 schrieb Arunpravin Paneer Selvam: We are adding two new callbacks to ttm resource manager function to handle intersection and compatibility of placement and resources. v2: move the amdgpu and ttm_range_manager changes to

Re: [PATCH 1/2] drm/amdgpu: The call to amdgpu_xgmi_remove_device needs to be earlier than psp_hw_fini

2022-08-15 Thread Zhang, Hawking
Fixed typo Regards, Hawking From: Zhang, Hawking Date: Tuesday, August 16, 2022 at 11:49 To: Chai, Thomas , amd-gfx@lists.freedesktop.org Cc: Wang, Yang(Kevin) Subject: RE: [PATCH 1/2] drm/amdgpu: The call to amdgpu_xgmi_remove_device needs to be earlier than psp_hw_fini [AMD Official Use On

RE: [PATCH 1/2] drm/amdgpu: The call to amdgpu_xgmi_remove_device needs to be earlier than psp_hw_fini

2022-08-15 Thread Zhang, Hawking
[AMD Official Use Only - General] Alternatively, we might be better split xgmi ta terminate from xgmi_remove_device. In psp_hw_fini, check ta->fw and num_of_physical_mode to terminate xgmi ta. and make amdgpu_xgmi_remove_device only deal with software fini, like add_device. Regards, Hawking -

Re: [PATCH linux-next] drm/amdgpu/vcn: Return void from the stop_dbg_mode

2022-08-15 Thread Alex Deucher
Applied. Thanks! Alex On Mon, Aug 15, 2022 at 2:40 PM Dong, Ruijing wrote: > > [AMD Official Use Only - General] > > This patch is > > Reviewed-by: Ruijing Dong > > Thanks, > Ruijing > > -Original Message- > From: Khalid Masum > Sent: Monday, August 15, 2022 2:34 PM > To: Dong, Ruijin

Re: [PATCH v3 4/4] drm/amdgpu: Document gfx_off members of struct amdgpu_gfx

2022-08-15 Thread Alex Deucher
Applied the series. Thanks! Alex On Wed, Aug 10, 2022 at 7:30 PM André Almeida wrote: > > Add comments to document gfx_off related members of struct amdgpu_gfx. > > Signed-off-by: André Almeida > --- > drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.h | 12 ++-- > 1 file changed, 6 insertions(+

Re: [PATCH 2/2] drm/amd/display: fix minor codestyle problems

2022-08-15 Thread Alex Deucher
Applied the series. Thanks! Alex On Thu, Aug 11, 2022 at 4:44 PM Tales Aparecida wrote: > > Fixes five checkpatch warnings: > > CHECK: Please don't use multiple blank lines > + > + > > ERROR: Macros with complex values should be enclosed in parentheses > +#define MAX_I64 \ > + (int64_t)((

Re: [PATCH] drm/amd/display: Fix comment typo

2022-08-15 Thread Alex Deucher
Applied. Thanks! On Sat, Aug 13, 2022 at 11:13 AM min tang wrote: > > The double `aligned' is duplicated in line 1070, remove one. > > Signed-off-by: min tang > --- > drivers/gpu/drm/amd/display/dc/dcn10/dcn10_optc.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/driv

[PATCHv2] drm/amdgpu: Fix interrupt handling on ih_soft ring

2022-08-15 Thread Mukul Joshi
There are no backing hardware registers for ih_soft ring. As a result, don't try to access hardware registers for read and write pointers when processing interrupts on the IH soft ring. Signed-off-by: Mukul Joshi --- drivers/gpu/drm/amd/amdgpu/navi10_ih.c | 7 ++- drivers/gpu/drm/amd/amdgpu/

Re: [PATCH] drm/amdgpu: Add decode_iv_ts helper for ih_v6 block

2022-08-15 Thread Alex Deucher
On Mon, Aug 15, 2022 at 2:18 PM Harish Kasiviswanathan wrote: > > Signed-off-by: Harish Kasiviswanathan > Reviewed-by: Hawking Zhang Please add a basic commit message. With that: Reviewed-by: Alex Deucher > --- > drivers/gpu/drm/amd/amdgpu/ih_v6_0.c | 1 + > 1 file changed, 1 insertion(+) >

Re: [PATCH linux-next] drm/amdgpu/vcn: Remove unused assignment in vcn_v4_0_stop

2022-08-15 Thread Khalid Masum
On 8/15/22 22:00, Dong, Ruijing wrote: [AMD Official Use Only - General] Then please update commit message, this change is due to "value r is never used, and remove unnecessary assignment", that makes sense to me. Thanks Ruijing Greg also pointed out that the function vcn_v4_0_stop_dpg_mode s

Re: Build regressions/improvements in v6.0-rc1

2022-08-15 Thread Geert Uytterhoeven
On Mon, 15 Aug 2022, Geert Uytterhoeven wrote: Below is the list of build error/warning regressions/improvements in v6.0-rc1[1] compared to v5.19[2]. Summarized: - build errors: +26/-15 + /kisskb/src/arch/parisc/kernel/vdso32/restart_syscall.S: Error: .cfi_endproc without corresponding .cf

[PATCH linux-next] drm/amdgpu/vcn: Return void from the stop_dbg_mode

2022-08-15 Thread Khalid Masum
There is no point in returning an int here. It only returns 0 which the caller never uses. Therefore return void and remove the unnecessary assignment. Addresses-Coverity: 1504988 ("Unused value") Fixes: 8da1170a16e4 ("drm/amdgpu: add VCN4 ip block support") Suggested-by: Ruijing Dong Suggested-

Re: [PATCH linux-next] drm/amdgpu/vcn: Remove unused assignment in vcn_v4_0_stop

2022-08-15 Thread Greg KH
On Mon, Aug 15, 2022 at 09:11:18PM +0600, Khalid Masum wrote: > On 8/15/22 20:15, Dong, Ruijing wrote: > > [AMD Official Use Only - General] > > > > Sorry, which "r" value was overwritten? I didn't see the point of making > > this change. > > > > Thanks > > Ruijing > > > > -Original Messag

Re: [PATCH linux-next] drm/amdgpu/vcn: Remove unused assignment in vcn_v4_0_stop

2022-08-15 Thread Khalid Masum
On 8/15/22 22:12, Greg KH wrote: On Mon, Aug 15, 2022 at 09:11:18PM +0600, Khalid Masum wrote: On 8/15/22 20:15, Dong, Ruijing wrote: [AMD Official Use Only - General] Sorry, which "r" value was overwritten? I didn't see the point of making this change. Thanks Ruijing -Original Message

Re: [PATCH linux-next] drm/amdgpu/vcn: Remove unused assignment in vcn_v4_0_stop

2022-08-15 Thread Khalid Masum
On 8/15/22 21:17, Dong, Ruijing wrote: [AMD Official Use Only - General] If the condition was met and it came to execute vcn_4_0_stop_dpg_mode, then it would never have a chance to go for /*wait for vcn idle*/, isn't it? Hypothetically, some other thread might set adev->pg_flags NULL and in

RE: [PATCH linux-next] drm/amdgpu/vcn: Return void from the stop_dbg_mode

2022-08-15 Thread Dong, Ruijing
[AMD Official Use Only - General] This patch is Reviewed-by: Ruijing Dong Thanks, Ruijing -Original Message- From: Khalid Masum Sent: Monday, August 15, 2022 2:34 PM To: Dong, Ruijing ; amd-gfx@lists.freedesktop.org; dri-de...@lists.freedesktop.org; linux-ker...@vger.kernel.org Cc: D

[PATCH] drm/amdgpu: Add decode_iv_ts helper for ih_v6 block

2022-08-15 Thread Harish Kasiviswanathan
Signed-off-by: Harish Kasiviswanathan Reviewed-by: Hawking Zhang --- drivers/gpu/drm/amd/amdgpu/ih_v6_0.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/gpu/drm/amd/amdgpu/ih_v6_0.c b/drivers/gpu/drm/amd/amdgpu/ih_v6_0.c index 92dc60a9d209..085e613f3646 100644 --- a/drivers/gpu/drm

Re: [PATCH] drm/amdgpu: Fix interrupt handling on ih_soft ring

2022-08-15 Thread Christian König
Am 15.08.22 um 17:16 schrieb Felix Kuehling: Am 2022-08-14 um 13:27 schrieb Christian König: Am 12.08.22 um 22:56 schrieb Mukul Joshi: There are no backing hardware registers for ih_soft ring. As a result, don't try to access hardware registers for read and write pointers when processing interr

RE: [PATCH linux-next] drm/amdgpu/vcn: Remove unused assignment in vcn_v4_0_stop

2022-08-15 Thread Dong, Ruijing
[AMD Official Use Only - General] Then please update commit message, this change is due to "value r is never used, and remove unnecessary assignment", that makes sense to me. Thanks Ruijing -Original Message- From: Khalid Masum Sent: Monday, August 15, 2022 11:54 AM To: Dong, Ruijing ;

[PATCH] drm/amdgpu: Handle potential NULL pointer dereference

2022-08-15 Thread Kent Russell
If m is NULL, we will end up referencing a NULL pointer in the subsequent m elements like extcpu, bank and status. Pull the NULL check out and do it first before referencing m's elements. Signed-off-by: Kent Russell --- drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c | 5 - 1 file changed, 4 inserti

RE: [PATCH linux-next] drm/amdgpu/vcn: Remove unused assignment in vcn_v4_0_stop

2022-08-15 Thread Dong, Ruijing
[AMD Official Use Only - General] If the condition was met and it came to execute vcn_4_0_stop_dpg_mode, then it would never have a chance to go for /*wait for vcn idle*/, isn't it? I still didn't see obvious purpose of this change. if (adev->pg_flags & AMD_PG_SUPPORT_VCN_DPG) {

Re: [PATCH] drm/amdgpu: Fix interrupt handling on ih_soft ring

2022-08-15 Thread Felix Kuehling
Am 2022-08-14 um 13:27 schrieb Christian König: Am 12.08.22 um 22:56 schrieb Mukul Joshi: There are no backing hardware registers for ih_soft ring. As a result, don't try to access hardware registers for read and write pointers when processing interrupts on the IH soft ring. Mhm, the original

RE: [PATCH linux-next] drm/amdgpu/vcn: Remove unused assignment in vcn_v4_0_stop

2022-08-15 Thread Dong, Ruijing
[AMD Official Use Only - General] Sorry, which "r" value was overwritten? I didn't see the point of making this change. Thanks Ruijing -Original Message- From: Khalid Masum Sent: Monday, August 15, 2022 3:01 AM To: amd-gfx@lists.freedesktop.org; dri-de...@lists.freedesktop.org; linux

Re: [PATCH linux-next] drm/amdgpu/vcn: Remove unused assignment in vcn_v4_0_stop

2022-08-15 Thread James Zhu
ThispatchisReviewed-by:JamesZhu On 2022-08-15 3:00 a.m., Khalid Masum wrote: The value assigned from vcn_v4_0_stop_dbg_mode to r is overwritten before it can be used. Remove this assignment. Addresses-Coverity: 1504988 ("Unused value") Fixes: 8da1170a16e4 ("drm/amdgpu: add VCN4 ip block support

Re: [PATCH] drm/radeon: add a force flush to delay work when radeon

2022-08-15 Thread Christian König
Am 15.08.22 um 09:34 schrieb 李真能: 在 2022/8/12 18:55, Christian König 写道: Am 11.08.22 um 09:25 schrieb Zhenneng Li: Although radeon card fence and wait for gpu to finish processing current batch rings, there is still a corner case that radeon lockup work queue may not be fully flushed, and mea

Re: [PATCH] drm/radeon: add a force flush to delay work when radeon

2022-08-15 Thread 李真能
在 2022/8/12 18:55, Christian König 写道: Am 11.08.22 um 09:25 schrieb Zhenneng Li: Although radeon card fence and wait for gpu to finish processing current batch rings, there is still a corner case that radeon lockup work queue may not be fully flushed, and meanwhile the radeon_suspend_kms() fu

Re: [PATCH] drm/amdgpu: Fix use-after-free on amdgpu_bo_list mutex

2022-08-15 Thread Christian König
Am 15.08.22 um 13:39 schrieb Maíra Canal: If amdgpu_cs_vm_handling returns r != 0, then it will unlock the bo_list_mutex inside the function amdgpu_cs_vm_handling and again on amdgpu_cs_parser_fini. This problem results in the following use-after-free problem: [ 220.280990] [ cut

[PATCH] drm/amdgpu: Fix use-after-free on amdgpu_bo_list mutex

2022-08-15 Thread Maíra Canal
If amdgpu_cs_vm_handling returns r != 0, then it will unlock the bo_list_mutex inside the function amdgpu_cs_vm_handling and again on amdgpu_cs_parser_fini. This problem results in the following use-after-free problem: [ 220.280990] [ cut here ] [ 220.281000] refcount_t: un

Re: [PATCH] drm/amdkfd: potential crash in kfd_create_indirect_link_prop()

2022-08-15 Thread Dan Carpenter
On Fri, Aug 12, 2022 at 05:10:51PM -0400, Felix Kuehling wrote: > On 2022-08-12 02:20, Dan Carpenter wrote: > > This code has two bugs. If kfd_topology_device_by_proximity_domain() > > failed on the first iteration through the loop then "cpu_link" is > > uninitialized and should not be dereference

Re: [PATCH v2] drm/amdgpu: Fix UBSAN shift-out-of-bounds for gfx v9_0

2022-08-15 Thread Christian König
Am 15.08.22 um 13:08 schrieb Candice Li: Check shift number to avoid doing a shift operation when the number of bits shifted equal to or greater than number of bits in the operand. v2: Only calculate shift number for non-zero data and fix build warning. Well that doesn't sounds like a good ide

[PATCH v2] drm/amdgpu: Fix UBSAN shift-out-of-bounds for gfx v9_0

2022-08-15 Thread Candice Li
Check shift number to avoid doing a shift operation when the number of bits shifted equal to or greater than number of bits in the operand. v2: Only calculate shift number for non-zero data and fix build warning. Signed-off-by: Candice Li --- drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c | 8 ++--

Re: [PATCH v6 1/6] drm/ttm: Add new callbacks to ttm res mgr

2022-08-15 Thread Christian König
Am 12.08.22 um 15:30 schrieb Arunpravin Paneer Selvam: We are adding two new callbacks to ttm resource manager function to handle intersection and compatibility of placement and resources. v2: move the amdgpu and ttm_range_manager changes to separate patches (Christian) v3: rename "intersec

Re: [BUG][5.20] refcount_t: underflow; use-after-free

2022-08-15 Thread Christian König
Am 15.08.22 um 12:55 schrieb Melissa Wen: On 08/14, Maíra Canal wrote: Hi Mikhail Looks like this use-after-free problem was introduced on 90af0ca047f3049c4b46e902f432ad6ef1e2ded6. Checking this patch it seems like: if amdgpu_cs_vm_handling return r != 0, then it will unlock bo_list_mutex insid

Re: [BUG][5.20] refcount_t: underflow; use-after-free

2022-08-15 Thread Melissa Wen
On 08/14, Maíra Canal wrote: > Hi Mikhail > > Looks like this use-after-free problem was introduced on > 90af0ca047f3049c4b46e902f432ad6ef1e2ded6. Checking this patch it seems > like: if amdgpu_cs_vm_handling return r != 0, then it will unlock > bo_list_mutex inside the function amdgpu_cs_vm_handl

Re: [BUG][5.20] refcount_t: underflow; use-after-free

2022-08-15 Thread Mikhail Gavrilov
On Mon, Aug 15, 2022 at 5:20 AM Maíra Canal wrote: > > Hi Mikhail > > Looks like this use-after-free problem was introduced on > 90af0ca047f3049c4b46e902f432ad6ef1e2ded6. Checking this patch it seems > like: if amdgpu_cs_vm_handling return r != 0, then it will unlock > bo_list_mutex inside the fun

RE: [PATCH] drm/amdgpu: Add secure display TA load for Renoir

2022-08-15 Thread Liu, Aaron
[AMD Official Use Only - General] Reviewed-by: Aaron Liu > -Original Message- > From: amd-gfx On Behalf Of > Shane Xiao > Sent: Monday, August 15, 2022 4:40 PM > To: amd-gfx@lists.freedesktop.org > Cc: Xiao, Shane > Subject: [PATCH] drm/amdgpu: Add secure display TA load for Renoir >

[PATCH] drm/amdgpu: Add secure display TA load for Renoir

2022-08-15 Thread Shane Xiao
Add secure display TA load for Renoir Signed-off-by: Shane Xiao --- drivers/gpu/drm/amd/amdgpu/psp_v12_0.c | 10 ++ 1 file changed, 10 insertions(+) diff --git a/drivers/gpu/drm/amd/amdgpu/psp_v12_0.c b/drivers/gpu/drm/amd/amdgpu/psp_v12_0.c index a2588200ea58..0b2ac418e4ac 100644 ---

[PATCH linux-next] drm/amdgpu/vcn: Remove unused assignment in vcn_v4_0_stop

2022-08-15 Thread Khalid Masum
The value assigned from vcn_v4_0_stop_dbg_mode to r is overwritten before it can be used. Remove this assignment. Addresses-Coverity: 1504988 ("Unused value") Fixes: 8da1170a16e4 ("drm/amdgpu: add VCN4 ip block support") Signed-off-by: Khalid Masum --- drivers/gpu/drm/amd/amdgpu/vcn_v4_0.c | 2 +

[REQUEST] Unusable state of Laptop powered by AMD SmartShift

2022-08-15 Thread Pratham Sharma
I come from https://gitlab.freedesktop.org/drm/amd/-/issues/1707 I have a DELL G5 SE, it's a laptop specced with a Ryzen 5 4600H, a Renoir iGPU driving the display and RX5600M for all GPU intensive tasks. It's as good as it gets, all AMD powered, it doesn't have a dGPU from the You Know Who so I e

[PATCH] drm/amdgpu: TA unload messages are not actually sent to psp when amdgpu is uninstalled

2022-08-15 Thread YiPeng Chai
The psp_cmd_submit_buf function is called by psp_hw_fini to send TA unload messages to psp to terminate ras, asd and tmr. But when amdgpu is uninstalled, drm_dev_unplug is called earlier than psp_hw_fini in amdgpu_pci_remove, the calling order as follows: static void amdgpu_pci_remove(struct pci_de