Re: [PATCH v2 16/17] driver/edac: enable Hygon support to AMD64 EDAC driver

From: Paolo Bonzini
Date: Sat Jul 28 2018 - 19:43:05 EST


On 23/07/2018 15:20, Pu Wen wrote:
> @@ -211,7 +211,7 @@ static int __set_scrub_rate(struct amd64_pvt *pvt, u32 new_bw, u32 min_rate)
>
> scrubval = scrubrates[i].scrubval;
>
> - if (pvt->fam == 0x17) {
> + if (pvt->fam == 0x17 || pvt->fam == 0x18) {
> __f17h_set_scrubval(pvt, scrubval);
> } else if (pvt->fam == 0x15 && pvt->model == 0x60) {
> f15h_select_dct(pvt, 0);

This, and many other occurrences in this file, should in my opinion
avoid testing family 18h without also checking for Hygon as a vendor.
You probably need to add a vendor field to struct amd64_pvt and
initialize it in per_family_init.

Paolo