Commit 94952205 authored by Evan Quan's avatar Evan Quan Committed by Alex Deucher

drm/amd/powerplay: try to do a graceful shutdown on SW CTF

Normally this(SW CTF) should not happen. And by doing graceful
shutdown we can prevent further damage.
Signed-off-by: default avatarEvan Quan <evan.quan@amd.com>
Reviewed-by: default avatarAlex Deucher <alexander.deucher@amd.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent 73339a71
...@@ -22,6 +22,7 @@ ...@@ -22,6 +22,7 @@
*/ */
#include <linux/pci.h> #include <linux/pci.h>
#include <linux/reboot.h>
#include "hwmgr.h" #include "hwmgr.h"
#include "pp_debug.h" #include "pp_debug.h"
...@@ -595,12 +596,18 @@ int phm_irq_process(struct amdgpu_device *adev, ...@@ -595,12 +596,18 @@ int phm_irq_process(struct amdgpu_device *adev,
uint32_t src_id = entry->src_id; uint32_t src_id = entry->src_id;
if (client_id == AMDGPU_IRQ_CLIENTID_LEGACY) { if (client_id == AMDGPU_IRQ_CLIENTID_LEGACY) {
if (src_id == VISLANDS30_IV_SRCID_CG_TSS_THERMAL_LOW_TO_HIGH) if (src_id == VISLANDS30_IV_SRCID_CG_TSS_THERMAL_LOW_TO_HIGH) {
pr_warn("GPU over temperature range detected on PCIe %d:%d.%d!\n", pr_warn("GPU over temperature range detected on PCIe %d:%d.%d!\n",
PCI_BUS_NUM(adev->pdev->devfn), PCI_BUS_NUM(adev->pdev->devfn),
PCI_SLOT(adev->pdev->devfn), PCI_SLOT(adev->pdev->devfn),
PCI_FUNC(adev->pdev->devfn)); PCI_FUNC(adev->pdev->devfn));
else if (src_id == VISLANDS30_IV_SRCID_CG_TSS_THERMAL_HIGH_TO_LOW) /*
* SW CTF just occurred.
* Try to do a graceful shutdown to prevent further damage.
*/
dev_emerg(adev->dev, "System is going to shutdown due to SW CTF!\n");
orderly_poweroff(true);
} else if (src_id == VISLANDS30_IV_SRCID_CG_TSS_THERMAL_HIGH_TO_LOW)
pr_warn("GPU under temperature range detected on PCIe %d:%d.%d!\n", pr_warn("GPU under temperature range detected on PCIe %d:%d.%d!\n",
PCI_BUS_NUM(adev->pdev->devfn), PCI_BUS_NUM(adev->pdev->devfn),
PCI_SLOT(adev->pdev->devfn), PCI_SLOT(adev->pdev->devfn),
...@@ -611,12 +618,18 @@ int phm_irq_process(struct amdgpu_device *adev, ...@@ -611,12 +618,18 @@ int phm_irq_process(struct amdgpu_device *adev,
PCI_SLOT(adev->pdev->devfn), PCI_SLOT(adev->pdev->devfn),
PCI_FUNC(adev->pdev->devfn)); PCI_FUNC(adev->pdev->devfn));
} else if (client_id == SOC15_IH_CLIENTID_THM) { } else if (client_id == SOC15_IH_CLIENTID_THM) {
if (src_id == 0) if (src_id == 0) {
pr_warn("GPU over temperature range detected on PCIe %d:%d.%d!\n", pr_warn("GPU over temperature range detected on PCIe %d:%d.%d!\n",
PCI_BUS_NUM(adev->pdev->devfn), PCI_BUS_NUM(adev->pdev->devfn),
PCI_SLOT(adev->pdev->devfn), PCI_SLOT(adev->pdev->devfn),
PCI_FUNC(adev->pdev->devfn)); PCI_FUNC(adev->pdev->devfn));
else /*
* SW CTF just occurred.
* Try to do a graceful shutdown to prevent further damage.
*/
dev_emerg(adev->dev, "System is going to shutdown due to SW CTF!\n");
orderly_poweroff(true);
} else
pr_warn("GPU under temperature range detected on PCIe %d:%d.%d!\n", pr_warn("GPU under temperature range detected on PCIe %d:%d.%d!\n",
PCI_BUS_NUM(adev->pdev->devfn), PCI_BUS_NUM(adev->pdev->devfn),
PCI_SLOT(adev->pdev->devfn), PCI_SLOT(adev->pdev->devfn),
......
...@@ -23,6 +23,7 @@ ...@@ -23,6 +23,7 @@
#include <linux/firmware.h> #include <linux/firmware.h>
#include <linux/module.h> #include <linux/module.h>
#include <linux/pci.h> #include <linux/pci.h>
#include <linux/reboot.h>
#define SMU_11_0_PARTIAL_PPTABLE #define SMU_11_0_PARTIAL_PPTABLE
...@@ -1561,6 +1562,12 @@ static int smu_v11_0_irq_process(struct amdgpu_device *adev, ...@@ -1561,6 +1562,12 @@ static int smu_v11_0_irq_process(struct amdgpu_device *adev,
PCI_BUS_NUM(adev->pdev->devfn), PCI_BUS_NUM(adev->pdev->devfn),
PCI_SLOT(adev->pdev->devfn), PCI_SLOT(adev->pdev->devfn),
PCI_FUNC(adev->pdev->devfn)); PCI_FUNC(adev->pdev->devfn));
/*
* SW CTF just occurred.
* Try to do a graceful shutdown to prevent further damage.
*/
dev_emerg(adev->dev, "System is going to shutdown due to SW CTF!\n");
orderly_poweroff(true);
break; break;
case THM_11_0__SRCID__THM_DIG_THERM_H2L: case THM_11_0__SRCID__THM_DIG_THERM_H2L:
pr_warn("GPU under temperature range detected on PCIe %d:%d.%d!\n", pr_warn("GPU under temperature range detected on PCIe %d:%d.%d!\n",
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment