# \[PATCH\] EDAC, ghes: Make platform-based whitelisting x86-only

- From: Zhengqiang \<hidden\>
- Date: 2018-05-21 09:39:01 
- List: linux-arm-kernel
- Page: https://ratatoskr.run/linux-arm-kernel/2018/05/8768894
- Thread: https://ratatoskr.run/linux-arm-kernel/2018/05/8768400/t.md

```text
Thanks, it works for me.

On 2018/5/18 19:20, Borislav Petkov wrote:
> From: Borislav Petkov <redacted>
> 
> ARM machines all have DMI tables so if they request hw error reporting
> through GHES, then the driver should be able to detect DIMMs and report
> errors successfully (famous last words :)).
> 
> Make the platform-based list x86-specific so that ghes_edac can load on
> ARM.
> 
> Signed-off-by: Borislav Petkov <redacted>
> Reviewed-by: James Morse <james.morse@arm.com>
> Tested-by: James Morse <james.morse@arm.com>
> Cc: Qiang Zheng <redacted>
> Link: https://lkml.kernel.org/r/1526039543-180996-1-git-send-email-zhengqiang10 at huawei.com

Tested-by: Qiang Zheng <redacted>

> ---
>  drivers/edac/ghes_edac.c | 14 +++++++++-----
>  1 file changed, 9 insertions(+), 5 deletions(-)
> 
> diff --git a/drivers/edac/ghes_edac.c b/drivers/edac/ghes_edac.c
> index 863fbf3db29f..473aeec4b1da 100644
> --- a/drivers/edac/ghes_edac.c
> +++ b/drivers/edac/ghes_edac.c
> @@ -440,12 +440,16 @@ int ghes_edac_register(struct ghes *ghes, struct device *dev)
>  	struct mem_ctl_info *mci;
>  	struct edac_mc_layer layers[1];
>  	struct ghes_edac_dimm_fill dimm_fill;
> -	int idx;
> +	int idx = -1;
>  
> -	/* Check if safe to enable on this system */
> -	idx = acpi_match_platform_list(plat_list);
> -	if (!force_load && idx < 0)
> -		return -ENODEV;
> +	if (IS_ENABLED(CONFIG_X86)) {
> +		/* Check if safe to enable on this system */
> +		idx = acpi_match_platform_list(plat_list);
> +		if (!force_load && idx < 0)
> +			return -ENODEV;
> +	} else {
> +		idx = 0;
> +	}
>  
>  	/*
>  	 * We have only one logical memory controller to which all DIMMs belong.
> 
```
