Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp10457144ybi; Wed, 24 Jul 2019 23:35:30 -0700 (PDT) X-Google-Smtp-Source: APXvYqwlUsBrWgYTBit75JoR/1ZFpgSHgqU9x8Jew9TJOzngpEaCJW/30L14fZmj/sTL7/J3i5/v X-Received: by 2002:a62:6dc2:: with SMTP id i185mr15315293pfc.40.1564036530532; Wed, 24 Jul 2019 23:35:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1564036530; cv=none; d=google.com; s=arc-20160816; b=AJxcaMMq/V972tvNbsvPKPfuZo8YkkdiIlDKyy3e6lyl5CmJP8rWQlZ8/fCxLCCvPA h3A4VLO4J99DiIQq/YEHl4x07EhVOh7xP6IjNtTLmqCgxkDnNpmpWLk5cFRLJ5QyBNrF jnLQ9EYdSIoJsACdGfhB3yfgfLarJ3Rk/DAk31tOX3w5KCWHyBQDjABPzGhZxXiqCtJr c7pYsnApjNPU6HzV7B1MZEdTlem7rAwUYePFUsRAaO7w9oo1+psdxx4YD2oNHlwLkxXg /ahxlliEPo9PwtHJp7FKviD7/QJGhMS7eSVpy1sPdGvZlnhaAP9GR5FHvrCx1daIUdm8 AVfA== 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=d+t4C/hr/wbo8g3I+4ql+ZpB78OiwWL5tPluO1amVCI=; b=rGwEAmv7JgK91SgG5bmwO5p+shpk4OtdGfxuIm0uqpWnp7mf6/wjUogB/GuzVUqUFh qWvJcm+F/XtOuJ1E1TTrNMhPOM7Rc/z0dCdF2CKQn0vPkwaJ6/8e59dOvgRSpJS84/D+ ZfeMed1zisCMgn+0Sf4NSHT+vXey9xNSAYW8QcwsHQEULoNPbFdDgmkCxaaZ7UJrqxzT UYSfvhgA/DaZO/crgyNXMYO7U7AzayCbSroeUP3qMEfPW5d39LohPfcLKbWoiIhWdISo ia3ojHFlLcrClcP0sZzWOF4d3lvWiM9w0HxT1SCot6X32Q8/A+2VYuzr+wyIbS6XFrly WNVA== 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 b20si16928812pfo.108.2019.07.24.23.35.16; Wed, 24 Jul 2019 23:35:30 -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 S1728048AbfGYG2u (ORCPT + 99 others); Thu, 25 Jul 2019 02:28:50 -0400 Received: from Galois.linutronix.de ([193.142.43.55]:45232 "EHLO Galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726005AbfGYG2u (ORCPT ); Thu, 25 Jul 2019 02:28:50 -0400 Received: from pd9ef1cb8.dip0.t-ipconnect.de ([217.239.28.184] helo=nanos) by Galois.linutronix.de with esmtpsa (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1hqXF9-0007qn-56; Thu, 25 Jul 2019 08:28:47 +0200 Date: Thu, 25 Jul 2019 08:28:45 +0200 (CEST) From: Thomas Gleixner To: Rui Salvaterra cc: LKML , x86@kernel.org, Daniel Drake Subject: Re: [BUG] Linux 5.3-rc1: timer problem on x86-64 (Pentium D) In-Reply-To: Message-ID: References: User-Agent: Alpine 2.21 (DEB 202 2017-01-01) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="8323329-1596934924-1564036127=:1791" 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-1596934924-1564036127=:1791 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8BIT Rui, On Thu, 25 Jul 2019, Rui Salvaterra wrote: > Looks like we have a winner. Actually, I did a full bisection between > 5.2 and 5.3-rc1. Full log follows: > > git bisect start > # good: [0ecfebd2b52404ae0c54a878c872bb93363ada36] Linux 5.2 > git bisect good 0ecfebd2b52404ae0c54a878c872bb93363ada36 > > # first bad commit: [3222daf970f30133cc4c639cbecdc29c4ae91b2b] > x86/hpet: Separate counter check out of clocksource register code > > I haven't tried reverting this commit and recompiling (it's already 'Revert' on top of Linus tree below. > past 1:00 here, need to sleep), but I'll try it tomorrow, if required. > Note that on this machine (i945G) the HPET is disabled at boot and is > forcefully enabled by the kernel… > [ 0.147527] pci 0000:00:1f.0: Force enabled HPET at 0xfed00000 Ok. > … and the commit message reads… > > "The init code checks whether the HPET counter works late in the init > function when the clocksource is registered. That should happen right > with the other sanity checks." > > … maybe now the check is happening a bit too early…? The only reason I can think of is that the HPET on that machine has a weird register state (it's not advertised by the BIOS ... ) But that does not explain the boot failure completely. If the HPET is not available then the kernel should automatically do the right thing and fall back to something else. Can you please provide the output of: cat /sys/devices/system/clocksource/clocksource0/available_clocksource and cat /sys/devices/system/clocksource/clocksource0/current_clocksource from a successful boot with 5.2 and 5.3 head with the 'fix' applied? Then boot these kernels with 'hpet=disable' on the command line and see whether they come up. If so please provide the same output. The dmesg output of each boot would be useful as well. Thanks, tglx 8<-------------------- --- a/arch/x86/kernel/hpet.c +++ b/arch/x86/kernel/hpet.c @@ -827,10 +827,6 @@ int __init hpet_enable(void) if (!hpet_cfg_working()) goto out_nohpet; - /* Validate that the counter is counting */ - if (!hpet_counting()) - goto out_nohpet; - /* * Read the period and check for a sane value: */ @@ -896,6 +892,14 @@ int __init hpet_enable(void) } hpet_print_config(); + /* + * Validate that the counter is counting. This needs to be done + * after sanitizing the config registers to properly deal with + * force enabled HPETs. + */ + if (!hpet_counting()) + goto out_nohpet; + clocksource_register_hz(&clocksource_hpet, (u32)hpet_freq); if (id & HPET_ID_LEGSUP) { --8323329-1596934924-1564036127=:1791--