[PATCH 036/109] drm/amd/ras: Isolate ras mce handler with CONFIG_X86_MCE_AMD
Alex Deucher <[email protected]>
| Newsgroups | org.freedesktop.lists.amd-gfx |
|---|---|
| Message-ID | <[email protected]> |
From: YiPeng Chai <[email protected]> Isolate ras mce handler with CONFIG_X86_MCE_AMD. v2: Isolate all ras mce handlers. Signed-off-by: YiPeng Chai <[email protected]> Reviewed-by: Hawking Zhang <[email protected]> Signed-off-by: Alex Deucher <[email protected]> --- drivers/gpu/drm/amd/ras/ras_mgr/amdgpu_ras_mce.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/drivers/gpu/drm/amd/ras/ras_mgr/amdgpu_ras_mce.c b/drivers/gpu/drm/amd/ras/ras_mgr/amdgpu_ras_mce.c index 795085beb1986..bc7a44618ac6c 100644 --- a/drivers/gpu/drm/amd/ras/ras_mgr/amdgpu_ras_mce.c +++ b/drivers/gpu/drm/amd/ras/ras_mgr/amdgpu_ras_mce.c @@ -27,6 +27,9 @@ #include "amdgpu_ras_mce.h" #include <asm/mce.h> +#ifdef CONFIG_X86_MCE_AMD +#include <asm/mce.h> + static int amdgpu_sys_mce_notifier(struct notifier_block *nb, unsigned long val, void *data); typedef int (*mce_notifier)(struct amdgpu_device *dev, unsigned int id, unsigned long val, void *data); @@ -232,6 +235,7 @@ static int amdgpu_ras_mce_notifier(struct amdgpu_device *adev, return 0; } +#endif int amdgpu_ras_mce_hw_init(struct amdgpu_device *adev) { @@ -245,12 +249,16 @@ int amdgpu_ras_mce_hw_fini(struct amdgpu_device *adev) int amdgpu_ras_mce_sw_init(struct amdgpu_device *adev) { +#ifdef CONFIG_X86_MCE_AMD amdgpu_ras_register_mce_notifier(adev, amdgpu_ras_mce_notifier); +#endif return 0; } int amdgpu_ras_mce_sw_fini(struct amdgpu_device *adev) { +#ifdef CONFIG_X86_MCE_AMD amdgpu_ras_unregister_mce_notifier(adev); +#endif return 0; } -- 2.55.0