Commit 522c961
authored
clk: sunxi-ng: ccu_common: Replace ktime-dependent lock wait loop with udelay (#10119)
The Allwinner sunxi-ng clock control unit (CCU) driver utilizes
readl_relaxed_poll_timeout_atomic() inside ccu_helper_wait_for_lock()
to wait for PLLs to lock. This timeout loop relies internally on ktime_get()
and timekeeping APIs.
During early boot or clock transitions (such as CPUfreq DVFS scaling),
the system's clock sources and timekeeping may be unstable or temporarily
suspended. This causes ktime_get() to fail to increment or return invalid
readings, turning the timeout calculation into an infinite busy-wait loop
and triggering critical RCU stalls / kernel lockups.
Decouple the PLL lock wait loop from the timekeeping framework by replacing
the poll timeout loop with a robust, timekeeping-independent iteration loop
utilizing udelay(1) (up to 100,000 iterations / 100ms timeout limit). This
avoids timekeeping dependencies during sensitive frequency scaling operations
and prevents infinite CPU lockups when timer interrupts are suspended.
Assisted-by: Antigravity <antigravity@google.com>
Signed-off-by: Alastair D'Silva <alastair@d-silva.org>1 parent e46f5a4 commit 522c961
4 files changed
Lines changed: 71 additions & 0 deletions
File tree
- patch/kernel/archive
- sunxi-6.18
- patches.armbian
- sunxi-7.0
- patches.armbian
Lines changed: 34 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
564 | 564 | | |
565 | 565 | | |
566 | 566 | | |
| 567 | + | |
567 | 568 | | |
Lines changed: 35 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
520 | 520 | | |
521 | 521 | | |
522 | 522 | | |
| 523 | + | |
523 | 524 | | |
524 | 525 | | |
525 | 526 | | |
0 commit comments