[PATCH] drm/amdgpu: Normalize reg offsets on JPEG v4.0.3

2024-08-20 Thread Lijo Lazar
Only local register offsets should be used on JPEG v4.0.3 as they cannot handle remote access to other AIDs. Since only local offsets are used, the special write to MCM_ADDR register is no longer needed. Signed-off-by: Lijo Lazar --- drivers/gpu/drm/amd/amdgpu/jpeg_v4_0_3.c | 32

[PATCH] drm/amd/pm: Add support for new P2S table revision

2024-08-21 Thread Lijo Lazar
Add p2s table support for a new revision of SMUv13.0.6. Signed-off-by: Lijo Lazar Reviewed-by: Hawking Zhang Reviewed-by: Asad Kamal --- drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_6_ppt.c | 7 ++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/amd/pm/swsmu

[PATCH v2] drm/amdgpu: Normalize reg offsets on JPEG v4.0.3

2024-08-27 Thread Lijo Lazar
On VFs and SOCs with GC 9.4.4, VCN RRMT is disabled. Only local register offsets should be used on JPEG v4.0.3 as they cannot handle remote access to other AIDs. Since only local offsets are used, the special write to MCM_ADDR register is no longer needed. Signed-off-by: Lijo Lazar --- v2

[PATCH 00/10] Support XGMI reset on init

2024-09-02 Thread Lijo Lazar
scenario where device is going to be reset. The series adds an API interface to check if a PSP TOS reload is required. Lijo Lazar (10): drm/amdgpu: Add init levels drm/amdgpu: Use init level for pending_reset flag drm/amdgpu: Separate reinitialization after reset drm/amdgpu: Add reset

[PATCH 01/10] drm/amdgpu: Add init levels

2024-09-02 Thread Lijo Lazar
Add init levels to define the level to which device needs to be initialized. Signed-off-by: Lijo Lazar --- drivers/gpu/drm/amd/amdgpu/amdgpu.h| 14 ++ drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 54 ++ 2 files changed, 68 insertions(+) diff --git a/drivers/gpu

[PATCH 02/10] drm/amdgpu: Use init level for pending_reset flag

2024-09-02 Thread Lijo Lazar
Drop pending_reset flag in gmc block. Instead use init level to determine which type of init is preferred - in this case MINIMAL. Signed-off-by: Lijo Lazar --- drivers/gpu/drm/amd/amdgpu/amdgpu_device.c| 33 --- drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c | 1 - drivers

[PATCH 05/10] drm/amdgpu: Add helper to initialize badpage info

2024-09-02 Thread Lijo Lazar
Add a separate function to read badpage data during initialization. Reading bad pages will need hardware access and cannot be done during reset. Hence in cases where device needs a full reset during init itself, attempting to read will cause a deadlock. Signed-off-by: Lijo Lazar --- drivers/gpu

[PATCH 03/10] drm/amdgpu: Separate reinitialization after reset

2024-09-02 Thread Lijo Lazar
Move the reinitialization part after a reset to another function. No functional changes. Signed-off-by: Lijo Lazar --- drivers/gpu/drm/amd/amdgpu/amdgpu.h| 2 + drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 150 - 2 files changed, 89 insertions(+), 63 deletions

[PATCH 04/10] drm/amdgpu: Add reset on init handler for XGMI

2024-09-02 Thread Lijo Lazar
In some cases, device needs to be reset before first use. Add handlers for doing device reset during driver init sequence. Signed-off-by: Lijo Lazar --- drivers/gpu/drm/amd/amdgpu/amdgpu.h | 1 + drivers/gpu/drm/amd/amdgpu/amdgpu_reset.c | 148 ++ drivers/gpu/drm/amd

[PATCH 07/10] drm/amdgpu: Drop delayed reset work handler

2024-09-02 Thread Lijo Lazar
Drop delayed reset work handler as it is no longer used. Signed-off-by: Lijo Lazar --- drivers/gpu/drm/amd/amdgpu/amdgpu.h | 4 -- drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c | 80 - 2 files changed, 84 deletions(-) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu.h b

[PATCH 06/10] drm/amdgpu: Refactor XGMI reset on init handling

2024-09-02 Thread Lijo Lazar
Use XGMI hive information to rely on resetting XGMI devices on initialization rather than using mgpu structure. mgpu structure may have other devices as well. Signed-off-by: Lijo Lazar --- drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 10 +-- drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c| 6

[PATCH 08/10] drm/amdgpu: Support reset-on-init on select SOCs

2024-09-02 Thread Lijo Lazar
Add XGMI reset on init support to aldebaran and SOCs with GC v9.4.3. Signed-off-by: Lijo Lazar --- drivers/gpu/drm/amd/amdgpu/aldebaran.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/gpu/drm/amd/amdgpu/aldebaran.c b/drivers/gpu/drm/amd/amdgpu/aldebaran.c index b0f95a7649bf

[PATCH 09/10] drm/amdgpu: Add interface for TOS reload cases

2024-09-02 Thread Lijo Lazar
Add interface to check if a different TOS needs to be loaded than the one which is which is already active on the SOC. Presently the interface is restricted to specific variants of PSPv13.0. Signed-off-by: Lijo Lazar --- drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c | 13 + drivers/gpu

[PATCH 10/10] drm/amdgpu: Add PSP reload case to reset-on-init

2024-09-02 Thread Lijo Lazar
A reset on initialization will be needed if a new PSP TOS needs to be loaded than the one currently active on the system. This is possible only on SOCs which support a full device reset which results in unload of active PSP TOS. Signed-off-by: Lijo Lazar --- drivers/gpu/drm/amd/amdgpu/soc15.c

