[PATCH] drm/amd: Fix UBSAN array-index-out-of-bounds for Polaris and Tonga

2023-10-04 Thread Mario Limonciello
For pptable structs that use flexible array sizes, use flexible arrays. Link: https://bugs.launchpad.net/ubuntu/+source/linux/+bug/2036742 Signed-off-by: Mario Limonciello --- >From this bug report there are more to fix .../gpu/drm/amd/pm/powerplay/hwmgr/pptable_v1_0.h| 12 ++--

[PATCH 2/2] drm/radeon: Fix UBSAN array-index-out-of-bounds for Radeon HD 5430

2023-10-04 Thread Mario Limonciello
For pptable structs that use flexible array sizes, use flexible arrays. Suggested-by: Felix Held Link: https://gitlab.freedesktop.org/drm/amd/-/issues/2894 Signed-off-by: Mario Limonciello --- drivers/gpu/drm/radeon/pptable.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git

[PATCH 1/2] drm/amd: Fix UBSAN array-index-out-of-bounds for SMU7

2023-10-04 Thread Mario Limonciello
For pptable structs that use flexible array sizes, use flexible arrays. Suggested-by: Felix Held Link: https://gitlab.freedesktop.org/drm/amd/-/issues/2874 Signed-off-by: Mario Limonciello --- drivers/gpu/drm/amd/include/pptable.h | 4 ++-- drivers/gpu/drm/amd/pm/powerplay

[PATCH v4 3/3] drm/amd/display: make dc_set_power_state() return type `void` again

2023-10-04 Thread Mario Limonciello
As dc_set_power_state() no longer allocates memory, it's not necessary to have return types and check return code as it can't fail anymore. Change it back to `void`. Signed-off-by: Mario Limonciello --- .../gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 17 + drivers/gpu/drm/amd

[PATCH v4 1/3] drm/amd: Evict resources during PM ops prepare() callback

2023-10-04 Thread Mario Limonciello
() to move evict majority of resources while leaving all existing steps that put the GPU into a low power state in suspend(). Link: https://gitlab.freedesktop.org/drm/amd/-/issues/2362 Signed-off-by: Mario Limonciello --- drivers/gpu/drm/amd/amdgpu/amdgpu.h| 1 + drivers/gpu/drm/amd/amdgpu

[PATCH v4 2/3] drm/amd/display: Destroy DC context while keeping DML

2023-10-04 Thread Mario Limonciello
-by: Mario Limonciello --- drivers/gpu/drm/amd/display/dc/core/dc.c | 25 --- .../gpu/drm/amd/display/dc/core/dc_resource.c | 12 + 2 files changed, 12 insertions(+), 25 deletions(-) diff --git a/drivers/gpu/drm/amd/display/dc/core/dc.c b/drivers/gpu/drm/amd/display/dc

[PATCH v4 0/3] Better handle memory pressure at suspend

2023-10-04 Thread Mario Limonciello
eries v1->v2: * Handle DC code too * Add prepare callback rather than moving symbol calls Mario Limonciello (3): drm/amd: Evict resources during PM ops prepare() callback drm/amd/display: Destroy DC context while keeping DML drm/amd/display: make dc_set_power_state() return type `void` again

Re: [PATCH v3 1/4] drm/amd: Add support for prepare() and complete() callbacks

2023-10-03 Thread Mario Limonciello
() and complete() callbacks On 10/3/2023 16:11, Deucher, Alexander wrote: [Public] -Original Message- From: amd-gfx On Behalf Of Mario Limonciello Sent: Tuesday, October 3, 2023 4:55 PM To: amd-gfx@lists.freedesktop.org Cc: Wentland, Harry ; Limonciello, Mario Subject: [PATCH v3 1/4] drm/amd

Re: [PATCH v3 1/4] drm/amd: Add support for prepare() and complete() callbacks

2023-10-03 Thread Mario Limonciello
On 10/3/2023 16:11, Deucher, Alexander wrote: [Public] -Original Message- From: amd-gfx On Behalf Of Mario Limonciello Sent: Tuesday, October 3, 2023 4:55 PM To: amd-gfx@lists.freedesktop.org Cc: Wentland, Harry ; Limonciello, Mario Subject: [PATCH v3 1/4] drm/amd: Add support

[PATCH v3 4/4] drm/amd/display: make dc_set_power_state() return type `void` again

2023-10-03 Thread Mario Limonciello
As dc_set_power_state() no longer allocates memory, it's not necessary to have return types and check return code as it can't fail anymore. Change it back to `void`. Signed-off-by: Mario Limonciello --- .../gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 17 + drivers/gpu/drm/amd

[PATCH v3 3/4] drm/amd/display: Destroy DC context while keeping DML

2023-10-03 Thread Mario Limonciello
-by: Mario Limonciello --- Cc: harry.wentl...@amd.com --- drivers/gpu/drm/amd/display/dc/core/dc.c | 25 --- .../gpu/drm/amd/display/dc/core/dc_resource.c | 12 + 2 files changed, 12 insertions(+), 25 deletions(-) diff --git a/drivers/gpu/drm/amd/display/dc/core/dc.c b

[PATCH v3 2/4] drm/amd: Move evict resources suspend step to prepare()

2023-10-03 Thread Mario Limonciello
into a low power state in suspend(). Link: https://gitlab.freedesktop.org/drm/amd/-/issues/2362 Signed-off-by: Mario Limonciello --- drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 9 - 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c b/drivers

[PATCH v3 1/4] drm/amd: Add support for prepare() and complete() callbacks

