git: 8eb94b238f24 - main - Set denominator to 1 if it is 0 in the init phase. This prevents panic and also helps when the clocks become available later. This is based on comment from manu@ on https://reviews.freebsd.org/D31299
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Sat, 01 Oct 2022 02:03:20 UTC
The branch main has been updated by ganbold:
URL: https://cgit.FreeBSD.org/src/commit/?id=8eb94b238f24fc7429f65bfd30bb538f72e87502
commit 8eb94b238f24fc7429f65bfd30bb538f72e87502
Author: Ganbold Tsagaankhuu <ganbold@FreeBSD.org>
AuthorDate: 2022-10-01 02:01:59 +0000
Commit: Ganbold Tsagaankhuu <ganbold@FreeBSD.org>
CommitDate: 2022-10-01 02:01:59 +0000
Set denominator to 1 if it is 0 in the init phase.
This prevents panic and also helps when the clocks
become available later.
This is based on comment from manu@ on
https://reviews.freebsd.org/D31299
---
sys/arm64/rockchip/clk/rk_clk_fract.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/sys/arm64/rockchip/clk/rk_clk_fract.c b/sys/arm64/rockchip/clk/rk_clk_fract.c
index 2b347db91790..17547b311eac 100644
--- a/sys/arm64/rockchip/clk/rk_clk_fract.c
+++ b/sys/arm64/rockchip/clk/rk_clk_fract.c
@@ -150,6 +150,8 @@ rk_clk_fract_init(struct clknode *clk, device_t dev)
sc->numerator = (reg >> 16) & 0xFFFF;
sc->denominator = reg & 0xFFFF;
+ if (sc->denominator == 0)
+ sc->denominator = 1;
clknode_init_parent_idx(clk, 0);
return(0);