[PATCH] drm/amdgpu: Fix JPEG v4.0.3 register write

2024-09-06 Thread Lijo Lazar
EXTERNAL_REG_INTERNAL_OFFSET/EXTERNAL_REG_WRITE_ADDR should be used in pairs. If an external register shoudln't be written, both packets shouldn't be sent. Fixes: a78b48146972 ("drm/amdgpu: Skip PCTL0_MMHUB_DEEPSLEEP_IB write in jpegv4.0.3 under SRIOV") Signed-off-by: Lijo

[PATCH v2 00/10] Support XGMI reset on init

2024-09-11 Thread Lijo Lazar
scenario where device is going to be reset. The series adds an API interface to check if a PSP TOS reload is required. v2: Fix logical issue while replacing pending_reset flag with init level Use consistent naming for functions/variables Lijo Lazar (10): drm/amdgpu: Add init

[PATCH v2 01/10] drm/amdgpu: Add init levels

2024-09-11 Thread Lijo Lazar
Add init levels to define the level to which device needs to be initialized. Signed-off-by: Lijo Lazar --- v2: Add comments describing init levels Drop unnecessary assignment Rename AMDGPU_INIT_LEVEL_MINIMAL to AMDGPU_INIT_LEVEL_MINIMAL_XGMI drivers/gpu/drm/amd/amdgpu

[PATCH v2 02/10] drm/amdgpu: Use init level for pending_reset flag

2024-09-11 Thread Lijo Lazar
Drop pending_reset flag in gmc block. Instead use init level to determine which type of init is preferred - in this case MINIMAL. Signed-off-by: Lijo Lazar --- v2: Fix logical issue while replacing pending_reset flag in smuv11 (Feifei) Use renamed init level id

[PATCH v2 03/10] drm/amdgpu: Separate reinitialization after reset

2024-09-11 Thread Lijo Lazar
Move the reinitialization part after a reset to another function. No functional changes. Signed-off-by: Lijo Lazar Reviewed-by: Feifei Xu Acked-by: Alex Deucher --- drivers/gpu/drm/amd/amdgpu/amdgpu.h| 2 + drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 150 - 2

[PATCH v2 04/10] drm/amdgpu: Add reset on init handler for XGMI

2024-09-11 Thread Lijo Lazar
In some cases, device needs to be reset before first use. Add handlers for doing device reset during driver init sequence. Signed-off-by: Lijo Lazar Reviewed-by: Feifei Xu --- v2: Use consistent naming scheme for functions/variables (Alex Deucher) drivers/gpu/drm/amd/amdgpu/amdgpu.h

[PATCH v2 06/10] drm/amdgpu: Refactor XGMI reset on init handling

