* [PATCH] drm/amdgpu: Added check for RAS EEPROM support
@ 2020-01-17 9:43 Clements, John
2020-01-17 15:02 ` Zhang, Hawking
0 siblings, 1 reply; 2+ messages in thread
From: Clements, John @ 2020-01-17 9:43 UTC (permalink / raw)
To: amd-gfx, Zhang, Hawking
[-- Attachment #1.1: Type: text/plain, Size: 183 bytes --]
[AMD Official Use Only - Internal Distribution Only]
Submitting patch to disable access of RAS EEPROM in event SMU is disabled during modprobe phase.
Thank you,
John Clements
[-- Attachment #1.2: Type: text/html, Size: 2229 bytes --]
[-- Attachment #2: 0001-drm-amdgpu-Added-check-for-RAS-EEPROM-support.patch --]
[-- Type: application/octet-stream, Size: 2186 bytes --]
From 08b748fb739574a6fa82121086c2b878cd443bd6 Mon Sep 17 00:00:00 2001
From: John Clements <john.clements@amd.com>
Date: Fri, 17 Jan 2020 17:39:31 +0800
Subject: [PATCH] drm/amdgpu: Added check for RAS EEPROM support
If SMU is disabled prevent access to RAS EEPROM
Change-Id: I26b4a265235b246eb860dd9c4000860d61a3b21f
Signed-off-by: John Clements <john.clements@amd.com>
---
.../gpu/drm/amd/amdgpu/amdgpu_ras_eeprom.c | 23 +++++++++++++++++++
1 file changed, 23 insertions(+)
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ras_eeprom.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_ras_eeprom.c
index 2a8e04895595..4e4c03f62697 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ras_eeprom.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ras_eeprom.c
@@ -174,12 +174,29 @@ static bool __validate_tbl_checksum(struct amdgpu_ras_eeprom_control *control,
return true;
}
+static bool __is_eeprom_supported(struct amdgpu_ras_eeprom_control *control)
+{
+ struct amdgpu_device *adev = to_amdgpu_device(control);
+ struct amdgpu_ip_block *smu_block = amdgpu_device_ip_get_ip_block(adev, AMD_IP_BLOCK_TYPE_SMC);
+
+ if (!smu_block || !smu_block->status.valid)
+ {
+ DRM_WARN("SMU disabled, RAS EEPROM not supported\n");
+ return false;
+ }
+
+ return true;
+}
+
int amdgpu_ras_eeprom_reset_table(struct amdgpu_ras_eeprom_control *control)
{
unsigned char buff[EEPROM_ADDRESS_SIZE + EEPROM_TABLE_HEADER_SIZE] = { 0 };
struct amdgpu_ras_eeprom_table_header *hdr = &control->tbl_hdr;
int ret = 0;
+ if (!__is_eeprom_supported(control))
+ return 0;
+
mutex_lock(&control->tbl_mutex);
hdr->header = EEPROM_TABLE_HDR_VAL;
@@ -212,6 +229,9 @@ int amdgpu_ras_eeprom_init(struct amdgpu_ras_eeprom_control *control)
.buf = buff,
};
+ if (!__is_eeprom_supported(control))
+ return 0;
+
mutex_init(&control->tbl_mutex);
switch (adev->asic_type) {
@@ -267,6 +287,9 @@ void amdgpu_ras_eeprom_fini(struct amdgpu_ras_eeprom_control *control)
{
struct amdgpu_device *adev = to_amdgpu_device(control);
+ if (!__is_eeprom_supported(control))
+ return;
+
switch (adev->asic_type) {
case CHIP_VEGA20:
smu_v11_0_i2c_eeprom_control_fini(&control->eeprom_accessor);
--
2.17.1
[-- Attachment #3: Type: text/plain, Size: 154 bytes --]
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
^ permalink raw reply related [flat|nested] 2+ messages in thread
* RE: [PATCH] drm/amdgpu: Added check for RAS EEPROM support
2020-01-17 9:43 [PATCH] drm/amdgpu: Added check for RAS EEPROM support Clements, John
@ 2020-01-17 15:02 ` Zhang, Hawking
0 siblings, 0 replies; 2+ messages in thread
From: Zhang, Hawking @ 2020-01-17 15:02 UTC (permalink / raw)
To: Clements, John, amd-gfx
[-- Attachment #1.1: Type: text/plain, Size: 738 bytes --]
[AMD Official Use Only - Internal Distribution Only]
Hello John,
The patch is good enough to deal with the modified IP_MASK parameter which masked out SMU IP block, but I don't think it is able to deal with module parameter dpm=0. Please check with Kenneth to have a better solution for both cases.
Regards,
Hawking
From: Clements, John <John.Clements@amd.com>
Sent: Friday, January 17, 2020 17:43
To: amd-gfx@lists.freedesktop.org; Zhang, Hawking <Hawking.Zhang@amd.com>
Subject: [PATCH] drm/amdgpu: Added check for RAS EEPROM support
[AMD Official Use Only - Internal Distribution Only]
Submitting patch to disable access of RAS EEPROM in event SMU is disabled during modprobe phase.
Thank you,
John Clements
[-- Attachment #1.2: Type: text/html, Size: 3817 bytes --]
[-- Attachment #2: Type: text/plain, Size: 154 bytes --]
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2020-01-17 15:02 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-01-17 9:43 [PATCH] drm/amdgpu: Added check for RAS EEPROM support Clements, John
2020-01-17 15:02 ` Zhang, Hawking
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).