Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp2701857imm; Mon, 10 Sep 2018 05:21:12 -0700 (PDT) X-Google-Smtp-Source: ANB0VdZ5obqMhUmXMygTmUNUPc4yQ+sImfzPyQ+UJtqEsfezXPm2XcER5rPtdWreb4C/gOtyMDCL X-Received: by 2002:a63:804a:: with SMTP id j71-v6mr22324601pgd.171.1536582072343; Mon, 10 Sep 2018 05:21:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1536582072; cv=none; d=google.com; s=arc-20160816; b=HMDjsa0dmpBKIbpgvBs+DCkHjKck819UXuLgYNU7e51tzD2rXRtRJ139fUXQVrP4zg 9hwgPPw7loPKDMtzyEx0ApHTLZkY57S+VEwLcleGs+EtaBtROUFU+lJe8E4Z2hYPAGeg 5WDW0TaaQ+ERQU7T/pfqfCWVUoZ6Xiu78pHZ4Ow9uun4Y0vxBphnAzUlPHRlqGiIL3i5 zwxLUQRerGggkmrONiPJxRwkM7t+qXhGsg2rBj8/VgFQ9x/R8tGPvfhiri0ztceZT85O 5nvl7t5hUMhGg7YSPjR7sM/rsfZlgLKXs8WXYnMTcyTR0LcLXh9mkq7Sm85066UfoRYc r/wQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=MT+YNTJIq6SCu1IvVL63VN6mqTPAwzaIV4Y68Hz4cNI=; b=lD9WA7UcaHvacV1nnpbphm+Lg13FSEJQ1qKa5Q0rzkqda7V17CFZPFnD20fUrcO32Z eVqN01IqB7lPCvTrJIc7fJwT3cO+Ew1Q648CjxLDOLIDEXHsTnf28eJLL1nqIgyPjx1n t3FQeOaK3K0P9zDngK+OU6/pQBNjf25Z22Xlr20B9eag7MG2oQQJURqYMwU2VB3zrSux eBPb9eXnt+FggQq9sV7poQNYowwBwh9vlT09n60C7bQAQLMhwyilFSi2WiZhWGX/hG6e EX8wk++F8nJdRJ0iFT7IO87DsgkDPgNQBLwcnSKJP7PydSqoIBYlrwpRS2AyqXu4N7Ov sCkA== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f185-v6si16833180pgc.625.2018.09.10.05.20.57; Mon, 10 Sep 2018 05:21:12 -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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728618AbeIJRN3 (ORCPT + 99 others); Mon, 10 Sep 2018 13:13:29 -0400 Received: from mga02.intel.com ([134.134.136.20]:53290 "EHLO mga02.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728101AbeIJRNR (ORCPT ); Mon, 10 Sep 2018 13:13:17 -0400 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga008.jf.intel.com ([10.7.209.65]) by orsmga101.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 10 Sep 2018 05:19:28 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.53,355,1531810800"; d="scan'208";a="72003878" Received: from stinkbox.fi.intel.com (HELO stinkbox) ([10.237.72.174]) by orsmga008.jf.intel.com with SMTP; 10 Sep 2018 05:19:25 -0700 Received: by stinkbox (sSMTP sendmail emulation); Mon, 10 Sep 2018 15:19:25 +0300 From: Ville Syrjala To: linux-kernel@vger.kernel.org Cc: Dou Liyang , Thomas Gleixner , Pavel Tatashin , hpa@zytor.com, Peter Zijlstra , =?UTF-8?q?Ville=20Syrj=C3=A4l=C3=A4?= Subject: [PATCH] Revert "x86/tsc: Consolidate init code" Date: Mon, 10 Sep 2018 15:19:25 +0300 Message-Id: <20180910121925.27682-1-ville.syrjala@linux.intel.com> X-Mailer: git-send-email 2.16.4 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Ville Syrjälä This reverts commit 608008a45798fe9e2aee04f99b5270ea57c1376f. It breaks wifi on my pentium 3 Fujitsu-Siemens Lifebook S6010 laptop. Scanning for APs doesn't seem to work most of the time, and, even when it manages to find some APs it never manages to authenticate successfully. dmesg is just littered with: "wlan0: send auth to ... (try 1/3) wlan0: send auth to ... (try 2/3) wlan0: send auth to ... (try 3/3) wlan0: authentication with ... timed out" Presumably also USB is broken on account of the following noise in dmesg: "usb usb2-port2: Cannot enable. Maybe the USB cable is bad?". Cc: Dou Liyang Cc: Thomas Gleixner Cc: Pavel Tatashin Cc: Cc: Peter Zijlstra Cc: "H. Peter Anvin" Signed-off-by: Ville Syrjälä --- arch/x86/kernel/tsc.c | 22 ++++++++++------------ 1 file changed, 10 insertions(+), 12 deletions(-) diff --git a/arch/x86/kernel/tsc.c b/arch/x86/kernel/tsc.c index 6490f618e096..203edfabe813 100644 --- a/arch/x86/kernel/tsc.c +++ b/arch/x86/kernel/tsc.c @@ -182,7 +182,7 @@ static void __init cyc2ns_init_boot_cpu(void) } /* - * Secondary CPUs do not run through tsc_init(), so set up + * Secondary CPUs do not run through cyc2ns_init(), so set up * all the scale factors for all CPUs, assuming the same * speed as the bootup CPU. (cpufreq notifiers will fix this * up if their speed diverges) @@ -1389,7 +1389,7 @@ static bool __init determine_cpu_tsc_frequencies(bool early) } /* - * Trust non-zero tsc_khz as authoritative, + * Trust non-zero tsc_khz as authorative, * and use it to sanity check cpu_khz, * which will be off if system timer is off. */ @@ -1421,14 +1421,6 @@ static unsigned long __init get_loops_per_jiffy(void) return lpj; } -static void __init tsc_enable_sched_clock(void) -{ - /* Sanitize TSC ADJUST before cyc2ns gets initialized */ - tsc_store_and_check_tsc_adjust(true); - cyc2ns_init_boot_cpu(); - static_branch_enable(&__use_tsc); -} - void __init tsc_early_init(void) { if (!boot_cpu_has(X86_FEATURE_TSC)) @@ -1437,7 +1429,10 @@ void __init tsc_early_init(void) return; loops_per_jiffy = get_loops_per_jiffy(); - tsc_enable_sched_clock(); + /* Sanitize TSC ADJUST before cyc2ns gets initialized */ + tsc_store_and_check_tsc_adjust(true); + cyc2ns_init_boot_cpu(); + static_branch_enable(&__use_tsc); } void __init tsc_init(void) @@ -1461,10 +1456,13 @@ void __init tsc_init(void) setup_clear_cpu_cap(X86_FEATURE_TSC_DEADLINE_TIMER); return; } - tsc_enable_sched_clock(); + /* Sanitize TSC ADJUST before cyc2ns gets initialized */ + tsc_store_and_check_tsc_adjust(true); + cyc2ns_init_boot_cpu(); } cyc2ns_init_secondary_cpus(); + static_branch_enable(&__use_tsc); if (!no_sched_irq_time) enable_sched_clock_irqtime(); -- 2.16.4