lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <560AA686.4010109@amd.com>
Date:	Tue, 29 Sep 2015 09:56:06 -0500
From:	Aravind Gopalakrishnan <aravind.gopalakrishnan@....com>
To:	Borislav Petkov <bp@...en8.de>
CC:	<mchehab@....samsung.com>, <dougthompson@...ssion.com>,
	<linux-edac@...r.kernel.org>, <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH V2 1/3] EDAC, amd64_edac: Extend scrub rate
 programmability feature for F15hM60h

On 9/29/2015 6:45 AM, Borislav Petkov wrote:
>> @@ -216,12 +223,17 @@ static int set_scrub_rate(struct mem_ctl_info *mci, u32 bw)
>>   
>>   	if (pvt->fam == 0xf)
>>   		min_scrubrate = 0x0;
>> +	else if (pvt->fam == 0x15 && pvt->model == 0x60)
>> +		min_scrubrate = 0x6;
>>   
>>   	/* Erratum #505 */
>>   	if (pvt->fam == 0x15 && pvt->model < 0x10)
>>   		f15h_select_dct(pvt, 0);
>>   
>> -	return __set_scrub_rate(pvt->F3, bw, min_scrubrate);
>> +	if (pvt->fam == 0x15 && pvt->model == 0x60)
>> +		return __set_scrub_rate(pvt, bw, min_scrubrate);
>> +
>> +	return __set_scrub_rate(pvt, bw, min_scrubrate);
> This looks sloppy:
>
> 	if (condition)
> 		return function()
> 	return function()
>
> I ended up committing the version below. Other two applied too.
>

Forgot to remove that conditional :|
Thanks for cleaning it up.

-Aravind.

>   
>
> +	if (pvt->fam == 0x15) {
> +		/* Erratum #505 */
> +		if (pvt->model < 0x10)
> +			f15h_select_dct(pvt, 0);
>   
> -	return __set_scrub_rate(pvt->F3, bw, min_scrubrate);
> +		if (pvt->model == 0x60)
> +			min_scrubrate = 0x6;
> +	}
> +	return __set_scrub_rate(pvt, bw, min_scrubrate);
>   }
>   
>   static int get_scrub_rate(struct mem_ctl_info *mci)
> @@ -230,11 +241,15 @@ static int get_scrub_rate(struct mem_ctl_info *mci)
>   	u32 scrubval = 0;
>   	int i, retval = -EINVAL;
>   
>
> +	if (pvt->fam == 0x15) {
> +		/* Erratum #505 */
> +		if (pvt->model < 0x10)
> +			f15h_select_dct(pvt, 0);
>   
> -	amd64_read_pci_cfg(pvt->F3, SCRCTRL, &scrubval);
> +		if (pvt->model == 0x60)
> +			amd64_read_pci_cfg(pvt->F2, F15H_M60H_SCRCTRL, &scrubval);
> +	} else
> +		amd64_read_pci_cfg(pvt->F3, SCRCTRL, &scrubval);
>   
>   	scrubval = scrubval & 0x001F;
>   
>

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