2024-09-11 Thread Lijo Lazar
Use XGMI hive information to rely on resetting XGMI devices on initialization rather than using mgpu structure. mgpu structure may have other devices as well. Signed-off-by: Lijo Lazar Reviewed-by: Feifei Xu --- v2: Use consistent naming scheme for functions/variables (Alex Deucher

[PATCH v2 08/10] drm/amdgpu: Support reset-on-init on select SOCs

2024-09-11 Thread Lijo Lazar
Add XGMI reset on init support to aldebaran and SOCs with GC v9.4.3. Signed-off-by: Lijo Lazar Reviewed-by: Feifei Xu Reviewed-by: Alex Deucher --- v2: Use renamed variable drivers/gpu/drm/amd/amdgpu/aldebaran.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/gpu/drm/amd

[PATCH v2 09/10] drm/amdgpu: Add interface for TOS reload cases

2024-09-11 Thread Lijo Lazar
Add interface to check if a different TOS needs to be loaded than the one which is which is already active on the SOC. Presently the interface is restricted to specific variants of PSPv13.0. Signed-off-by: Lijo Lazar Reviewed-by: Feifei Xu Reviewed-by: Alex Deucher --- drivers/gpu/drm/amd

[PATCH v2 05/10] drm/amdgpu: Add helper to initialize badpage info

2024-09-11 Thread Lijo Lazar
Add a separate function to read badpage data during initialization. Reading bad pages will need hardware access and cannot be done during reset. Hence in cases where device needs a full reset during init itself, attempting to read will cause a deadlock. Signed-off-by: Lijo Lazar Reviewed-by

[PATCH v2 07/10] drm/amdgpu: Drop delayed reset work handler

2024-09-11 Thread Lijo Lazar
Drop delayed reset work handler as it is no longer used. Signed-off-by: Lijo Lazar Reviewed-by: Feifei Xu Reviewed-by: Alex Deucher --- drivers/gpu/drm/amd/amdgpu/amdgpu.h | 4 -- drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c | 80 - 2 files changed, 84 deletions

[PATCH v2 10/10] drm/amdgpu: Add PSP reload case to reset-on-init

2024-09-11 Thread Lijo Lazar
A reset on initialization will be needed if a new PSP TOS needs to be loaded than the one currently active on the system. This is possible only on SOCs which support a full device reset which results in unload of active PSP TOS. Signed-off-by: Lijo Lazar Reviewed-by: Feifei Xu Reviewed-by: Alex

[PATCH] drm/amdgpu: Fix XCP instance mask calculation

2024-09-12 Thread Lijo Lazar
Fix instance mask calculation for VCN IP. There are cases where VCN instance could be shared across partitions. Fix here so that other blocks don't need to check for any shared instances based on partition mode. Signed-off-by: Lijo Lazar --- drivers/gpu/drm/amd/amdgpu/aqua_vanjaram.c

[PATCH] drm/amdgpu: Avoid fetching VRAM vendor info

2024-02-02 Thread Lijo Lazar
The present way to fetch VRAM vendor information turns out to be not reliable on GFX 9.4.3 dGPUs as well. Avoid using the data. Signed-off-by: Lijo Lazar --- drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c | 8 1 file changed, 8 deletions(-) diff --git a/drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c b

[PATCH] drm/amdgpu: Fix HDP flush for VFs on nbio v7.9

2024-02-06 Thread Lijo Lazar
HDP flush remapping is not done for VFs. Keep the original offsets in VF environment. Signed-off-by: Lijo Lazar --- drivers/gpu/drm/amd/amdgpu/nbio_v7_9.c | 6 ++ 1 file changed, 6 insertions(+) diff --git a/drivers/gpu/drm/amd/amdgpu/nbio_v7_9.c b/drivers/gpu/drm/amd/amdgpu/nbio_v7_9.c

[PATCH] drm/amd/pm: Allow setting max UCLK on SMU v13.0.6

2024-02-08 Thread Lijo Lazar
t; "/sys/bus/pci/devices/.../pp_od_clk_voltage” Signed-off-by: Lijo Lazar --- .../drm/amd/pm/swsmu/smu13/smu_v13_0_6_ppt.c | 103 -- 1 file changed, 92 insertions(+), 11 deletions(-) diff --git a/drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_6_ppt.c b/drivers/gpu/drm/amd/pm/

[PATCH v2] drm/amd/pm: Allow setting max UCLK on SMU v13.0.6

2024-02-08 Thread Lijo Lazar
t; "/sys/bus/pci/devices/.../pp_od_clk_voltage” Signed-off-by: Lijo Lazar --- v2: On switching perf level to auto, restore GFX and UCLK levels only if needed. .../drm/amd/pm/swsmu/smu13/smu_v13_0_6_ppt.c | 122 +++--- 1 file changed, 102 insertions(+), 20 deletions(-) dif

[PATCH 1/2] drm/amdgpu: Add fatal error detected flag

2024-02-22 Thread Lijo Lazar
For a RAS error that needs a full reset to recover, set the fatal error status. Clear the status once the device is reset. Signed-off-by: Lijo Lazar --- drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 1 + drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c| 32 ++ drivers/gpu/drm/amd

[PATCH 2/2] drm/amdkfd : Skip packet submission on fatal error

2024-02-22 Thread Lijo Lazar
If fatal error is detected, packet submission won't go through. Return error in such cases. Also, avoid waiting for fence when fatal error is detected. Signed-off-by: Lijo Lazar --- drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.c| 5 + drivers/gpu/drm/amd/amdgpu/amdgpu_amd

[PATCH] drm/amdkfd: Add partition id field to location_id

2024-02-22 Thread Lijo Lazar
On devices which have multi-partition nodes, keep partition id in location_id[31:28]. Signed-off-by: Lijo Lazar --- drivers/gpu/drm/amd/amdkfd/kfd_topology.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_topology.c b/drivers/gpu/drm/amd

[PATCH] drm/amd/pm: Increase SMUv13.0.6 mode-2 reset time

2024-02-26 Thread Lijo Lazar
On SOCs with SMUv13.0.6, mode-2 reset takes a bit longer. Wait for 200ms before trying to restore config space after mode-2 reset. Signed-off-by: Lijo Lazar --- drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_6_ppt.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers

[PATCH 1/2] drm/amdgpu: Add HDP flush to VCN v4.0.3

2024-03-04 Thread Lijo Lazar
VCN 4.0.3 cannot trigger HDP flush with RRMT enabled. Instead, trigger HDP flush from host side before ringing doorbell. Signed-off-by: Lijo Lazar --- drivers/gpu/drm/amd/amdgpu/vcn_v4_0_3.c | 25 + 1 file changed, 25 insertions(+) diff --git a/drivers/gpu/drm/amd

[PATCH 2/2] drm/amdgpu: Use offsets local to VCN in VF

2024-03-04 Thread Lijo Lazar
For VCN 4.0.3, use only the local addressing scheme while in VF mode. This includes addressing scheme used for HUB offsets. Signed-off-by: Lijo Lazar --- drivers/gpu/drm/amd/amdgpu/vcn_v4_0_3.c | 20 +++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/drivers/gpu

[PATCH] drm/amdgpu: Do a basic health check before reset

2024-03-13 Thread Lijo Lazar
Check if the device is present in the bus before trying to recover. It could be that device itself is lost from the bus in some hang situations. Signed-off-by: Lijo Lazar --- drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 24 ++ 1 file changed, 24 insertions(+) diff --git a

[PATCH 0/9] Add PM policy interfaces

2024-03-13 Thread Lijo Lazar
policy types are supported. It also removes the legacy sysfs interface to set XGMI PLPD as it is not used any client like SMI tool. Lijo Lazar (9): drm/amd/pm: Add support for DPM policies drm/amd/pm: Update PMFW messages for SMUv13.0.6 drm/amd/pm: Add support to select pstate policy drm/amd

[PATCH 1/9] drm/amd/pm: Add support for DPM policies

2024-03-13 Thread Lijo Lazar
chosen. Signed-off-by: Lijo Lazar Reviewed-by: Hawking Zhang --- .../gpu/drm/amd/include/kgd_pp_interface.h| 16 drivers/gpu/drm/amd/pm/amdgpu_dpm.c | 29 ++ drivers/gpu/drm/amd/pm/amdgpu_pm.c| 92 ++ drivers/gpu/drm/amd/pm/inc/amdgpu_dpm.h

[PATCH 3/9] drm/amd/pm: Add support to select pstate policy

2024-03-13 Thread Lijo Lazar
Add support to select pstate policy in SOCs with SMUv13.0.6 Signed-off-by: Lijo Lazar Reviewed-by: Hawking Zhang --- .../gpu/drm/amd/pm/swsmu/smu13/smu_v13_0.c| 2 + .../drm/amd/pm/swsmu/smu13/smu_v13_0_6_ppt.c | 71 +++ drivers/gpu/drm/amd/pm/swsmu/smu_cmn.c| 30

[PATCH 2/9] drm/amd/pm: Update PMFW messages for SMUv13.0.6

2024-03-13 Thread Lijo Lazar
Add PMF message to select a Pstate policy in SOCs with SMU v13.0.6. Signed-off-by: Lijo Lazar Reviewed-by: Hawking Zhang --- drivers/gpu/drm/amd/pm/swsmu/inc/pmfw_if/smu_v13_0_6_ppsmc.h | 3 ++- drivers/gpu/drm/amd/pm/swsmu/inc/smu_types.h | 3 ++- 2 files changed, 4 insertions

[PATCH 5/9] drm/amd/pm: Add xgmi plpd to SMU v13.0.6 pm_policy

2024-03-13 Thread Lijo Lazar
On SOCs with SMU v13.0.6, allow changing xgmi plpd policy through pm_policy sysfs interface. Signed-off-by: Lijo Lazar Reviewed-by: Hawking Zhang --- drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c | 15 +- .../drm/amd/pm/swsmu/smu13/smu_v13_0_6_ppt.c | 51 +-- drivers/gpu

[PATCH 4/9] drm/amd/pm: Add xgmi plpd policy to pm_policy

2024-03-13 Thread Lijo Lazar
Add support to set XGMI PLPD policy levels through pm_policy sysfs node. Signed-off-by: Lijo Lazar Reviewed-by: Hawking Zhang --- drivers/gpu/drm/amd/include/kgd_pp_interface.h | 1 + drivers/gpu/drm/amd/pm/amdgpu_pm.c | 3 +++ 2 files changed, 4 insertions(+) diff --git a/drivers

[PATCH 7/9] drm/amd/pm: Add xgmi plpd to arcturus pm_policy

2024-03-13 Thread Lijo Lazar
On arcturus, allow changing xgmi plpd policy through pm_policy sysfs interface. Signed-off-by: Lijo Lazar Reviewed-by: Hawking Zhang --- drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c | 7 ++-- .../gpu/drm/amd/pm/swsmu/smu11/arcturus_ppt.c | 42 +++ 2 files changed, 46

[PATCH 8/9] drm/amd/pm: Remove legacy interface for xgmi plpd

2024-03-13 Thread Lijo Lazar
Replace the legacy interface with amdgpu_dpm_set_pm_policy to set XGMI PLPD mode. Also, xgmi_plpd sysfs node is not used by any client. Remove that as well. Signed-off-by: Lijo Lazar Reviewed-by: Hawking Zhang --- drivers/gpu/drm/amd/amdgpu/amdgpu_xgmi.c | 4 +- drivers/gpu/drm/amd/pm

[PATCH 6/9] drm/amd/pm: Add xgmi plpd to aldebaran pm_policy

2024-03-13 Thread Lijo Lazar
On aldebaran, allow changing xgmi plpd policy through pm_policy sysfs interface. Signed-off-by: Lijo Lazar Reviewed-by: Hawking Zhang --- .../drm/amd/pm/swsmu/smu13/aldebaran_ppt.c| 35 +++ 1 file changed, 35 insertions(+) diff --git a/drivers/gpu/drm/amd/pm/swsmu/smu13

[PATCH 9/9] drm/amd/pm: Remove unused interface to set plpd

2024-03-13 Thread Lijo Lazar
Remove unused callback to set PLPD policy and its implementation from arcturus, aldebaran and SMUv13.0.6 SOCs. Signed-off-by: Lijo Lazar Reviewed-by: Hawking Zhang --- drivers/gpu/drm/amd/pm/swsmu/inc/amdgpu_smu.h | 6 --- .../gpu/drm/amd/pm/swsmu/smu11/arcturus_ppt.c | 22

[PATCH v2 0/9] Add PM policy interfaces

2024-03-14 Thread Lijo Lazar
policy types are supported. It also removes the legacy sysfs interface to set XGMI PLPD as it is not used any client like SMI tool. v2: Add NULL checks to avoid access on SOCs which don't support any policy. Lijo Lazar (9): drm/amd/pm: Add support for DPM policies drm/amd/pm: Update

[PATCH v2 2/9] drm/amd/pm: Update PMFW messages for SMUv13.0.6

2024-03-14 Thread Lijo Lazar
Add PMF message to select a Pstate policy in SOCs with SMU v13.0.6. Signed-off-by: Lijo Lazar Reviewed-by: Hawking Zhang --- drivers/gpu/drm/amd/pm/swsmu/inc/pmfw_if/smu_v13_0_6_ppsmc.h | 3 ++- drivers/gpu/drm/amd/pm/swsmu/inc/smu_types.h | 3 ++- 2 files changed, 4 insertions

[PATCH v2 4/9] drm/amd/pm: Add xgmi plpd policy to pm_policy

2024-03-14 Thread Lijo Lazar
Add support to set XGMI PLPD policy levels through pm_policy sysfs node. Signed-off-by: Lijo Lazar Reviewed-by: Hawking Zhang --- drivers/gpu/drm/amd/include/kgd_pp_interface.h | 1 + drivers/gpu/drm/amd/pm/amdgpu_pm.c | 3 +++ 2 files changed, 4 insertions(+) diff --git a/drivers

[PATCH v2 5/9] drm/amd/pm: Add xgmi plpd to SMU v13.0.6 pm_policy

2024-03-14 Thread Lijo Lazar
On SOCs with SMU v13.0.6, allow changing xgmi plpd policy through pm_policy sysfs interface. Signed-off-by: Lijo Lazar Reviewed-by: Hawking Zhang --- drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c | 19 ++- .../drm/amd/pm/swsmu/smu13/smu_v13_0_6_ppt.c | 51 +-- drivers/gpu

[PATCH v2 1/9] drm/amd/pm: Add support for DPM policies

2024-03-14 Thread Lijo Lazar
chosen. Signed-off-by: Lijo Lazar Reviewed-by: Hawking Zhang --- v2: Add NULL checks before accessing smu_dpm_policy_ctxt .../gpu/drm/amd/include/kgd_pp_interface.h| 16 drivers/gpu/drm/amd/pm/amdgpu_dpm.c | 29 ++ drivers/gpu/drm/amd/pm/amdgpu_pm.c| 92

[PATCH v2 3/9] drm/amd/pm: Add support to select pstate policy

2024-03-14 Thread Lijo Lazar
Add support to select pstate policy in SOCs with SMUv13.0.6 Signed-off-by: Lijo Lazar Reviewed-by: Hawking Zhang --- .../gpu/drm/amd/pm/swsmu/smu13/smu_v13_0.c| 2 + .../drm/amd/pm/swsmu/smu13/smu_v13_0_6_ppt.c | 71 +++ drivers/gpu/drm/amd/pm/swsmu/smu_cmn.c| 30

[PATCH v2 6/9] drm/amd/pm: Add xgmi plpd to aldebaran pm_policy

2024-03-14 Thread Lijo Lazar
On aldebaran, allow changing xgmi plpd policy through pm_policy sysfs interface. Signed-off-by: Lijo Lazar Reviewed-by: Hawking Zhang --- .../drm/amd/pm/swsmu/smu13/aldebaran_ppt.c| 35 +++ 1 file changed, 35 insertions(+) diff --git a/drivers/gpu/drm/amd/pm/swsmu/smu13

[PATCH v2 8/9] drm/amd/pm: Remove legacy interface for xgmi plpd

2024-03-14 Thread Lijo Lazar
Replace the legacy interface with amdgpu_dpm_set_pm_policy to set XGMI PLPD mode. Also, xgmi_plpd sysfs node is not used by any client. Remove that as well. Signed-off-by: Lijo Lazar Reviewed-by: Hawking Zhang --- drivers/gpu/drm/amd/amdgpu/amdgpu_xgmi.c | 4 +- drivers/gpu/drm/amd/pm

[PATCH v2 7/9] drm/amd/pm: Add xgmi plpd to arcturus pm_policy

2024-03-14 Thread Lijo Lazar
On arcturus, allow changing xgmi plpd policy through pm_policy sysfs interface. Signed-off-by: Lijo Lazar Reviewed-by: Hawking Zhang --- drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c | 7 ++-- .../gpu/drm/amd/pm/swsmu/smu11/arcturus_ppt.c | 42 +++ 2 files changed, 46

[PATCH v2 9/9] drm/amd/pm: Remove unused interface to set plpd

2024-03-14 Thread Lijo Lazar
Remove unused callback to set PLPD policy and its implementation from arcturus, aldebaran and SMUv13.0.6 SOCs. Signed-off-by: Lijo Lazar Reviewed-by: Hawking Zhang --- drivers/gpu/drm/amd/pm/swsmu/inc/amdgpu_smu.h | 6 --- .../gpu/drm/amd/pm/swsmu/smu11/arcturus_ppt.c | 22

[PATCH] drm/amdgpu: Refine IB schedule error logging

2024-03-21 Thread Lijo Lazar
Downgrade to debug information when IBs are skipped. Also, use dev_* to identify the device. Signed-off-by: Lijo Lazar --- drivers/gpu/drm/amd/amdgpu/amdgpu_job.c | 7 +-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_job.c b/drivers/gpu

[PATCH] drm/amdgpu: Fix VCN allocation in CPX partition

2024-03-27 Thread Lijo Lazar
VCN need not be shared in CPX mode always for all GFX 9.4.3 SOC SKUs. In certain configs, VCN instance can be exclusively allocated to a partition even under CPX mode. Signed-off-by: Lijo Lazar Reviewed-by: James Zhu Reviewed-by: Asad Kamal --- drivers/gpu/drm/amd/amdgpu/aqua_vanjaram.c | 15

[PATCH v2 2/4] drm/amd/pm: Add PMFW message and capability flags

2024-03-27 Thread Lijo Lazar
Add flags to categorize messages and PMFW capabilities. Signed-off-by: Lijo Lazar --- drivers/gpu/drm/amd/pm/swsmu/inc/amdgpu_smu.h | 3 ++- drivers/gpu/drm/amd/pm/swsmu/inc/smu_types.h | 7 +++ drivers/gpu/drm/amd/pm/swsmu/smu_cmn.c| 2 +- 3 files changed, 10 insertions(+), 2

[PATCH v2 1/4] drm/amdgpu: Set fatal errror detected flag earlier

2024-03-27 Thread Lijo Lazar
In case of fatal errors, set FED status when interrupt is received. Set the flag on other devices in the hive before RAS recovery work. Signed-off-by: Lijo Lazar --- v2: Avoid accessing hive in interrupt handler as it may take mutex path (Kevin) drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c | 41

[PATCH v2 3/4] drm/amd/pm: Add special handling for RAS messages

2024-03-27 Thread Lijo Lazar
response status register before sending priority messages. Use firmware capability flag to determine whether to filter priority messages. Signed-off-by: Lijo Lazar --- drivers/gpu/drm/amd/pm/swsmu/smu_cmn.c | 65 +++--- 1 file changed, 59 insertions(+), 6 deletions(-) diff --gi

[PATCH v2 4/4] drm/amd/pm: Categorize RAS messages on SMUv13.0.6

2024-03-27 Thread Lijo Lazar
Set RAS priority handling capability for SMUv13.0.6 SOCs and categorize RAS priority messages allowed. Signed-off-by: Lijo Lazar --- v2: Move setting FW capability flags to IP specific code (Kevin) drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_6_ppt.c | 11 ++- 1 file changed, 6

[PATCH] drm/amdgpu: Reset dGPU if suspend got aborted

2024-03-27 Thread Lijo Lazar
For SOC21 ASICs, there is an issue in re-enabling PM features if a suspend got aborted. In such cases, reset the device during resume phase. This is a workaround till a proper solution is finalized. Signed-off-by: Lijo Lazar --- drivers/gpu/drm/amd/amdgpu/soc21.c | 27

[PATCH v2] drm/amdgpu: Reset dGPU if suspend got aborted

2024-03-27 Thread Lijo Lazar
For SOC21 ASICs, there is an issue in re-enabling PM features if a suspend got aborted. In such cases, reset the device during resume phase. This is a workaround till a proper solution is finalized. Signed-off-by: Lijo Lazar --- v2: Read TOS status only if required (Kevin). Refine log

[PATCH v3] drm/amdgpu: Reset dGPU if suspend got aborted

2024-03-27 Thread Lijo Lazar
For SOC21 ASICs, there is an issue in re-enabling PM features if a suspend got aborted. In such cases, reset the device during resume phase. This is a workaround till a proper solution is finalized. Signed-off-by: Lijo Lazar Reviewed-by: Alex Deucher Reviewed-by: Yang Wang Cc: sta

[PATCH] drm/amd/pm: Allow setting soft max frequency in VF

2024-04-03 Thread Lijo Lazar
Setting soft max frequency for MCLK is allowed in 1VF mode in SMUv13.0.6 SOCs. Signed-off-by: Lijo Lazar --- drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_6_ppt.c | 7 ++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_6_ppt.c b

[PATCH] drm/amdgpu: Fix pci state save during mode-1 reset

2024-06-18 Thread Lijo Lazar
Cache the PCI state before bus master is disabled. The saved state is later used for other cases like restoring config space after mode-2 reset. Signed-off-by: Lijo Lazar Fixes: 5c03e5843e6b ("drm/amdgpu:add smu mode1/2 support for aldebaran") --- drivers/gpu/drm/amd/amdgpu/amdgpu_de

[PATCH] drm/amdkfd: Use device based logging for errors

2024-06-25 Thread Lijo Lazar
Convert some pr_* to some dev_* APIs to identify the device. Signed-off-by: Lijo Lazar --- drivers/gpu/drm/amd/amdkfd/kfd_flat_memory.c | 3 +- drivers/gpu/drm/amd/amdkfd/kfd_kernel_queue.c | 21 --- drivers/gpu/drm/amd/amdkfd/kfd_mqd_manager.c | 8 ++- .../gpu/drm/amd/amdkfd

[PATCH] drm/amdgpu: Initialize VF partition mode

2024-07-08 Thread Lijo Lazar
For SOCs with GFX v9.4.3, a VF may have multiple compute partitions. Fetch the partition information during init and initialize partition nodes. There is no support to switch partition mode in VF mode, hence disable the same. Signed-off-by: Lijo Lazar --- drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.h

[PATCH] drm/amd/pm: Ignore throttle events on SMUv13.0.6

2024-07-24 Thread Lijo Lazar
Spurious events are seen, temporarily ignore the events altogether. Signed-off-by: Lijo Lazar --- drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_6_ppt.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_6_ppt.c b/drivers/gpu/drm/amd/pm/swsmu/smu13

[PATCH] drm/amdkfd: Add node_id to location_id generically

2024-08-08 Thread Lijo Lazar
If there are multiple nodes per kfd device, add nodeid to location_id to differentiate. Signed-off-by: Lijo Lazar --- drivers/gpu/drm/amd/amdkfd/kfd_topology.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_topology.c b/drivers/gpu/drm/amd

[PATCH] drm/amdgpu: Reorder to read EFI exported ROM first

2024-08-11 Thread Lijo Lazar
On EFI BIOSes, PCI ROM may be exported through EFI_PCI_IO_PROTOCOL and expansion ROM BARs may not be enabled. Choose to read from EFI exported ROM data before reading PCI Expansion ROM BAR. Signed-off-by: Lijo Lazar --- drivers/gpu/drm/amd/amdgpu/amdgpu_bios.c | 10 +- 1 file changed, 5

[PATCH] drm/amdgpu: Change AID detection logic

2024-04-14 Thread Lijo Lazar
On GFX 9.4.3 SOCs, only 2 SDMA instances need to be available to be considered as a valid AID. Signed-off-by: Lijo Lazar Reviewed-by: Asad Kamal --- drivers/gpu/drm/amd/amdgpu/aqua_vanjaram.c | 7 --- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/amd/amdgpu

[PATCH] drm/amdgpu: Assign correct bits for SDMA HDP flush

2024-04-17 Thread Lijo Lazar
HDP Flush request bit can be kept unique per AID, and doesn't need to be unique SOC-wide. Assign only bits 10-13 for SDMA v4.4.2. Signed-off-by: Lijo Lazar --- drivers/gpu/drm/amd/amdgpu/sdma_v4_4_2.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/dr

[PATCH] drm/amd/pm: Restore config space after reset

2024-04-17 Thread Lijo Lazar
ad is same as the saved value. Add a workaround to write saved config space values from driver side. Presently, these switches are in platforms with SMU v13.0.6 SOCs, hence restrict the workaround only to those. Signed-off-by: Lijo Lazar --- .../drm/amd/pm/swsmu/smu13/smu_v13_0_6_ppt.c

[PATCH] Revert "drm/amdkfd: Add partition id field to location_id"

2024-04-23 Thread Lijo Lazar
This reverts commit 925c7bd1d1cf9f173b22603c8bd4816d142d4935. RCCL library is currently not treating spatial partitions differently, hence this change is causing issues. Revert temporarily till RCCL implementation is ready for spatial partitions. Signed-off-by: Lijo Lazar --- drivers/gpu/drm

[PATCH] drm/amd/amdxcp: Use unique name for partition dev

2024-04-30 Thread Lijo Lazar
e device to populate 'MODALIAS'. When 'amdxcp' is used as the base name, only first partition device gets identified. Assign unique name so that drm library identifies partition devices separately. amdxcp doesn't support probe of partitions, it doesn't bother about modaliases

[PATCH] drm/amd/amdxcp: Fix warnings

2024-05-05 Thread Lijo Lazar
on of size 20 59 | snprintf(dev_name, sizeof(dev_name), "amdgpu_xcp_%d", pdev_num); | ^~~ Fixes: f3b4c9a2746c ("drm/amd/amdxcp: Use unique name for partition dev") Signed-off-by: Lijo Lazar Re

[PATCH] drm/amd/pm: Fix aldebaran pcie speed reporting

2024-05-09 Thread Lijo Lazar
Fix the field definitions for LC_CURRENT_DATA_RATE. Signed-off-by: Lijo Lazar Fixes: c05d1c401572 ("drm/amd/swsmu: add aldebaran smu13 ip support") --- drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/

[PATCH v3 00/10] Add PM policy interfaces

2024-05-13 Thread Lijo Lazar
policy types are supported. It also removes the legacy sysfs interface to set XGMI PLPD as it is not used any client like SMI tool. v2: Add NULL checks to avoid access on SOCs which don't support any policy. v3: Rebase and add documentation patch Lijo Lazar (10): drm/amd/pm: Add support fo

[PATCH v3 01/10] drm/amd/pm: Add support for DPM policies

2024-05-13 Thread Lijo Lazar
chosen. Signed-off-by: Lijo Lazar Reviewed-by: Hawking Zhang --- v2: Add NULL checks before accessing smu_dpm_policy_ctxt v3: Rebase to add device_attr_id__pm_policy .../gpu/drm/amd/include/kgd_pp_interface.h| 16 +++ drivers/gpu/drm/amd/pm/amdgpu_dpm.c | 29 ++ drivers/gpu

[PATCH v3 02/10] drm/amd/pm: Update PMFW messages for SMUv13.0.6

2024-05-13 Thread Lijo Lazar
Add PMF message to select a Pstate policy in SOCs with SMU v13.0.6. Signed-off-by: Lijo Lazar Reviewed-by: Hawking Zhang --- drivers/gpu/drm/amd/pm/swsmu/inc/pmfw_if/smu_v13_0_6_ppsmc.h | 3 ++- drivers/gpu/drm/amd/pm/swsmu/inc/smu_types.h | 3 ++- 2 files changed, 4 insertions

[PATCH v3 03/10] drm/amd/pm: Add support to select pstate policy

2024-05-13 Thread Lijo Lazar
Add support to select pstate policy in SOCs with SMUv13.0.6 Signed-off-by: Lijo Lazar Reviewed-by: Hawking Zhang --- .../gpu/drm/amd/pm/swsmu/smu13/smu_v13_0.c| 2 + .../drm/amd/pm/swsmu/smu13/smu_v13_0_6_ppt.c | 71 +++ drivers/gpu/drm/amd/pm/swsmu/smu_cmn.c| 30

[PATCH v3 07/10] drm/amd/pm: Add xgmi plpd to arcturus pm_policy

2024-05-13 Thread Lijo Lazar
On arcturus, allow changing xgmi plpd policy through pm_policy sysfs interface. Signed-off-by: Lijo Lazar Reviewed-by: Hawking Zhang --- drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c | 7 ++-- .../gpu/drm/amd/pm/swsmu/smu11/arcturus_ppt.c | 42 +++ 2 files changed, 46

[PATCH v3 04/10] drm/amd/pm: Add xgmi plpd policy to pm_policy

2024-05-13 Thread Lijo Lazar
Add support to set XGMI PLPD policy levels through pm_policy sysfs node. Signed-off-by: Lijo Lazar Reviewed-by: Hawking Zhang --- drivers/gpu/drm/amd/include/kgd_pp_interface.h | 1 + drivers/gpu/drm/amd/pm/amdgpu_pm.c | 3 +++ 2 files changed, 4 insertions(+) diff --git a/drivers

[PATCH v3 08/10] drm/amd/pm: Remove legacy interface for xgmi plpd

2024-05-13 Thread Lijo Lazar
Replace the legacy interface with amdgpu_dpm_set_pm_policy to set XGMI PLPD mode. Also, xgmi_plpd sysfs node is not used by any client. Remove that as well. Signed-off-by: Lijo Lazar Reviewed-by: Hawking Zhang --- v2: No change v3: Rebase to remove device_attr_id__xgmi_plpd_policy drivers/gpu

[PATCH v3 05/10] drm/amd/pm: Add xgmi plpd to SMU v13.0.6 pm_policy

2024-05-13 Thread Lijo Lazar
On SOCs with SMU v13.0.6, allow changing xgmi plpd policy through pm_policy sysfs interface. Signed-off-by: Lijo Lazar Reviewed-by: Hawking Zhang --- drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c | 19 +-- .../drm/amd/pm/swsmu/smu13/smu_v13_0_6_ppt.c | 51 +-- drivers/gpu

[PATCH v3 09/10] drm/amd/pm: Remove unused interface to set plpd

2024-05-13 Thread Lijo Lazar
Remove unused callback to set PLPD policy and its implementation from arcturus, aldebaran and SMUv13.0.6 SOCs. Signed-off-by: Lijo Lazar Reviewed-by: Hawking Zhang --- drivers/gpu/drm/amd/pm/swsmu/inc/amdgpu_smu.h | 6 --- .../gpu/drm/amd/pm/swsmu/smu11/arcturus_ppt.c | 22

[PATCH v3 06/10] drm/amd/pm: Add xgmi plpd to aldebaran pm_policy

2024-05-13 Thread Lijo Lazar
On aldebaran, allow changing xgmi plpd policy through pm_policy sysfs interface. Signed-off-by: Lijo Lazar Reviewed-by: Hawking Zhang --- .../drm/amd/pm/swsmu/smu13/aldebaran_ppt.c| 35 +++ 1 file changed, 35 insertions(+) diff --git a/drivers/gpu/drm/amd/pm/swsmu/smu13

[PATCH v3 10/10] Documentation/amdgpu: Add PM policy documentation

2024-05-13 Thread Lijo Lazar
Add documentation about the newly added pm_policy node in sysfs. Signed-off-by: Lijo Lazar --- Documentation/gpu/amdgpu/thermal.rst | 6 drivers/gpu/drm/amd/pm/amdgpu_pm.c | 48 2 files changed, 54 insertions(+) diff --git a/Documentation/gpu/amdgpu

[PATCH 1/3] drm/amdgpu: Fix memory range calculation

2024-05-14 Thread Lijo Lazar
Consider the 16M reserved region also before range calculation for GMC 9.4.3 SOCs. Signed-off-by: Lijo Lazar Acked-by: Christian König Reviewed-by: Le Ma Fixes: a433f1f59484 ("drm/amdgpu: Initialize memory ranges for GC 9.4.3") --- drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c | 2 +- 1 fi

[PATCH 2/3] drm/amdgpu: Add nps info table to IP discovery

2024-05-14 Thread Lijo Lazar
Add support to fetch NPS info table in IP discovery table. Signed-off-by: Lijo Lazar Reviewed-by: Le Ma --- drivers/gpu/drm/amd/include/discovery.h | 25 - 1 file changed, 24 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/amd/include/discovery.h b/drivers

[PATCH 3/3] drm/amdgpu: Use NPS ranges from discovery table

2024-05-14 Thread Lijo Lazar
Add GMC API to fetch NPS range information from discovery table. Use NPS range information in GMC 9.4.3 SOCs when available, otherwise fallback to software method. Signed-off-by: Lijo Lazar Reviewed-by: Le Ma --- drivers/gpu/drm/amd/amdgpu/amdgpu_discovery.c | 92 +++ drivers

[PATCH v4 00/10] Add PM policy interfaces

2024-05-14 Thread Lijo Lazar
read/write (Alex Deucher) Lijo Lazar (10): drm/amd/pm: Add support for DPM policies drm/amd/pm: Update PMFW messages for SMUv13.0.6 drm/amd/pm: Add support to select pstate policy drm/amd/pm: Add xgmi plpd policy to pm_policy drm/amd/pm: Add xgmi plpd to SMU v13.0.6 pm_policy drm/amd/pm

[PATCH v4 01/10] drm/amd/pm: Add support for DPM policies

2024-05-14 Thread Lijo Lazar
chosen. Signed-off-by: Lijo Lazar Reviewed-by: Hawking Zhang --- v2: Add NULL checks before accessing smu_dpm_policy_ctxt v3: Rebase to add device_attr_id__pm_policy v4: Use macro to define policy type for consistency. .../gpu/drm/amd/include/kgd_pp_interface.h| 16 +++ drivers/gpu/drm/amd

[PATCH v4 02/10] drm/amd/pm: Update PMFW messages for SMUv13.0.6

2024-05-14 Thread Lijo Lazar
Add PMF message to select a Pstate policy in SOCs with SMU v13.0.6. Signed-off-by: Lijo Lazar Reviewed-by: Hawking Zhang --- drivers/gpu/drm/amd/pm/swsmu/inc/pmfw_if/smu_v13_0_6_ppsmc.h | 3 ++- drivers/gpu/drm/amd/pm/swsmu/inc/smu_types.h | 3 ++- 2 files changed, 4 insertions

[PATCH v4 04/10] drm/amd/pm: Add xgmi plpd policy to pm_policy

2024-05-14 Thread Lijo Lazar
Add support to set XGMI PLPD policy levels through pm_policy sysfs node. Signed-off-by: Lijo Lazar Reviewed-by: Hawking Zhang --- v2, v3: No change v4: Use a macro for XGMI PLPD policy type drivers/gpu/drm/amd/include/kgd_pp_interface.h | 1 + drivers/gpu/drm/amd/pm/amdgpu_pm.c

[PATCH v4 03/10] drm/amd/pm: Add support to select pstate policy

2024-05-14 Thread Lijo Lazar
Add support to select pstate policy in SOCs with SMUv13.0.6 Signed-off-by: Lijo Lazar Reviewed-by: Hawking Zhang --- v2,v3: No change v4: Use macro for policy type name .../gpu/drm/amd/pm/swsmu/smu13/smu_v13_0.c| 2 + .../drm/amd/pm/swsmu/smu13/smu_v13_0_6_ppt.c | 71

  1   2   3   4   5   >