x86: hpet: fix periodic mode programming on AMD 81xx
commit42c8b89f855f88d83b409f122b9a1b7a3c54e2ae
authorAndreas Herrmann <andreas.herrmann3@amd.com>
Tue, 21 Apr 2009 18:00:37 +0000 (21 20:00 +0200)
committerGreg Kroah-Hartman <gregkh@suse.de>
Mon, 15 Jun 2009 16:40:21 +0000 (15 09:40 -0700)
tree07410a8ad44c0ab81a700a3979c5462f6209cb0e
parent5beb01f947a1607c094f053d6575b4f647b7016c
x86: hpet: fix periodic mode programming on AMD 81xx

commit 7a6f9cbb37120c745fc187083fb5c3de4dca4f97 upstream.

(See http://bugzilla.kernel.org/show_bug.cgi?id=12961)

It partially reverts commit c23e253e67c9d8a91a0ffa33c1f571a17f0a2403
(x86: hpet: stop HPET_COUNTER when programming periodic mode)

HPET on AMD 81xx chipset needs a second write (with HPET_TN_SETVAL
cleared) to T0_CMP register to set the period in periodic mode.

With this patch HPET_COUNTER is still stopped but not reset when HPET
is programmed in periodic mode. This should help to avoid races when
HPET is programmed in periodic mode and fixes a boot time hang that
I've observed on a machine when using 1000HZ.

[ Impact: fix boot time hang on machines with AMD 81xx chipset ]

Reported-by: Jeff Mahoney <jeffm@suse.com>
Signed-off-by: Andreas Herrmann <andreas.herrmann3@amd.com>
Tested-by: Jeff Mahoney <jeffm@suse.com>
LKML-Reference: <20090421180037.GA2763@alberich.amd.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Cc: Chuck Ebbert <cebbert@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
arch/x86/kernel/hpet.c