[AMD Public Use]

Thanks Hawking.

Then let's skip this patch, and I will work out another reasonable approach.

Regards,
Guchun

-----Original Message-----
From: Zhang, Hawking <[email protected]> 
Sent: Monday, January 4, 2021 3:52 PM
To: Zhang, Hawking <[email protected]>; Chen, Guchun <[email protected]>; 
[email protected]; Deucher, Alexander <[email protected]>; 
Yang, Stanley <[email protected]>; Li, Dennis <[email protected]>; Zhou1, 
Tao <[email protected]>; Clements, John <[email protected]>
Subject: RE: [PATCH] drm/amdgpu: drop ras ta firmware loading for non-ras asic

[AMD Public Use]

Btw, the original purpose for the asic type check is to prevent any further 
atombios call for RAS capability check. But it's not necessary to be there. We 
shall consider to change it in a more reasonable approach by dropping the asic 
type check.

Regards,
Hawking

-----Original Message-----
From: amd-gfx <[email protected]> On Behalf Of Zhang, 
Hawking
Sent: Monday, January 4, 2021 15:48
To: Chen, Guchun <[email protected]>; [email protected]; Deucher, 
Alexander <[email protected]>; Yang, Stanley <[email protected]>; 
Li, Dennis <[email protected]>; Zhou1, Tao <[email protected]>; Clements, John 
<[email protected]>
Subject: RE: [PATCH] drm/amdgpu: drop ras ta firmware loading for non-ras asic

[AMD Public Use]

Then we can refine the wording, or make this to be debug message, although the 
message already states explicitly this is "optional". Split 
amdgpu_ras_checked_support may not be a good idea since this is strictly not 
correct -  RAS is not necessarily bind to ASIC type. 

Regards,
Hawking
-----Original Message-----
From: Chen, Guchun <[email protected]> 
Sent: Monday, January 4, 2021 14:57
To: Zhang, Hawking <[email protected]>; [email protected]; 
Deucher, Alexander <[email protected]>; Yang, Stanley 
<[email protected]>; Li, Dennis <[email protected]>; Zhou1, Tao 
<[email protected]>; Clements, John <[email protected]>
Subject: RE: [PATCH] drm/amdgpu: drop ras ta firmware loading for non-ras asic

[AMD Public Use]

Hi Hawking,

Yes, these kernel messages are indeed not harmful, but some audiences may feel 
confused on this, as they will guess why kernel said " ras ta ucode is not 
available " during boot up, and furthermore, if the users miss some FWs? So 
this is to exclude the confusion on the ASICs that don't have RAS feature.

Asic type check for ras is not introduced by this patch, it exists already as 
it's used in amdgpu_ras_checked_support. This patch extends its scope by moving 
it to header file(amdgpu_ras.h) for wide usage.

Regards,
Guchun

-----Original Message-----
From: Zhang, Hawking <[email protected]> 
Sent: Monday, January 4, 2021 2:23 PM
To: Chen, Guchun <[email protected]>; [email protected]; Deucher, 
Alexander <[email protected]>; Yang, Stanley <[email protected]>; 
Li, Dennis <[email protected]>; Zhou1, Tao <[email protected]>; Clements, John 
<[email protected]>
Subject: RE: [PATCH] drm/amdgpu: drop ras ta firmware loading for non-ras asic

[AMD Public Use]

We shall check ras ta firmware image size or/and ras ta binary start address to 
exclude ASICs that don't support ras.

Introduce asic type check here is unnecessary and the functional also need to 
be modified every time we add a new asic with ras capablility.

Kernel message that indicates ras ta, and other ta are optional one seems no 
harm to me. this is not limited to ras, but also hdcp/dtm.etc. If people have 
concern on this kind of messages, we can leverage amdgpu_ras_checked_support to 
only allow the message for ASICs that support RAS, although I don't think that 
is necessary.

