1
0
Fork 0
alistair23-linux/drivers/clk/at91
Claudiu Beznea 0d03cbfdf3 clk: at91: usb: continue if clk_hw_round_rate() return zero
[ Upstream commit b0ecf1c6c6 ]

clk_hw_round_rate() may call round rate function of its parents. In case
of SAM9X60 two of USB parrents are PLLA and UPLL. These clocks are
controlled by clk-sam9x60-pll.c driver. The round rate function for this
driver is sam9x60_pll_round_rate() which call in turn
sam9x60_pll_get_best_div_mul(). In case the requested rate is not in the
proper range (rate < characteristics->output[0].min &&
rate > characteristics->output[0].max) the sam9x60_pll_round_rate() will
return a negative number to its caller (called by
clk_core_round_rate_nolock()). clk_hw_round_rate() will return zero in
case a negative number is returned by clk_core_round_rate_nolock(). With
this, the USB clock will continue its rate computation even caller of
clk_hw_round_rate() returned an error. With this, the USB clock on SAM9X60
may not chose the best parent. I detected this after a suspend/resume
cycle on SAM9X60.

Signed-off-by: Claudiu Beznea <claudiu.beznea@microchip.com>
Link: https://lkml.kernel.org/r/1579261009-4573-2-git-send-email-claudiu.beznea@microchip.com
Signed-off-by: Stephen Boyd <sboyd@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2020-04-23 10:36:28 +02:00
..
Makefile clk: at91: add sam9x60 pmc driver 2019-04-25 14:15:53 -07:00
at91sam9rl.c clk: at91: fix possible deadlock 2020-01-12 12:21:34 +01:00
at91sam9x5.c clk: at91: fix possible deadlock 2020-01-12 12:21:34 +01:00
at91sam9260.c clk: at91: fix possible deadlock 2020-01-12 12:21:34 +01:00
clk-audio-pll.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 152 2019-05-30 11:26:32 -07:00
clk-generated.c clk: at91: generated: Truncate divisor to GENERATED_MAX_DIV + 1 2019-07-22 14:32:08 -07:00
clk-h32mx.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 152 2019-05-30 11:26:32 -07:00
clk-i2s-mux.c clk: at91: move DT compatibility code to its own file 2018-10-17 10:45:39 -07:00
clk-main.c clk: at91: avoid sleeping early 2019-10-28 07:55:01 -07:00
clk-master.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 152 2019-05-30 11:26:32 -07:00
clk-peripheral.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 152 2019-05-30 11:26:32 -07:00
clk-pll.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 152 2019-05-30 11:26:32 -07:00
clk-plldiv.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 152 2019-05-30 11:26:32 -07:00
clk-programmable.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 152 2019-05-30 11:26:32 -07:00
clk-sam9x60-pll.c clk: at91: add sam9x60 PLL driver 2019-04-25 12:34:06 -07:00
clk-slow.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 152 2019-05-30 11:26:32 -07:00
clk-smd.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 152 2019-05-30 11:26:32 -07:00
clk-system.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 152 2019-05-30 11:26:32 -07:00
clk-usb.c clk: at91: usb: continue if clk_hw_round_rate() return zero 2020-04-23 10:36:28 +02:00
clk-utmi.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 152 2019-05-30 11:26:32 -07:00
dt-compat.c clk: at91: allow configuring generated PCR layout 2019-04-25 12:34:03 -07:00
pmc.c clk: at91: fix possible deadlock 2020-01-12 12:21:34 +01:00
pmc.h treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 152 2019-05-30 11:26:32 -07:00
sam9x60.c clk: at91: sam9x60: fix usb clock parents 2020-04-21 09:04:53 +02:00
sama5d2.c clk: at91: fix possible deadlock 2020-01-12 12:21:34 +01:00
sama5d4.c clk: at91: fix possible deadlock 2020-01-12 12:21:34 +01:00
sckc.c clk: at91: avoid sleeping early 2019-10-28 07:55:01 -07:00