2023-10-03 Thread Mario Limonciello
this call instead of the suspend() callback. By moving the allocations to prepare() the system suspend will be failed before any IP block has done any suspend code. If the suspend fails, then do any cleanups in the complete() callback. Signed-off-by: Mario Limonciello --- drivers/gpu/drm/amd

[PATCH v3 0/4] Better handle memory pressure at suspend

2023-10-03 Thread Mario Limonciello
cratch variable in dc_resource_state_destruct() * Revert error code propagation in same series v1->v2: * Handle DC code too * Add prepare callback rather than moving symbol calls Mario Limonciello (4): drm/amd: Add support for prepare() and complete() callbacks drm/amd: Move evict resource

Re: [PATCH v2 2/3] drm/amd: Move evict resources suspend step to prepare()

2023-10-03 Thread Mario Limonciello
On 10/3/2023 07:58, Deucher, Alexander wrote: [AMD Official Use Only - General] -Original Message- From: amd-gfx On Behalf Of Mario Limonciello Sent: Monday, October 2, 2023 6:45 PM To: amd-gfx@lists.freedesktop.org Cc: Wentland, Harry ; Limonciello, Mario Subject: [PATCH v2 2/3] drm

[PATCH v2 3/3] drm/amd/display: Destroy DC context while keeping DML

2023-10-02 Thread Mario Limonciello
-by: Mario Limonciello --- Cc: harry.wentl...@amd.com --- drivers/gpu/drm/amd/display/dc/core/dc.c | 25 --- .../gpu/drm/amd/display/dc/core/dc_resource.c | 11 2 files changed, 11 insertions(+), 25 deletions(-) diff --git a/drivers/gpu/drm/amd/display/dc/core/dc.c b

[PATCH v2 2/3] drm/amd: Move evict resources suspend step to prepare()

2023-10-02 Thread Mario Limonciello
into a low power state in suspend(). Link: https://gitlab.freedesktop.org/drm/amd/-/issues/2362 Signed-off-by: Mario Limonciello --- drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 12 +--- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c b

[PATCH v2 1/3] drm/amd: Add support for prepare() callback

2023-10-02 Thread Mario Limonciello
this call instead of the suspend() callback. By moving the allocations to prepare() the system suspend will be failed before any IP block has done any suspend code. Signed-off-by: Mario Limonciello --- drivers/gpu/drm/amd/amdgpu/amdgpu.h| 1 + drivers/gpu/drm/amd/amdgpu/amdgpu_device.c

[PATCH v2 0/3] Better handle memory pressure at suspend

2023-10-02 Thread Mario Limonciello
: https://patchwork.freedesktop.org/patch/559270/ v1->v2: * Handle DC code too * Add prepare callback rather than moving symbol calls Mario Limonciello (3): drm/amd: Add support for prepare() callback drm/amd: Move evict resources suspend step to prepare() drm/amd/display: Destroy DC cont

Re: [2/3] drm/amdgpu: fall back to INPUT power for AVG power via INFO IOCTL

2023-10-02 Thread Mario Limonciello
On 10/2/2023 13:49, Alex Deucher wrote: For backwards compatibility with userspace. Fixes: 47f1724db4fe ("drm/amd: Introduce `AMDGPU_PP_SENSOR_GPU_INPUT_POWER`") Link: https://gitlab.freedesktop.org/drm/amd/-/issues/2897 Signed-off-by: Alex Deucher --- drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c

Re: [PATCH 2/3] power: supply: Don't count 'unknown' scope power supplies

2023-10-01 Thread Mario Limonciello
On 9/30/2023 15:18, Sebastian Reichel wrote: Hi, On Tue, Sep 26, 2023 at 05:59:54PM -0500, Mario Limonciello wrote: On some systems AMD Navi3x dGPU triggers RAS errors on startup; but only if the amdgpu kernel module is not part of the initramfs. This is because the hardware is not properly

[PATCH 2/2] drm/amd: Drop all hand-built MIN and MAX macros in the amdgpu base driver

2023-09-29 Thread Mario Limonciello
Several files declare MIN() or MAX() macros that ignore the types of the values being compared. Drop these macros and switch to min() min_t(), and max() from `linux/minmax.h`. Suggested-by: Hamza Mahfooz Signed-off-by: Mario Limonciello --- drivers/gpu/drm/amd/amdgpu/amdgpu.h

[PATCH 1/2] drm/amd: Update `update_pcie_parameters` functions to use uint8_t arguments

2023-09-29 Thread Mario Limonciello
The matching values for `pcie_gen_cap` and `pcie_width_cap` when fetched from powerplay tables are 1 byte, so narrow the arguments to match to ensure min() and max() comparisons without casts. Signed-off-by: Mario Limonciello --- drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c | 2

Re: [PATCH] drm/amd: Fix logic error in sienna_cichlid_update_pcie_parameters()

2023-09-29 Thread Mario Limonciello
On 9/29/2023 10:23, Hamza Mahfooz wrote: On 9/26/23 22:07, Mario Limonciello wrote: While aligning SMU11 with SMU13 implementation an assumption was made that `dpm_context->dpm_tables.pcie_table` was populated in dpm table initialization like in SMU13 but it isn't. So restore s

[PATCH] drm/amd: Fix logic error in sienna_cichlid_update_pcie_parameters()

2023-09-28 Thread Mario Limonciello
rameters implementation with SMU13") Signed-off-by: Mario Limonciello --- .../amd/pm/swsmu/smu11/sienna_cichlid_ppt.c | 41 +++ 1 file changed, 23 insertions(+), 18 deletions(-) diff --git a/drivers/gpu/drm/amd/pm/swsmu/smu11/sienna_cichlid_ppt.c b/drivers/gpu/drm/amd/p

