Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge tag 'clk-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/clk/linux

Pull clk fixes from Stephen Boyd:
"Here's a collection of primarily clk driver fixes, with a couple fixes
to the core framework.

We had to revert out a commit that affected boot on some devices that
have the CLK_OPS_PARENT_ENABLE flag set. It isn't critical to have
that fix so we'll try again next time.

Driver side fixes include:

- Plug an OF-node refcount bug in the TI clk driver

- Fix the error handling in the raspberry pi firmware get_rate so
that errors don't look like valid frequencies

- Avoid going out of bounds in the raspberry pi driver too if the
video firmware returns something we're not expecting"

* tag 'clk-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/clk/linux:
Revert "clk: core: Honor CLK_OPS_PARENT_ENABLE for clk gate ops"
clk: bcm: rpi: Show clock id limit in error case
clk: bcm: rpi: Add missing newline
clk: bcm: rpi: Prevent out-of-bounds access
clk: bcm: rpi: Fix error handling of raspberrypi_fw_get_rate
clk: core: Fix runtime PM sequence in clk_core_unprepare()
clk: core: Honor CLK_OPS_PARENT_ENABLE for clk gate ops
clk: ti: Fix missing of_node_get() ti_find_clock_provider()

+13 -7
+11 -5
drivers/clk/bcm/clk-raspberrypi.c
··· 203 203 ret = raspberrypi_clock_property(rpi->firmware, data, 204 204 RPI_FIRMWARE_GET_CLOCK_RATE, &val); 205 205 if (ret) 206 - return ret; 206 + return 0; 207 207 208 208 return val; 209 209 } ··· 220 220 ret = raspberrypi_clock_property(rpi->firmware, data, 221 221 RPI_FIRMWARE_SET_CLOCK_RATE, &_rate); 222 222 if (ret) 223 - dev_err_ratelimited(rpi->dev, "Failed to change %s frequency: %d", 223 + dev_err_ratelimited(rpi->dev, "Failed to change %s frequency: %d\n", 224 224 clk_hw_get_name(hw), ret); 225 225 226 226 return ret; ··· 288 288 RPI_FIRMWARE_GET_MIN_CLOCK_RATE, 289 289 &min_rate); 290 290 if (ret) { 291 - dev_err(rpi->dev, "Failed to get clock %d min freq: %d", 291 + dev_err(rpi->dev, "Failed to get clock %d min freq: %d\n", 292 292 id, ret); 293 293 return ERR_PTR(ret); 294 294 } ··· 344 344 struct rpi_firmware_get_clocks_response *clks; 345 345 int ret; 346 346 347 + /* 348 + * The firmware doesn't guarantee that the last element of 349 + * RPI_FIRMWARE_GET_CLOCKS is zeroed. So allocate an additional 350 + * zero element as sentinel. 351 + */ 347 352 clks = devm_kcalloc(rpi->dev, 348 - RPI_FIRMWARE_NUM_CLK_ID, sizeof(*clks), 353 + RPI_FIRMWARE_NUM_CLK_ID + 1, sizeof(*clks), 349 354 GFP_KERNEL); 350 355 if (!clks) 351 356 return -ENOMEM; ··· 365 360 struct raspberrypi_clk_variant *variant; 366 361 367 362 if (clks->id > RPI_FIRMWARE_NUM_CLK_ID) { 368 - dev_err(rpi->dev, "Unknown clock id: %u", clks->id); 363 + dev_err(rpi->dev, "Unknown clock id: %u (max: %u)\n", 364 + clks->id, RPI_FIRMWARE_NUM_CLK_ID); 369 365 return -EINVAL; 370 366 } 371 367
+1 -2
drivers/clk/clk.c
··· 840 840 if (core->ops->unprepare) 841 841 core->ops->unprepare(core->hw); 842 842 843 - clk_pm_runtime_put(core); 844 - 845 843 trace_clk_unprepare_complete(core); 846 844 clk_core_unprepare(core->parent); 845 + clk_pm_runtime_put(core); 847 846 } 848 847 849 848 static void clk_core_unprepare_lock(struct clk_core *core)
+1
drivers/clk/ti/clk.c
··· 135 135 continue; 136 136 137 137 if (!strncmp(n, tmp, strlen(tmp))) { 138 + of_node_get(np); 138 139 found = true; 139 140 break; 140 141 }