From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Google-Smtp-Source: AH8x227jUKSZ5fZQKCjcy6B8tYE67AR7S/v2vttnNzfRzf0rAnNigbSQoJCW4U7C0wtX5C7ypbhX ARC-Seal: i=1; a=rsa-sha256; t=1516611020; cv=none; d=google.com; s=arc-20160816; b=LKTigM3tYBHGpLrhawz6uQ01DyppAkQy9Qei7K46uDT2MDuar5KyNlKoAIm7EGfmac zgnkPzC7cBUTxdwfN6SU1JOpLxUTTixv70s4OM6bW5o0RwfxwEL875wKmk+D8Mm30zcx FAoYWDscs+ZT/dZfSthMeUFK3x0Yoig+s5TZaS5lDduF1jLdty8uVtgz8bFn2rLQvY4u +Cl+zOsbtKjF4ph8AAmdhvMyKzjjZtcG/LGgKx789/xO9rKySwpgF5p9bt83+bFm9rV0 n6mqldhrWDQqj9h3gPPVGDQmHBbCzPuEeKcoU2C4umUr8Bx1mwOw88U5CqNZLs3+Ms2E HIoA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=mime-version:user-agent:references:in-reply-to:message-id:date :subject:cc:to:from:arc-authentication-results; bh=EY2UgIl/9WoLJ0kJI7VO72wUgeM/qs9Nlw1RuMtczxE=; b=ukIbcX05S4BJSVDdIwE4BZq63dj8c4TNWlNfB4NfL1snQsHbS0ZI4PnyN+NEMn7Ep4 6v2tqgZebS8E/jWKyshjdAJ0Mwtpn8alfxYV50kF/lePn9WYxdEvmvzL46Ba1ex0mx53 Z1LHugLeYZfy45U2eDJliozb0GgnnaY+ExvBAw0D1hQAfmIp0D9DUd8xzJYkOr5o9Xwh G5vjcMpd+1V4KhFxDDPa6rzTkTIZa4fzV8BybSkQ6GELkco82MjSCQVCkbm7MzZXScE2 emEU56qEVqdZVXZBzK3tZObCuEMqM0NCbB/gMGg/HZ79B5gQJ5tmuPJlXOr1EEYlNYnz /cMw== ARC-Authentication-Results: i=1; mx.google.com; spf=softfail (google.com: domain of transitioning gregkh@linuxfoundation.org does not designate 90.92.71.90 as permitted sender) smtp.mailfrom=gregkh@linuxfoundation.org Authentication-Results: mx.google.com; spf=softfail (google.com: domain of transitioning gregkh@linuxfoundation.org does not designate 90.92.71.90 as permitted sender) smtp.mailfrom=gregkh@linuxfoundation.org From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Len Brown , Thomas Gleixner , peterz@infradead.org, Prarit Bhargava Subject: [PATCH 4.9 20/47] x86/tsc: Fix erroneous TSC rate on Skylake Xeon Date: Mon, 22 Jan 2018 09:45:31 +0100 Message-Id: <20180122083927.255964624@linuxfoundation.org> X-Mailer: git-send-email 2.16.0 In-Reply-To: <20180122083925.568134913@linuxfoundation.org> References: <20180122083925.568134913@linuxfoundation.org> User-Agent: quilt/0.65 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-LABELS: =?utf-8?b?IlxcU2VudCI=?= X-GMAIL-THRID: =?utf-8?q?1590281916972679458?= X-GMAIL-MSGID: =?utf-8?q?1590281916972679458?= X-Mailing-List: linux-kernel@vger.kernel.org List-ID: 4.9-stable review patch. If anyone has any objections, please let me know. ------------------ From: Len Brown commit b511203093489eb1829cb4de86e8214752205ac6 upstream. The INTEL_FAM6_SKYLAKE_X hardcoded crystal_khz value of 25MHZ is problematic: - SKX workstations (with same model # as server variants) use a 24 MHz crystal. This results in a -4.0% time drift rate on SKX workstations. - SKX servers subject the crystal to an EMI reduction circuit that reduces its actual frequency by (approximately) -0.25%. This results in -1 second per 10 minute time drift as compared to network time. This issue can also trigger a timer and power problem, on configurations that use the LAPIC timer (versus the TSC deadline timer). Clock ticks scheduled with the LAPIC timer arrive a few usec before the time they are expected (according to the slow TSC). This causes Linux to poll-idle, when it should be in an idle power saving state. The idle and clock code do not graciously recover from this error, sometimes resulting in significant polling and measurable power impact. Stop using native_calibrate_tsc() for INTEL_FAM6_SKYLAKE_X. native_calibrate_tsc() will return 0, boot will run with tsc_khz = cpu_khz, and the TSC refined calibration will update tsc_khz to correct for the difference. [ tglx: Sanitized change log ] Fixes: 6baf3d61821f ("x86/tsc: Add additional Intel CPU models to the crystal quirk list") Signed-off-by: Len Brown Signed-off-by: Thomas Gleixner Cc: peterz@infradead.org Cc: Prarit Bhargava Link: https://lkml.kernel.org/r/ff6dcea166e8ff8f2f6a03c17beab2cb436aa779.1513920414.git.len.brown@intel.com Signed-off-by: Greg Kroah-Hartman --- arch/x86/kernel/tsc.c | 1 - 1 file changed, 1 deletion(-) --- a/arch/x86/kernel/tsc.c +++ b/arch/x86/kernel/tsc.c @@ -693,7 +693,6 @@ unsigned long native_calibrate_tsc(void) case INTEL_FAM6_KABYLAKE_DESKTOP: crystal_khz = 24000; /* 24.0 MHz */ break; - case INTEL_FAM6_SKYLAKE_X: case INTEL_FAM6_ATOM_DENVERTON: crystal_khz = 25000; /* 25.0 MHz */ break;