Re: [PATCH 0/3] Fix Navi3x boot and hotplug problems

2023-09-28 Thread Mario Limonciello
On 9/28/2023 13:00, Alex Deucher wrote: On Thu, Sep 28, 2023 at 12:41 PM Mario Limonciello wrote: On some OEM systems multiple navi3x dGPUS are triggering RAS errors and BACO errors. These errors come from elements of the OEM system that weren't part of original test environment

[PATCH 3/3] Revert "drm/amd/pm: workaround for the wrong ac power detection on smu 13.0.0"

2023-09-28 Thread Mario Limonciello
This workaround is not necessary with the power supply core fixed. This reverts commit 0e5e1a84f0b8c814d502a135824244127fed8f23. Signed-off-by: Mario Limonciello --- drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0.c | 3 ++- drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_0_ppt.c | 1 + 2

[PATCH 0/3] Fix Navi3x boot and hotplug problems

2023-09-28 Thread Mario Limonciello
this all through DRM because there is a workaround in linux-next that I would like to be reverted at the same time as picking up the first two patches. Mario Limonciello (3): drm/amd: Fix detection of _PR3 on the PCIe root port power: supply: Don't count 'unknown' scope power supplies Revert

[PATCH 2/3] power: supply: Don't count 'unknown' scope power supplies

2023-09-28 Thread Mario Limonciello
Signed-off-by: Mario Limonciello --- drivers/power/supply/power_supply_core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/power/supply/power_supply_core.c b/drivers/power/supply/power_supply_core.c index d325e6dbc770..3de6e6d00815 100644 --- a/drivers/po

[PATCH 1/3] drm/amd: Fix detection of _PR3 on the PCIe root port

2023-09-28 Thread Mario Limonciello
BOCO detection logic to fail. Fix the intent of the logic by looking at root port, not the immediate upstream bridge for _PR3. Cc: sta...@vger.kernel.org Suggested-by: Jun Ma Tested-by: David Perry Fixes: b10c1c5b3a4e ("drm/amdgpu: add check for ACPI power resources") Signed-off

[PATCH v2 1/2] drm/amd: Move `enum drm_amdgpu_ta_fw_type` to uapi

2023-09-27 Thread Mario Limonciello
Enum values used by the ioctl `AMDGPU_INFO_FW_VERSION`/`AMDGPU_INFO_FW_TA` are not exported so clients need to keep their own copy of the definitions while looking up firmware versions for the TA. Move this to uapi instead. Signed-off-by: Mario Limonciello -- v1->v2: * Rename while mov

[PATCH v2 2/2] drm/amd: Also export `AMDGPU_TA_FW_TYPE_PSP_ASD` for `AMDGPU_INFO_FW_TA`

2023-09-27 Thread Mario Limonciello
All other `drm_amdgpu_ta_fw_type` enums are exported for `AMDGPU_INFO_FW_TA`. ASD is available via `AMDGPU_INFO_FW_ASD` but for symmetry in other values export as part of `AMDGPU_INFO_FW_TA` as well. Signed-off-by: Mario Limonciello --- drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c | 5 + 1 file

[PATCH] drm/amd: Move `enum drm_amdgpu_ta_fw_type` to uapi

2023-09-27 Thread Mario Limonciello
Enum values used by the ioctl `AMDGPU_INFO_FW_VERSION`/`AMDGPU_INFO_FW_TA` are not exported so clients need to keep their own copy of the definitions while looking up firmware versions for the TA. Move this to uapi instead. Signed-off-by: Mario Limonciello --- drivers/gpu/drm/amd/amdgpu

[PATCH] drm/amd: Limit seamless boot by default to APUs

2023-09-26 Thread Mario Limonciello
...@amd.com/T/#m2887e919d7c01b2a4860d2261b366d22e070f309 Signed-off-by: Mario Limonciello --- drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c index 22c0e035de81

Re: [PATCH v2 4/4] drm/amd: Enable seamless boot by default on newer ASICs

2023-09-25 Thread Mario Limonciello
SDN hash can you reproduce it and then try the module parameter (amdgpu.seamless=0) to disable it and confirm things are fixed? Can I see more complete dmesg? Thanks, Feifei -Original Message- From: amd-gfx On Behalf Of Mario Limonciello Sent: Thursday, September 14, 2023 1:15 AM To:

[PATCH 8/8] drm/amd: Move microcode init from sw_init to early_init for CIK SDMA

2023-09-25 Thread Mario Limonciello
sw_init to early_init. Signed-off-by: Mario Limonciello --- drivers/gpu/drm/amd/amdgpu/cik_sdma.c | 9 + 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/drivers/gpu/drm/amd/amdgpu/cik_sdma.c b/drivers/gpu/drm/amd/amdgpu/cik_sdma.c index 4193289ae82f..ee5dce6f6043 100644

[PATCH 6/8] drm/amd: Move microcode init from sw_init to early_init for SDMA v3.0

2023-09-25 Thread Mario Limonciello
sw_init to early_init. Signed-off-by: Mario Limonciello --- drivers/gpu/drm/amd/amdgpu/sdma_v3_0.c | 9 + 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/drivers/gpu/drm/amd/amdgpu/sdma_v3_0.c b/drivers/gpu/drm/amd/amdgpu/sdma_v3_0.c index dc7aab68ed66..c5ea32687eb5 100644

[PATCH 4/8] drm/amd: Move microcode init from sw_init to early_init for SDMA v6.0

