[PATCH] drm/amdgpu: fix invalid fence handling in amdgpu_vm_tlb_flush

2024-09-01 Thread Lang Yu
Fixes: 5a1c27951966 ("drm/amdgpu: implement TLB flush fence") Signed-off-by: Lang Yu --- drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c | 6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_

[PATCH] drm/amdgpu: break COW for user ptr during fork()

2024-02-21 Thread Lang Yu
This is useful to prevent copy-on-write semantics from changing the physical location of a page if the parent writes to it after a fork(). Signed-off-by: Lang Yu --- drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c | 1 + drivers/gpu/drm/amd/amdkfd/kfd_svm.c| 1 + 2 files changed, 2 insertions

[PATCH] drm/amdgpu: fix mmhub client id out-of-bounds access

2024-03-06 Thread Lang Yu
Fixes: aba2be41470a ("drm/amdgpu: add mmhub 3.3.0 support") Signed-off-by: Lang Yu --- drivers/gpu/drm/amd/amdgpu/mmhub_v3_3.c | 7 +++ 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/drivers/gpu/drm/amd/amdgpu/mmhub_v3_3.c b/drivers/gpu/drm/amd/amdgpu/mmhub_v3

[PATCH] Revert "drm/amdgpu/vpe: don't emit cond exec command under collaborate mode"

2024-03-18 Thread Lang Yu
Ready now. Remove this workaround. This reverts commit 1a2bb3bb2a84f8364f0a8b338afa9b9025e1bcc0. Signed-off-by: Lang Yu Tested-by: Alan Liu --- drivers/gpu/drm/amd/amdgpu/amdgpu_vpe.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_vpe.c b/drivers/gpu

[PATCH 1/2] drm/amdgpu/umsch: update UMSCH 4.0 FW interface

2024-03-21 Thread Lang Yu
Align with FW changes. Signed-off-by: Lang Yu Reviewed-by: Veerabadhran Gopalakrishnan --- drivers/gpu/drm/amd/amdgpu/amdgpu_umsch_mm.h | 20 +-- .../drm/amd/include/umsch_mm_4_0_api_def.h| 13 ++-- 2 files changed, 21 insertions(+), 12 deletions(-) diff --git a

[PATCH 2/2] drm/amdgpu: enable UMSCH 4.0.6

2024-03-21 Thread Lang Yu
Share same codes with 4.0.5 and enable collaborate mode for VPE. Signed-off-by: Lang Yu Reviewed-by: Veerabadhran Gopalakrishnan --- drivers/gpu/drm/amd/amdgpu/amdgpu_discovery.c | 1 + drivers/gpu/drm/amd/amdgpu/amdgpu_umsch_mm.c | 12 ++-- drivers/gpu/drm/amd/amdgpu/umsch_mm_v4_0.c

[PATCH 1/2] drm/amdgpu: use CPU to update VM during GPU reset

2024-03-24 Thread Lang Yu
drm sched is stopped and SDMA mode is not available, while CPU mode worked well in such a case. Use case, amdgpu_do_asic_reset amdgpu_device_ip_late_init umsch_mm_late_init umsch_mm_test amdgpu_vm_init Signed-off-by: Lang Yu --- drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c | 4 ++-- 1 file changed

[PATCH 2/2] drm/amdgpu/umsch: reinitialize write pointer in hw init

2024-03-24 Thread Lang Yu
Otherwise the old one will be used during GPU reset. That's not expected. Signed-off-by: Lang Yu --- drivers/gpu/drm/amd/amdgpu/umsch_mm_v4_0.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/gpu/drm/amd/amdgpu/umsch_mm_v4_0.c b/drivers/gpu/drm/amd/amdgpu/umsch_mm_v4_0.c

[PATCH] drm/amdgpu: add post reset IP callback

2024-03-27 Thread Lang Yu
after GPU reset succeeds. Signed-off-by: Lang Yu --- drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 24 ++ drivers/gpu/drm/amd/include/amd_shared.h | 3 +++ 2 files changed, 27 insertions(+) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c b/drivers/gpu/drm/amd/amdgpu

[PATCH] drm/amdkfd: make sure VM is ready for updating operations

2024-04-06 Thread Lang Yu
When VM is in evicting state, amdgpu_vm_update_range would return -EBUSY. Then restore_process_worker runs into a dead loop. Fixes: 2fdba514ad5a ("drm/amdgpu: Auto-validate DMABuf imports in compute VMs") Signed-off-by: Lang Yu --- drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c | 6

[PATCH v2] drm/amdkfd: make sure VM is ready for updating operations

2024-04-11 Thread Lang Yu
amdgpu_amdkfd_restore_process_bos. (Felix) 1.Validate BOs 2.Validate VM (and DMABuf attachments) 3.Update page tables for the BOs validated above Fixes: 2fdba514ad5a ("drm/amdgpu: Auto-validate DMABuf imports in compute VMs") Signed-off-by: Lang Yu --- .../gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpu

[PATCH] drm/amdgpu/umsch: don't execute umsch test when GPU is in reset/suspend

2024-04-19 Thread Lang Yu
umsch test needs full GPU functionality(e.g., VM update, TLB flush, possibly buffer moving under memory pressure) which may be not ready under these states. Just skip it to avoid potential issues. Signed-off-by: Lang Yu --- drivers/gpu/drm/amd/amdgpu/amdgpu_umsch_mm.c | 3 +++ 1 file changed, 3

[PATCH] drm/amdkfd: handle duplicate BOs in reserve_bo_and_cond_vms

