Re: [PATCH v6 05/45] drm/amd: Add a new helper for loading/validating microcode

2023-01-04 Thread Mario Limonciello
On 1/4/23 23:29, Lazar, Lijo wrote: On 1/5/2023 10:53 AM, Mario Limonciello wrote: On 1/4/23 23:07, Lazar, Lijo wrote: On 1/5/2023 9:12 AM, Mario Limonciello wrote: All microcode runs a basic validation after it's been loaded. Each IP block as part of init will run both. Introduce a wrapp

Re: [PATCH v6 05/45] drm/amd: Add a new helper for loading/validating microcode

2023-01-04 Thread Lazar, Lijo
On 1/5/2023 10:53 AM, Mario Limonciello wrote: On 1/4/23 23:07, Lazar, Lijo wrote: On 1/5/2023 9:12 AM, Mario Limonciello wrote: All microcode runs a basic validation after it's been loaded. Each IP block as part of init will run both. Introduce a wrapper for request_firmware and amdgpu_u

Re: [PATCH v6 05/45] drm/amd: Add a new helper for loading/validating microcode

2023-01-04 Thread Mario Limonciello
On 1/4/23 23:07, Lazar, Lijo wrote: On 1/5/2023 9:12 AM, Mario Limonciello wrote: All microcode runs a basic validation after it's been loaded. Each IP block as part of init will run both. Introduce a wrapper for request_firmware and amdgpu_ucode_validate. This wrapper will also remap any err

Re: [PATCH v6 05/45] drm/amd: Add a new helper for loading/validating microcode

2023-01-04 Thread Lazar, Lijo
On 1/5/2023 9:12 AM, Mario Limonciello wrote: All microcode runs a basic validation after it's been loaded. Each IP block as part of init will run both. Introduce a wrapper for request_firmware and amdgpu_ucode_validate. This wrapper will also remap any error codes from request_firmware to -E

RE: [PATCH 2/2] drm/amd: update securedisplay_cmd to ta_securedisplay_cmd

2023-01-04 Thread Liu, Aaron
[AMD Official Use Only - General] Squashed into one patch now. Thanks Alex. > -Original Message- > From: Alex Deucher > Sent: Thursday, January 5, 2023 11:28 AM > To: Liu, Aaron > Cc: amd-gfx@lists.freedesktop.org; Liu, HaoPing (Alan) > ; Deucher, Alexander ; > Xiao, Shane > Subject: R

[PATCH v6 44/45] drm/amd: Use `amdgpu_ucode_release` helper for si

