Skip to content

Commit 0f532a7

Browse files
Lakshmi-SowjanyaKAGA-KOKO
authored andcommitted
x86/tsc: Remove obsolete ART to TSC conversion functions
convert_art_to_tsc() and convert_art_ns_to_tsc() interfaces are no longer required. The conversion is now handled by the core code. Signed-off-by: Lakshmi Sowjanya D <[email protected]> Signed-off-by: Thomas Gleixner <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent d4bea54 commit 0f532a7

File tree

2 files changed

+0
-63
lines changed

2 files changed

+0
-63
lines changed

arch/x86/include/asm/tsc.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,6 @@ static inline cycles_t get_cycles(void)
2828
}
2929
#define get_cycles get_cycles
3030

31-
extern struct system_counterval_t convert_art_to_tsc(u64 art);
32-
extern struct system_counterval_t convert_art_ns_to_tsc(u64 art_ns);
33-
3431
extern void tsc_early_init(void);
3532
extern void tsc_init(void);
3633
extern void mark_tsc_unstable(char *reason);

arch/x86/kernel/tsc.c

Lines changed: 0 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -1297,66 +1297,6 @@ int unsynchronized_tsc(void)
12971297
return 0;
12981298
}
12991299

1300-
/*
1301-
* Convert ART to TSC given numerator/denominator found in detect_art()
1302-
*/
1303-
struct system_counterval_t convert_art_to_tsc(u64 art)
1304-
{
1305-
u64 tmp, res, rem;
1306-
1307-
rem = do_div(art, art_base_clk.denominator);
1308-
1309-
res = art * art_base_clk.numerator;
1310-
tmp = rem * art_base_clk.numerator;
1311-
1312-
do_div(tmp, art_base_clk.denominator);
1313-
res += tmp + art_base_clk.offset;
1314-
1315-
return (struct system_counterval_t) {
1316-
.cs_id = have_art ? CSID_X86_TSC : CSID_GENERIC,
1317-
.cycles = res,
1318-
};
1319-
}
1320-
EXPORT_SYMBOL(convert_art_to_tsc);
1321-
1322-
/**
1323-
* convert_art_ns_to_tsc() - Convert ART in nanoseconds to TSC.
1324-
* @art_ns: ART (Always Running Timer) in unit of nanoseconds
1325-
*
1326-
* PTM requires all timestamps to be in units of nanoseconds. When user
1327-
* software requests a cross-timestamp, this function converts system timestamp
1328-
* to TSC.
1329-
*
1330-
* This is valid when CPU feature flag X86_FEATURE_TSC_KNOWN_FREQ is set
1331-
* indicating the tsc_khz is derived from CPUID[15H]. Drivers should check
1332-
* that this flag is set before conversion to TSC is attempted.
1333-
*
1334-
* Return:
1335-
* struct system_counterval_t - system counter value with the ID of the
1336-
* corresponding clocksource:
1337-
* cycles: System counter value
1338-
* cs_id: The clocksource ID for validating comparability
1339-
*/
1340-
1341-
struct system_counterval_t convert_art_ns_to_tsc(u64 art_ns)
1342-
{
1343-
u64 tmp, res, rem;
1344-
1345-
rem = do_div(art_ns, USEC_PER_SEC);
1346-
1347-
res = art_ns * tsc_khz;
1348-
tmp = rem * tsc_khz;
1349-
1350-
do_div(tmp, USEC_PER_SEC);
1351-
res += tmp;
1352-
1353-
return (struct system_counterval_t) {
1354-
.cs_id = have_art ? CSID_X86_TSC : CSID_GENERIC,
1355-
.cycles = res,
1356-
};
1357-
}
1358-
EXPORT_SYMBOL(convert_art_ns_to_tsc);
1359-
13601300
static void tsc_refine_calibration_work(struct work_struct *work);
13611301
static DECLARE_DELAYED_WORK(tsc_irqwork, tsc_refine_calibration_work);
13621302
/**

0 commit comments

Comments
 (0)