2024-04-22 Thread Lang Yu
] ret_from_fork_asm+0x1b/0x30 Signed-off-by: Lang Yu --- drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c index 101a2836480d

[PATCH 1/2] drm/amdkfd: Let VRAM allocations go to GTT domain on small APUs

2024-04-26 Thread Lang Yu
t. Though we can change BIOS settings to enlarge carveout size, which is inflexible and may bring complaint. On the other hand, the memory resource can't be effectively used between host and device. The solution is MI300A approach, i.e., let VRAM allocations go to GTT. Signed-off-by: Lang Y

[PATCH 2/2] drm/amdkfd: Allow memory oversubscription on small APUs

2024-04-26 Thread Lang Yu
The default ttm_tt_pages_limit is 1/2 of system memory. It is prone to out of memory with such a configuration. Signed-off-by: Lang Yu --- drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.c | 2 +- drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.h | 4 ++-- drivers/gpu/drm/amd/amdgpu

[PATCH v2] drm/amdkfd: Let VRAM allocations go to GTT domain on small APUs

2024-04-30 Thread Lang Yu
effectively share system memory. v2: Report local_mem_size_private as 0. (Felix) Signed-off-by: Lang Yu --- drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.c| 5 + .../gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c | 20 ++- drivers/gpu/drm/amd/amdkfd/kfd_migrate.c | 2 +- d

[PATCH] drm/amdkfd: reserve the BO before validating it

2024-01-10 Thread Lang Yu
k+0x5/0x7f [ 41.709949] ? tomoyo_file_ioctl+0x20/0x30 [ 41.709959] __x64_sys_ioctl+0x9c/0xd0 [ 41.709967] do_syscall_64+0x3f/0x90 [ 41.709973] entry_SYSCALL_64_after_hwframe+0x6e/0xd8 Signed-off-by: Lang Yu --- drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c | 7 ++- 1 file changed, 6

[PATCH v2] drm/amdkfd: reserve the BO before validating it

2024-01-22 Thread Lang Yu
10 [amdgpu] [ 41.709945] ? srso_alias_return_thunk+0x5/0x7f [ 41.709949] ? tomoyo_file_ioctl+0x20/0x30 [ 41.709959] __x64_sys_ioctl+0x9c/0xd0 [ 41.709967] do_syscall_64+0x3f/0x90 [ 41.709973] entry_SYSCALL_64_after_hwframe+0x6e/0xd8 Signed-off-by: Lang Yu --- drivers/gpu/drm/

[PATCH v3] drm/amdkfd: reserve the BO before validating it

2024-01-30 Thread Lang Yu
after_hwframe+0x6e/0xd8 Signed-off-by: Lang Yu --- drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.h| 2 +- .../gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c | 20 --- drivers/gpu/drm/amd/amdkfd/kfd_chardev.c | 4 +++- 3 files changed, 21 insertions(+), 5 deletions(-) diff --git

[PATCH] drm/amdgpu: check CG flag before querying CG status

2021-08-02 Thread Lang Yu
For ASICs which don't supoort clock gating, querying CG status may cause a hardware hang issue. So add a CG flag check to exit directly in such a case. Signed-off-by: Lang Yu --- drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 5 + 1 file changed, 5 insertions(+) diff --git a/drivers/gp

[PATCH] drm/amdgpu: show both cmd id and name when psp cmd failed

2021-08-26 Thread Lang Yu
To cover the corner case that people want to know the ID of an UNKNOWN CMD. Suggested-by: John Clements Signed-off-by: Lang Yu --- drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c b

[PATCH] drm/amdgpu: fix sysfs_emit/sysfs_emit_at warnings

2021-09-07 Thread Lang Yu
] [ 492.662107] amdgpu_get_pp_od_clk_voltage+0x13d/0x190 [amdgpu] [ 492.663620] dev_attr_show+0x1d/0x40 Signed-off-by: Lang Yu --- drivers/gpu/drm/amd/pm/swsmu/smu11/arcturus_ppt.c | 9 +++-- drivers/gpu/drm/amd/pm/swsmu/smu11/navi10_ppt.c | 5 - .../drm/amd/pm/swsmu/smu11/sienna_cichlid_ppt.c

[PATCH v2] drm/amdgpu: fix sysfs_emit/sysfs_emit_at warnings(v2)

2021-09-09 Thread Lang Yu
+0x65/0x90 [amdgpu] [ 492.662107] amdgpu_get_pp_od_clk_voltage+0x13d/0x190 [amdgpu] [ 492.663620] dev_attr_show+0x1d/0x40 Signed-off-by: Lang Yu --- .../gpu/drm/amd/pm/swsmu/smu11/arcturus_ppt.c| 8 ++-- drivers/gpu/drm/amd/pm/swsmu/smu11/navi10_ppt.c | 4 +++- .../drm/amd/pm/swsmu

[PATCH 1/3] drm/amdgpu: update SMU PPSMC for cyan skilfish

2021-09-10 Thread Lang Yu
Add some PPSMC MSGs for cyan skilfish. Signed-off-by: Lang Yu Reviewed-by: Huang Rui --- drivers/gpu/drm/amd/pm/inc/smu_v11_8_ppsmc.h | 9 - 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/amd/pm/inc/smu_v11_8_ppsmc.h b/drivers/gpu/drm/amd/pm/inc

[PATCH v3 2/3] drm/amdgpu: update SMU driver interface for cyan skilfish(v3)

2021-09-10 Thread Lang Yu
Add SmuMetrics_t definition for cyan skilfish. v2: update SmuMetrics_t definition. v3: cleanup and rearrange the order of fields. Signed-off-by: Lang Yu Reviewed-by: Huang Rui --- .../pm/inc/smu11_driver_if_cyan_skillfish.h | 86 --- 1 file changed, 35 insertions(+), 51