2023-01-04 Thread Mario Limonciello
The `amdgpu_ucode_release` helper is replacing all calls to release_firmware. Reviewed-by: Alex Deucher Signed-off-by: Mario Limonciello --- v5->v6: * Adjust for amdgpu_ucode_release argument change --- drivers/gpu/drm/amd/pm/legacy-dpm/si_dpm.c | 11 ++- 1 file changed, 2 insertions(+

[PATCH v6 42/45] drm/amd: Use `amdgpu_ucode_*` helpers for DMCU

2023-01-04 Thread Mario Limonciello
The `amdgpu_ucode_request` helper will ensure that the return code for missing firmware is -ENODEV so that early_init can fail. The `amdgpu_ucode_release` helper is for symmetry on unloading. Reviewed-by: Alex Deucher Signed-off-by: Mario Limonciello --- drivers/gpu/drm/amd/display/amdgpu_dm/a

[PATCH v6 41/45] drm/amd: Use `amdgpu_ucode_*` helpers for GPU info bin

2023-01-04 Thread Mario Limonciello
The `amdgpu_ucode_request` helper will ensure that the return code for missing firmware is -ENODEV so that early_init can fail. The `amdgpu_ucode_release` helper is for symmetry on unloading. Reviewed-by: Alex Deucher Signed-off-by: Mario Limonciello --- v5->v6: * Adjust for amdgpu_ucode_relea

[PATCH v6 45/45] drm/amd: make amdgpu_ucode_validate static

2023-01-04 Thread Mario Limonciello
No consumers outside of amdgpu_ucode.c use amdgpu_ucode_validate anymore, so make the function static. Reviewed-by: Alex Deucher Signed-off-by: Mario Limonciello --- drivers/gpu/drm/amd/amdgpu/amdgpu_ucode.c | 2 +- drivers/gpu/drm/amd/amdgpu/amdgpu_ucode.h | 1 - 2 files changed, 1 insertion(+

[PATCH v6 43/45] drm/amd: Use `amdgpu_ucode_release` helper for powerplay

2023-01-04 Thread Mario Limonciello
The `amdgpu_ucode_release` helper is replacing all calls to release_firmware. Reviewed-by: Alex Deucher Signed-off-by: Mario Limonciello --- v5->v6: * Adjust for amdgpu_ucode_release argument change --- drivers/gpu/drm/amd/pm/powerplay/amd_powerplay.c | 3 +-- 1 file changed, 1 insertion(+), 2

[PATCH v6 37/45] drm/amd: Use `amdgpu_ucode_*` helpers for SDMA on CIK

2023-01-04 Thread Mario Limonciello
The `amdgpu_ucode_request` helper will ensure that the return code for missing firmware is -ENODEV so that early_init can fail. The `amdgpu_ucode_release` helper is for symmetry on unloading. Reviewed-by: Alex Deucher Signed-off-by: Mario Limonciello --- v5->v6: * Adjust for amdgpu_ucode_relea

[PATCH v6 38/45] drm/amd: Use `amdgpu_ucode_*` helpers for UVD

2023-01-04 Thread Mario Limonciello
The `amdgpu_ucode_request` helper will ensure that the return code for missing firmware is -ENODEV so that early_init can fail. The `amdgpu_ucode_release` helper is for symmetry on unloading. Reviewed-by: Alex Deucher Signed-off-by: Mario Limonciello --- v5->v6: * Adjust for amdgpu_ucode_relea

[PATCH v6 40/45] drm/amd: Use `amdgpu_ucode_*` helpers for CGS

2023-01-04 Thread Mario Limonciello
The `amdgpu_ucode_request` helper will ensure that the return code for missing firmware is -ENODEV so that early_init can fail. The `amdgpu_ucode_release` helper is for symmetry on unloading. Reviewed-by: Alex Deucher Signed-off-by: Mario Limonciello --- v5->v6: * Adjust for amdgpu_ucode_relea

[PATCH v6 39/45] drm/amd: Use `amdgpu_ucode_*` helpers for VCE

2023-01-04 Thread Mario Limonciello
The `amdgpu_ucode_request` helper will ensure that the return code for missing firmware is -ENODEV so that early_init can fail. The `amdgpu_ucode_release` helper is for symmetry on unloading. Reviewed-by: Alex Deucher Signed-off-by: Mario Limonciello --- v5->v6: * Adjust for amdgpu_ucode_relea

[PATCH v6 36/45] drm/amd: Use `amdgpu_ucode_*` helpers for SDMA3.0

2023-01-04 Thread Mario Limonciello
The `amdgpu_ucode_request` helper will ensure that the return code for missing firmware is -ENODEV so that early_init can fail. The `amdgpu_ucode_release` helper is for symmetry on unloading. Reviewed-by: Alex Deucher Signed-off-by: Mario Limonciello --- v5->v6: * Adjust for amdgpu_ucode_relea

[PATCH v6 29/45] drm/amd: Use `amdgpu_ucode_*` helpers for GFX6

2023-01-04 Thread Mario Limonciello
The `amdgpu_ucode_request` helper will ensure that the return code for missing firmware is -ENODEV so that early_init can fail. The `amdgpu_ucode_release` helper is for symmetry on unloading. Reviewed-by: Alex Deucher Signed-off-by: Mario Limonciello --- v5->v6: * Adjust for amdgpu_ucode_relea

[PATCH v6 35/45] drm/amd: Use `amdgpu_ucode_*` helpers for SDMA2.4

2023-01-04 Thread Mario Limonciello
The `amdgpu_ucode_request` helper will ensure that the return code for missing firmware is -ENODEV so that early_init can fail. The `amdgpu_ucode_release` helper is for symmetry on unloading. Reviewed-by: Alex Deucher Signed-off-by: Mario Limonciello --- v5->v6: * Adjust for amdgpu_ucode_relea

[PATCH v6 28/45] drm/amd: Optimize SRIOV switch/case for PSP microcode load

2023-01-04 Thread Mario Limonciello
Now that IP version decoding is used, a number of case statements can be combined. Reviewed-by: Alex Deucher Reviewed-by: Christian König Signed-off-by: Mario Limonciello --- drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c | 8 +--- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/driv

[PATCH v6 34/45] drm/amd: Use `amdgpu_ucode_*` helpers for GMC8

2023-01-04 Thread Mario Limonciello
The `amdgpu_ucode_request` helper will ensure that the return code for missing firmware is -ENODEV so that early_init can fail. The `amdgpu_ucode_release` helper is for symmetry on unloading. Reviewed-by: Alex Deucher Signed-off-by: Mario Limonciello --- v5->v6: * Adjust for amdgpu_ucode_relea

[PATCH v6 32/45] drm/amd: Use `amdgpu_ucode_*` helpers for GMC6

2023-01-04 Thread Mario Limonciello
The `amdgpu_ucode_request` helper will ensure that the return code for missing firmware is -ENODEV so that early_init can fail. The `amdgpu_ucode_release` helper is for symmetry on unloading. Reviewed-by: Alex Deucher Signed-off-by: Mario Limonciello --- v5->v6: * Adjust for amdgpu_ucode_relea

[PATCH v6 33/45] drm/amd: Use `amdgpu_ucode_*` helpers for GMC7

2023-01-04 Thread Mario Limonciello
The `amdgpu_ucode_request` helper will ensure that the return code for missing firmware is -ENODEV so that early_init can fail. The `amdgpu_ucode_release` helper is for symmetry on unloading. Reviewed-by: Alex Deucher Signed-off-by: Mario Limonciello --- v5->v6: * Adjust for amdgpu_ucode_relea

[PATCH v6 31/45] drm/amd: Use `amdgpu_ucode_*` helpers for GFX8

2023-01-04 Thread Mario Limonciello
The `amdgpu_ucode_request` helper will ensure that the return code for missing firmware is -ENODEV so that early_init can fail. The `amdgpu_ucode_release` helper is for symmetry on unloading. Reviewed-by: Alex Deucher Signed-off-by: Mario Limonciello --- v5->v6: * Adjust for amdgpu_ucode_relea

[PATCH v6 30/45] drm/amd: Use `amdgpu_ucode_*` helpers for GFX7

2023-01-04 Thread Mario Limonciello
The `amdgpu_ucode_request` helper will ensure that the return code for missing firmware is -ENODEV so that early_init can fail. The `amdgpu_ucode_release` helper is for symmetry on unloading. Reviewed-by: Alex Deucher Signed-off-by: Mario Limonciello --- v5->v6: * Adjust for amdgpu_ucode_relea

[PATCH v6 24/45] drm/amd/display: Load DMUB microcode during early_init

2023-01-04 Thread Mario Limonciello
If DMUB is required for an ASIC, ensure that the microcode is available and validates during early_init. Any failures will cause the driver to fail to probe before the firmware framebuffer has been removed. Reviewed-by: Alex Deucher Reviewed-by: Harry Wentland Signed-off-by: Mario Limonciello

[PATCH v6 27/45] drm/amd: Load SMU microcode during early_init

2023-01-04 Thread Mario Limonciello
This will ensure that the microcode is available before the firmware framebuffer has been destroyed. Reviewed-by: Alex Deucher Signed-off-by: Mario Limonciello --- drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c | 12 +--- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/drivers/

[PATCH v6 25/45] drm/amd: Use `amdgpu_ucode_release` helper for DMUB

2023-01-04 Thread Mario Limonciello
The `amdgpu_ucode_release` helper is for symmetry on unloading. Reviewed-by: Alex Deucher Signed-off-by: Mario Limonciello --- v5->v6: * Adjust for amdgpu_ucode_release argument change --- drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 10 +++--- 1 file changed, 3 insertions(+), 7 del

[PATCH v6 26/45] drm/amd: Use `amdgpu_ucode_*` helpers for SMU

2023-01-04 Thread Mario Limonciello
The `amdgpu_ucode_request` helper will ensure that the return code for missing firmware is -ENODEV so that early_init can fail. The `amdgpu_ucode_release` helper is for symmetry on unloading. Reviewed-by: Alex Deucher Signed-off-by: Mario Limonciello --- v5->v6: * Adjust for amdgpu_ucode_relea

[PATCH v6 22/45] drm/amd: Load PSP microcode during early_init

2023-01-04 Thread Mario Limonciello
Simplifies the code so that all PSP versions will get the firmware name from `amdgpu_ucode_ip_version_decode` and then use this filename to load microcode as part of the early_init process. Any failures will cause the driver to fail to probe before the firmware framebuffer has been removed. Revie

[PATCH v6 21/45] drm/amd: Avoid BUG() for case of SRIOV missing IP version

2023-01-04 Thread Mario Limonciello
No need to crash the kernel. AMDGPU will now fail to probe. Reviewed-by: Alex Deucher Signed-off-by: Mario Limonciello --- drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c b/drivers/gpu/drm/amd/

[PATCH v6 23/45] drm/amd: Use `amdgpu_ucode_*` helpers for PSP

2023-01-04 Thread Mario Limonciello
The `amdgpu_ucode_request` helper will ensure that the return code for missing firmware is -ENODEV so that early_init can fail. The `amdgpu_ucode_release` helper is for symmetry on unloading. Reviewed-by: Alex Deucher Signed-off-by: Mario Limonciello --- v5->v6: * Adjust for amdgpu_ucode_relea

[PATCH v6 18/45] drm/amd: Use `amdgpu_ucode_*` helpers for GFX11

2023-01-04 Thread Mario Limonciello
The `amdgpu_ucode_request` helper will ensure that the return code for missing firmware is -ENODEV so that early_init can fail. The `amdgpu_ucode_release` helper will provide symmetery on unload. Reviewed-by: Alex Deucher Signed-off-by: Mario Limonciello --- v5->v6: * Adjust for amdgpu_ucode_r

[PATCH v6 16/45] drm/amd: Use `amdgpu_ucode_*` helpers for GFX10

2023-01-04 Thread Mario Limonciello
The `amdgpu_ucode_request` helper will ensure that the return code for missing firmware is -ENODEV so that early_init can fail. The `amdgpu_ucode_release` helper is for symmetry on unload. Reviewed-by: Alex Deucher Signed-off-by: Mario Limonciello --- v5->v6: * Adjust for amdgpu_ucode_release

[PATCH v6 20/45] drm/amd: Parse both v1 and v2 TA microcode headers using same function

2023-01-04 Thread Mario Limonciello
Several IP versions duplicate code and can't use the common helpers. Move this code into a single function so that the helpers can be used. Reviewed-by: Alex Deucher Signed-off-by: Mario Limonciello --- v5->v6: * Rebase on earlier patches --- drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c | 120 +

[PATCH v6 19/45] drm/amd: Load GFX11 microcode during early_init

2023-01-04 Thread Mario Limonciello
If GFX11 microcode is required but not available during early init, the firmware framebuffer will have already been released and the screen will freeze. Move the request for GFX11 microcode into the early_init phase so that if it's not available, driver init will fail. Reviewed-by: Alex Deucher

[PATCH v6 17/45] drm/amd: Load GFX10 microcode during early_init

2023-01-04 Thread Mario Limonciello
Simplifies the code so that GFX10 will get the firmware name from `amdgpu_ucode_ip_version_decode` and then use this filename to load microcode as part of the early_init process. Any failures will cause the driver to fail to probe before the firmware framebuffer has been removed. Reviewed-by: Ale

[PATCH v6 15/45] drm/amd: Load GFX9 microcode during early_init

2023-01-04 Thread Mario Limonciello
If GFX9 microcode is required but not available during early init, the firmware framebuffer will have already been released and the screen will freeze. Reviewed-by: Alex Deucher Signed-off-by: Mario Limonciello --- drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c | 58 +-- 1 file c

[PATCH v6 13/45] drm/amd: Remove superfluous assignment for `adev->mes.adev`

2023-01-04 Thread Mario Limonciello
`amdgpu_mes_init` already sets `adev->mes.adev`, so there is no need to also set it in the IP specific versions. Reviewed-by: Alex Deucher Signed-off-by: Mario Limonciello --- drivers/gpu/drm/amd/amdgpu/mes_v10_1.c | 1 - drivers/gpu/drm/amd/amdgpu/mes_v11_0.c | 1 - 2 files changed, 2 deletion

[PATCH v6 14/45] drm/amd: Use `amdgpu_ucode_*` helpers for GFX9

2023-01-04 Thread Mario Limonciello
The `amdgpu_ucode_request` helper will ensure that the return code for missing firmware is -ENODEV so that early_init can fail. The `amdgpu_ucode_release` helper will provide symmetry on unload. Reviewed-by: Alex Deucher Signed-off-by: Mario Limonciello --- v5->v6: * Adjust for amdgpu_ucode_re

[PATCH v6 12/45] drm/amd: Use `amdgpu_ucode_*` helpers for MES

2023-01-04 Thread Mario Limonciello
The `amdgpu_ucode_request` helper will ensure that the return code for missing firmware is -ENODEV so that early_init can fail. The `amdgpu_ucode_release` helper provides symmetry for releasing firmware. Reviewed-by: Alex Deucher Signed-off-by: Mario Limonciello --- v5->v6: * Adjust for amdgpu

[PATCH v6 11/45] drm/amd: Load MES microcode during early_init

2023-01-04 Thread Mario Limonciello
Add an early_init phase to MES for fetching and validating microcode from the filesystem. If MES microcode is required but not available during early init, the firmware framebuffer will have already been released and the screen will freeze. Move the request for MES microcode into the early_init p

[PATCH v6 10/45] drm/amd: Load VCN microcode during early_init

2023-01-04 Thread Mario Limonciello
Simplifies the code so that all VCN versions will get the firmware name from `amdgpu_ucode_ip_version_decode` and then use this filename to load microcode as part of the early_init process. Signed-off-by: Mario Limonciello --- v5->v6: * Fix whitespace problem in firmware file names * Adjust for

[PATCH v6 07/45] drm/amd: Convert SDMA to use `amdgpu_ucode_ip_version_decode`

2023-01-04 Thread Mario Limonciello
Simplifies the code so that all SDMA versions will get the firmware name from `amdgpu_ucode_ip_version_decode`. Reviewed-by: Alex Deucher Signed-off-by: Mario Limonciello --- drivers/gpu/drm/amd/amdgpu/amdgpu_sdma.c | 12 -- drivers/gpu/drm/amd/amdgpu/amdgpu_sdma.h | 4 +- drivers/gpu/drm/

[PATCH v6 08/45] drm/amd: Make SDMA firmware load failures less noisy.

2023-01-04 Thread Mario Limonciello
When firmware is missing we get failures at every step. ``` [3.855086] amdgpu :04:00.0: Direct firmware load for amdgpu/green_sardine_sdma.bin failed with error -2 [3.855087] [drm:amdgpu_sdma_init_microcode [amdgpu]] *ERROR* SDMA: Failed to init firmware "amdgpu/green_sardine_sdma.bin

[PATCH v6 06/45] drm/amd: Use `amdgpu_ucode_request` helper for SDMA

2023-01-04 Thread Mario Limonciello
The `amdgpu_ucode_request` helper will ensure that the return code for missing firmware is -ENODEV so that early_init can fail. Reviewed-by: Alex Deucher Signed-off-by: Mario Limonciello --- v5->v6: * Adjust for amdgpu_ucode_release argument change --- drivers/gpu/drm/amd/amdgpu/amdgpu_sdma.c

[PATCH v6 09/45] drm/amd: Use `amdgpu_ucode_*` helpers for VCN

2023-01-04 Thread Mario Limonciello
The `amdgpu_ucode_request` helper will ensure that the return code for missing firmware is -ENODEV so that early_init can fail. The `amdgpu_ucode_release` helper is for symmetry. Reviewed-by: Alex Deucher Signed-off-by: Mario Limonciello --- v5->v6: * Adjust for amdgpu_ucode_release argument c

[PATCH v6 05/45] drm/amd: Add a new helper for loading/validating microcode

2023-01-04 Thread Mario Limonciello
All microcode runs a basic validation after it's been loaded. Each IP block as part of init will run both. Introduce a wrapper for request_firmware and amdgpu_ucode_validate. This wrapper will also remap any error codes from request_firmware to -ENODEV. This is so that early_init will fail if fir

[PATCH v6 04/45] drm/amd: Convert SMUv13 microcode to use `amdgpu_ucode_ip_version_decode`

2023-01-04 Thread Mario Limonciello
The special case for the one dGPU has been moved into `amdgpu_ucode_ip_version_decode`, so simplify this code. Signed-off-by: Mario Limonciello Acked-by: Christian König Reviewed-by: Alex Deucher --- drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0.c | 12 ++-- 1 file changed, 2 insertions

[PATCH v6 03/45] drm/amd: Convert SMUv11 microcode to use `amdgpu_ucode_ip_version_decode`

2023-01-04 Thread Mario Limonciello
Remove the special casing from SMU v11 code. No intended functional changes. Signed-off-by: Mario Limonciello Acked-by: Christian König Reviewed-by: Alex Deucher --- .../gpu/drm/amd/pm/swsmu/smu11/smu_v11_0.c| 35 ++- 1 file changed, 3 insertions(+), 32 deletions(-) diff -

[PATCH v6 02/45] drm/amd: Add a legacy mapping to "amdgpu_ucode_ip_version_decode"

2023-01-04 Thread Mario Limonciello
This will allow other parts of the driver that currently special case firmware file names to before IP version style naming to just have a single call to `amdgpu_ucode_ip_version_decode`. Signed-off-by: Mario Limonciello Acked-by: Christian König Reviewed-by: Alex Deucher --- drivers/gpu/drm/a

[PATCH v6 01/45] drm/amd: Delay removal of the firmware framebuffer

2023-01-04 Thread Mario Limonciello
Removing the firmware framebuffer from the driver means that even if the driver doesn't support the IP blocks in a GPU it will no longer be functional after the driver fails to initialize. This change will ensure that unsupported IP blocks at least cause the driver to work with the EFI framebuffer

[PATCH v6 00/45] Recover from failure to probe GPU

2023-01-04 Thread Mario Limonciello
One of the first thing that KMS drivers do during initialization is destroy the system firmware framebuffer by means of `drm_aperture_remove_conflicting_pci_framebuffers` This means that if for any reason the GPU failed to probe the user will be stuck with at best a screen frozen at the last thing

[pull] amdgpu, amdkfd drm-fixes-6.2

2023-01-04 Thread Alex Deucher
Hi Dave, Daniel, Fixes for 6.2. The following changes since commit c8de526215fdab9f2dd0d9675582cf9f1391a919: Merge tag 'drm-misc-next-fixes-2023-01-03' of git://anongit.freedesktop.org/drm/drm-misc into drm-fixes (2023-01-03 21:02:57 +0100) are available in the Git repository at: https:/

Re: [PATCH 2/2] drm/amd: update securedisplay_cmd to ta_securedisplay_cmd

2023-01-04 Thread Alex Deucher
These two patches should be squashed together to avoid breaking the build. Alex On Wed, Jan 4, 2023 at 8:04 PM Aaron Liu wrote: > > This patch updates securedisplay_cmd to ta_securedisplay_cmd > starting from amd-ta_securedisplay-v27.00.00.08. > > Signed-off-by: Aaron Liu > --- > drivers/gpu/d

[PATCH 8/8] drm/amd/pm: drop the support for manual fan speed setting on SMU13.0.7

2023-01-04 Thread Evan Quan
Due to lack of support from PMFW. Signed-off-by: Evan Quan Change-Id: I8439e72b95ad2fdf8cfdf1edc4d9c8af58109dc3 --- drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_7_ppt.c | 5 + 1 file changed, 5 insertions(+) diff --git a/drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_7_ppt.c b/drivers/gpu/dr

[PATCH 6/8] drm/amd/pm: refine the checks for hwmon interfaces support

2023-01-04 Thread Evan Quan
Make the code more clean and readable with no real logics change. Signed-off-by: Evan Quan Change-Id: I2c9e661ed6b855ea6ddd8554dd4f975cd2faa24f --- drivers/gpu/drm/amd/pm/amdgpu_pm.c | 329 ++--- 1 file changed, 206 insertions(+), 123 deletions(-) diff --git a/drivers/gp

[PATCH 7/8] drm/amd/pm: drop the support for manual fan speed setting on SMU13.0.0

2023-01-04 Thread Evan Quan
Due to lack of support from PMFW. Signed-off-by: Evan Quan Change-Id: I5d466d3d521b26a484bd837e173b9b289d4020ec --- drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_0_ppt.c | 5 + 1 file changed, 5 insertions(+) diff --git a/drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_0_ppt.c b/drivers/gpu/dr

[PATCH 5/8] drm/amdgpu: add bitmask controll for hwmon related interfaces

2023-01-04 Thread Evan Quan
Via this, the logic for adding/dropping the support for some specific hwmon interface can be greatly simplified. Signed-off-by: Evan Quan Change-Id: Ia85082c964d80d1c43dd2d8bf51592aba968e364 --- drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 7 ++- drivers/gpu/drm/amd/pm/inc/amdgpu_dpm.h| 52

[PATCH 4/8] drm/amd/pm: drop the support for legacy sysfs interfaces on SMU13.0.7

2023-01-04 Thread Evan Quan
Those legacy sysfs interfaces are actually not supported. Their outputs are confusing. Signed-off-by: Evan Quan Change-Id: Iba89f12ae3e79b856d6c0904b371590b6fd0d327 --- drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_7_ppt.c | 9 + 1 file changed, 9 insertions(+) diff --git a/drivers/gpu/d

[PATCH 1/8] drm/amdgpu: add bitmask controll for power related sysfs interfaces

2023-01-04 Thread Evan Quan
Via this, the logic for adding/dropping the support for some specific sysfs interface can be greatly simplified. Signed-off-by: Evan Quan Change-Id: Ica470cb8afd5b6cf7cc2a47b8310746b6c3b6f97 --- drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 9 ++ drivers/gpu/drm/amd/pm/amdgpu_pm.c | 115

[PATCH 3/8] drm/amd/pm: drop the support for legacy sysfs interfaces on SMU13.0.0

2023-01-04 Thread Evan Quan
Those legacy sysfs interfaces are actually not supported. Their outputs are confusing. Signed-off-by: Evan Quan Change-Id: I95a772911a6f0ec89b0dfed08bef50f0060defad --- drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_0_ppt.c | 9 + 1 file changed, 9 insertions(+) diff --git a/drivers/gpu/d

[PATCH 2/8] drm/amd/pm: refine the checks for sysfs interfaces support

2023-01-04 Thread Evan Quan
Make the code more clean and readable with no real logics change. Signed-off-by: Evan Quan Change-Id: I21c879fa9abad9f6da3b5289adf3124950d2f4eb --- drivers/gpu/drm/amd/pm/amdgpu_pm.c | 200 ++--- 1 file changed, 98 insertions(+), 102 deletions(-) diff --git a/drivers/gpu

RE: [PATCH 1/2] drm/amdgpu: update ta_secureDisplay_if.h to v27.00.00.08

2023-01-04 Thread Liu, HaoPing (Alan)
[AMD Official Use Only - General] Reviewed-by: Alan Liu -Original Message- From: Liu, Aaron Sent: Thursday, January 5, 2023 9:04 AM To: amd-gfx@lists.freedesktop.org Cc: Liu, HaoPing (Alan) ; Deucher, Alexander ; Xiao, Shane ; Liu, Aaron Subject: [PATCH 1/2] drm/amdgpu: update ta_se

RE: [PATCH 2/2] drm/amd: update securedisplay_cmd to ta_securedisplay_cmd

2023-01-04 Thread Liu, HaoPing (Alan)
[AMD Official Use Only - General] Reviewed-by: Alan Liu -Original Message- From: Liu, Aaron Sent: Thursday, January 5, 2023 9:04 AM To: amd-gfx@lists.freedesktop.org Cc: Liu, HaoPing (Alan) ; Deucher, Alexander ; Xiao, Shane ; Liu, Aaron Subject: [PATCH 2/2] drm/amd: update securedi

[PATCH 2/2] drm/amd: update securedisplay_cmd to ta_securedisplay_cmd

2023-01-04 Thread Aaron Liu
This patch updates securedisplay_cmd to ta_securedisplay_cmd starting from amd-ta_securedisplay-v27.00.00.08. Signed-off-by: Aaron Liu --- drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c | 2 +- drivers/gpu/drm/amd/amdgpu/amdgpu_securedisplay.c | 8 drivers/gpu/drm/amd/amdgpu/

[PATCH 1/2] drm/amdgpu: update ta_secureDisplay_if.h to v27.00.00.08

2023-01-04 Thread Aaron Liu
1. Rename securedisplay_cmd to ta_securedisplay_cmd. 2. Rename ta_securedisplay_max_phy to ta_securedisplay_phy_ID. Signed-off-by: Aaron Liu Signed-off-by: Shane Xiao --- .../gpu/drm/amd/amdgpu/ta_secureDisplay_if.h | 24 +-- 1 file changed, 12 insertions(+), 12 deletions(-) d

Re: [PATCH] drm/amd/display: fix array-bounds errors in dc_stream_remove_writeback()

2023-01-04 Thread Hamza Mahfooz
On 12/25/22 10:10, wenyang.li...@foxmail.com wrote: From: Wen Yang The following errors occurred when using gcc 7.5.0-3ubuntu1~18.04: drivers/gpu/drm/amd/amdgpu/../display/dc/core/dc_stream.c: In function  ‘dc_stream_remove_writeback’: drivers/gpu/drm/amd/amdgpu/../display/dc/core/dc_stream.c:5

Re: [PATCH] drm/amd/display: Remove redundant logs from DSC code

2023-01-04 Thread Hamza Mahfooz
On 12/16/22 05:35, Praful Swarnakar wrote: [Why & How] Remove redundant log in DSC that just add additional blank prints Signed-off-by: Praful Swarnakar Applied, thanks! --- drivers/gpu/drm/amd/display/dc/core/dc_link_dp.c | 1 - drivers/gpu/drm/amd/display/dc/dcn20/dcn20_dsc.c | 1 - 2

[PATCH] drm/amdgpu: Fix potential NULL dereference

2023-01-04 Thread Luben Tuikov
Fix potential NULL dereference, in the case when "man", the resource manager might be NULL, when/if we print debug information. Cc: Alex Deucher Cc: Christian König Cc: AMD Graphics Cc: Dan Carpenter Cc: kernel test robot Fixes: 7554886daa31ea ("drm/amdgpu: Fix size validation for non-exclusi

Re: [PATCH 1/2] drm/amdgpu: return the PCIe gen and lanes from the INFO

2023-01-04 Thread Marek Olšák
Yes, it's meant to be like a spec sheet. We are not interested in the current bandwidth utilization. Marek On Wed, Jan 4, 2023 at 10:33 AM Lazar, Lijo wrote: > [AMD Official Use Only - General] > > To clarify, with DPM in place, the current bandwidth will be changing > based on the load. > > If

[PATCH 12/14] drm/amd/display: Do not add '-mhard-float' to dml_ccflags for clang

2023-01-04 Thread Nathan Chancellor
When clang's -Qunused-arguments is dropped from KBUILD_CPPFLAGS, it warns: clang-16: error: argument unused during compilation: '-mhard-float' [-Werror,-Wunused-command-line-argument] Similar to commit 84edc2eff827 ("selftest/fpu: avoid clang warning"), just add this flag to GCC builds. Commit

[PATCH 00/14] Remove clang's -Qunused-arguments from KBUILD_CPPFLAGS

2023-01-04 Thread Nathan Chancellor
Hi all, Clang can emit a few different warnings when it encounters a flag that it recognizes but does not support internally. These warnings are elevated to errors within {as,cc}-option via -Werror to catch unsupported flags that should not be added to KBUILD_{A,C}FLAGS; see commit c3f0d0bc5b01 ("

[PATCH 5.4 1/1] drm/amdkfd: Check for null pointer after calling kmemdup

2023-01-04 Thread Dragos-Marian Panait
From: Jiasheng Jiang [ Upstream commit abfaf0eee97925905e742aa3b0b72e04a918fa9e ] As the possible failure of the allocation, kmemdup() may return NULL pointer. Therefore, it should be better to check the 'props2' in order to prevent the dereference of NULL pointer. Fixes: 3a87177eb141 ("drm/amd

[PATCH 5.10 1/1] drm/amdkfd: Check for null pointer after calling kmemdup

2023-01-04 Thread Dragos-Marian Panait
From: Jiasheng Jiang [ Upstream commit abfaf0eee97925905e742aa3b0b72e04a918fa9e ] As the possible failure of the allocation, kmemdup() may return NULL pointer. Therefore, it should be better to check the 'props2' in order to prevent the dereference of NULL pointer. Fixes: 3a87177eb141 ("drm/amd

[PATCH 5.10 0/1] drm/amdkfd: Check for null pointer after calling kmemdup

2023-01-04 Thread Dragos-Marian Panait
The following commit is needed to fix CVE-2022-3108: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=abfaf0eee97925905e742aa3b0b72e04a918fa9e Jiasheng Jiang (1): drm/amdkfd: Check for null pointer after calling kmemdup drivers/gpu/drm/amd/amdkfd/kfd_crat.c | 3 +++

[PATCH 5.4 0/1] drm/amdkfd: Check for null pointer after calling kmemdup

2023-01-04 Thread Dragos-Marian Panait
The following commit is needed to fix CVE-2022-3108: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=abfaf0eee97925905e742aa3b0b72e04a918fa9e Jiasheng Jiang (1): drm/amdkfd: Check for null pointer after calling kmemdup drivers/gpu/drm/amd/amdkfd/kfd_crat.c | 3 +++

Re: [PATCH 4.19 1/1] drm/amdkfd: Check for null pointer after calling kmemdup

2023-01-04 Thread Dragos-Marian Panait
On 04.01.2023 16:48, Greg KH wrote: On Wed, Jan 04, 2023 at 09:35:03AM -0500, Alex Deucher wrote: On Wed, Jan 4, 2023 at 8:23 AM Christian König wrote: Am 04.01.23 um 13:41 schrieb Greg KH: On Tue, Jan 03, 2023 at 08:43:08PM +0200, Dragos-Marian Panait wrote: From: Jiasheng Jiang [ Upstr

Re: [PATCH] drm/amd/display: drop unnecessary NULL checks in debugfs

2023-01-04 Thread Hamza Mahfooz
On 12/27/22 12:04, Alexey Kodanev wrote: pipe_ctx pointer cannot be NULL when getting the address of an element of the pipe_ctx array. Moreover, the MAX_PIPES is defined as 6, so pipe_ctx is not NULL after the loop either. Detected using the static analysis tool - Svace. Signed-off-by: Alexey Ko

Re: [PATCH v5 45/45] drm/amd: make amdgpu_ucode_validate static

2023-01-04 Thread Alex Deucher
Other than the patches I commented directly on, this series is: Reviewed-by: Alex Deucher On Wed, Jan 4, 2023 at 11:45 AM Mario Limonciello wrote: > > No consumers outside of amdgpu_ucode.c use amdgpu_ucode_validate > anymore, so make the function static. > > Signed-off-by: Mario Limonciello >

RE: [PATCH v5 10/45] drm/amd: Load VCN microcode during early_init

2023-01-04 Thread Limonciello, Mario
[Public] > -Original Message- > From: Alex Deucher > Sent: Wednesday, January 4, 2023 11:16 > To: Limonciello, Mario > Cc: Deucher, Alexander ; linux- > ker...@vger.kernel.org; Pan, Xinhui ; Lazar, Lijo > ; Javier Martinez Canillas ; dri- > de...@lists.freedesktop.org; amd-gfx@lists.fr

Re: [PATCH v5 10/45] drm/amd: Load VCN microcode during early_init

2023-01-04 Thread Alex Deucher
On Wed, Jan 4, 2023 at 11:42 AM Mario Limonciello wrote: > > Simplifies the code so that all VCN versions will get the firmware > name from `amdgpu_ucode_ip_version_decode` and then use this filename > to load microcode as part of the early_init process. > > Signed-off-by: Mario Limonciello > ---

Re: [PATCH v5 05/45] drm/amd: Add a new helper for loading/validating microcode

2023-01-04 Thread Alex Deucher
On Wed, Jan 4, 2023 at 11:42 AM Mario Limonciello wrote: > > All microcode runs a basic validation after it's been loaded. Each > IP block as part of init will run both. > > Introduce a wrapper for request_firmware and amdgpu_ucode_validate. > This wrapper will also remap any error codes from requ

[PATCH v5 45/45] drm/amd: make amdgpu_ucode_validate static

2023-01-04 Thread Mario Limonciello
No consumers outside of amdgpu_ucode.c use amdgpu_ucode_validate anymore, so make the function static. Signed-off-by: Mario Limonciello --- drivers/gpu/drm/amd/amdgpu/amdgpu_ucode.c | 2 +- drivers/gpu/drm/amd/amdgpu/amdgpu_ucode.h | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --g

[PATCH v5 43/45] drm/amd: Use `amdgpu_ucode_release` helper for powerplay

2023-01-04 Thread Mario Limonciello
The `amdgpu_ucode_release` helper is replacing all calls to release_firmware. Signed-off-by: Mario Limonciello --- drivers/gpu/drm/amd/pm/powerplay/amd_powerplay.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/gpu/drm/amd/pm/powerplay/amd_powerplay.c b/drivers/gp

[PATCH v5 40/45] drm/amd: Use `amdgpu_ucode_*` helpers for CGS

2023-01-04 Thread Mario Limonciello
The `amdgpu_ucode_request` helper will ensure that the return code for missing firmware is -ENODEV so that early_init can fail. The `amdgpu_ucode_release` helper is for symmetry on unloading. Signed-off-by: Mario Limonciello --- drivers/gpu/drm/amd/amdgpu/amdgpu_cgs.c | 11 ++- 1 file c

[PATCH v5 37/45] drm/amd: Use `amdgpu_ucode_*` helpers for SDMA on CIK

2023-01-04 Thread Mario Limonciello
The `amdgpu_ucode_request` helper will ensure that the return code for missing firmware is -ENODEV so that early_init can fail. The `amdgpu_ucode_release` helper is for symmetry on unloading. Signed-off-by: Mario Limonciello --- drivers/gpu/drm/amd/amdgpu/cik_sdma.c | 16 ++-- 1 fil

[PATCH v5 42/45] drm/amd: Use `amdgpu_ucode_*` helpers for DMCU

2023-01-04 Thread Mario Limonciello
The `amdgpu_ucode_request` helper will ensure that the return code for missing firmware is -ENODEV so that early_init can fail. The `amdgpu_ucode_release` helper is for symmetry on unloading. Signed-off-by: Mario Limonciello --- drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 11 ++-

[PATCH v5 26/45] drm/amd: Use `amdgpu_ucode_*` helpers for SMU

2023-01-04 Thread Mario Limonciello
The `amdgpu_ucode_request` helper will ensure that the return code for missing firmware is -ENODEV so that early_init can fail. The `amdgpu_ucode_release` helper is for symmetry on unloading. Signed-off-by: Mario Limonciello --- drivers/gpu/drm/amd/pm/swsmu/smu11/smu_v11_0.c | 16 --

[PATCH v5 44/45] drm/amd: Use `amdgpu_ucode_release` helper for si

2023-01-04 Thread Mario Limonciello
The `amdgpu_ucode_release` helper is replacing all calls to release_firmware. Signed-off-by: Mario Limonciello --- drivers/gpu/drm/amd/pm/legacy-dpm/si_dpm.c | 11 ++- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/drivers/gpu/drm/amd/pm/legacy-dpm/si_dpm.c b/drivers/gpu/

[PATCH v5 30/45] drm/amd: Use `amdgpu_ucode_*` helpers for GFX7

2023-01-04 Thread Mario Limonciello
The `amdgpu_ucode_request` helper will ensure that the return code for missing firmware is -ENODEV so that early_init can fail. The `amdgpu_ucode_release` helper is for symmetry on unloading. Signed-off-by: Mario Limonciello --- drivers/gpu/drm/amd/amdgpu/gfx_v7_0.c | 68 +++

[PATCH v5 41/45] drm/amd: Use `amdgpu_ucode_*` helpers for GPU info bin

2023-01-04 Thread Mario Limonciello
The `amdgpu_ucode_request` helper will ensure that the return code for missing firmware is -ENODEV so that early_init can fail. The `amdgpu_ucode_release` helper is for symmetry on unloading. Signed-off-by: Mario Limonciello --- drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 14 +++--- 1

[PATCH v5 32/45] drm/amd: Use `amdgpu_ucode_*` helpers for GMC6

2023-01-04 Thread Mario Limonciello
The `amdgpu_ucode_request` helper will ensure that the return code for missing firmware is -ENODEV so that early_init can fail. The `amdgpu_ucode_release` helper is for symmetry on unloading. Signed-off-by: Mario Limonciello --- drivers/gpu/drm/amd/amdgpu/gmc_v6_0.c | 14 +++--- 1 file

[PATCH v5 39/45] drm/amd: Use `amdgpu_ucode_*` helpers for VCE

2023-01-04 Thread Mario Limonciello
The `amdgpu_ucode_request` helper will ensure that the return code for missing firmware is -ENODEV so that early_init can fail. The `amdgpu_ucode_release` helper is for symmetry on unloading. Signed-off-by: Mario Limonciello --- drivers/gpu/drm/amd/amdgpu/amdgpu_vce.c | 14 +++--- 1 fil

[PATCH v5 38/45] drm/amd: Use `amdgpu_ucode_*` helpers for UVD

2023-01-04 Thread Mario Limonciello
The `amdgpu_ucode_request` helper will ensure that the return code for missing firmware is -ENODEV so that early_init can fail. The `amdgpu_ucode_release` helper is for symmetry on unloading. Signed-off-by: Mario Limonciello --- drivers/gpu/drm/amd/amdgpu/amdgpu_uvd.c | 14 +++--- 1 fil

[PATCH v5 28/45] drm/amd: Optimize SRIOV switch/case for PSP microcode load

2023-01-04 Thread Mario Limonciello
Now that IP version decoding is used, a number of case statements can be combined. Reviewed-by: Christian König Signed-off-by: Mario Limonciello --- drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c | 8 +--- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/drivers/gpu/drm/amd/amdgpu/amdg

[PATCH v5 31/45] drm/amd: Use `amdgpu_ucode_*` helpers for GFX8

2023-01-04 Thread Mario Limonciello
The `amdgpu_ucode_request` helper will ensure that the return code for missing firmware is -ENODEV so that early_init can fail. The `amdgpu_ucode_release` helper is for symmetry on unloading. Signed-off-by: Mario Limonciello --- drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c | 94 ++-

[PATCH v5 36/45] drm/amd: Use `amdgpu_ucode_*` helpers for SDMA3.0

2023-01-04 Thread Mario Limonciello
The `amdgpu_ucode_request` helper will ensure that the return code for missing firmware is -ENODEV so that early_init can fail. The `amdgpu_ucode_release` helper is for symmetry on unloading. Signed-off-by: Mario Limonciello --- drivers/gpu/drm/amd/amdgpu/sdma_v3_0.c | 18 ++ 1

[PATCH v5 35/45] drm/amd: Use `amdgpu_ucode_*` helpers for SDMA2.4

2023-01-04 Thread Mario Limonciello
The `amdgpu_ucode_request` helper will ensure that the return code for missing firmware is -ENODEV so that early_init can fail. The `amdgpu_ucode_release` helper is for symmetry on unloading. Signed-off-by: Mario Limonciello --- drivers/gpu/drm/amd/amdgpu/sdma_v2_4.c | 18 ++ 1

[PATCH v5 34/45] drm/amd: Use `amdgpu_ucode_*` helpers for GMC8

2023-01-04 Thread Mario Limonciello
The `amdgpu_ucode_request` helper will ensure that the return code for missing firmware is -ENODEV so that early_init can fail. The `amdgpu_ucode_release` helper is for symmetry on unloading. Signed-off-by: Mario Limonciello --- drivers/gpu/drm/amd/amdgpu/gmc_v8_0.c | 13 +++-- 1 file c

[PATCH v5 27/45] drm/amd: Load SMU microcode during early_init

2023-01-04 Thread Mario Limonciello
This will ensure that the microcode is available before the firmware framebuffer has been destroyed. Signed-off-by: Mario Limonciello --- drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c | 12 +--- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/drivers/gpu/drm/amd/pm/swsmu/amdgpu

[PATCH v5 33/45] drm/amd: Use `amdgpu_ucode_*` helpers for GMC7

2023-01-04 Thread Mario Limonciello
The `amdgpu_ucode_request` helper will ensure that the return code for missing firmware is -ENODEV so that early_init can fail. The `amdgpu_ucode_release` helper is for symmetry on unloading. Signed-off-by: Mario Limonciello --- drivers/gpu/drm/amd/amdgpu/gmc_v7_0.c | 13 +++-- 1 file c

  1   2   >