Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754698AbbFCStL (ORCPT ); Wed, 3 Jun 2015 14:49:11 -0400 Received: from terminus.zytor.com ([198.137.202.10]:36902 "EHLO mail.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754696AbbFCStC (ORCPT ); Wed, 3 Jun 2015 14:49:02 -0400 Message-ID: <556F4C10.7050005@zytor.com> Date: Wed, 03 Jun 2015 11:48:48 -0700 From: "H. Peter Anvin" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.5.0 MIME-Version: 1.0 To: George Spelvin CC: adrian.hunter@intel.com, ak@linux.intel.com, linux-kernel@vger.kernel.org, luto@amacapital.net, tglx@linutronix.de, torvalds@linux-foundation.org Subject: Re: [PATCH RFC] x86, tsc: Allow for high latency in quick_pit_calibrate() References: <20150603182936.16475.qmail@ns.horizon.com> In-Reply-To: <20150603182936.16475.qmail@ns.horizon.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1546 Lines: 39 On 06/03/2015 11:29 AM, George Spelvin wrote: > > Indeed, it's the only one which is guaranteed a separate crystal. > Many low-cost chipsets generate ALL other frequencies from one crystal > with PLLs. > Not guaranteed either, and I know for a fact there are platforms out there which synthesize the RTC clock. > But as I mentioned earlier, you *can* get higher frequencies with > interrupts *or* polling. When you program the periodic event frequency > (from 2 to 8192 Hz), it does three things at that rate: > > 1) Periodic interrupts (if enabled), > 2) Square wave output (if enabled, and relevant to discrete chips only), and > 3) Sets the PE bit (register C, bit 6), which is auto-cleared on read. Ah, I wasn't aware of the PF (not PE) bit. That suddenly makes it a lot more interesting. So polling for the PF bit suddenly makes sense, and is probably the single best option for calibration. > So if you're willing to poll the device (which the TSC calibration does > already), you can get high resolution tick edges without interrupts. > > Because it's only one read (port 0x71), it's slightly faster than the PIT. > > (I also wish we could use all those TSC reads for initial entropy seeding > somehow.) Well, on x86 hopefully the entropy problem should soon be history... -hpa -- 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/