summaryrefslogtreecommitdiff
path: root/include/linux/clocksource.h
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2024-04-05 09:48:12 +0300
committerTakashi Iwai <tiwai@suse.de>2024-04-05 09:48:12 +0300
commit100c85421b52e41269ada88f7d71a6b8a06c7a11 (patch)
tree1e291a2d1b8e68720a15dfd48964357502d03fc9 /include/linux/clocksource.h
parentc4e51e424e2c772ce1836912a8b0b87cd61bc9d5 (diff)
parent90f8917e7a15f6dd508779048bdf00ce119b6ca0 (diff)
downloadlinux-100c85421b52e41269ada88f7d71a6b8a06c7a11.tar.xz
Merge tag 'asoc-fix-v6.9-rc2' of https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound into for-linus
ASoC: Fixes for v6.9 A relatively large set of fixes here, the biggest piece of it is a series correcting some problems with the delay reporting for Intel SOF cards but there's a bunch of other things. Everything here is driver specific except for a fix in the core for an issue with sign extension handling volume controls.
Diffstat (limited to 'include/linux/clocksource.h')
-rw-r--r--include/linux/clocksource.h14
1 files changed, 13 insertions, 1 deletions
diff --git a/include/linux/clocksource.h b/include/linux/clocksource.h
index 1d42d4b17327..0ad8b550bb4b 100644
--- a/include/linux/clocksource.h
+++ b/include/linux/clocksource.h
@@ -291,7 +291,19 @@ static inline void timer_probe(void) {}
#define TIMER_ACPI_DECLARE(name, table_id, fn) \
ACPI_DECLARE_PROBE_ENTRY(timer, name, table_id, 0, NULL, 0, fn)
-extern ulong max_cswd_read_retries;
+static inline unsigned int clocksource_get_max_watchdog_retry(void)
+{
+ /*
+ * When system is in the boot phase or under heavy workload, there
+ * can be random big latencies during the clocksource/watchdog
+ * read, so allow retries to filter the noise latency. As the
+ * latency's frequency and maximum value goes up with the number of
+ * CPUs, scale the number of retries with the number of online
+ * CPUs.
+ */
+ return (ilog2(num_online_cpus()) / 2) + 1;
+}
+
void clocksource_verify_percpu(struct clocksource *cs);
#endif /* _LINUX_CLOCKSOURCE_H */