Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp1687624yba; Thu, 4 Apr 2019 16:20:48 -0700 (PDT) X-Google-Smtp-Source: APXvYqzyZwBa6H4RPfHYzcy2SAOLfKD86Ow8kF3G0rudybiRSoGb841145JWdsi0skDZT0+CrbcJ X-Received: by 2002:a62:6985:: with SMTP id e127mr8916154pfc.188.1554420048069; Thu, 04 Apr 2019 16:20:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1554420048; cv=none; d=google.com; s=arc-20160816; b=kGkBeCc2jR6aNXnYWThz36OgKohgFru0tinNbu9yOgF9BVQxhJUmV6gJl6EEouWear W4FiElDnHU0bvJnGfrcOIAH1Fr6nvKy48zufh1o76OQhdKrE0P433VkVGQeVxFWCo7DD 4SbrXR8VyX9P5iYXtfLZHvFb9a6PC6B1DzxZ6NHOEat9fu+9olFv+JFkXOOSqXlF77hf eZKBQ5A63kjg+B4510Rl5o8JnW8RlTNAsXZqiXVaBObSNtyFu1m+OQCqci76OXAPY4Xq y4Izb6drAhcNYshtJ3C7Fuhfy8LZxRNYiDy+0aUc1Ki4LsMu80jAUR2irM0RdzvJO3wv 0W3Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :message-id:in-reply-to:subject:cc:to:from:date; bh=tr8HnB4rjIYz1m4hPaJkOGg7/1SSqG0cIiPI/h6TQgM=; b=xHAbVI8vRStuIEVSODkrdCr576bC6sjabp7VP6WsrwPOKF9E8owdCmAKCFPoWQNGyv 0m13NUE1Cvo/B946PUyuNgivsDbk6Gllgy4E8a9kJ+J0uHAtLQw2+X/nf6GDcD7ru9Vu FWogkThgKFyVIN6Fjs37BieKPqkij919M/TRRKCP11BRgflN+auwP4w9N0DMw0msVhNr 9PQz8kCQeTweat3upFYQx/zX7P2Ud9X3k54902dlvZ3zO36abWMfUqhqj4s9AaYq/TFE f/Y4uRsGnnmcRTYXwryDeFB2fH0lvF8RDT7fbpqwH9J1+1lZ2fKLVNS+9qiHeU/iYPR9 dp6A== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id q4si17997279pfb.264.2019.04.04.16.20.32; Thu, 04 Apr 2019 16:20:48 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730282AbfDDWGa (ORCPT + 99 others); Thu, 4 Apr 2019 18:06:30 -0400 Received: from Galois.linutronix.de ([146.0.238.70]:46504 "EHLO Galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727263AbfDDWGa (ORCPT ); Thu, 4 Apr 2019 18:06:30 -0400 Received: from p5492e2fc.dip0.t-ipconnect.de ([84.146.226.252] helo=nanos) by Galois.linutronix.de with esmtpsa (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1hCAUy-00030m-Gn; Fri, 05 Apr 2019 00:06:16 +0200 Date: Fri, 5 Apr 2019 00:06:16 +0200 (CEST) From: Thomas Gleixner To: =?ISO-8859-15?Q?Jan_H=2E_Sch=F6nherr?= cc: Borislav Petkov , Ingo Molnar , x86@kernel.org, Paul Menzel , Thomas Lendacky , "H. Peter Anvin" , LKML , Linus Torvalds Subject: Re: [PATCH v2] x86/tsc: Allow quick PIT calibration despite interruptions In-Reply-To: Message-ID: References: <20190214214608.8672-1-jan@schnhrr.de> User-Agent: Alpine 2.21 (DEB 202 2017-01-01) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="8323329-1007672906-1554415576=:1802" X-Linutronix-Spam-Score: -1.0 X-Linutronix-Spam-Level: - X-Linutronix-Spam-Status: No , -1.0 points, 5.0 required, ALL_TRUSTED=-1,SHORTCIRCUIT=-0.0001 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This message is in MIME format. The first part should be readable text, while the remaining parts are likely unreadable without MIME-aware tools. --8323329-1007672906-1554415576=:1802 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8BIT On Thu, 14 Feb 2019, Thomas Gleixner wrote: > On Thu, 14 Feb 2019, Jan H. Schönherr wrote: > > Cc+: Linus (he wrote the original implementation and might have opinions) > > > Some systems experience regular interruptions (60 Hz SMI?), that prevent > > the quick PIT calibration from succeeding: individual interruptions can be > > so long, that the PIT MSB is observed to decrement by 2 or 3 instead of 1. > > The existing code cannot recover from this. > > > > The system in question is an AMD Ryzen Threadripper 2950X, microcode > > 0x800820b, on an ASRock Fatal1ty X399 Professional Gaming, BIOS P3.30. > > > > Change the code to handle (almost) arbitrary interruptions, as long > > as they happen only once in a while and they do not take too long. > > Specifically, also cover an interruption during the very first reads. > > > > Signed-off-by: Jan H. Schönherr > > --- > > > > v2: > > - Dropped the other hacky patch for the time being. > > - Fixed the early exit check. > > - Hopefully fixed all inaccurate math in v1. > > - Extended comments. > > That looks halfways sane, but I'm way too tired to wrap my head around > it right now. Went through it again and did not find any obvious issue. Nice work! > Vs. comments: The big comment above pit_verify_msb() needs a big overhaul > as well. Would you please fix that up and repost? Thanks, tglx --8323329-1007672906-1554415576=:1802--