2023-09-25 Thread Mario Limonciello
sw_init to early_init. Signed-off-by: Mario Limonciello --- drivers/gpu/drm/amd/amdgpu/sdma_v6_0.c | 9 + 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/drivers/gpu/drm/amd/amdgpu/sdma_v6_0.c b/drivers/gpu/drm/amd/amdgpu/sdma_v6_0.c index 2c0c2e9f2783..1f8122fd1ad7 100644

[PATCH 0/8] Some cleanups related to missing microcode

2023-09-25 Thread Mario Limonciello
I recently found a noisier experience than I expected with missing microcode. As a result I found that some microcode wasn't being loaded in early_init and some messages were unnecessary. Mario Limonciello (8): drm/amd: Drop error message about failing to load DMUB firmware drm/amd: Drop

[PATCH 7/8] drm/amd: Move microcode init from sw_init to early_init for SDMA v2.4

2023-09-25 Thread Mario Limonciello
sw_init to early_init. Signed-off-by: Mario Limonciello --- drivers/gpu/drm/amd/amdgpu/sdma_v2_4.c | 9 + 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/drivers/gpu/drm/amd/amdgpu/sdma_v2_4.c b/drivers/gpu/drm/amd/amdgpu/sdma_v2_4.c index 4dd944a93cf1..b58a13bd75db 100644

[PATCH 3/8] drm/amd: Move microcode init from sw_init to early_init for SDMA v5.0

2023-09-25 Thread Mario Limonciello
sw_init to early_init. Signed-off-by: Mario Limonciello --- drivers/gpu/drm/amd/amdgpu/sdma_v5_0.c | 9 + 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/drivers/gpu/drm/amd/amdgpu/sdma_v5_0.c b/drivers/gpu/drm/amd/amdgpu/sdma_v5_0.c index 7e837acffa6e..c1ff5eda8961 100644

[PATCH 5/8] drm/amd: Move microcode init from sw_init to early_init for SDMA v5.2

2023-09-25 Thread Mario Limonciello
sw_init to early_init. Signed-off-by: Mario Limonciello --- drivers/gpu/drm/amd/amdgpu/sdma_v5_2.c | 9 + 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/drivers/gpu/drm/amd/amdgpu/sdma_v5_2.c b/drivers/gpu/drm/amd/amdgpu/sdma_v5_2.c index 86661f9653fa..7d1e57189c8c 100644

[PATCH 2/8] drm/amd: Drop error message about failing to load SDMA firmware

2023-09-25 Thread Mario Limonciello
! [drm:amdgpu_device_init [amdgpu]] *ERROR* early_init of IP block failed -19 ``` The error code for the device init is bubbled up already, remove the second one. Signed-off-by: Mario Limonciello --- drivers/gpu/drm/amd/amdgpu/cik_sdma.c| 4 +--- drivers/gpu/drm/amd/amdgpu/sdma_v2_4.c | 4

[PATCH 1/8] drm/amd: Drop error message about failing to load DMUB firmware

2023-09-25 Thread Mario Limonciello
[drm:amdgpu_device_init [amdgpu]] *ERROR* early_init of IP block failed -19 ``` The error code for the device init is bubbled up already, remove the second one. Signed-off-by: Mario Limonciello --- drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/drivers

[PATCH] drm/amd/display: Change dc_set_power_state() to bool instead of int

2023-09-25 Thread Mario Limonciello
DC code is reused by other OSes and so Linux return codes don't make sense. Change dc_set_power_state() to boolean and add a wrapper dm_set_power_state() to return a Linux error code for the memory allocation failure. Suggested-by: Harry Wentland Signed-off-by: Mario Limonciello --- drivers

Re: [PATCH] drm/amd: Propagate failures in dc_set_power_state()

2023-09-25 Thread Mario Limonciello
On 9/25/2023 12:50, Harry Wentland wrote: On 2023-09-22 16:12, Mario Limonciello wrote: During the suspend process dc_set_power_state() will use kzalloc to allocate memory, but this potentially fails with memory pressure. If it fails, the suspend should be aborted. Link: https

Re: [PATCH 13/15] platform/x86/amd/pmf: Add PMF-AMDGPU set interface

2023-09-25 Thread Mario Limonciello
level mean for the system when this framework is in place? What if a user manually changes the backlight level? Additional comments below. It's also for the display count. Co-developed-by: Mario Limonciello Signed-off-by: Mario Limonciello Signed-off-by: Shyam Sundar S K --- drivers/gpu

[PATCH] drm/amd: Move evict resources suspend step to prepare()

2023-09-25 Thread Mario Limonciello
into a low power state in suspend(). Link: https://gitlab.freedesktop.org/drm/amd/-/issues/2362 Signed-off-by: Mario Limonciello --- drivers/gpu/drm/amd/amdgpu/amdgpu.h| 1 + drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 7 +-- drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c| 11 +-- 3

Re: [PATCH 14/15] platform/x86/amd/pmf: Add PMF-AMDSFH interface for HPD

2023-09-22 Thread Mario Limonciello
On 9/22/2023 14:04, Mario Limonciello wrote: On 9/22/2023 12:50, Shyam Sundar S K wrote: From: Basavaraj Natikar AMDSFH has information about the User presence information via the Human Presence Detection (HPD) sensor which is part of the AMD sensor fusion hub. Add PMF and AMDSFH interface

[PATCH] drm/amd: Propagate failures in dc_set_power_state()

2023-09-22 Thread Mario Limonciello
During the suspend process dc_set_power_state() will use kzalloc to allocate memory, but this potentially fails with memory pressure. If it fails, the suspend should be aborted. Link: https://gitlab.freedesktop.org/drm/amd/-/issues/2362 Signed-off-by: Mario Limonciello --- Cc: harry.wentl

