Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752893AbbFCG1w (ORCPT ); Wed, 3 Jun 2015 02:27:52 -0400 Received: from ns.horizon.com ([71.41.210.147]:51802 "HELO ns.horizon.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with SMTP id S1751794AbbFCG1o (ORCPT ); Wed, 3 Jun 2015 02:27:44 -0400 Date: 3 Jun 2015 02:27:42 -0400 Message-ID: <20150603062742.19228.qmail@ns.horizon.com> From: "George Spelvin" To: torvalds@linux-foundation.org Subject: Re: [PATCH RFC] x86, tsc: Allow for high latency in quick_pit_calibrate() Cc: adrian.hunter@intel.com, ak@linux.intel.com, linux@horizon.com, linux-kernel@vger.kernel.org, luto@amcapital.net, tglx@linutronix.de Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1048 Lines: 25 Linus wrote: > The only *well-defined* clock in a modern PC seems to still remain the > PIT. Yes, it's very sad. But all the other clocks tend to be > untrustworthy for various reasons Actually, there is one more: the CMOS RTC clock is quite reliably 32768 Hz. The reas process is very similar, although you only have a single PE bit rather than a count for sanity checking. You can program a rate between 2 Hz and 8192 Hz at which the PE bit (register C, 0x06) will be set. A rate of 4096 Hz would work similarly to the current PIT-based 1193182/256 = 4661 Hz code. Then you just poll until you capture the transition (it's cleared automatically by read) and do similar filtering. (It would also be very nifty to use some of the values collected by this calibration to seed boot-time entropy.) -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/