linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH AUTOSEL 4.19 01/40] clk: at91: usb: continue if clk_hw_round_rate() return zero
@ 2020-04-15 11:45 Sasha Levin
  2020-04-15 11:45 ` [PATCH AUTOSEL 4.19 02/40] power: supply: bq27xxx_battery: Silence deferred-probe error Sasha Levin
                   ` (38 more replies)
  0 siblings, 39 replies; 40+ messages in thread
From: Sasha Levin @ 2020-04-15 11:45 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: Claudiu Beznea, Stephen Boyd, Sasha Levin, linux-clk, linux-arm-kernel

From: Claudiu Beznea <claudiu.beznea@microchip.com>

[ Upstream commit b0ecf1c6c6e82da4847900fad0272abfd014666d ]

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>
---
 drivers/clk/at91/clk-usb.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/clk/at91/clk-usb.c b/drivers/clk/at91/clk-usb.c
index 791770a563fcc..6fac6383d024e 100644
--- a/drivers/clk/at91/clk-usb.c
+++ b/drivers/clk/at91/clk-usb.c
@@ -78,6 +78,9 @@ static int at91sam9x5_clk_usb_determine_rate(struct clk_hw *hw,
 			tmp_parent_rate = req->rate * div;
 			tmp_parent_rate = clk_hw_round_rate(parent,
 							   tmp_parent_rate);
+			if (!tmp_parent_rate)
+				continue;
+
 			tmp_rate = DIV_ROUND_CLOSEST(tmp_parent_rate, div);
 			if (tmp_rate < req->rate)
 				tmp_diff = req->rate - tmp_rate;
-- 
2.20.1


^ permalink raw reply related	[flat|nested] 40+ messages in thread

end of thread, other threads:[~2020-04-15 12:17 UTC | newest]

Thread overview: 40+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-04-15 11:45 [PATCH AUTOSEL 4.19 01/40] clk: at91: usb: continue if clk_hw_round_rate() return zero Sasha Levin
2020-04-15 11:45 ` [PATCH AUTOSEL 4.19 02/40] power: supply: bq27xxx_battery: Silence deferred-probe error Sasha Levin
2020-04-15 11:45 ` [PATCH AUTOSEL 4.19 03/40] clk: tegra: Fix Tegra PMC clock out parents Sasha Levin
2020-04-15 11:45 ` [PATCH AUTOSEL 4.19 04/40] soc: imx: gpc: fix power up sequencing Sasha Levin
2020-04-15 11:45 ` [PATCH AUTOSEL 4.19 05/40] rtc: 88pm860x: fix possible race condition Sasha Levin
2020-04-15 11:45 ` [PATCH AUTOSEL 4.19 06/40] NFSv4/pnfs: Return valid stateids in nfs_layout_find_inode_by_stateid() Sasha Levin
2020-04-15 11:45 ` [PATCH AUTOSEL 4.19 07/40] NFS: direct.c: Fix memory leak of dreq when nfs_get_lock_context fails Sasha Levin
2020-04-15 11:45 ` [PATCH AUTOSEL 4.19 08/40] s390/cpuinfo: fix wrong output when CPU0 is offline Sasha Levin
2020-04-15 11:45 ` [PATCH AUTOSEL 4.19 09/40] btrfs: handle NULL roots in btrfs_put/btrfs_grab_fs_root Sasha Levin
2020-04-15 11:45 ` [PATCH AUTOSEL 4.19 10/40] powerpc/maple: Fix declaration made after definition Sasha Levin
2020-04-15 11:45 ` [PATCH AUTOSEL 4.19 11/40] s390/cpum_sf: Fix wrong page count in error message Sasha Levin
2020-04-15 11:45 ` [PATCH AUTOSEL 4.19 12/40] ext4: do not commit super on read-only bdev Sasha Levin
2020-04-15 11:45 ` [PATCH AUTOSEL 4.19 13/40] ext4: fix incorrect group count in ext4_fill_super error message Sasha Levin
2020-04-15 11:45 ` [PATCH AUTOSEL 4.19 14/40] ext4: fix incorrect inodes per group in " Sasha Levin
2020-04-15 11:45 ` [PATCH AUTOSEL 4.19 15/40] um: ubd: Prevent buffer overrun on command completion Sasha Levin
2020-04-15 11:45 ` [PATCH AUTOSEL 4.19 16/40] cifs: Allocate encryption header through kmalloc Sasha Levin
2020-04-15 11:46 ` [PATCH AUTOSEL 4.19 17/40] slcan: Don't transmit uninitialized stack data in padding Sasha Levin
2020-04-15 11:46 ` [PATCH AUTOSEL 4.19 18/40] net: qualcomm: rmnet: Allow configuration updates to existing devices Sasha Levin
2020-04-15 11:46 ` [PATCH AUTOSEL 4.19 19/40] net: stmmac: dwmac1000: fix out-of-bounds mac address reg setting Sasha Levin
2020-04-15 11:46 ` [PATCH AUTOSEL 4.19 20/40] net: dsa: bcm_sf2: Do not register slave MDIO bus with OF Sasha Levin
2020-04-15 11:46 ` [PATCH AUTOSEL 4.19 21/40] include/linux/swapops.h: correct guards for non_swap_entry() Sasha Levin
2020-04-15 11:46 ` [PATCH AUTOSEL 4.19 22/40] percpu_counter: fix a data race at vm_committed_as Sasha Levin
2020-04-15 11:46 ` [PATCH AUTOSEL 4.19 23/40] compiler.h: fix error in BUILD_BUG_ON() reporting Sasha Levin
2020-04-15 11:46 ` [PATCH AUTOSEL 4.19 24/40] KVM: s390: vsie: Fix possible race when shadowing region 3 tables Sasha Levin
2020-04-15 11:46 ` [PATCH AUTOSEL 4.19 25/40] net: dsa: bcm_sf2: Ensure correct sub-node is parsed Sasha Levin
2020-04-15 11:46 ` [PATCH AUTOSEL 4.19 26/40] x86: ACPI: fix CPU hotplug deadlock Sasha Levin
2020-04-15 11:46 ` [PATCH AUTOSEL 4.19 27/40] net: phy: micrel: kszphy_resume(): add delay after genphy_resume() before accessing PHY registers Sasha Levin
2020-04-15 11:46 ` [PATCH AUTOSEL 4.19 28/40] drm/amdkfd: kfree the wrong pointer Sasha Levin
2020-04-15 11:46 ` [PATCH AUTOSEL 4.19 29/40] NFS: Fix memory leaks in nfs_pageio_stop_mirroring() Sasha Levin
2020-04-15 11:46 ` [PATCH AUTOSEL 4.19 30/40] f2fs: fix NULL pointer dereference in f2fs_write_begin() Sasha Levin
2020-04-15 11:46 ` [PATCH AUTOSEL 4.19 31/40] mfd: dln2: Fix sanity checking for endpoints Sasha Levin
2020-04-15 11:46 ` [PATCH AUTOSEL 4.19 32/40] drm/vc4: Fix HDMI mode validation Sasha Levin
2020-04-15 11:46 ` [PATCH AUTOSEL 4.19 33/40] iommu/vt-d: Fix mm reference leak Sasha Levin
2020-04-15 11:46 ` [PATCH AUTOSEL 4.19 34/40] ext2: fix empty body warnings when -Wextra is used Sasha Levin
2020-04-15 11:46 ` [PATCH AUTOSEL 4.19 35/40] ovl: fix value of i_ino for lower hardlink corner case Sasha Levin
2020-04-15 11:46 ` [PATCH AUTOSEL 4.19 36/40] ext2: fix debug reference to ext2_xattr_cache Sasha Levin
2020-04-15 11:46 ` [PATCH AUTOSEL 4.19 37/40] power: supply: axp288_fuel_gauge: Broaden vendor check for Intel Compute Sticks Sasha Levin
2020-04-15 11:46 ` [PATCH AUTOSEL 4.19 38/40] libnvdimm: Out of bounds read in __nd_ioctl() Sasha Levin
2020-04-15 11:46 ` [PATCH AUTOSEL 4.19 39/40] iommu/amd: Fix the configuration of GCR3 table root pointer Sasha Levin
2020-04-15 11:46 ` [PATCH AUTOSEL 4.19 40/40] f2fs: fix to wait all node page writeback Sasha Levin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).