Re: [PATCH 15/15] platform/x86/amd/pmf: Add PMF-AMDSFH interface for ALS

2023-09-22 Thread Mario Limonciello
On 9/22/2023 12:50, Shyam Sundar S K wrote: From: Basavaraj Natikar AMDSFH has information about the Ambient light via the Ambient Light Sensor (ALS) which is part of the AMD sensor fusion hub. Add PMF and AMDSFH interface to get this information. Co-developed-by: Shyam Sundar S K

Re: [PATCH 14/15] platform/x86/amd/pmf: Add PMF-AMDSFH interface for HPD

2023-09-22 Thread Mario Limonciello
On 9/22/2023 12:50, Shyam Sundar S K wrote: From: Basavaraj Natikar AMDSFH has information about the User presence information via the Human Presence Detection (HPD) sensor which is part of the AMD sensor fusion hub. Add PMF and AMDSFH interface to get this information. Co-developed-by: Shyam

Re: [PATCH 11/15] platform/x86/amd/pmf: dump policy binary data

2023-09-22 Thread Mario Limonciello
On 9/22/2023 12:50, Shyam Sundar S K wrote: Sometimes policy binary retrieved from the BIOS maybe incorrect that can end up in failing to enable the Smart PC solution feature. Use print_hex_dump_debug() to dump the policy binary in hex, so that we debug the issues related to the binary even

Re: [PATCH 04/15] platform/x86/amd/pmf: Add support for PMF Policy Binary

2023-09-22 Thread Mario Limonciello
On 9/22/2023 12:50, Shyam Sundar S K wrote: PMF Policy binary is a encrypted and signed binary that will be part of the BIOS. PMF driver via the ACPI interface checks the existence of Smart PC bit. If the advertised bit is found, PMF driver walks the acpi namespace to find out the policy binary

Re: [V11 1/8] ACPI: Add support for AMD ACPI based Wifi band RFI mitigation feature

2023-09-18 Thread Mario Limonciello
On 8/31/2023 01:20, Evan Quan wrote: Due to electrical and mechanical constraints in certain platform designs there may be likely interference of relatively high-powered harmonics of the (G-)DDR memory clocks with local radio module frequency bands used by Wifi 6/6e/7. To mitigate this, AMD has

[PATCH v2 4/4] drm/amd: Enable seamless boot by default on newer ASICs

2023-09-13 Thread Mario Limonciello
Seamless boot can technically be supported as far back as DCN1 but to avoid regressions on older hardware, enable it for DCN3 and later. If users report using the module parameter that it works on older ASICs as well, this can be adjusted. Signed-off-by: Mario Limonciello --- drivers/gpu/drm

[PATCH v2 1/4] drm/amd: Drop special case for yellow carp without discovery

2023-09-13 Thread Mario Limonciello
ove it. Signed-off-by: Mario Limonciello Reviewed-by: Alex Deucher --- drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.c | 6 -- 1 file changed, 6 deletions(-) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.c index de7b379a9cc8..c7793db6d098 100

[PATCH v2 3/4] drm/amd: Add a module parameter for seamless boot

2023-09-13 Thread Mario Limonciello
The module parameter can be used to test more easily enabling seamless boot support on additional ASICs. Reviewed-by: Harry Wentland Signed-off-by: Mario Limonciello --- drivers/gpu/drm/amd/amdgpu/amdgpu.h| 1 + drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 20

[PATCH v2 0/4] Enable seamless boot more widely

2023-09-13 Thread Mario Limonciello
sily force it enabled on other ASICs too, which may be useful to adjust policy. Mario Limonciello (4): drm/amd: Drop special case for yellow carp without discovery drm/amd: Move seamless boot check out of display drm/amd: Add a module parameter for seamless boot drm/amd: Enable sea

[PATCH v2 2/4] drm/amd: Move seamless boot check out of display

2023-09-13 Thread Mario Limonciello
This will allow base driver to dictate whether seamless should be enabled. No intended functional changes. Reviewed-by: Harry Wentland Signed-off-by: Mario Limonciello --- drivers/gpu/drm/amd/amdgpu/amdgpu.h | 1 + drivers/gpu/drm/amd/amdgpu/amdgpu_device.c| 21

Re: [V11 3/8] wifi: mac80211: Add support for WBRF features

2023-09-06 Thread Mario Limonciello
register the frequencies in use(or unregister those frequencies no longer used) via the dedicated calls. So that, other drivers responding to the frequencies can take proper actions to mitigate possible interference. Co-developed-by: Mario Limonciello Signed-off-by: Mario Limonciello Co-developed-by:

Re: [PATCH 4/4] drm/amd: Enable seamless boot by default on newer APUs

2023-09-05 Thread Mario Limonciello
On 9/5/2023 15:07, Deucher, Alexander wrote: [Public] -Original Message- From: amd-gfx On Behalf Of Mario Limonciello Sent: Tuesday, September 5, 2023 3:26 PM To: amd-gfx@lists.freedesktop.org Cc: Limonciello, Mario Subject: [PATCH 4/4] drm/amd: Enable seamless boot by default

[PATCH 3/4] drm/amd: Add a module parameter for seamless boot

2023-09-05 Thread Mario Limonciello
The module parameter can be used to test more easily enabling seamless boot support on additional ASICs. Signed-off-by: Mario Limonciello --- drivers/gpu/drm/amd/amdgpu/amdgpu.h| 1 + drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 20 +--- drivers/gpu/drm/amd/amdgpu

[PATCH 0/4] Enable seamless boot more widely

