Skip to contentSkip to conversation

drm/amd: Avoid running psp_ras_initialize() on HW without RAS

PATCH In review Mario Limonciello 2 participants 3 messages Jul 5, 2023 – Jul 6, 2023

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

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
index c2508462e02f..a87b6c761e78 100644
@@ -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
#1 lore raw

[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
index c2508462e02f..a87b6c761e78 100644
@@ -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

#2 lore raw
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 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 -1
index c2508462e02f..a87b6c761e78 100644
@@ -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