[PATCH v3 3/3] drm/amdgpu: add some pptable funcs for cyan skilfish(v3)

2021-09-10 Thread Lang Yu
Add print_clk_levels and read_sensor pptable funcs for cyan skilfish. v2: keep consitency and add get_gpu_metrics callback. v3: use sysfs_emit_at() in sysfs show function. Signed-off-by: Lang Yu Reviewed-by: Huang Rui --- .../amd/pm/swsmu/smu11/cyan_skillfish_ppt.c | 347

[PATCH v3] drm/amdgpu: add manual sclk/vddc setting support for cyan skilfish(v3)

2021-09-10 Thread Lang Yu
cho c > pp_od_clk_voltage $ cat pp_od_clk_voltage OD_SCLK: 0: 1800Mhz * OD_VDDC: 0: 874mV * OD_RANGE: SCLK:1000Mhz 2000Mhz VDDC: 700mV1129mV NOTE: We don't specify an explicit safe range, you can set any

[PATCH] drm/kfd: fix ttm_bo_release warning

2021-09-23 Thread Lang Yu
+0x22/0x30 Signed-off-by: Lang Yu --- drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c index 2d6b2d77b738..7e693b064072 100644 --- a/drivers/gpu

[PATCH] drm/amdkfd: fix a potential ttm->sg memory leak

2021-09-29 Thread Lang Yu
Memory is allocated for ttm->sg by kmalloc in kfd_mem_dmamap_userptr, but isn't freed by kfree in kfd_mem_dmaunmap_userptr. Free it! Signed-off-by: Lang Yu --- drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/gpu/drm/am

[PATCH] drm/amdkfd: fix a potential cu_mask memory leak

2021-09-29 Thread Lang Yu
If user doesn't explicitly call kfd_ioctl_destroy_queue to destroy all created queues, when the kfd process is destroyed, some queues' cu_mask memory are not freed. To avoid forgetting to free them in some places, free them immediately after use. Signed-off-by: Lang Yu --- drivers/g

[PATCH] drm/amdgpu: query default sclk from smu for cyan_skillfish

2021-10-11 Thread Lang Yu
Query default sclk instead of hard code. Signed-off-by: Lang Yu --- .../gpu/drm/amd/pm/swsmu/smu11/cyan_skillfish_ppt.c | 12 +--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/amd/pm/swsmu/smu11/cyan_skillfish_ppt.c b/drivers/gpu/drm/amd/pm/swsmu/smu11

[PATCH] drm/amdkfd: Separate pinned BOs destruction from general routine

2021-10-11 Thread Lang Yu
Currently, all kfd BOs use same destruction routine. But pinned BOs are not unpinned properly. Separate them from general routine. Signed-off-by: Lang Yu --- drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.h| 2 + .../gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c | 10 ++ drivers/gpu/drm/amd/amdkfd

[PATCH] drm/amdgpu: enable display for cyan skillfish

2021-10-11 Thread Lang Yu
Display support for cyan skillfish is ready now. Enable it! Signed-off-by: Lang Yu --- drivers/gpu/drm/amd/amdgpu/amdgpu_discovery.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_discovery.c b/drivers/gpu/drm/amd/amdgpu

[PATCH] drm/amdkfd: Fix an inappropriate error handling in allloc memory of gpu

2021-10-13 Thread Lang Yu
We should unreference a gem object instead of an amdgpu bo here. Fixes: 5ae0283e831a ("drm/amdgpu: Add userptr support for KFD") Signed-off-by: Lang Yu --- drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/g

[PATCH] drm/amdkfd: Fix a __user pointer dereference in create_signal_event

2021-10-13 Thread Lang Yu
We should not dereference __user pointers directly. https://yarchive.net/comp/linux/user_pointers.html Fixes: 482f07775cf5 ("drm/amdkfd: Simplify event ID and signal slot management") Signed-off-by: Lang Yu --- drivers/gpu/drm/amd/amdkfd/kfd_events.c | 2 +- 1 file changed, 1 inser

[PATCH v2] drm/amdkfd: Separate pinned BOs destruction from general routine

2021-10-14 Thread Lang Yu
duplicating the code. Signed-off-by: Lang Yu --- drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.h| 2 + .../gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c | 10 ++ drivers/gpu/drm/amd/amdkfd/kfd_chardev.c | 31 +++-- drivers/gpu/drm/amd/amdkfd/kfd_priv.h | 3 + drivers/gpu/drm/amd/amdkfd

[PATCH 1/2] drm/amdkfd: Add an optional argument into update queue operation

2021-10-15 Thread Lang Yu
x27;t have to persist in queue_properties. So add an argument into update queue to pass such properties and remove them from queue_properties. Signed-off-by: Lang Yu --- .../drm/amd/amdkfd/kfd_device_queue_manager.c | 4 ++-- .../drm/amd/amdkfd/kfd_device_queue_manager.h | 2 +- drivers/gpu/dr

[PATCH 2/2] drm/amdkfd: Remove cu mask from struct queue_properties

2021-10-15 Thread Lang Yu
Actually, cu_mask has been copied to mqd memory and don't have to persist in queue_properties. Remove it from queue_properties. Use struct queue_update_info to wrap queue_properties and cu mask, then pass it to update queue operation. Signed-off-by: Lang Yu --- drivers/gpu/drm/amd/a

[PATCH v2 1/2] drm/amdkfd: Add an optional argument into update queue operation(v2)