2023-09-05 Thread Mario Limonciello
nel module parameter that to easily force it enabled on other ASICs too, which may be useful to adjust policy. Mario Limonciello (4): drm/amd: Drop special case for yellow carp without discovery drm/amd: Move seamless boot check out of display drm/amd: Add a module parameter for seamless boot drm/a

[PATCH 1/4] drm/amd: Drop special case for yellow carp without discovery

2023-09-05 Thread Mario Limonciello
ove it. Signed-off-by: Mario Limonciello --- drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.c | 6 -- 1 file changed, 6 deletions(-) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.c index 5f7641d9f346..27e534b0b8e5 100644 --- a/drivers/gpu/drm/amd/amd

[PATCH 4/4] drm/amd: Enable seamless boot by default on newer APUs

2023-09-05 Thread Mario Limonciello
IP discovery is a good line in the sand to expand seamless boot to more ASICs. Signed-off-by: Mario Limonciello --- drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 10 +++--- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c b/drivers/gpu

[PATCH 2/4] drm/amd: Move seamless boot check out of display

2023-09-05 Thread Mario Limonciello
This will allow base driver to dictate whether seamless should be enabled. No intended functional changes. Signed-off-by: Mario Limonciello --- drivers/gpu/drm/amd/amdgpu/amdgpu.h | 1 + drivers/gpu/drm/amd/amdgpu/amdgpu_device.c| 21 + .../gpu/drm/amd/display

Re: drm/amd/pm: workaround for the wrong ac power detection on smu 13.0.0

2023-08-25 Thread Mario Limonciello
On 8/24/2023 22:19, Kenneth Feng wrote: workaround for the wrong ac power detection on smu 13.0.0 Signed-off-by: Kenneth Feng This workaround appears to be only necessary if you're missing these commits. a7fbfd44c020 ("usb: typec: ucsi: Mark dGPUs as DEVICE scope") 95339f40a8b6 ("power:

Re: [PATCH v3] drm/amdgpu: register a dirty framebuffer callback for fbcon

2023-08-23 Thread Mario Limonciello
c KMS. Cc: Aurabindo Pillai Cc: Mario Limonciello Cc: sta...@vger.kernel.org # 6.1+ Link: https://gitlab.freedesktop.org/drm/amd/-/issues/2519 Signed-off-by: Hamza Mahfooz Signed-off-by: Alex Deucher You probably meant to drop Alex's SoB as you bumped v2. When committing this make sure you dr

Re: [PATCH v2] drm/amdgpu: register a dirty framebuffer callback for fbcon

2023-08-15 Thread Mario Limonciello
commits to be made at once. So, implement amdgpu_dirtyfb() and only enable it for fbcon framebuffers on devices that support atomic KMS. Cc: Aurabindo Pillai Cc: Mario Limonciello Cc: sta...@vger.kernel.org # 6.1+ This is safe specifically because other things like FB_DAMAGE_CLIPS have come back

[PATCH] drm/amd: Drop USB-C PD F/W flashing support

2023-08-14 Thread Mario Limonciello
fwupd. Signed-off-by: Mario Limonciello --- Documentation/gpu/amdgpu/flashing.rst | 12 drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c | 91 - drivers/gpu/drm/amd/amdgpu/amdgpu_psp.h | 10 --- drivers/gpu/drm/amd/amdgpu/psp_v11_0.c | 60 drivers/gpu/drm/amd

[PATCH] drm/amd/display: If HPD fails probe EDID to decide if monitor is present

2023-08-14 Thread Mario Limonciello
-by: Mario Limonciello --- Cc: Harry Wentland --- drivers/gpu/drm/amd/display/dc/link/link_detection.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/gpu/drm/amd/display/dc/link/link_detection.c b/drivers/gpu/drm/amd/display/dc/link/link_detection.c index c9b6676eaf53..26a739128dd3

[PATCH 9/9] drm/amd: Hide unsupported power attributes

2023-08-10 Thread Mario Limonciello
Some ASICS only offer one type of power attribute, so in the visible callback check whether the attributes are supported and hide if not supported. Signed-off-by: Mario Limonciello --- drivers/gpu/drm/amd/pm/amdgpu_pm.c | 9 + 1 file changed, 9 insertions(+) diff --git a/drivers/gpu

[PATCH 7/9] drm/amd: Show both power attributes for vega20

2023-08-10 Thread Mario Limonciello
Vega20 can offer average power in some versions of the PMFW and current power in others. Signed-off-by: Mario Limonciello --- .../drm/amd/pm/powerplay/hwmgr/vega20_hwmgr.c | 18 +- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/drivers/gpu/drm/amd/pm/powerplay

[PATCH 8/9] drm/amd: Rename AMDGPU_PP_SENSOR_GPU_POWER

2023-08-10 Thread Mario Limonciello
Use the clearer name `AMDGPU_PP_SENSOR_GPU_AVG_POWER` instead. Signed-off-by: Mario Limonciello --- drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c | 2 +- drivers/gpu/drm/amd/include/kgd_pp_interface.h | 2 +- drivers/gpu/drm/amd/pm/amdgpu_pm.c | 4

[PATCH 4/9] drm/amd: Fix SMU 13.0.4/13.0.11 GPU metrics average power

2023-08-10 Thread Mario Limonciello
The average power for the GPU metrics sysfs file contains the input power not the average power. The member that is set is called average power though, so correct it to the right value. Signed-off-by: Mario Limonciello --- drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_4_ppt.c | 2 +- 1 file

[PATCH 5/9] drm/amd: Drop unnecessary helper for aldebaran

