From 341ccc993cf6da5ccdb1bc3f457d3c6eb2cb4d49 Mon Sep 17 00:00:00 2001 From: Emmanuel Vadot Date: Fri, 28 Aug 2020 18:25:45 +0000 Subject: [PATCH] arm: allwinner: clk: Add printfs when we cannot set the correct freq For some unknown reason this seems to fix this function when we printf the best variable. This isn't a delay problem as doing a printf without it doesn't solve this problem. This is way above my pay grade so add some printf that shouldn't be printed in 99% of the case anyway. Fix booting on most Allwinner boards as the mmc IP uses a NM clock. Reported by: Alexander Mishin MFC after: 3 days X-MFC-With: 363887 --- sys/arm/allwinner/clkng/aw_clk_nm.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/sys/arm/allwinner/clkng/aw_clk_nm.c b/sys/arm/allwinner/clkng/aw_clk_nm.c index 27caf3374266..f530acf65a7a 100644 --- a/sys/arm/allwinner/clkng/aw_clk_nm.c +++ b/sys/arm/allwinner/clkng/aw_clk_nm.c @@ -221,11 +221,15 @@ aw_clk_nm_set_freq(struct clknode *clk, uint64_t fparent, uint64_t *fout, if ((best < *fout) && ((flags & CLK_SET_ROUND_DOWN) == 0)) { *stop = 1; + printf("best freq (%llu) < requested freq(%llu)\n", + best, *fout); return (ERANGE); } if ((best > *fout) && ((flags & CLK_SET_ROUND_UP) == 0)) { *stop = 1; + printf("best freq (%llu) > requested freq(%llu)\n", + best, *fout); return (ERANGE); }