2021-10-25 Thread Lang Yu
copied to mqd and don't have to persist in queue_properties. Add an argument into update queue to pass such properties, then we can remove them from queue_properties. v2: Don't use void *. Suggested-by: Felix Kuehling Signed-off-by: Lang Yu --- .../drm/amd/amdkfd/kfd_device_queue_mana

[PATCH v2 2/2] drm/amdkfd: Remove cu mask from struct queue_properties(v2)

2021-10-25 Thread Lang Yu
ename struct queue_update_info to struct mqd_update_info. * Rename pqm_set_cu_mask to pqm_update_mqd. Suggested-by: Felix Kuehling Signed-off-by: Lang Yu --- drivers/gpu/drm/amd/amdkfd/kfd_chardev.c | 31 ++- drivers/gpu/drm/amd/amdkfd/kfd_kernel_queue.c | 1 - .../gpu/dr

Re: [PATCH] drm/amdgpu: Pin MMIO/DOORBELL BO's in GTT domain

2021-11-08 Thread Lang Yu
On Mon, Nov 08, 2021 at 07:37:44PM -0600, Ramesh Errabolu wrote: > MMIO/DOORBELL BOs encode control data and should be pinned in GTT > domain before enabling PCIe connected peer devices in accessing it > > Signed-off-by: Ramesh Errabolu > --- > drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.h| 25

Re: [PATCH] drm/amdgpu: Pin MMIO/DOORBELL BO's in GTT domain

2021-11-08 Thread Lang Yu
On Tue, Nov 09, 2021 at 02:12:00PM +0800, Errabolu, Ramesh wrote: > [AMD Official Use Only] > > Responses in line > > -Original Message- > From: Yu, Lang > Sent: Monday, November 8, 2021 11:27 PM > To: Errabolu, Ramesh > Cc: amd-gfx@lists.freedesktop.org > Subject: Re: [PATCH] drm/amdg

Re: Questions about KMS flip

2021-11-16 Thread Lang Yu
On Tue, Nov 16, 2021 at 08:14:08AM +0100, Christian KKKnig wrote: > Am 16.11.21 um 04:27 schrieb Lang Yu: > > On Mon, Nov 15, 2021 at 01:04:15PM +0100, Michel DDDnzer wrote: > > > [SNIP] > > > > Though a single call to dce_v*_0_crtc_do_set_base() will > > >

[PATCH] drm/amdgpu: add SMU debug option support

2021-11-29 Thread Lang Yu
, enable SMU debug option # echo 1 > /sys/kernel/debug/dri/0/amdgpu_smu_debug 2, disable SMU debug option # echo 0 > /sys/kernel/debug/dri/0/amdgpu_smu_debug v2: - Resend command when timeout.(Lijo) - Use debugfs file instead of module parameter. Signed-off-by: Lang Yu --- drivers/gpu/d

Re: [PATCH] drm/amdgpu: add SMU debug option support

2021-11-30 Thread Lang Yu
On 11/30/ , Christian KKKnig wrote: > Am 30.11.21 um 06:17 schrieb Lang Yu: > > To maintain system error state when SMU errors occurred, > > which will aid in debugging SMU firmware issues, > > add SMU debug option support. > > > > It can be enabled or disabled

[PATCH] drm/amdgpu: add support to SMU debug option

2021-12-01 Thread Lang Yu
: - Resend command when timeout.(Lijo) - Use debugfs file instead of module parameter. Signed-off-by: Lang Yu --- drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c| 3 +++ drivers/gpu/drm/amd/pm/inc/amdgpu_smu.h| 5 + drivers/gpu/drm/amd/pm/swsmu/smu13/aldebaran_ppt.c | 2 ++

[PATCH 2/2] drm/amdgpu: allow APU to send power gate message when dpm is disabled

2021-12-02 Thread Lang Yu
The general hw fini sequence is SMU-> ... ->SDMA-> ... We need to send power gate message to power off SDMA(in SDMA hw_fini()) afer dpm is disabled(in SMU hw_fini()). Allow that for APU. Signed-off-by: Lang Yu --- drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c | 2 +- 1 file changed, 1

[PATCH 1/2] drm/amdgpu: remove power on/off SDMA in SMU hw_init/fini()

2021-12-02 Thread Lang Yu
Currently, we don't find some neccesities to power on/off SDMA in SMU hw_init/fini(). It makes more sense in SDMA hw_init/fini(). Signed-off-by: Lang Yu --- drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c | 5 - 1 file changed, 5 deletions(-) diff --git a/drivers/gpu/drm/amd/pm/

Re: [PATCH 2/2] drm/amdgpu: allow APU to send power gate message when dpm is disabled

2021-12-06 Thread Lang Yu
; > > > > > > > > > > > > > > > > > > > > -Original Message- > > > > > > From: Lazar, Lijo > > > > > > Sent: Friday, December 3, 2021 5:52 PM > > > > > > To: Yu, Lang ; amd

Re: [PATCH 2/2] drm/amdgpu: allow APU to send power gate message when dpm is disabled

2021-12-06 Thread Lang Yu
On 12/06/ , Lazar, Lijo wrote: > > > On 12/6/2021 2:14 PM, Lang Yu wrote: > > On 12/06/ , Lazar, Lijo wrote: > > > > > > > > > On 12/6/2021 12:18 PM, Yu, Lang wrote: > > > > [Public] > > > > > > > > A typo. > &g

[PATCH 2/2] drm/amdgpu: only hw fini SMU fisrt for ASICs need that

