Received: by 2002:a05:7412:2a8a:b0:fc:a2b0:25d7 with SMTP id u10csp113810rdh; Tue, 6 Feb 2024 22:12:31 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCXdvANJTI9lKwWUT+NCuJK2v/jYwLIizCZoiW7NT4xm2XdDz7P9sAmLf0Pph+J/9hfOX/RsMvKc1mYjp76G94pE0wFwwAhwoJTAGPMbqw== X-Google-Smtp-Source: AGHT+IFU73slCJ4+RGIwZ6Q+g3djS1rDJkidZOq4QBj5vAN40/mBKXnYYAHy0jecf8u8phWxH8Iy X-Received: by 2002:aa7:df11:0:b0:560:8fb7:a721 with SMTP id c17-20020aa7df11000000b005608fb7a721mr3409531edy.13.1707286351051; Tue, 06 Feb 2024 22:12:31 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707286351; cv=pass; d=google.com; s=arc-20160816; b=uWUnXtK4INr6+BtY4TS6/ZhGilWaA7ltPCskqZME7p0nfhpMS4uJkZBSaAlKbr9blM npKFaT9y5RB2ysKSvwV80+/lqyPlaLNvzSZJW/2BIopCS+4Rr0DaA5GIqrYrEtX7QTV6 YWbevMUk+eZB9T/RW8NKcjosS/L6F+7WNhqAVJu0BO1vHm7iQ3rbaly3xpB98T0e+/lu DqqN60PHXg68H0DIgwE7ik8juHZ9+5Am/8m1RK84fDNx/C1Qzo2QNWQorzls9LpqX5f5 pkz0gHfx95Djs40dWk0fsBVdERZNqyeRbxodRRRZlkW3GZqxLUkklZGHUaJGbocV8wZc S0JQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=ywgSWWjzGSSZJLmzw5t9/86dBBZS8eMPYf1yOGQSY50=; fh=vj3X2/DiCqczyBz1G6fRFUSf5oT4avVdxyL9LMiIrEI=; b=KRDRf8Hyydj/YKzmWaHUPM/9uTijEPsy6nLuFciwgGASDAuRRGoxvuICWx3fqWS8FT k6wfHODukrREw6GFwYaGiKSaZwtZzMEAbzsmx7QTkaZvSav91Gop0Ii0Nq70OmAwGD05 M5KxnuIBuKovRZFF9d4Qt9NwvGpnSzoat9S3JHKb9lJQZiOdFxmuapgtXstCgI35KdvP jTBzXXWWvfRPY6gm4DtMz7EwJzlg0M004a/NxOSxKqs7VoOKAbHU2qVvnxluHHF6oAkn wk7SqWWAgAllHzgONRHvpkqHMlVUXJxQ4zGKOVGKJDvxR39+mxyOe5qYrt37KDFf9Veb yvfQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=j+Xok4Yb; arc=pass (i=1 spf=pass spfdomain=intel.com dkim=pass dkdomain=intel.com dmarc=pass fromdomain=intel.com); spf=pass (google.com: domain of linux-kernel+bounces-56001-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-56001-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com X-Forwarded-Encrypted: i=2; AJvYcCXLMWpTQyY0aBVP4Ul4T7+EZYLuc8ZyvSQ2hctNi46OFl6d5CxrvAuZqlft79Sz3I4BPc57wdKhQFxEbdrGpJZ7HWHId+Bv+HmuaTc1GA== Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id c11-20020a056402120b00b0055deaaf8b06si434746edw.346.2024.02.06.22.12.30 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 06 Feb 2024 22:12:31 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-56001-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=j+Xok4Yb; arc=pass (i=1 spf=pass spfdomain=intel.com dkim=pass dkdomain=intel.com dmarc=pass fromdomain=intel.com); spf=pass (google.com: domain of linux-kernel+bounces-56001-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-56001-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 7BFD81F23CB1 for ; Wed, 7 Feb 2024 06:12:30 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 5289020B20; Wed, 7 Feb 2024 06:09:59 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="j+Xok4Yb" Received: from mgamail.intel.com (mgamail.intel.com [192.55.52.88]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id D98B820DCC; Wed, 7 Feb 2024 06:09:56 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=192.55.52.88 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707286198; cv=none; b=vAHrwW16kH0x6heADH4tGfMoliWaVBF5XcnPHimAWmae0//iolFa8+5GRJ5jCK2Q6zrp5nfA6eOzNCQthFs+zLC/4dlqlvMf47AY7m6CMi0k6KPRnELc1P6BndfEFZLsuiFQ5evU8B7VSv1T97uuD4idGSKZrcQqB1w62iLu8VA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707286198; c=relaxed/simple; bh=t6cpcq7SdAhCh1eL4xC81g6usIlQlk83sietgrk1PRY=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=MVc7GJi7Sr6SGfVpMINYDgglE3IPf0lDEPw4VigBolcY11y1KMLdEVBNf3RS66ddFPo6Hcidk4m0Bjb413B5SctVjSNREdjmBdp5LdP6Qx9zFRsXCBc0mx+pBaoyWiLDnVsKxgE7AnI8cNDaRPWG78Kd+Znl/fqdRTJ2B2C0f4Y= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=intel.com; spf=pass smtp.mailfrom=intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=j+Xok4Yb; arc=none smtp.client-ip=192.55.52.88 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=intel.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=intel.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1707286196; x=1738822196; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=t6cpcq7SdAhCh1eL4xC81g6usIlQlk83sietgrk1PRY=; b=j+Xok4YbiGYyrVjN3rFmLwJEthgCtr8XD3b99z7IYmTa88YWRmj5hORt mI/W5UCItN+/D4E13pNc8dQ5NlVKd7F/gEIurMTI2hRdKohQgi2EwEtqI 6wKLgVNDbJHW/5ujZO0KxAV5nPgsPSrQlfXl8P46Is5J4ozdUj5+NG3sV LlXKwH7Ted5giWcSZp1H48eKVahufOBa4YxaS56tAKB0OpUUuXQBNbZxN 2ms/PnYzXN340k8mJKWu03AIO3XcywnkEQCrk7sT+qlzbsogr6mye5I5a fN+Otl16NDqSFjqQr5HaO6cAZD6u/pTTTz7VaUznjmCuZQXrYr8wvtfmu Q==; X-IronPort-AV: E=McAfee;i="6600,9927,10976"; a="436054054" X-IronPort-AV: E=Sophos;i="6.05,250,1701158400"; d="scan'208";a="436054054" Received: from fmviesa004.fm.intel.com ([10.60.135.144]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 06 Feb 2024 22:09:55 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.05,250,1701158400"; d="scan'208";a="5849871" Received: from inlubt0316.iind.intel.com ([10.191.20.213]) by fmviesa004.fm.intel.com with ESMTP; 06 Feb 2024 22:09:49 -0800 From: lakshmi.sowjanya.d@intel.com To: tglx@linutronix.de, jstultz@google.com, giometti@enneenne.com, corbet@lwn.net, linux-kernel@vger.kernel.org Cc: x86@kernel.org, netdev@vger.kernel.org, linux-doc@vger.kernel.org, intel-wired-lan@lists.osuosl.org, andriy.shevchenko@linux.intel.com, eddie.dong@intel.com, christopher.s.hall@intel.com, jesse.brandeburg@intel.com, davem@davemloft.net, alexandre.torgue@foss.st.com, joabreu@synopsys.com, mcoquelin.stm32@gmail.com, perex@perex.cz, linux-sound@vger.kernel.org, anthony.l.nguyen@intel.com, peter.hilber@opensynergy.com, pandith.n@intel.com, mallikarjunappa.sangannavar@intel.com, subramanian.mohan@intel.com, thejesh.reddy.t.r@intel.com, lakshmi.sowjanya.d@intel.com Subject: [PATCH v4 08/11] x86/tsc: Remove art to tsc conversion functions which are obsolete Date: Wed, 7 Feb 2024 11:38:51 +0530 Message-Id: <20240207060854.6524-9-lakshmi.sowjanya.d@intel.com> X-Mailer: git-send-email 2.35.3 In-Reply-To: <20240207060854.6524-1-lakshmi.sowjanya.d@intel.com> References: <20240207060854.6524-1-lakshmi.sowjanya.d@intel.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit From: Lakshmi Sowjanya D The convert_art_to_tsc() and convert_art_ns_to_tsc() interfaces are no longer required. This conversion is internally done in get_device_system_crosststamp() using convert_base_to_cs(). Signed-off-by: Lakshmi Sowjanya D --- arch/x86/include/asm/tsc.h | 3 -- arch/x86/kernel/tsc.c | 57 -------------------------------------- 2 files changed, 60 deletions(-) diff --git a/arch/x86/include/asm/tsc.h b/arch/x86/include/asm/tsc.h index 594fce0ca744..5e36495cc821 100644 --- a/arch/x86/include/asm/tsc.h +++ b/arch/x86/include/asm/tsc.h @@ -27,9 +27,6 @@ static inline cycles_t get_cycles(void) } #define get_cycles get_cycles -extern struct system_counterval_t convert_art_to_tsc(u64 art); -extern struct system_counterval_t convert_art_ns_to_tsc(u64 art_ns); - extern void tsc_early_init(void); extern void tsc_init(void); extern void mark_tsc_unstable(char *reason); diff --git a/arch/x86/kernel/tsc.c b/arch/x86/kernel/tsc.c index 96a5c4c2c6ee..646f716dc32a 100644 --- a/arch/x86/kernel/tsc.c +++ b/arch/x86/kernel/tsc.c @@ -1297,63 +1297,6 @@ int unsynchronized_tsc(void) return 0; } -/* - * Convert ART to TSC given numerator/denominator found in detect_art() - */ -struct system_counterval_t convert_art_to_tsc(u64 art) -{ - u64 tmp, res, rem; - - rem = do_div(art, art_base_clk.denominator); - - res = art * art_base_clk.numerator; - tmp = rem * art_base_clk.numerator; - - do_div(tmp, art_base_clk.denominator); - res += tmp + art_base_clk.offset; - - return (struct system_counterval_t) { - .cs_id = have_art ? CSID_X86_TSC : CSID_GENERIC, - .cycles = res - }; -} -EXPORT_SYMBOL(convert_art_to_tsc); - -/** - * convert_art_ns_to_tsc() - Convert ART in nanoseconds to TSC. - * @art_ns: ART (Always Running Timer) in unit of nanoseconds - * - * PTM requires all timestamps to be in units of nanoseconds. When user - * software requests a cross-timestamp, this function converts system timestamp - * to TSC. - * - * This is valid when CPU feature flag X86_FEATURE_TSC_KNOWN_FREQ is set - * indicating the tsc_khz is derived from CPUID[15H]. Drivers should check - * that this flag is set before conversion to TSC is attempted. - * - * Return: - * struct system_counterval_t - system counter value with the ID of the - * corresponding clocksource - */ - -struct system_counterval_t convert_art_ns_to_tsc(u64 art_ns) -{ - u64 tmp, res, rem; - - rem = do_div(art_ns, USEC_PER_SEC); - - res = art_ns * tsc_khz; - tmp = rem * tsc_khz; - - do_div(tmp, USEC_PER_SEC); - res += tmp; - return (struct system_counterval_t) { - .cs_id = have_art ? CSID_X86_TSC : CSID_GENERIC, - .cycles = res - }; -} -EXPORT_SYMBOL(convert_art_ns_to_tsc); - static void tsc_refine_calibration_work(struct work_struct *work); static DECLARE_DELAYED_WORK(tsc_irqwork, tsc_refine_calibration_work); /** -- 2.35.3