2023-08-10 Thread Mario Limonciello
aldebaran_get_gpu_power() is only called by one place and just calls aldebaran_get_smu_metrics_data(), so drop the helper. Signed-off-by: Mario Limonciello --- .../gpu/drm/amd/pm/swsmu/smu13/aldebaran_ppt.c| 15 +++ 1 file changed, 3 insertions(+), 12 deletions(-) diff --git

[PATCH 3/9] drm/amd: Introduce `AMDGPU_PP_SENSOR_GPU_INPUT_POWER`

2023-08-10 Thread Mario Limonciello
Some GPUs have been overloading average power values and input power values. To disambiguate these, introduce a new `AMDGPU_PP_SENSOR_GPU_INPUT_POWER` and the GPUs that share input power update to use this instead of average power. Signed-off-by: Mario Limonciello --- drivers/gpu/drm/amd

[PATCH 6/9] drm/amd: Fix the return for average power on aldebaran

2023-08-10 Thread Mario Limonciello
Aldebaran can only return average socket power for the first die. The other dies return 0. Instead of returning a bad value, return -EOPNOTSUPP so that the attribute will be hidden. Signed-off-by: Mario Limonciello --- drivers/gpu/drm/amd/pm/swsmu/smu13/aldebaran_ppt.c | 7 --- 1 file

[PATCH 1/9] drm/amd: Add amdgpu_hwmon_get_sensor_generic()

2023-08-10 Thread Mario Limonciello
Many sensor function have a lot of boilerplate checks. Move these into a generic amdgpu_hwmon_get_sensor_generic() instead. No intended functional changes. Signed-off-by: Mario Limonciello --- drivers/gpu/drm/amd/pm/amdgpu_pm.c | 321 - 1 file changed, 88

[PATCH 2/9] drm/amd: Add a new hwmon attribute for instantaneous power

2023-08-10 Thread Mario Limonciello
Some GPUs provide support for current power, some average power, and some both. To be able to support all these combinations, introduce a new attribute. Signed-off-by: Mario Limonciello --- drivers/gpu/drm/amd/pm/amdgpu_pm.c | 17 + 1 file changed, 17 insertions(+) diff --git

Re: [PATCH] drm/amd: fix debugfs access for discovery blob

2023-08-08 Thread Mario Limonciello
On 8/7/2023 10:20, Alex Deucher wrote: On Tue, Aug 1, 2023 at 4:15 PM Mario Limonciello wrote: Accessing the blob for amdgpu discovery from debugfs triggers: [ 1924.487667] kernel BUG at mm/usercopy.c:102! usercopy_abort() explains that it needs to be solved by creating a cache to store

[PATCH] drm/amd: fix debugfs access for discovery blob

2023-08-01 Thread Mario Limonciello
Accessing the blob for amdgpu discovery from debugfs triggers: [ 1924.487667] kernel BUG at mm/usercopy.c:102! usercopy_abort() explains that it needs to be solved by creating a cache to store the data. Link: https://gitlab.freedesktop.org/drm/amd/-/issues/2748#note_2023519 Signed-off-by: Mario

[PATCH v2] drm/amd/display: Don't show stack trace for missing eDP

2023-07-31 Thread Mario Limonciello
Some systems are only connected by HDMI or DP, so warning related to missing eDP is unnecessary. Downgrade to debug instead. Cc: Hamza Mahfooz Fixes: 6d9b6dceaa51 ("drm/amd/display: only warn once in dce110_edp_wait_for_hpd_ready()") Reported-by: mastan.katraga...@amd.com Signed-off

[PATCH] drm/amd/display: Don't show stack trace for missing eDP

2023-07-31 Thread Mario Limonciello
Signed-off-by: Mario Limonciello --- drivers/gpu/drm/amd/display/dc/dce110/dce110_hw_sequencer.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/amd/display/dc/dce110/dce110_hw_sequencer.c b/drivers/gpu/drm/amd/display/dc/dce110/dce110_hw_sequenc

Re: [PATCH] drm/amdgpu: Sort the includes in amdgpu/amdgpu_drv.c

2023-07-31 Thread Mario Limonciello
On 7/27/23 23:16, Srinivasan Shanmugam wrote: Sort the include files that are included in amdgpu_drv.c alphabetically. Suggested-by: Mario Limonciello Cc: Mario Limonciello Cc: Christian König Cc: Alex Deucher Signed-off-by: Srinivasan Shanmugam --- Reviewed-by: Mario Limonciello

Re: [PATCH v2] drm/amdgpu: Move vram, gtt & flash defines to amdgpu_ ttm & _psp.h

2023-07-31 Thread Mario Limonciello
nig Cc: Mario Limonciello Cc: Christian König Cc: Alex Deucher Signed-off-by: Srinivasan Shanmugam --- Reviewed-by: Mario Limonciello v2: 1. As a prerequisite, sorted the inludes in other patch https://patchwork.freedesktop.org/patch/549850/ | drm/amdgpu: Sort the includes in amdgp

[PATCH] drm/amd/display: Fix a regression on Polaris cards

2023-07-28 Thread Mario Limonciello
Closes: https://gitlab.freedesktop.org/drm/amd/-/issues/2671 Fixes: efa4c4df864e ("drm/amd/display: call remove_stream_from_ctx from res_pool funcs") Signed-off-by: Mario Limonciello --- drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_mst_types.c | 2 +- 1 file changed, 1 insertion(+),

Re: [PATCH] drm/amd/pm: skip the RLC stop when S0i3 suspend for SMU v13.0.4/11

2023-07-27 Thread Mario Limonciello
with this patch it will not hang but fences expire. It makes sense to me. This patch shouldn't be any "more" harmful then. Reviewed-by: Mario Limonciello For the delayed GFXOFF issue maybe we should revisit my previous idea for flushing GFXOFF requests. IIRC the most recent version wa