2021-12-08 Thread Lang Yu
We found some headaches on ASICs don't need that, so remove that for them. Suggested-by: Lijo Lazar Signed-off-by: Lang Yu --- drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 47 +++--- 1 file changed, 32 insertions(+), 15 deletions(-) diff --git a/drivers/gpu/drm/amd/a

[PATCH 1/2] drm/amdgpu: remove power on/off SDMA in SMU hw_init/fini()

2021-12-08 Thread Lang Yu
Currently, we don't find some neccesities to power on/off SDMA in SMU hw_init/fini(). It makes more sense in SDMA hw_init/fini(). Signed-off-by: Lang Yu --- drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c | 5 - 1 file changed, 5 deletions(-) diff --git a/drivers/gpu/drm/amd/pm/

Re: [PATCH 1/2] drm/amdgpu: remove power on/off SDMA in SMU hw_init/fini()

2021-12-08 Thread Lang Yu
Best Regards, >Kevin > __ > > From: amd-gfx on behalf of Lang >Yu >Sent: Wednesday, December 8, 2021 5:26 PM >To: amd-gfx@lists.freedesktop.org >Cc: Deucher, Alexander ; Yu, Lang >; Lazar, Lijo ; Huang, Ray >

[PATCH 1/2] drm/amdgpu: introduce a kind of halt state for amdgpu device

2021-12-09 Thread Lang Yu
should be trivial to inspect the hardware state and see what's going on. Suggested-by: Christian Koenig Suggested-by: Andrey Grodzovsky Signed-off-by: Lang Yu --- drivers/gpu/drm/amd/amdgpu/amdgpu.h| 2 ++ drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 39 ++ 2

[PATCH 2/2] drm/amdgpu: add support for SMU debug option

2021-12-09 Thread Lang Yu
g v4: - Set to halt state instead of a simple hang.(Christian) v3: - Use debugfs_create_bool().(Christian) - Put variable into smu_context struct. - Don't resend command when timeout. v2: - Resend command when timeout.(Lijo) - Use debugfs file instead of module parameter. Signed-off-by:

Re: [PATCH 2/2] drm/amdgpu: add support for SMU debug option

2021-12-09 Thread Lang Yu
On 12/10/ , Quan, Evan wrote: > [AMD Official Use Only] > > > > > -Original Message- > > From: amd-gfx On Behalf Of Lang > > Yu > > Sent: Thursday, December 9, 2021 4:49 PM > > To: amd-gfx@lists.freedesktop.org > > Cc: Grodzovsky,

Re: [PATCH 2/2] drm/amdgpu: add support for SMU debug option

2021-12-09 Thread Lang Yu
azar, Lijo ; Huang, > > Ray ; Deucher, Alexander > > ; Koenig, Christian > > > > Subject: Re: [PATCH 2/2] drm/amdgpu: add support for SMU debug option > > > > On 12/10/ , Quan, Evan wrote: > > > [AMD Official Use Only] > > > > > > >

Re: [PATCH 2/2] drm/amdgpu: add support for SMU debug option

2021-12-09 Thread Lang Yu
On 12/10/ , Christian KKKnig wrote: > Am 10.12.21 um 04:21 schrieb Lang Yu: > > On 12/10/ , Quan, Evan wrote: > > > [AMD Official Use Only] > > > > > > > > > > > > > -Original Message- > > > > From: Yu, Lang &g

[PATCH v2] drm/amdgpu: introduce a kind of halt state for amdgpu device

2021-12-10 Thread Lang Yu
be trivial to inspect the hardware state and see what's going on. Suggested-by: Christian Koenig Suggested-by: Andrey Grodzovsky Signed-off-by: Lang Yu v2: - Set adev->no_hw_access earlier to avoid crashes.(Christian) --- drivers/gpu/drm/amd/amdgpu/amdgpu.h| 2 ++ drivers/gpu

[PATCH v5] drm/amdgpu: add support for SMU debug option

2021-12-10 Thread Lang Yu
().(Christian) - Put variable into smu_context struct. - Don't resend command when timeout. v2: - Resend command when timeout.(Lijo) - Use debugfs file instead of module parameter. Signed-off-by: Lang Yu --- drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c | 3 +++ drivers/gpu/drm/amd/pm

[PATCH] drm/amd/pm: fix a potential gpu_metrics_table memory leak

2021-12-14 Thread Lang Yu
Memory is allocated for gpu_metrics_table in renoir_init_smc_tables(), but not freed in int smu_v12_0_fini_smc_tables(). Free it! Fixes: 95868b85764a ("drm/amd/powerplay: add Renoir support for gpu metrics export") Signed-off-by: Lang Yu --- drivers/gpu/drm/amd/pm/swsmu/smu12/smu_v

[PATCH 1/2] drm/amd/display: fix a potential dmub_srv memory leak

2021-12-14 Thread Lang Yu
Memory is allocated for dmub_srv in dm_sw_init(), but not freed in dm_sw_fini(). Free it! Signed-off-by: Lang Yu --- drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c b/drivers/gpu/drm/amd

[PATCH 2/2] drm/amd/display: refine error handling for dm_dmub_sw_init()

2021-12-14 Thread Lang Yu
To avoid potential memory leaks, refine error handling for dm_dmub_sw_init(). Signed-off-by: Lang Yu --- .../gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 37 ++- 1 file changed, 27 insertions(+), 10 deletions(-) diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c b

[PATCH] drm/amd/dispaly: fix deadlock issue in amdgpu reset

