Skip to contentSkip to conversation

drm/amdgpu: Re-enable FRU check for most models v3

PATCH In review Kent Russell 2 participants 4 messages Apr 3, 2020

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

PATCH 1/1 drm/amdgpu: Re-enable FRU check for most models v3

There are 2 VG20 SKUs that do not have the FRU on there, and trying to read that will cause a hang. For now, check for the gaming SKU until a proper fix can be implemented. This re-enables serial number reporting for server cards

v2: Add ASIC check
v3: Don't default to true for pre-VG10

---
 .../gpu/drm/amd/amdgpu/amdgpu_fru_eeprom.c    | 22 +++++++++++++++++--
 1 file changed, 20 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_fru_eeprom.c +20 -2
index bfe4259f9508..508906177cad 100644
@@ -31,9 +31,27 @@
 
 bool is_fru_eeprom_supported(struct amdgpu_device *adev)
 {
-	/* TODO: Resolve supported ASIC type */
+	struct atom_context *atom_ctx = adev->mode_info.atom_context;
 
-	return false;
+	if (!atom_ctx)
+		return false;
+
+	/* TODO: Gaming SKUs don't have the FRU EEPROM.
+	 * Use this to address hangs on modprobe on gaming SKUs
+	 * until a proper solution can be implemented
+	 */
+	switch (adev->asic_type) {
+	case CHIP_VEGA20:
+		if (strnstr(atom_ctx->vbios_version, "D360",
+				sizeof(atom_ctx->vbios_version)))
+			return false;
+		return true;
+	case CHIP_ARCTURUS:
+		/* There are no gaming Arcturus SKUs */
+		return true;
+	default:
+		return false;
+	}
 }
 
 int amdgpu_fru_read_eeprom(struct amdgpu_device *adev, uint32_t addrptr,
Signature · 6 lines
2.17.1

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
#1 lore raw
Quoted 28 lines · Kent Russell

There are 2 VG20 SKUs that do not have the FRU on there, and trying to read that will cause a hang. For now, check for the gaming SKU until a proper fix can be implemented. This re-enables serial number reporting for server cards

v2: Add ASIC check
v3: Don't default to true for pre-VG10

---
 .../gpu/drm/amd/amdgpu/amdgpu_fru_eeprom.c    | 22 +++++++++++++++++--
 1 file changed, 20 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_fru_eeprom.c +3 -2
index bfe4259f9508..508906177cad 100644
@@ -31,9 +31,27 @@
 
 bool is_fru_eeprom_supported(struct amdgpu_device *adev)
 {
-       /* TODO: Resolve supported ASIC type */
+       struct atom_context *atom_ctx = adev->mode_info.atom_context;
 
-       return false;
+       if (!atom_ctx)
+               return false;

drivers/gpu/drm/amd/amdgpu/amdgpu_fru_eeprom.c line 47

Quoted 10 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_fru_eeprom.c +10 -0
+
+       /* TODO: Gaming SKUs don't have the FRU EEPROM.
+        * Use this to address hangs on modprobe on gaming SKUs
+        * until a proper solution can be implemented
+        */
+       switch (adev->asic_type) {
+       case CHIP_VEGA20:
+               if (strnstr(atom_ctx->vbios_version, "D360",
+                               sizeof(atom_ctx->vbios_version)))
+                       return false;

Most skus are separated by pci revision ids. Maybe it would be more reliable to check that than a vbios string?

Alex

Quoted 13 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_fru_eeprom.c +7 -1
+               return true;
+       case CHIP_ARCTURUS:
+               /* There are no gaming Arcturus SKUs */
+               return true;
+       default:
+               return false;
+       }
 }
 
 int amdgpu_fru_read_eeprom(struct amdgpu_device *adev, uint32_t addrptr,
--

2.17.1

Quoted 4 lines

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

#2 lore raw

[AMD Official Use Only - Internal Distribution Only]

Quoted 34 lines

-----Original Message-----
From: Alex Deucher <[email protected]>
Sent: Friday, April 3, 2020 4:51 PM
To: Russell, Kent <[email protected]>
Cc: amd-gfx list <[email protected]>
Subject: Re: [PATCH] drm/amdgpu: Re-enable FRU check for most models v3

Quoted 6 lines · Kent Russell

There are 2 VG20 SKUs that do not have the FRU on there, and trying to read that will cause a hang. For now, check for the gaming SKU until a proper fix can be implemented. This re-enables serial number reporting for server cards

Quoted 6 lines

v2: Add ASIC check
v3: Don't default to true for pre-VG10

---
 .../gpu/drm/amd/amdgpu/amdgpu_fru_eeprom.c    | 22

+++++++++++++++++--

Quoted 13 lines
 1 file changed, 20 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_fru_eeprom.c +1 -1
index bfe4259f9508..508906177cad 100644
@@ -31,9 +31,27 @@
 
 bool is_fru_eeprom_supported(struct amdgpu_device *adev)  {
-       /* TODO: Resolve supported ASIC type */
+       struct atom_context *atom_ctx = adev->mode_info.atom_context;
 
Quoted 16 lines

drivers/gpu/drm/amd/amdgpu/amdgpu_fru_eeprom.c line 47

Quoted 13 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_fru_eeprom.c +12 -1
-       return false;
+       if (!atom_ctx)
+               return false;
+
+       /* TODO: Gaming SKUs don't have the FRU EEPROM.
+        * Use this to address hangs on modprobe on gaming SKUs
+        * until a proper solution can be implemented
+        */
+       switch (adev->asic_type) {
+       case CHIP_VEGA20:
+               if (strnstr(atom_ctx->vbios_version, "D360",
+                               sizeof(atom_ctx->vbios_version)))
+                       return false;

Most skus are separated by pci revision ids. Maybe it would be more reliable to check that than a vbios string?

I can look into that. This was really meant as a temporary workaround until we found the right way to poll the card altogether. I lifted this from John Clements' patch to isolate the D342 variant of Arcturus due to that whole EEPROM addressing thing. I'll see if I can find the revision IDs for those and see if they can be used instead. Maybe I can use that for John's D342 check as well.

Quoted 22 lines

Alex

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

Quoted 10 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_fru_eeprom.c +7 -0
+               return true;
+       case CHIP_ARCTURUS:
+               /* There are no gaming Arcturus SKUs */
+               return true;
+       default:
+               return false;
+       }
 }
 
 int amdgpu_fru_read_eeprom(struct amdgpu_device *adev, uint32_t

addrptr,

Quoted 7 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_fru_eeprom.c +0 -1
--

2.17.1

_______________________________________________
amd-gfx mailing list
[email protected]

Quoted 6 lines

https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Flists.fr
eedesktop.org%2Fmailman%2Flistinfo%2Famd- gfx&amp;data=02%7C01%7Ckent.russell%40amd.com%7Cd1d72c89825549c6f 06e08d7d810c83e%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C6 37215438899199940&amp;sdata=BnHE%2BT8D0j%2BHKD7s9J%2BXePsSYcXLG bEYkmawDv3GNbw%3D&amp;reserved=0

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

#3 lore raw
Quoted 53 lines · Kent

[AMD Official Use Only - Internal Distribution Only]

Quoted 34 lines

-----Original Message-----
From: Alex Deucher <[email protected]>
Sent: Friday, April 3, 2020 4:51 PM
To: Russell, Kent <[email protected]>
Cc: amd-gfx list <[email protected]>
Subject: Re: [PATCH] drm/amdgpu: Re-enable FRU check for most models v3

Quoted 6 lines · Kent Russell

There are 2 VG20 SKUs that do not have the FRU on there, and trying to read that will cause a hang. For now, check for the gaming SKU until a proper fix can be implemented. This re-enables serial number reporting for server cards

Quoted 6 lines

v2: Add ASIC check
v3: Don't default to true for pre-VG10

---
 .../gpu/drm/amd/amdgpu/amdgpu_fru_eeprom.c    | 22

+++++++++++++++++--

Quoted 13 lines
 1 file changed, 20 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_fru_eeprom.c +1 -1
index bfe4259f9508..508906177cad 100644
@@ -31,9 +31,27 @@
 
 bool is_fru_eeprom_supported(struct amdgpu_device *adev)  {
-       /* TODO: Resolve supported ASIC type */
+       struct atom_context *atom_ctx = adev->mode_info.atom_context;
 
Quoted 16 lines

drivers/gpu/drm/amd/amdgpu/amdgpu_fru_eeprom.c line 47

Quoted 13 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_fru_eeprom.c +12 -1
-       return false;
+       if (!atom_ctx)
+               return false;
+
+       /* TODO: Gaming SKUs don't have the FRU EEPROM.
+        * Use this to address hangs on modprobe on gaming SKUs
+        * until a proper solution can be implemented
+        */
+       switch (adev->asic_type) {
+       case CHIP_VEGA20:
+               if (strnstr(atom_ctx->vbios_version, "D360",
+                               sizeof(atom_ctx->vbios_version)))
+                       return false;

Most skus are separated by pci revision ids. Maybe it would be more reliable to check that than a vbios string?

Quoted 1 line

I can look into that. This was really meant as a temporary workaround until we found the right way to poll the card altogether. I lifted this from John Clements' patch to isolate the D342 variant of Arcturus due to that whole EEPROM addressing thing. I'll see if I can find the revision IDs for those and see if they can be used instead. Maybe I can use that for John's D342 check as well.

In that case, we have two of the same sku, but with different EEPROM chips, so the vbios version was the only thing we could use to differentiate. Really the EEPROM stuff should live in a vbios table so we can query it. For the pci revision id, in most cases there are different revision ids for each sku. There are generally more client skus than server skus, so it's probably best to match on the server sku and return true in that case. I think the same logic also makes sense if you end up having to use the vbios version (i.e., reverse the current logic in this hunk of the patch). I'd prefer to match the vbios version of the server skus and return true for them and false for everything else because I'm not sure what the vbios string will be on AIB boards. The DXXX naming is an AMD thing as far I know.

Alex

Quoted 24 lines
Quoted 24 lines

Alex

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

Quoted 10 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_fru_eeprom.c +7 -0
+               return true;
+       case CHIP_ARCTURUS:
+               /* There are no gaming Arcturus SKUs */
+               return true;
+       default:
+               return false;
+       }
 }
 
 int amdgpu_fru_read_eeprom(struct amdgpu_device *adev, uint32_t

addrptr,

Quoted 7 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_fru_eeprom.c +0 -1
--

2.17.1

_______________________________________________
amd-gfx mailing list
[email protected]

Quoted 6 lines
Quoted 6 lines

https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Flists.fr
eedesktop.org%2Fmailman%2Flistinfo%2Famd- gfx&amp;data=02%7C01%7Ckent.russell%40amd.com%7Cd1d72c89825549c6f 06e08d7d810c83e%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C6 37215438899199940&amp;sdata=BnHE%2BT8D0j%2BHKD7s9J%2BXePsSYcXLG bEYkmawDv3GNbw%3D&amp;reserved=0

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx