Skip to contentSkip to conversation

drm/amdgpu: update default timeout of Aldebaran SQ watchdog

PATCH In review Alex Deucher 2 participants 5 messages Feb 25, 2021 – Feb 26, 2021

Subsystems (2)
lore
Share & tools
lore

Alex Deucher

author maintainer
#0 lore raw

PATCH 1/3 drm/amdgpu: update default timeout of Aldebaran SQ watchdog

From: Harish Kasiviswanathan <[email protected]>

---
 drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c | 4 ++--
 drivers/gpu/drm/amd/amdgpu/gfx_v9_4_2.c | 7 +++++++
 2 files changed, 9 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c +2 -2
index 42654deb9c55..29a2fc56e51b 100644
@@ -174,7 +174,7 @@ uint amdgpu_ras_mask = 0xffffffff;
 int amdgpu_bad_page_threshold = 100;
 struct amdgpu_watchdog_timer amdgpu_watchdog_timer = {
 	.timeout_fatal_disable = false,
-	.period = 0x3f, /* about 8s */
+	.period = 0x23, /* default to max. timeout = 1 << 0x23 cycles */
 };
 
 /**
@@ -542,7 +542,7 @@ module_param_named(timeout_fatal_disable, amdgpu_watchdog_timer.timeout_fatal_di
  * DOC: timeout_period (uint)
  * Modify the watchdog timeout max_cycles as (1 << period)
  */
