From: "Jan Beulich" <JBeulich@suse.com>
To: "Thomas Gleixner" <tglx@linutronix.de>
Cc: <mingo@elte.hu>, <linux-kernel@vger.kernel.org>, <hpa@zytor.com>
Subject: Re: [PATCH] x86: clear HPET configuration registers on startup
Date: Fri, 25 May 2012 11:21:01 +0100 [thread overview]
Message-ID: <4FBF792D02000078000861BD@nat28.tlf.novell.com> (raw)
In-Reply-To: <alpine.LFD.2.02.1205242352460.3231@ionos>
>>> On 25.05.12 at 00:06, Thomas Gleixner <tglx@linutronix.de> wrote:
> On Mon, 2 Apr 2012, Jan Beulich wrote:
>
> Sorry for ignoring this for so long.
>
>> + cfg = hpet_readl(HPET_CFG);
>> + hpet_boot_cfg = kmalloc((last + 2) * sizeof(*hpet_boot_cfg),
>> + GFP_KERNEL);
>> + if (hpet_boot_cfg)
>> + *hpet_boot_cfg = cfg;
>> + else
>> + pr_warn("HPET initial state will not be saved\n");
>> + cfg &= ~(HPET_CFG_ENABLE | HPET_CFG_LEGACY);
>> + hpet_writel(cfg, HPET_Tn_CFG(i));
>
> This wants to be
>
>> + hpet_writel(cfg, HPET_CFG);
>
> Right ?
Oh yes, absolutely.
>> @@ -923,14 +952,28 @@ fs_initcall(hpet_late_init);
>> void hpet_disable(void)
>> {
>> if (is_hpet_capable() && hpet_virt_address) {
>> - unsigned int cfg = hpet_readl(HPET_CFG);
>> + unsigned int cfg = hpet_readl(HPET_CFG), id, last;
>>
>> - if (hpet_legacy_int_enabled) {
>> + if (hpet_boot_cfg)
>> + cfg = *hpet_boot_cfg;
>
> That restores the setting which you recorded at init time. Why do you
> want to do that? There is no point to restore to an eventually borked
> state. If we shut down the thing, then we better leave it in a
> consistent state rather than something dubious, really.
The problem is that we can't - forward compatibly - say what
is "borked" and what is merely beyond the knowledge of the
kernel. Given the system was able to boot with the original
settings, restoring them seems the safest approach to me.
Besides that it's not the purpose of the patch to get around
firmware bugs, but instead to get the hardware back into
boot-time like state. So I'd really like to merely correct the
error above that you pointed out (which also would seem to
be the most appropriate route given that Linus already
merged the patch), and leave a decision whether you agree
with my position here (or whether you want to further
tweak that code) to you.
Jan
next prev parent reply other threads:[~2012-05-25 10:20 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-04-02 14:15 Jan Beulich
2012-05-08 4:22 ` [tip:timers/core] x86: Clear " tip-bot for Jan Beulich
2012-05-24 22:06 ` [PATCH] x86: clear " Thomas Gleixner
2012-05-25 10:21 ` Jan Beulich [this message]
2012-05-25 10:33 ` Thomas Gleixner
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=4FBF792D02000078000861BD@nat28.tlf.novell.com \
--to=jbeulich@suse.com \
--cc=hpa@zytor.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@elte.hu \
--cc=tglx@linutronix.de \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®