From 1c055e55a242a33e574e48be530e06770a210dcd Mon Sep 17 00:00:00 2001
From: hc <hc@nodka.com>
Date: Mon, 19 Feb 2024 03:26:26 +0000
Subject: [PATCH] add r8169 read mac form eeprom
---
kernel/include/linux/delay.h | 26 ++++++++++++++++++++------
1 files changed, 20 insertions(+), 6 deletions(-)
diff --git a/kernel/include/linux/delay.h b/kernel/include/linux/delay.h
index 7c4bc41..abecbcc 100644
--- a/kernel/include/linux/delay.h
+++ b/kernel/include/linux/delay.h
@@ -16,10 +16,11 @@
* 3. CPU clock rate changes.
*
* Please see this thread:
- * http://lists.openwall.net/linux-kernel/2011/01/09/56
+ * https://lists.openwall.net/linux-kernel/2011/01/09/56
*/
#include <linux/kernel.h>
+#include <linux/sched.h>
extern unsigned long loops_per_jiffy;
@@ -55,19 +56,32 @@
extern unsigned long lpj_fine;
void calibrate_delay(void);
+void __attribute__((weak)) calibration_delay_done(void);
void msleep(unsigned int msecs);
unsigned long msleep_interruptible(unsigned int msecs);
+void usleep_range_state(unsigned long min, unsigned long max,
+ unsigned int state);
void usleep_range(unsigned long min, unsigned long max);
+
+static inline void usleep_idle_range(unsigned long min, unsigned long max)
+{
+ usleep_range_state(min, max, TASK_IDLE);
+}
static inline void ssleep(unsigned int seconds)
{
msleep(seconds * 1000);
}
-#ifdef CONFIG_PREEMPT_RT_FULL
-extern void cpu_chill(void);
-#else
-# define cpu_chill() cpu_relax()
-#endif
+/* see Documentation/timers/timers-howto.rst for the thresholds */
+static inline void fsleep(unsigned long usecs)
+{
+ if (usecs <= 10)
+ udelay(usecs);
+ else if (usecs <= 20000)
+ usleep_range(usecs, 2 * usecs);
+ else
+ msleep(DIV_ROUND_UP(usecs, 1000));
+}
#endif /* defined(_LINUX_DELAY_H) */
--
Gitblit v1.6.2