-MODULE_PARM_DESC(timeout_period, "watchdog timeout period (0x1F = default), timeout maxCycles = (1 << period)");
+MODULE_PARM_DESC(timeout_period, "watchdog timeout period (1 to 0x23(default), timeout maxCycles = (1 << period)");
 module_param_named(timeout_period, amdgpu_watchdog_timer.period, uint, 0644);
 
 /**
drivers/gpu/drm/amd/amdgpu/gfx_v9_4_2.c +7 -0
index 1faeae14ead9..44024ab93577 100644
@@ -1138,6 +1138,13 @@ void gfx_v9_4_2_enable_watchdog_timer(struct amdgpu_device *adev)
 	data = REG_SET_FIELD(0, SQ_TIMEOUT_CONFIG, TIMEOUT_FATAL_DISABLE,
 			     amdgpu_watchdog_timer.timeout_fatal_disable ? 1 :
 									   0);
+
+	if (amdgpu_watchdog_timer.timeout_fatal_disable &&
+	    (amdgpu_watchdog_timer.period < 1 ||
+	     amdgpu_watchdog_timer.period > 0x23)) {
+		dev_warn(adev->dev, "Watchdog period range is 1 to 0x23\n");
+		amdgpu_watchdog_timer.period = 0x23;
+	}
 	data = REG_SET_FIELD(data, SQ_TIMEOUT_CONFIG, PERIOD_SEL,
 			     amdgpu_watchdog_timer.period);
 
Signature · 6 lines
2.29.2

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
author maintainer
#1 lore raw

PATCH 2/3 drm/amdgpu: Make noretry the default on Aldebaran

From: Felix Kuehling <[email protected]>

This is needed for best machine learning performance. XNACK can still be enabled per-process if needed.

---
 drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.c | 1 +
 1 file changed, 1 insertion(+)
drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.c +1 -0
index 6d9c660da27a..8a64f5e49cb2 100644
@@ -508,6 +508,7 @@ void amdgpu_gmc_noretry_set(struct amdgpu_device *adev)
 	switch (adev->asic_type) {
 	case CHIP_VEGA10:
 	case CHIP_VEGA20:
+	case CHIP_ALDEBARAN:
 		/*
 		 * noretry = 0 will cause kfd page fault tests fail
 		 * for some ASICs, so set default to 1 for these ASICs.
Signature · 6 lines
2.29.2

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

Re: [PATCH 2/3] drm/amdgpu: Make noretry the default on Aldebaran

This depends on two previous patches:

2e464a7fb883 drm/amdgpu: Enable retry faults unconditionally on Aldebaran 628c8d3a1602 drm/amdgpu: Retry fault handling based on per-process XNACK mode

Regards,
  Felix

Am 2021-02-25 um 1:56 p.m. schrieb Alex Deucher:

Quoted 19 lines

From: Felix Kuehling <[email protected]>

This is needed for best machine learning performance. XNACK can still be enabled per-process if needed.

---
 drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.c | 1 +
 1 file changed, 1 insertion(+)
drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.c +0 -0
index 6d9c660da27a..8a64f5e49cb2 100644

drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.c void amdgpu_gmc_noretry_set(struct amdgpu_device *adev) · line 514

Quoted 7 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.c +1 -0
@@ -508,6 +508,7 @@ void amdgpu_gmc_noretry_set(struct amdgpu_device *adev)
 	switch (adev->asic_type) {
 	case CHIP_VEGA10:
 	case CHIP_VEGA20:
+	case CHIP_ALDEBARAN:
 		/*
 		 * noretry = 0 will cause kfd page fault tests fail
 		 * for some ASICs, so set default to 1 for these ASICs.

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

#3 lore raw

Re: [PATCH 2/3] drm/amdgpu: Make noretry the default on Aldebaran

Never mind. Those previous patches are part of the HMM work, which hasn't been merged yet.

This-patch is good on its own for amd-staging-drm-next.

Thanks,
  Felix

Am 2021-02-26 um 11:24 a.m. schrieb Felix Kuehling:

Quoted 24 lines

This depends on two previous patches:

2e464a7fb883 drm/amdgpu: Enable retry faults unconditionally on Aldebaran 628c8d3a1602 drm/amdgpu: Retry fault handling based on per-process XNACK mode

Regards,
  Felix

Am 2021-02-25 um 1:56 p.m. schrieb Alex Deucher:

Quoted 14 lines

From: Felix Kuehling <[email protected]>

This is needed for best machine learning performance. XNACK can still be enabled per-process if needed.

---
 drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.c | 1 +
 1 file changed, 1 insertion(+)
Quoted 16 lines

drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.c void amdgpu_gmc_noretry_set(struct amdgpu_device *adev) · line 514

Quoted 12 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.c +1 -0
index 6d9c660da27a..8a64f5e49cb2 100644
@@ -508,6 +508,7 @@ void amdgpu_gmc_noretry_set(struct amdgpu_device *adev)
 	switch (adev->asic_type) {
 	case CHIP_VEGA10:
 	case CHIP_VEGA20:
+	case CHIP_ALDEBARAN:
 		/*
 		 * noretry = 0 will cause kfd page fault tests fail
 		 * for some ASICs, so set default to 1 for these ASICs.

_______________________________________________
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

author maintainer
#4 lore raw

PATCH 3/3 drm/amdgpu: harvest edc status when connected to host via xGMI

In reply to Alex Deucher

From: Dennis Li <[email protected]>

When connected to a host via xGMI, system fatal errors may trigger warm reset, driver has no change to query edc status before reset. Therefore in this case, driver should harvest previous error loging registers during boot, instead of only resetting them.

v2:
1. IP's ras_manager object is created when its ras feature is enabled, so change to query edc status after amdgpu_ras_late_init called

2. change to enable watchdog timer after finishing gfx edc init

---
 drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c |  9 ++++-
 drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.h |  2 +-
 drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c | 50 ++++++++++++++++++-----
 drivers/gpu/drm/amd/amdgpu/amdgpu_ras.h |  5 ++-
 drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c   | 12 ++----
 drivers/gpu/drm/amd/amdgpu/gfx_v9_4_2.c | 54 ++++++++++++++++++++++---
 drivers/gpu/drm/amd/amdgpu/gfx_v9_4_2.h |  3 +-
 7 files changed, 107 insertions(+), 28 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c +8 -1
index 8e0a6c62322e..689addb1520d 100644
@@ -601,6 +601,7 @@ int amdgpu_gfx_ras_late_init(struct amdgpu_device *adev)
 	struct ras_ih_if ih_info = {
 		.cb = amdgpu_gfx_process_ras_data_cb,
 	};
+	struct ras_query_if info = { 0 };
 
 	if (!adev->gfx.ras_if) {
 		adev->gfx.ras_if = kmalloc(sizeof(struct ras_common_if), GFP_KERNEL);
@@ -612,13 +613,19 @@ int amdgpu_gfx_ras_late_init(struct amdgpu_device *adev)
 		strcpy(adev->gfx.ras_if->name, "gfx");
 	}
 	fs_info.head = ih_info.head = *adev->gfx.ras_if;
-
 	r = amdgpu_ras_late_init(adev, adev->gfx.ras_if,
 				 &fs_info, &ih_info);
 	if (r)
 		goto free;
 
 	if (amdgpu_ras_is_supported(adev, adev->gfx.ras_if->block)) {
+		if (adev->gmc.xgmi.connected_to_cpu) {
+			info.head = *adev->gfx.ras_if;
+			amdgpu_ras_query_error_status(adev, &info);
+		} else {
+			amdgpu_ras_reset_error_status(adev, AMDGPU_RAS_BLOCK__GFX);
+		}
+
 		r = amdgpu_irq_get(adev, &adev->gfx.cp_ecc_error_irq, 0);
 		if (r)
 			goto late_fini;
drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.h +1 -1
index d92f0f14cbeb..38af93f501e1 100644
@@ -225,9 +225,9 @@ struct amdgpu_gfx_funcs {
 	void (*reset_ras_error_count) (struct amdgpu_device *adev);
 	void (*init_spm_golden)(struct amdgpu_device *adev);
 	void (*query_ras_error_status) (struct amdgpu_device *adev);
+	void (*reset_ras_error_status) (struct amdgpu_device *adev);
 	void (*update_perfmon_mgcg)(struct amdgpu_device *adev, bool enable);
 	void (*enable_watchdog_timer)(struct amdgpu_device *adev);
-	void (*query_sq_timeout_status)(struct amdgpu_device *adev);
 };
 
 struct sq_work {
drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c +41 -9

102 lines not on this page · raw message

drivers/gpu/drm/amd/amdgpu/amdgpu_ras.h +4 -1
index aed0716efa5a..a9fd655ed5ee 100644
@@ -590,9 +590,12 @@ int amdgpu_ras_sysfs_remove(struct amdgpu_device *adev,
 
 void amdgpu_ras_debugfs_create_all(struct amdgpu_device *adev);
 
-int amdgpu_ras_error_query(struct amdgpu_device *adev,
+int amdgpu_ras_query_error_status(struct amdgpu_device *adev,
 		struct ras_query_if *info);
 
+int amdgpu_ras_reset_error_status(struct amdgpu_device *adev,
+		enum amdgpu_ras_block block);
+
 int amdgpu_ras_error_inject(struct amdgpu_device *adev,
 		struct ras_inject_if *info);
 
drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c +4 -8
index c37139d2c487..015bd6c1c9cc 100644
@@ -2121,8 +2121,8 @@ static const struct amdgpu_gfx_funcs gfx_v9_4_2_gfx_funcs = {
 	.query_ras_error_count = &gfx_v9_4_2_query_ras_error_count,
 	.reset_ras_error_count = &gfx_v9_4_2_reset_ras_error_count,
 	.query_ras_error_status = &gfx_v9_4_2_query_ras_error_status,
+	.reset_ras_error_status = &gfx_v9_4_2_reset_ras_error_status,
 	.enable_watchdog_timer = &gfx_v9_4_2_enable_watchdog_timer,
-	.query_sq_timeout_status = &gfx_v9_4_2_query_sq_timeout_status,
 };
 
 static int gfx_v9_0_gpu_early_init(struct amdgpu_device *adev)
@@ -3967,9 +3967,6 @@ static int gfx_v9_0_hw_init(void *handle)
 	if (adev->asic_type == CHIP_ALDEBARAN)
 		gfx_v9_4_2_set_power_brake_sequence(adev);
 
-	if (adev->gfx.funcs->enable_watchdog_timer)
-		adev->gfx.funcs->enable_watchdog_timer(adev);
-
 	return r;
 }
 
@@ -4733,14 +4730,13 @@ static int gfx_v9_0_ecc_late_init(void *handle)
 	if (r)
 		return r;
 
-	if (adev->gfx.funcs &&
-	    adev->gfx.funcs->reset_ras_error_count)
-		adev->gfx.funcs->reset_ras_error_count(adev);
-
 	r = amdgpu_gfx_ras_late_init(adev);
 	if (r)
 		return r;
 
+	if (adev->gfx.funcs->enable_watchdog_timer)
+		adev->gfx.funcs->enable_watchdog_timer(adev);
+
 	return 0;
 }
 
drivers/gpu/drm/amd/amdgpu/gfx_v9_4_2.c +48 -6

102 lines not on this page · raw message

drivers/gpu/drm/amd/amdgpu/gfx_v9_4_2.h +1 -2
index e01fa6afa8e4..c143d178ef98 100644
@@ -35,7 +35,6 @@ int gfx_v9_4_2_ras_error_inject(struct amdgpu_device *adev, void *inject_if);
 void gfx_v9_4_2_query_ras_error_status(struct amdgpu_device *adev);
 int gfx_v9_4_2_query_ras_error_count(struct amdgpu_device *adev,
 				   void *ras_error_status);
-
+void gfx_v9_4_2_reset_ras_error_status(struct amdgpu_device *adev);
 void gfx_v9_4_2_enable_watchdog_timer(struct amdgpu_device *adev);
-void gfx_v9_4_2_query_sq_timeout_status(struct amdgpu_device *adev);
 #endif /* __GFX_V9_4_2_H__ */
Signature · 6 lines
2.29.2

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