2021-03-22 Thread Lang Yu
4096] 3 locks held by cat/1158: [ 104.644103] #0: 88810d0e4eb8 (&attr->mutex){+.+.}-{3:3}, at: simple_attr_read+0x4e/0x110 [ 104.644119] #1: 88810a0a1600 (&adev->reset_sem){}-{3:3}, at: amdgpu_device_lock_adev+0x42/0x94 [amdgpu] [ 104.644489] #2: 88810a09cc70 (&

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

2021-05-17 Thread Lang Yu
003 R14: 0002 R15: 0002 Signed-off-by: Lang Yu --- drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c index 7c6c435e5d02..ff341154394e

[PATCH] drm/amdgpu: enable amdgpu_dc module parameter

2022-01-19 Thread Lang Yu
It doesn't work under IP discovery mode. Make it work! Signed-off-by: Lang Yu --- drivers/gpu/drm/amd/amdgpu/amdgpu_discovery.c | 10 -- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_discovery.c b/drivers/gpu/drm/amd/a

Re: [PATCH] drm/amdgpu: enable amdgpu_dc module parameter

2022-01-20 Thread Lang Yu
On 01/20/ , Alex Deucher wrote: > On Thu, Jan 20, 2022 at 1:25 AM Lang Yu wrote: > > > > It doesn't work under IP discovery mode. Make it work! > > > > Signed-off-by: Lang Yu > > --- > > drivers/gpu/drm/amd/amdgpu/amdgpu_discovery.c | 10 ++

[PATCH 2/2] drm/amd/pm: use existing fini_smc_tables function for cyan skillfish

2022-01-23 Thread Lang Yu
Remove redundant code and use general smu_v11_0_fini_smc_tables function. Signed-off-by: Lang Yu --- .../amd/pm/swsmu/smu11/cyan_skillfish_ppt.c| 18 +- 1 file changed, 1 insertion(+), 17 deletions(-) diff --git a/drivers/gpu/drm/amd/pm/swsmu/smu11/cyan_skillfish_ppt.c b

[PATCH 1/2] drm/amd/pm: add get_dpm_ultimate_freq function for cyan skillfish

2022-01-23 Thread Lang Yu
Some clients(e.g., kfd) query sclk/mclk through this function. Before this patch: # /opt/rocm/opencl/bin/clinfo Max clock frequency: 0Mhz After this patch: # /opt/rocm/opencl/bin/clinfo Max clock frequency: 1500Mhz Signed-off-by: Lang Yu

Re: [PATCH 1/2] drm/amd/pm: add get_dpm_ultimate_freq function for cyan skillfish

2022-01-24 Thread Lang Yu
On 01/24/ , Lazar, Lijo wrote: > > > On 1/24/2022 12:13 PM, Lang Yu wrote: > > Some clients(e.g., kfd) query sclk/mclk through this function. > > > > Before this patch: > > # /opt/rocm/opencl/bin/clinfo > > > > Max clock frequency:

[PATCH v2] drm/amd/pm: add get_dpm_ultimate_freq function for cyan skillfish

2022-01-24 Thread Lang Yu
/rocm/opencl/bin/clinfo Max clock frequency: 0Mhz After this patch: # /opt/rocm/opencl/bin/clinfo Max clock frequency: 2000Mhz v2: - Maintain the existing min/max sclk logic.(Lijo) Signed-off-by: Lang Yu --- .../amd/pm/swsmu/

Re: [PATCH v2] drm/amd/pm: add get_dpm_ultimate_freq function for cyan skillfish

2022-01-24 Thread Lang Yu
On 01/24/ , Lazar, Lijo wrote: > > > On 1/24/2022 2:42 PM, Lang Yu wrote: > > Some clients(e.g., kfd) query sclk/mclk through this function. > > Because cyan skillfish don't support dpm. For sclk, set min/max > > to CYAN_SKILLFISH_SCLK_MIN/CYAN_SKILLFISH_SCLK_

[PATCH v3] drm/amd/pm: add get_dpm_ultimate_freq function for cyan skillfish

2022-01-24 Thread Lang Yu
ff-by: Lang Yu --- .../amd/pm/swsmu/smu11/cyan_skillfish_ppt.c | 31 +++ 1 file changed, 31 insertions(+) diff --git a/drivers/gpu/drm/amd/pm/swsmu/smu11/cyan_skillfish_ppt.c b/drivers/gpu/drm/amd/pm/swsmu/smu11/cyan_skillfish_ppt.c index 2238ee19c222..dfc5d6801f9f 100644 --- a/dr

[PATCH] drm/amdgpu: add safeguards for accessing mmhub CG registers

2022-01-25 Thread Lang Yu
igned-off-by: Lang Yu --- drivers/gpu/drm/amd/amdgpu/mmhub_v1_0.c | 3 +++ drivers/gpu/drm/amd/amdgpu/mmhub_v1_7.c | 3 +++ drivers/gpu/drm/amd/amdgpu/mmhub_v2_0.c | 3 +++ drivers/gpu/drm/amd/amdgpu/mmhub_v2_3.c | 3 +++ drivers/gpu/drm/amd/amdgpu/mmhub_v9_4.c | 3 +++ 5 files changed, 15 inser

[PATCH v2] drm/amdgpu: add safeguards for querying GMC CG state

2022-01-27 Thread Lang Yu
GC IP version instead of cg_flags to determine whether GMC CG is supported or not. v2: - Use a function to encapsulate more functionality.(Christian) - Use IP verion to determine whether CG is supported or not.(Lijo) Signed-off-by: Lang Yu --- drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.c

Re: [PATCH v2] drm/amdgpu: add safeguards for querying GMC CG state

