Skip to contentSkip to conversation

drm/amdgpu: Disable FRU EEPROM access for SRIOV

PATCH In review shaoyunl 4 participants 4 messages Jan 20, 2022 – Jan 21, 2022

Subsystems (2)
lore
Share & tools
lore

shaoyunl

author
#0 lore raw

PATCH 1/1 drm/amdgpu: Disable FRU EEPROM access for SRIOV

VF acces the EEPROM is blocked by security policy, we might need other way to get SKUs info for VF

---
 drivers/gpu/drm/amd/amdgpu/amdgpu_fru_eeprom.c | 6 ++++++
 1 file changed, 6 insertions(+)
drivers/gpu/drm/amd/amdgpu/amdgpu_fru_eeprom.c +6 -0
index 2a786e788627..0548e279cc9f 100644
@@ -40,6 +40,12 @@ static bool is_fru_eeprom_supported(struct amdgpu_device *adev)
 	 */
 	struct atom_context *atom_ctx = adev->mode_info.atom_context;
 
+	/* The i2c access is blocked on VF
+	 * TODO: Need other way to get the info
+	 */  
+	if (amdgpu_sriov_vf(adev)
+		return false;
+
 	/* VBIOS is of the format ###-DXXXYY-##. For SKU identification,
 	 * we can use just the "DXXX" portion. If there were more models, we
 	 * could convert the 3 characters to a hex integer and use a switch
Signature · 1 line
2.17.1
Acked-by on v1 1/1
#1 lore raw
Quoted 5 lines · shaoyunl

VF acces the EEPROM is blocked by security policy, we might need other way to get SKUs info for VF

Quoted 24 lines
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_fru_eeprom.c | 6 ++++++
 1 file changed, 6 insertions(+)
drivers/gpu/drm/amd/amdgpu/amdgpu_fru_eeprom.c +6 -1
index 2a786e788627..0548e279cc9f 100644
@@ -40,6 +40,12 @@ static bool is_fru_eeprom_supported(struct amdgpu_device *adev)
         */
        struct atom_context *atom_ctx = adev->mode_info.atom_context;
 
+       /* The i2c access is blocked on VF
+        * TODO: Need other way to get the info
+        */
+       if (amdgpu_sriov_vf(adev)
+               return false;
+
        /* VBIOS is of the format ###-DXXXYY-##. For SKU identification,
         * we can use just the "DXXX" portion. If there were more models, we
         * could convert the 3 characters to a hex integer and use a switch
--

2.17.1

Reviewed-by
#2 lore raw

[AMD Official Use Only]

Quoted 41 lines

-----Original Message-----
From: amd-gfx <[email protected]> On Behalf Of Alex Deucher
Sent: Thursday, January 20, 2022 11:51 AM
To: Liu, Shaoyun <[email protected]>
Cc: amd-gfx list <[email protected]>
Subject: Re: [PATCH] drm/amdgpu: Disable FRU EEPROM access for SRIOV

Quoted 5 lines · shaoyunl

VF acces the EEPROM is blocked by security policy, we might need other way to get SKUs info for VF

Review

Quoted 5 lines
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_fru_eeprom.c | 6 ++++++
 1 file changed, 6 insertions(+)
(quoted diff) +0 -0

b/drivers/gpu/drm/amd/amdgpu/amdgpu_fru_eeprom.c

Quoted 19 lines

index 2a786e788627..0548e279cc9f 100644

drivers/gpu/drm/amd/amdgpu/amdgpu_fru_eeprom.c +6 -1
@@ -40,6 +40,12 @@ static bool is_fru_eeprom_supported(struct amdgpu_device *adev)
         */
        struct atom_context *atom_ctx = adev->mode_info.atom_context;
 
+       /* The i2c access is blocked on VF
+        * TODO: Need other way to get the info
+        */
+       if (amdgpu_sriov_vf(adev)
+               return false;
+
        /* VBIOS is of the format ###-DXXXYY-##. For SKU identification,
         * we can use just the "DXXX" portion. If there were more models, we
         * could convert the 3 characters to a hex integer and use a switch
--

2.17.1

Acked-by on v1 1/1
#3 lore raw
In reply to shaoyunl

[Public]

Regards,
Guchun

-----Original Message-----
From: amd-gfx <[email protected]> On Behalf Of shaoyunl
Sent: Thursday, January 20, 2022 11:49 PM
To: [email protected]
Cc: Liu, Shaoyun <[email protected]>
Subject: [PATCH] drm/amdgpu: Disable FRU EEPROM access for SRIOV

VF acces the EEPROM is blocked by security policy, we might need other way to get SKUs info for VF

---
 drivers/gpu/drm/amd/amdgpu/amdgpu_fru_eeprom.c | 6 ++++++
 1 file changed, 6 insertions(+)
drivers/gpu/drm/amd/amdgpu/amdgpu_fru_eeprom.c +6 -0
index 2a786e788627..0548e279cc9f 100644
@@ -40,6 +40,12 @@ static bool is_fru_eeprom_supported(struct amdgpu_device *adev)
 	 */
 	struct atom_context *atom_ctx = adev->mode_info.atom_context;
 
+	/* The i2c access is blocked on VF
+	 * TODO: Need other way to get the info
+	 */  
+	if (amdgpu_sriov_vf(adev)
+		return false;
+
 	/* VBIOS is of the format ###-DXXXYY-##. For SKU identification,
 	 * we can use just the "DXXX" portion. If there were more models, we
 	 * could convert the 3 characters to a hex integer and use a switch

--
2.17.1