Regards,
Hawking
-----Original Message-----
From: Chen, Guchun <[email protected]> 
Sent: Monday, January 4, 2021 12:58
To: [email protected]; Deucher, Alexander 
<[email protected]>; Zhang, Hawking <[email protected]>; Yang, 
Stanley <[email protected]>; Li, Dennis <[email protected]>; Zhou1, Tao 
<[email protected]>; Clements, John <[email protected]>
Cc: Chen, Guchun <[email protected]>
Subject: [PATCH] drm/amdgpu: drop ras ta firmware loading for non-ras asic

Otherwise, below confused message is always printed during boot for asics 
without ras feature, but with common ta firmware.

amdgpu: RAS: optional ras ta ucode is not available

Signed-off-by: Guchun Chen <[email protected]>
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c |  5 +++--  
drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c | 22 ++++++++++++----------  
drivers/gpu/drm/amd/amdgpu/amdgpu_ras.h |  2 ++
 3 files changed, 17 insertions(+), 12 deletions(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c 
b/drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c
index eb19ae734396..730bc1fe2036 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c
@@ -1135,9 +1135,10 @@ static int psp_ras_initialize(struct psp_context *psp)
        int ret;
 
        /*
-        * TODO: bypass the initialize in sriov for now
+        * TODO: bypass the initialize in sriov and non-ras case
         */
-       if (amdgpu_sriov_vf(psp->adev))
+       if (amdgpu_sriov_vf(psp->adev) ||
+               !amdgpu_ras_check_enablement_by_asic(psp->adev))
                return 0;
 
        if (!psp->adev->psp.ta_ras_ucode_size || diff --git 
a/drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c 
b/drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c
index c136bd449744..41d97e56271e 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c
@@ -1897,15 +1897,17 @@ int amdgpu_ras_request_reset_on_boot(struct 
amdgpu_device *adev,
        return 0;
 }
 
-static int amdgpu_ras_check_asic_type(struct amdgpu_device *adev) -{
-       if (adev->asic_type != CHIP_VEGA10 &&
-               adev->asic_type != CHIP_VEGA20 &&
-               adev->asic_type != CHIP_ARCTURUS &&
-               adev->asic_type != CHIP_SIENNA_CICHLID)
-               return 1;
-       else
-               return 0;
+bool amdgpu_ras_check_enablement_by_asic(struct amdgpu_device *adev) {
+       switch (adev->asic_type) {
+       case CHIP_VEGA10:
+       case CHIP_VEGA20:
+       case CHIP_ARCTURUS:
+       case CHIP_SIENNA_CICHLID:
+               return true;
+       default:
+               return false;
+       }
 }
 
 /*
@@ -1924,7 +1926,7 @@ static void amdgpu_ras_check_supported(struct 
amdgpu_device *adev,
        *supported = 0;
 
        if (amdgpu_sriov_vf(adev) || !adev->is_atom_fw ||
-               amdgpu_ras_check_asic_type(adev))
+               !amdgpu_ras_check_enablement_by_asic(adev))
                return;
 
        if (amdgpu_atomfirmware_mem_ecc_supported(adev)) { diff --git 
a/drivers/gpu/drm/amd/amdgpu/amdgpu_ras.h 
b/drivers/gpu/drm/amd/amdgpu/amdgpu_ras.h
index 762f5e46c007..06b5f9d14bea 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ras.h
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ras.h
@@ -629,4 +629,6 @@ void amdgpu_ras_global_ras_isr(struct amdgpu_device *adev); 
 void amdgpu_ras_set_error_query_ready(struct amdgpu_device *adev, bool ready);
 
 bool amdgpu_ras_need_emergency_restart(struct amdgpu_device *adev);
+
+bool amdgpu_ras_check_enablement_by_asic(struct amdgpu_device *adev);
 #endif
--
2.17.1
_______________________________________________
amd-gfx mailing list
[email protected]
https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Flists.freedesktop.org%2Fmailman%2Flistinfo%2Famd-gfx&amp;data=04%7C01%7Chawking.zhang%40amd.com%7C3e86b4dc4a59450b440208d8b0850d12%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C637453432786828013%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&amp;sdata=JVlHoxp6CK3QUCrNMfFT%2FOrTNGll%2FKP0z3HOrpy5z3s%3D&amp;reserved=0
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

Reply via email to