From patchwork Wed Feb 7 06:08:51 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "D, Lakshmi Sowjanya" X-Patchwork-Id: 197758 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7301:168b:b0:106:860b:bbdd with SMTP id ma11csp2031687dyb; Tue, 6 Feb 2024 22:12:41 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCWDER2Vry5hILVLFqzBhUL+sI14oWbL0lLiOYPGiSEUiQvlAUMiy3AEyZA5X1P4anqI2lnwNRMFJIOPIrpx0j1Ux3ymwA== X-Google-Smtp-Source: AGHT+IG+mlOlaQ0F2Y1Cra6GMRo+NE57Pb23ASkK7R9j9UjyrrG6QGASgPV3n9DiNYcIivP5hr8G X-Received: by 2002:a2e:9b8f:0:b0:2d0:aae8:2297 with SMTP id z15-20020a2e9b8f000000b002d0aae82297mr3418089lji.5.1707286361316; Tue, 06 Feb 2024 22:12:41 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707286361; cv=pass; d=google.com; s=arc-20160816; b=bhrK4o5hRrldMSdfgU5EJTK+hSVpZACRAxoSPlNIiZWxr0mdCAmDrV+UKLIn8WFO44 vMSPEksrnTcs7LpSV4pwUNUxukHG1a9p0RWv0RxMqk9eeyZNtfMDMlXuERens3SQ3mvC 8TJx9L4vP4dwGxPBB6YyJSZxD115LT3umyUhQEQlSjdiaPA7Is0Gtrfefro0O6fcyEBV eW0Lz+cgsrvLT4zYYtDxdPh0bbHPNGrsEz26o1USYHBiCxZnThKongYJ9tP+KywvtZNk whpfcRwiz2SKj3946MTDDrGbstf0fMh44s8eWcqtpzSHJABRFZqslXBNMtY+psuw9ofr 2tgw== 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=q8gByZClfBfq6wJ31YOG63AnOq1GzROpQWXlLhTOVWM=; b=eJ+idJfyfVClBmmOmRQTn12ttqAT9x13cS+yMgdsJdP7Woc9iHeOhHoUu2Q1F9S7Nz 9OVYE9MeWA0dgcG/SfrmhiscFtuqoiizUpyEeNiMJ1KzDrM84PF+2wN7TBXmI0f2LDPs /NO0fHu82yFYJxZUh6kN4QO8fN3pmFe6qTXhZNcXeMkZVx7nAsb5e7lMqoIc3ZO9ej7R UB4h4BeSndBu/elusYCVWTDU8VgxbE2Q/A7fHLBIusv+cMveWQNudRONVrJ/gM6CZ7Kg zS+MFlXkEvj2qUt2caWYwV3SNH9Yk39ZNcxaXY2OpDWexWGk7WZED797jFRPRS8hLlOK RqvQ==; 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-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-56001-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com X-Forwarded-Encrypted: i=2; AJvYcCVl6wfazWTGWo7m8cPXDtoeUEsmoaGDJjGK0chVpjKttOY0j206AsFA7dIwVO5pKDV6IGb2kIIiI33OLhVO1B6lScFWHg== Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id v23-20020aa7d657000000b0055fa101e5casi447393edr.532.2024.02.06.22.12.41 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 06 Feb 2024 22:12:41 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-56001-ouuuleilei=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-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-56001-ouuuleilei=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 E34AB1F25604 for ; Wed, 7 Feb 2024 06:12:40 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 5AB6E1BC22; Wed, 7 Feb 2024 06:10:01 +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 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1790219503503849552 X-GMAIL-MSGID: 1790219503503849552 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); /**