drm/amd: Avoid running psp_ras_initialize() on HW without RAS
Subsystems (2)
PATCH 1/1 drm/amd: Avoid running psp_ras_initialize() on HW without RAS
On hardware known not to have RAS or in cases that a user has disabled RAS via kernel module parameter, it makes no sense to try to run code from psp_ras_initialize(). Furthermore trying to run it shows the following message on every boot:
RAS: optional ras ta ucode is not available
Avoid running the rest of the function is RAS is not available.
--- drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c | 3 +++ 1 file changed, 3 insertions(+)
drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c +3 -0
@@ -1603,6 +1603,9 @@ int psp_ras_initialize(struct psp_context *psp)if (amdgpu_sriov_vf (adev))return 0 ; +if (!adev->ras_enabled) +return 0 ; +if (!adev->psp.ras_context.context.bin_desc.size_bytes || !adev->psp.ras_context.context.bin_desc.start_addr) {dev_info (adev->dev,"RAS: optional ras ta ucode is not available\n" );
Signature · 1 line
2.34.1
[AMD Official Use Only - General]
The change doesn't make sense at all, especially for some ASIC where it is allowed enable/disable RAS config through RAS TA. i.e. set ras_enable==0 and the issue commands to RAS TA to change the RAS config.
It doesn't matter whether ras code path is enabled or not, but ras firmware, as long as it is built-in for the asic, it needs to be loaded.
Regards,
Hawking
-----Original Message-----
From: amd-gfx <[email protected]> On Behalf Of Mario Limonciello
Sent: Thursday, July 6, 2023 00:53
To: [email protected]
Cc: Limonciello, Mario <[email protected]>
Subject: [PATCH] drm/amd: Avoid running psp_ras_initialize() on HW without RAS
On hardware known not to have RAS or in cases that a user has disabled RAS via kernel module parameter, it makes no sense to try to run code from psp_ras_initialize(). Furthermore trying to run it shows the following message on every boot:
RAS: optional ras ta ucode is not available
Avoid running the rest of the function is RAS is not available.
--- drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c | 3 +++ 1 file changed, 3 insertions(+)
drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c +3 -0
@@ -1603,6 +1603,9 @@ int psp_ras_initialize(struct psp_context *psp)if (amdgpu_sriov_vf (adev))return 0 ; +if (!adev->ras_enabled) +return 0 ; +if (!adev->psp.ras_context.context.bin_desc.size_bytes || !adev->psp.ras_context.context.bin_desc.start_addr) {dev_info (adev->dev,"RAS: optional ras ta ucode is not available\n" );
--
2.34.1
Quoted 6 lines · Hawking
[AMD Official Use Only - General]
The change doesn't make sense at all, especially for some ASIC where it is allowed enable/disable RAS config through RAS TA. i.e. set ras_enable==0 and the issue commands to RAS TA to change the RAS config.
It doesn't matter whether ras code path is enabled or not, but ras firmware, as long as it is built-in for the asic, it needs to be loaded.
OK - how about instead to use adev->ras_hw_enabled?
Quoted 40 lines
Regards,
Hawking-----Original Message-----
From: amd-gfx <[email protected]> On Behalf Of Mario Limonciello
Sent: Thursday, July 6, 2023 00:53
To: [email protected]
Cc: Limonciello, Mario <[email protected]>
Subject: [PATCH] drm/amd: Avoid runningpsp_ras_initialize()on HW without RASOn hardware known not to have RAS or in cases that a user has disabled RAS via kernel module parameter, it makes no sense to try to run code from
psp_ras_initialize(). Furthermore trying to run it shows the following message on every boot:
RAS: optional ras ta ucode is not availableAvoid running the rest of the function is RAS is not available.
Signed-off-by Mario Limonciello <[email protected]>--- drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c | 3 +++ 1 file changed, 3 insertions(+)drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c +3
-1@@ -1603,6 +1603,9 @@ int psp_ras_initialize(struct psp_context *psp)if (amdgpu_sriov_vf (adev))return 0 ; +if (!adev->ras_enabled) +return 0 ; +if (!adev->psp.ras_context.context.bin_desc.size_bytes || !adev->psp.ras_context.context.bin_desc.start_addr) {dev_info (adev->dev,"RAS: optional ras ta ucode is not available\n" ); --2.34.1