2022-01-28 Thread Lang Yu
On 01/28/ , Lazar, Lijo wrote: > > > On 1/28/2022 12:24 PM, Lang Yu wrote: > > We observed a GPU hang when querying GMC CG state(i.e., > > cat amdgpu_pm_info) on cyan skillfish. Acctually, cyan > > skillfish doesn't support any CG features. > > > > On

Re: [PATCH v2] drm/amdgpu: add safeguards for querying GMC CG state

2022-01-28 Thread Lang Yu
On 01/28/ , Lazar, Lijo wrote: > > > On 1/28/2022 2:22 PM, Lang Yu wrote: > > On 01/28/ , Lazar, Lijo wrote: > > > > > > > > > On 1/28/2022 12:24 PM, Lang Yu wrote: > > > > We observed a GPU hang when querying GMC CG state(i.e., > >

[PATCH] drm/amdgpu: fix a potential GPU hang on cyan skillfish

2022-01-28 Thread Lang Yu
We observed a GPU hang when querying GMC CG state(i.e., cat amdgpu_pm_info) on cyan skillfish. Acctually, cyan skillfish doesn't support any CG features. Just prevent cyan skillfish from accessing GMC CG registers. Signed-off-by: Lang Yu --- drivers/gpu/drm/amd/amdgpu/gmc_v10_0.c | 3 +

Re: [PATCH v1 1/1] drm/amdgpu: Show IP discovery in sysfs

2022-02-09 Thread Lang Yu
On 02/09/ , Luben Tuikov wrote: > Add IP discovery data in sysfs. The format is: > /sys/class/drm/cardX/device/ip_discovery/die/D/B/I/ > where, > X is the card ID, an integer, > D is the die ID, an integer, > B is the IP HW ID, an integer, aka block type, > I is the IP HW ID instance, an integer. >

[PATCH] drm/amdgpu: add support for GC 10.1.4

2022-02-09 Thread Lang Yu
Add basic support for GC 10.1.4, it uses same IP blocks with GC 10.1.3 Signed-off-by: Lang Yu --- drivers/gpu/drm/amd/amdgpu/amdgpu_discovery.c | 6 ++ drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c | 3 ++- drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c| 9 + drivers/gpu/drm/amd

[PATCH 1/2] drm/ttm: cleanup and add TTM_PL_FLAG_TEMPORARY

2021-05-26 Thread Lang Yu
Make TTM_PL_FLAG_* start from zero and add TTM_PL_FLAG_TEMPORARY flag for temporary GTT allocation use. Signed-off-by: Lang Yu --- include/drm/ttm/ttm_placement.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/include/drm/ttm/ttm_placement.h b/include/drm/ttm

[PATCH 2/2] drm/amdgpu: stop bookkeeping of temporary GTT allocation

2021-05-26 Thread Lang Yu
To improve buffer migration performace, stop bookkeeping of temporary GTT allocation, including allocation for BO evicted from VRAM and bounce buffer. Signed-off-by: Lang Yu --- drivers/gpu/drm/amd/amdgpu/amdgpu_gtt_mgr.c | 16 ++-- drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c | 4

[PATCH v2 1/3] drm/ttm: cleanup and add TTM_PL_FLAG_TEMPORARY flag

2021-05-31 Thread Lang Yu
ments Suggested-by: Christian König Signed-off-by: Lang Yu --- include/drm/ttm/ttm_placement.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/include/drm/ttm/ttm_placement.h b/include/drm/ttm/ttm_placement.h index aa6ba4d0cf78..9f5cfc7c2d5a 100644 --- a/include/dr

[PATCH v2 3/3] drm/amdgpu: allow temporary GTT allocation under memory pressure

2021-05-31 Thread Lang Yu
it is not a temporary allocation bail out. v2: still account temporary GTT allocations Signed-off-by: Lang Yu --- drivers/gpu/drm/amd/amdgpu/amdgpu_gtt_mgr.c | 27 ++--- drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c | 4 ++- drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.h | 2 +- 3 files

[PATCH 2/3] drm/ttm: check with temporary GTT memory in BO validation

2021-05-31 Thread Lang Yu
If a BO's backing store is temporary GTT memory, we should move it in BO validation. Signed-off-by: Lang Yu --- drivers/gpu/drm/ttm/ttm_bo.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/gpu/drm/ttm/ttm_bo.c b/drivers/gpu/drm/ttm/ttm_bo.c index c32a37d0a460..80c8cb2c3f31 1

[PATCH v2 2/2] drm/ttm: check with temporary GTT memory in BO validation

2021-05-31 Thread Lang Yu
If a BO's backing store is temporary GTT memory, we should move it in BO validation. v2: move the check outside of for loop Signed-off-by: Lang Yu --- drivers/gpu/drm/ttm/ttm_bo.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/gpu/drm/ttm/ttm_bo.c b/drivers/gpu/drm/ttm/ttm

[PATCH 1/3] drm/amdgpu: add function to show ucode name via id

2021-06-24 Thread Lang Yu
From: Lang Yu Implement function amdgpu_ucode_show to show ucode name via ucode id. Signed-off-by: Lang Yu --- drivers/gpu/drm/amd/amdgpu/amdgpu_ucode.c | 78 +++ drivers/gpu/drm/amd/amdgpu/amdgpu_ucode.h | 2 + 2 files changed, 80 insertions(+) diff --git a/drivers/gpu

[PATCH 3/3] drm/amdgpu: show explicit name instead of id in psp_cmd_submit_buf

2021-06-24 Thread Lang Yu
From: Lang Yu Use amdgpu_ucode_show to show ucode name and psp_gfx_cmd_show to show psp_gfx_cmd name in psp_cmd_submit_buf. Signed-off-by: Lang Yu --- drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/gpu/drm/amd/amdgpu

[PATCH 2/3] drm/amdgpu: add function to show psp_gfx_cmd name via id

2021-06-24 Thread Lang Yu
From: Lang Yu Implement function psp_gfx_cmd_show to show cmd name via cmd id. Signed-off-by: Lang Yu --- drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c | 38 + 1 file changed, 38 insertions(+) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c b/drivers/gpu/drm/amd

[PATCH] drm/amd/display: 64-bit division on 32-bit arch issue

2021-01-22 Thread Lang Yu
Replace "/" with div_u64 for 32-bit arch. On 32-bit arch, the use of "/" for 64-bit division will cause build error, i.e. "__udivdi3/__divdi3 undefined!". Fixes: 27755cdf83f1 drm/amd/display: Update dcn30_apply_idle_power_optimizations() code Signed-off-by: Lan

[PATCH] drm/amd/amdkfd: adjust dummy functions ' placement

2021-01-27 Thread Lang Yu
Move all the dummy functions in amdgpu_amdkfd.c to amdgpu_amdkfd.h as inline functions. Signed-off-by: Lang Yu Suggested-by: Felix Kuehling --- drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.c | 87 drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.h | 151 ++--- 2 files changed

[PATCH] drm/amdgpu: fix incompatible types in conditional expression

2023-09-03 Thread Lang Yu
Fixes: ab041551f4a7 ("drm/amdgpu: add VPE 6.1.0 support") Signed-off-by: Lang Yu Reported-by: kernel test robot Link: https://lore.kernel.org/oe-kbuild-all/202309020608.fwp8qmht-...@intel.com --- drivers/gpu/drm/amd/amdgpu/amdgpu_vpe.h | 2 +- drivers/gpu/drm/amd/amdgpu/vpe_v6

Re: [bug report] drm/amdgpu: add selftest framework for UMSCH

2023-09-06 Thread Lang Yu
On 09/06/ , Dan Carpenter wrote: Thanks for reporting this bug. Can you give a link to this bug report? Commit message requests it. ("Reported-by: should be immediately followed by Link: with a URL to the report") Regards, Lang > Hello Lang Yu, > > The patch 5d5eac7e830

[PATCH] drm/amdgpu: fix unsigned error codes

2023-09-06 Thread Lang Yu
Fixes: 77b13b916728 ("drm/amdgpu: add selftest framework for UMSCH") Signed-off-by: Lang Yu Reported-by: Dan Carpenter Link: https://lore.kernel.org/all/ZPhddADtKmOuVyDq@lang-desktop --- drivers/gpu/drm/amd/amdgpu/amdgpu_umsch_mm.c | 7 +++ 1 file changed, 3 insertions(+), 4

[PATCH] drm/amdkfd: disable SVM for GC 10.1.3/4

2023-09-07 Thread Lang Yu
GC 10.1.3/4 have problems with TLB_FLUSH_HEAVYWEIGHT which is used by SVM in svm_range_unmap_from_gpus(). This causes problems on GC 10.1.3/4. Signed-off-by: Lang Yu --- drivers/gpu/drm/amd/amdkfd/kfd_migrate.c | 22 +- 1 file changed, 17 insertions(+), 5 deletions(-) diff

Re: [PATCH] drm/amdkfd: disable SVM for GC 10.1.3/4

2023-09-07 Thread Lang Yu
ect ROCm if we don't use SVM for ASICs except MI series. Regards, Lang > Regards, >   Felix > > > On 2023-09-07 08:08, Lang Yu wrote: > > GC 10.1.3/4 have problems with TLB_FLUSH_HEAVYWEIGHT > > which is used by SVM in svm_range_unmap_from_gpus(). > > This

Re: [PATCH] drm/amdkfd: Insert missing TLB flush on GFX10 and later

2023-09-11 Thread Lang Yu
On 09/11/ , Harish Kasiviswanathan wrote: > Heavy-weight TLB flush is required after unmap on all GPUs for > correctness and security. > > Signed-off-by: Harish Kasiviswanathan > --- > drivers/gpu/drm/amd/amdkfd/kfd_priv.h | 3 +-- > 1 file changed, 1 insertion(+), 2 deletions(-) > > diff --git

Re: [PATCH 2/2] drm/amdgpu: add remap_hdp_registers callback for nbio 7.11

2023-09-12 Thread Lang Yu
On 09/11/ , Alex Deucher wrote: > Implement support for remapping the HDP aperture registers for > NBIO 7.11. > > Signed-off-by: Alex Deucher The series is. Reviewed-by: Lang Yu > --- > drivers/gpu/drm/amd/amdgpu/nbio_v7_11.c | 9 + > 1 file changed, 9 insertio

Re: [PATCH] drm/amdgpu: add VPE IP discovery info to HW IP info query

2023-09-13 Thread Lang Yu
On 09/12/ , Alex Deucher wrote: > Add missing IP discovery info. > > Signed-off-by: Alex Deucher Reviewed-by: Lang Yu > --- > drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c | 3 +++ > 1 file changed, 3 insertions(+) > > diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c

Re: [PATCH] drm/amdkfd: Insert missing TLB flush on GFX10 and later

2023-09-13 Thread Lang Yu
On 09/12/ , Felix Kuehling wrote: > On 2023-09-11 22:52, Lang Yu wrote: > > On 09/11/ , Harish Kasiviswanathan wrote: > > > Heavy-weight TLB flush is required after unmap on all GPUs for > > > correctness and security. > > > > > > Signed-off-by: Har

  1   2   3   >