Re: iommu/amd: fix the address translation issue when do detach

2023-07-27 Thread Mario Limonciello
On 7/27/23 04:55, Jesse Zhang wrote: From: Jesse Zhang iGpu driver fail to read/write register by iommu when start X. kernel: [ 433.296634] audit: type=1400 audit(1690403823.130:64): apparmor="DENIED" operation="capable" class="cap" profile="/snap/snapd/19457/usr/lib/snapd/snap-confine"

Re: [PATCH] drm/amd/pm: skip the RLC stop when S0i3 suspend for SMU v13.0.4/11

2023-07-27 Thread Mario Limonciello
On 7/27/23 20:05, Tim Huang wrote: From: Tim Huang For SMU v13.0.4/11, driver does not need to stop RLC for S0i3, the firmwares will handle that properly. Conceptually I'm aligned to this. But, just to confirm, have you already run some testing with this with current GPU F/W, BIOS and either

[PATCH v3] drm/amd: Disable S/G for APUs when 64GB or more host memory

2023-07-27 Thread Mario Limonciello
: # 6.1.y: bf0207e172703 ("drm/amdgpu: add S/G display parameter") Cc: # 6.4.y Link: https://gitlab.freedesktop.org/drm/amd/-/issues/2735 Link: https://gitlab.freedesktop.org/drm/amd/-/issues/2354 Signed-off-by: Mario Limonciello --- v2->v3: * Account for the VRAM carveout v1->v2: * Fix

Re: [PATCH] drm/amdgpu: Move vram, gtt & flash defines to amdgpu_ ttm & _psp.h

2023-07-27 Thread Mario Limonciello
On 7/27/2023 11:31, Srinivasan Shanmugam wrote: As amdgpu.h is getting decomposed, move vram and gtt extern defines into amdgpu_ttm.h & flash extern to amdgpu_psp.h 'Fixes: 35488e44ed48 ("drm/amdgpu: Move externs to amdgpu.h file from amdgpu_drv.c")' Suggested-by: Christian Kö

Re: [PATCH v2] drm/amd: Disable S/G for APUs when 64GB or more host memory

2023-07-27 Thread Mario Limonciello
On 7/27/2023 13:02, Alex Deucher wrote: On Thu, Jul 27, 2023 at 1:29 PM Mario Limonciello wrote: Users report a white flickering screen on multiple systems that is tied to having 64GB or more memory. When S/G is enabled pages will get pinned to both VRAM carve out and system RAM leading

[PATCH v2] drm/amd: Disable S/G for APUs when 64GB or more host memory

2023-07-27 Thread Mario Limonciello
: # 6.1.y: bf0207e172703 ("drm/amdgpu: add S/G display parameter") Cc: # 6.4.y Link: https://gitlab.freedesktop.org/drm/amd/-/issues/2735 Link: https://gitlab.freedesktop.org/drm/amd/-/issues/2354 Signed-off-by: Mario Limonciello --- v1->v2: * Fix updating mode_info as well --- drivers/gpu/

[PATCH] drm/amd: Disable S/G for APUs when 64GB or more host memory

2023-07-27 Thread Mario Limonciello
: # 6.1.y: bf0207e172703 ("drm/amdgpu: add S/G display parameter") Cc: # 6.4.y Link: https://gitlab.freedesktop.org/drm/amd/-/issues/2735 Link: https://gitlab.freedesktop.org/drm/amd/-/issues/2354 Signed-off-by: Mario Limonciello --- drivers/gpu/drm/amd/amdgpu/amdgpu.h | 1 + driver

Re: [PATCH V7 4/9] wifi: mac80211: Add support for ACPI WBRF

2023-07-25 Thread Mario Limonciello
On 7/25/23 15:09, Andrew Lunn wrote: This comes back to the point that was mentioned by Johannes - you need to have deep design understanding of the hardware to know whether or not you will have producers that a consumer need to react to. Yes, this is the policy is keep referring to. I would

Re: [PATCH V7 4/9] wifi: mac80211: Add support for ACPI WBRF

2023-07-25 Thread Mario Limonciello
On 7/25/2023 13:57, Andrew Lunn wrote: @@ -1395,6 +1395,8 @@ int ieee80211_register_hw(struct ieee80211_hw *hw) debugfs_hw_add(local); rate_control_add_debugfs(local); + ieee80211_check_wbrf_support(local); + rtnl_lock(); wiphy_lock(hw->wiphy); +void

[PATCH 6.4] drm/client: Send hotplug event after registering a client

2023-07-20 Thread Mario Limonciello
Canillas Reviewed-by: Dmitry Baryshkov # msm Link: https://patchwork.freedesktop.org/patch/msgid/20230710091029.27503-1-tzimmerm...@suse.de (cherry picked from commit 27655b9bb9f0d9c32b8de8bec649b676898c52d5) Dropped changes to drivers/gpu/drm/armada/armada_fbdev.c as 174c3c38e3a2 d

[PATCH 6.1] drm/client: Send hotplug event after registering a client

2023-07-20 Thread Mario Limonciello
ols Cc: alexandru.gagn...@hp.com Link: https://lore.kernel.org/stable/sj0pr84mb20882eea1abb36f60e845e378f...@sj0pr84mb2088.namprd84.prod.outlook.com/ Signed-off-by: Mario Limonciello --- drivers/gpu/drm/drm_client.c| 21 + drivers/gpu/drm/drm_fb_helper.c | 4 2 file

<    1   2   3   4   5   6   7   8   9   >