Received: by 2002:a25:868d:0:0:0:0:0 with SMTP id z13csp1690891ybk; Mon, 11 May 2020 01:48:16 -0700 (PDT) X-Google-Smtp-Source: APiQypI3iatf+Q678Pc8giholy/Ejl9n9tpb24AlFINJXPb5xZYnN+CmBSj7Axbuno9nWbHSeBHb X-Received: by 2002:a50:d6d0:: with SMTP id l16mr12857794edj.317.1589186896492; Mon, 11 May 2020 01:48:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1589186896; cv=none; d=google.com; s=arc-20160816; b=ELyF1/tOpVNr82y9KsZLNQPcxYH+52Lg7SjKTQnOcdzp3cbMg7olDH+gEfceRxXM7S yoWSGNvSBAZ0JSWMBC0PpbPrzRgPufUPDyEbK+fA6JGkm68TPVs2fL51RAYFDMVJYrvA UzVB12j/k9oIC2rRek62f/NAzmRbkLfHPxO7CBoe8c7PLkLU2+seZYNu0JqEjHtqycr3 2R1kBB/7LWRHZt5XIULM6DNKfNlOjNd0cHF38wao/q4N+jSQI/kgRnQe+nVltuKsr7rP yX5JFiaXUIwEhvhLMYZq8+kJENtzsnxnHlZliVrykFa+oguyv3of9ZbYiWuWB3YOYAxa VKuw== 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:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=CXyk9pD8GiPYbrmsgGPsMzIe7WnVGxVB8QF/X4cMkHw=; b=paoAydFF/sKPPr7aFfcCk2R5QFjT4HnLZctodQr7scENh2Xzj94GWzcNJqLG+8GZ3w lbY7PaXP8m24BnDqRytjMSFSEQPNTJ8rK/WiSHdL4mUy60PG1vfj/rZZb3xvqQU87BJo xLl+02yig+EKvkXJMFYaoyGPUtpAW3Kiw7I4tmSSK2qvLTC4K90eEvl/I8BS6dwzzzPu PGb1suqBfLwx3FFeQ0cJpU+pIINR/WW2kqG6LvAgWA+IOr9c8pJ+XC6Rna/XcySyUpyr 5RqzHALGIc0pr8xssPungnZeTQg/yl6buzPASJ3G5EuB1Sb1X0iBMOLLh5S3zKF26C4j blUA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=tH1xyULT; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id s8si5171639eji.349.2020.05.11.01.47.49; Mon, 11 May 2020 01:48:16 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=tH1xyULT; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729180AbgEKIpl (ORCPT + 99 others); Mon, 11 May 2020 04:45:41 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42296 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728471AbgEKIpl (ORCPT ); Mon, 11 May 2020 04:45:41 -0400 Received: from mail-oo1-xc44.google.com (mail-oo1-xc44.google.com [IPv6:2607:f8b0:4864:20::c44]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1D76DC061A0C for ; Mon, 11 May 2020 01:45:41 -0700 (PDT) Received: by mail-oo1-xc44.google.com with SMTP id t3so1765479oou.8 for ; Mon, 11 May 2020 01:45:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=CXyk9pD8GiPYbrmsgGPsMzIe7WnVGxVB8QF/X4cMkHw=; b=tH1xyULTB1Tug2ZFWrkrSlIu0kazzBAmC0d7ASAUam2Nm+KjLPEo3EuDPk1i2zKm4A WhkNqvCi5AqW0Z4iI5dsSslvO2QUzOrYoy9+iG8Q5EVhlUB5uY3BAR/lENni1oevul3G zrsDWISutihyNh1wK9m8dNVFDLyOWMoGsLFtYaJGljfmw8LZ5Ux3vAQHOmXEam4DltZZ 7TV8hYObHuPuomfyPbQZY2JobEvOTPVwjMwhPewqAwPPAP85yjJyzE80iSPzvv2UzNZl QDHFJpyUZoTVlE9GqSfDDluaqUfDbK3zp5NNk+Oi1MKLKr6xylZhikr3FEzSBOHtJCav 1WGw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=CXyk9pD8GiPYbrmsgGPsMzIe7WnVGxVB8QF/X4cMkHw=; b=azLL8EZgnroOiyulEpfvjfeNV0+9g1epp1yepuxsHvTL/cdyHmrVF5zVbCnkb3Gq0/ MrQ2uE1dzWHpdn6OyrSP2WRoqON3V9V/vEfsG1ejO99Vvgyrh9ktaFNTdx8VvWvtxRLI fV+t2uLVZyvkYqctbc+5GmpD9dUs9AjXJL/8Q3qfkLbgWiYm5SMhDBGfLjsL/9+kRzu1 GtjC6qNsSx2MN7TrH1Qs9JXjFmkoEuZm5GdHZuOP4IuaAcldzH63z3aYLkEj0wR1WCya CXz3x/Kqm70w50LOXNsnKo9xmcLyqowXF10Y0tXcNC0FoFlO69pja4kqK9S8Pz8MNmA0 giBQ== X-Gm-Message-State: AGi0PuYWAGlcbQWUQbX6I6CczCTWGsFp7hzHRNBWuAtBVL74k53kyHbJ yE/g7djd0aS8V3dxwpyX+c5Cat+ilMTbldLHkmN1dw== X-Received: by 2002:a05:6820:164:: with SMTP id k4mr13069183ood.30.1589186740054; Mon, 11 May 2020 01:45:40 -0700 (PDT) MIME-Version: 1.0 References: <20200509113717.9084-1-pmenzel@molgen.mpg.de> <87eerr3ppb.fsf@nanos.tec.linutronix.de> In-Reply-To: From: Radoslaw Biernacki Date: Mon, 11 May 2020 10:45:28 +0200 Message-ID: Subject: Re: [PATCH] x86/tsc: Use hard-coded crystal clock for Skylake mobile To: Paul Menzel Cc: Thomas Gleixner , x86@kernel.org, Ross Zwisler , Daniel Drake , Andy Lutomirski , Borislav Petkov , "H . Peter Anvin" , Peter Zijlstra , Len Brown , Linux Upstreaming Team , "Rafael J . Wysocki" , Thorsten Leemhuis , LKML Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, May 11, 2020 at 9:38 AM Paul Menzel wrote: > > Dear Thomas, > > > Thank you for the quick reply. > > Am 11.05.20 um 09:17 schrieb Thomas Gleixner: > > > Paul Menzel writes: > > > > please send patches to LKML and not offlist. > > Sorry about that. From `MAINTAINERS` I thought x86@kernel.org is wanted. > Other subsystems list LKML explicitly there. > > >> From: Radoslaw Biernacki > >> > >> @@ -636,10 +636,24 @@ unsigned long native_calibrate_tsc(void) > >> * Denverton SoCs don't report crystal clock, and also don't supp= ort > >> * CPUID.0x16 for the calculation below, so hardcode the 25MHz cr= ystal > >> * clock. > >> + * Also estimation code is not reliable and gives 1.5% differenc= e for > >> + * tsc/clock ratio on Skylake mobile. Therefore below is a hardco= ded > >> + * crystal frequency for Skylake which was removed by upstream co= mmit > >> + * "x86/tsc: Use CPUID.0x16 to calculate missing crystal frequenc= y" > >> + * This is temporary workaround for bugs: > >> + * b/148108096, b/154283905, b/146787525, b/153400677, b/14817892= 9 > >> + * chromium/1031054 > >> */ > >> - if (crystal_khz =3D=3D 0 && > >> - boot_cpu_data.x86_model =3D=3D INTEL_FAM6_ATOM_GO= LDMONT_D) > >> - crystal_khz =3D 25000; > >> + if (crystal_khz =3D=3D 0) { > >> + switch (boot_cpu_data.x86_model) { > >> + case INTEL_FAM6_SKYLAKE_MOBILE: > >> + crystal_khz =3D 24000; /* 24.0 MHz */ > >> + break; > >> + case INTEL_FAM6_ATOM_GOLDMONT_X: > >> + crystal_khz =3D 25000; /* 25.0 MHz */ > >> + break; > >> + } > > > > Aside of being a workaround for Google issues which are probably caused= > by broken BIOSes > > Even if it was caused by broken firmware, wouldn=E2=80=99t Linux=E2=80=99= no regression > policy still consider this a regression as user should be able to the > Linux kernel =E2=80=9Cno matter what=E2=80=9D? > > > that patch is broken. > > > > INTEL_FAM6_ATOM_GOLDMONT_D !=3D INTEL_FAM6_ATOM_GOLDMONT_X > > Good catch. The commit didn=E2=80=99t apply cleanly to the master branch,= and I > missed this. > > I=E2=80=99ll wait for Radoslaw to comment before proceeding further with = this. We found that regression only on specific SKU which was used in one model of ChromeBook. What's interesting is that some other SKU is fine. The consequences of this are rather not trivial, so this was considered a quickfix and temporary till we develop something better. In contrast to ChromeOs, I know that there is no way of finding if there are in fact regressions on generic kernel in the field (this is SKU dependent), but we also think that this problem should be addressed in a better way (if possible). We plan to work on this. Any help is welcome. > > > Kind regards, > > Paul