From: Aravind Gopalakrishnan <aravind.gopalakrishnan@amd.com>
To: Borislav Petkov <bp@alien8.de>
Cc: <mchehab@osg.samsung.com>, <dougthompson@xmission.com>,
<linux-edac@vger.kernel.org>, <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH V2 1/3] EDAC, amd64_edac: Extend scrub rate programmability feature for F15hM60h
Date: Tue, 29 Sep 2015 09:56:06 -0500 [thread overview]
Message-ID: <560AA686.4010109@amd.com> (raw)
In-Reply-To: <20150929114517.GA3534@pd.tnic>
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;
>
>
next prev parent reply other threads:[~2015-09-29 14:56 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-09-28 11:43 [PATCH V2 0/3] Updates to amd64_edac Aravind Gopalakrishnan
2015-09-28 11:43 ` [PATCH V2 1/3] EDAC, amd64_edac: Extend scrub rate programmability feature for F15hM60h Aravind Gopalakrishnan
2015-09-29 11:45 ` Borislav Petkov
2015-09-29 14:56 ` Aravind Gopalakrishnan [this message]
2015-09-28 11:43 ` [PATCH V2 2/3] EDAC, amd64_edac: Update copyright and remove changelog Aravind Gopalakrishnan
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=560AA686.4010109@amd.com \
--to=aravind.gopalakrishnan@amd.com \
--cc=bp@alien8.de \
--cc=dougthompson@xmission.com \
--cc=linux-edac@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mchehab@osg.samsung.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.