From: Stephen Boyd Date: Mon, 26 Jun 2023 15:55:22 +0000 (-0700) Subject: Merge branches 'clk-imx', 'clk-microchip', 'clk-cleanup', 'clk-bindings', 'clk-ti... X-Git-Tag: v6.5-rc1~58^2~3 X-Git-Url: https://git.kernel.dk/?a=commitdiff_plain;h=b9a40506a2cb626da3f21c6d494a76879e3141d7;p=linux-block.git Merge branches 'clk-imx', 'clk-microchip', 'clk-cleanup', 'clk-bindings', 'clk-ti' and 'clk-kasprintf' into clk-next - Handle allocation failures from kasprintf() and friends * clk-imx: clk: imx: clk-imx8mp: improve error handling in imx8mp_clocks_probe() clk: imx93: fix memory leak and missing unwind goto in imx93_clocks_probe clk: imx: clk-imx8mn: fix memory leak in imx8mn_clocks_probe dt-bindings: clock: imx8m: Add missing interrupt property clk: imx: clk-imxrt1050: fix memory leak in imxrt1050_clocks_probe clk: imx: composite-8m: Add imx8m_divider_determine_rate clk: imx: scu: use _safe list iterator to avoid a use after free clk: imx: drop imx_unregister_clocks clk: imx6ul: retain early UART clocks during kernel init clk: imx: imx6sx: Remove CLK_SET_RATE_PARENT from the LDB clocks * clk-microchip: dt-bindings: clocks: at91sam9x5-sckc: convert to yaml dt-bindings: clocks: atmel,at91rm9200-pmc: convert to yaml clk: microchip: Use of_property_read_bool() for boolean properties clk: microchip: convert SOC_MICROCHIP_POLARFIRE to ARCH_MICROCHIP_POLARFIRE * clk-cleanup: clk: fix typo in clk_hw_register_fixed_rate_parent_data() macro clk: Fix memory leak in devm_clk_notifier_register() clk: mvebu: Iterate over possible CPUs instead of DT CPU nodes clk: mvebu: Use of_get_cpu_hwid() to read CPU ID MAINTAINERS: Add Marvell mvebu clock drivers clk: mvebu: Use of_address_to_resource() clk: tegra: tegra124-emc: Fix potential memory leak clk: clocking-wizard: Fix Oops in clk_wzrd_register_divider() clk: bcm: rpi: Fix off by one in raspberrypi_discover_clocks() clk: sifive: Use devm_platform_ioremap_resource() * clk-bindings: dt-bindings: clock: drop unneeded quotes and use absolute /schemas path dt-bindings: rcc: stm32: Sync with u-boot copy for STM32MP13 SoC * clk-ti: clk: keystone: syscon-clk: Add support for audio refclk dt-bindings: clock: Add binding documentation for TI Audio REFCLK dt-bindings: clock: ehrpwm: Remove unneeded syscon compatible clk: keystone: syscon-clk: Allow the clock node to not be of type syscon * clk-kasprintf: clk: clocking-wizard: check return value of devm_kasprintf() clk: ti: clkctrl: check return value of kasprintf() clk: keystone: sci-clk: check return value of kasprintf() clk: si5341: free unused memory on probe failure clk: si5341: check return value of {devm_}kasprintf() clk: si5341: return error if one synth clock registration fails clk: cdce925: check return value of kasprintf() clk: vc5: check memory returned by kasprintf() --- b9a40506a2cb626da3f21c6d494a76879e3141d7 diff --cc drivers/clk/clk.c index 7ac9f7a8cb84,27c30a533759,27c30a533759,ce9dbef314d5,27c30a533759,27c30a533759,27c30a533759..c249f9791ae8 --- a/drivers/clk/clk.c +++ b/drivers/clk/clk.c @@@@@@@@ -594,59 -594,45 -594,45 -594,45 -594,45 -594,45 -594,45 +594,59 @@@@@@@@ clk_core_forward_rate_req(struct clk_co req->max_rate = old_req->max_rate; } ------int clk_mux_determine_rate_flags(struct clk_hw *hw, ------ struct clk_rate_request *req, ------ unsigned long flags) ++++++static int ++++++clk_core_determine_rate_no_reparent(struct clk_hw *hw, ++++++ struct clk_rate_request *req) { ------ struct clk_core *core = hw->core, *parent, *best_parent = NULL; ------ int i, num_parents, ret; ------ unsigned long best = 0; -- --- -- --- /* if NO_REPARENT flag set, pass through to current parent */ -- --- if (core->flags & CLK_SET_RATE_NO_REPARENT) { -- --- parent = core->parent; -- --- if (core->flags & CLK_SET_RATE_PARENT) { -- --- struct clk_rate_request parent_req; ++++++ struct clk_core *core = hw->core; ++++++ struct clk_core *parent = core->parent; ++++++ unsigned long best; ++++++ int ret; -- --- if (!parent) { -- --- req->rate = 0; -- --- return 0; -- --- } - /* if NO_REPARENT flag set, pass through to current parent */ - if (core->flags & CLK_SET_RATE_NO_REPARENT) { - parent = core->parent; - if (core->flags & CLK_SET_RATE_PARENT) { - struct clk_rate_request parent_req; ++++++ if (core->flags & CLK_SET_RATE_PARENT) { ++++++ struct clk_rate_request parent_req; -- --- clk_core_forward_rate_req(core, req, parent, &parent_req, req->rate); - if (!parent) { - req->rate = 0; - return 0; - } ++++++ if (!parent) { ++++++ req->rate = 0; ++++++ return 0; ++++++ } -- --- trace_clk_rate_request_start(&parent_req); - clk_core_forward_rate_req(core, req, parent, &parent_req, req->rate); ++++++ clk_core_forward_rate_req(core, req, parent, &parent_req, ++++++ req->rate); - trace_clk_rate_request_start(&parent_req); - ------ ret = clk_core_round_rate_nolock(parent, &parent_req); ------ if (ret) ------ return ret; ++++++ trace_clk_rate_request_start(&parent_req); ------ trace_clk_rate_request_done(&parent_req); ++++++ ret = clk_core_round_rate_nolock(parent, &parent_req); ++++++ if (ret) ++++++ return ret; ------ best = parent_req.rate; ------ } else if (parent) { ------ best = clk_core_get_rate_nolock(parent); ------ } else { ------ best = clk_core_get_rate_nolock(core); ------ } ++++++ trace_clk_rate_request_done(&parent_req); ------ goto out; ++++++ best = parent_req.rate; ++++++ } else if (parent) { ++++++ best = clk_core_get_rate_nolock(parent); ++++++ } else { ++++++ best = clk_core_get_rate_nolock(core); } ++++++ req->best_parent_rate = best; ++++++ req->rate = best; ++++++ ++++++ return 0; ++++++} ++++++ ++++++int clk_mux_determine_rate_flags(struct clk_hw *hw, ++++++ struct clk_rate_request *req, ++++++ unsigned long flags) ++++++{ ++++++ struct clk_core *core = hw->core, *parent, *best_parent = NULL; ++++++ int i, num_parents, ret; ++++++ unsigned long best = 0; ++++++ ++++++ /* if NO_REPARENT flag set, pass through to current parent */ ++++++ if (core->flags & CLK_SET_RATE_NO_REPARENT) ++++++ return clk_core_determine_rate_no_reparent(hw, req); ++++++ /* find the parent that can provide the fastest rate <= rate */ num_parents = core->num_parents; for (i = 0; i < num_parents; i++) {