Skip to content

Fix to clk framework while handling orphan clks

Ambresh K linux-arm-kernel linux-omap lkml 2 versions – New

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest3 patches 0 repliesNew
  2. v13 patches 1 replySuperseded

Changes in v2 from the cover letter

- Fixed review comments.
- Fixed return type of .get_parent callback function.

Patches in v2 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/3clk: fix clk_mux_get_parent return's signed valuedrivers/clk/clk-mux.c drivers/clk/clk.c include/linux/clk-provider.h+15 -50 replies
2/3clk: skip re-parenting orphan clkdrivers/clk/clk.c+4 -00 replies
3/3ARM: OMAP2+: clk: Fix return type of callbacksarch/arm/mach-omap2/clkt_clksel.c arch/arm/mach-omap2/clkt_dpll.c arch/arm/mach-omap2/clock.h+4 -42 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v2 yet.

Read the v2 thread

Cover letter [PATCH V2 0/3] Fix to clk framework while handling orphan clks

From: Ambresh K <[email protected]>

On a possible HW bug or in-correct configuration of MUX register's in bootloader; might return a value greater than available parent clocks for a MUX clk.
Sensing invalid parent index, clk_mux_get_parent returns -EINVALID. Due to function's "u8" return type it will get converted into signed value, thus causing following pointer dereference on test platform.

M[ 0.000000] dra7xx_clk_init: clk init (gpu_core_gclk_mux)^M
^M[ 0.000000] Unable to handle kernel NULL pointer dereference at virtual
address 00000000^M

^M[    0.000000] pgd = c0004000^M
^M[    0.000000] [00000000] *pgd=00000000^M
^M[    0.000000] Internal error: Oops: 5 [#1] SMP ARM^M
^M[    0.000000] Modules linked in:^M
^M[    0.000000] CPU: 0    Not tainted  (3.8.4-gb746a7c-dirty #59)^M
^M[    0.000000] PC is at strcmp+0x8/0x34^M

Changes since v1:
- Fixed review comments.
- Fixed return type of .get_parent callback function.

Ambresh K (3):
clk: fix clk_mux_get_parent return's signed value
clk: skip re-parenting orphan clk
ARM: OMAP2+: clk: Fix return type of callbacks

 arch/arm/mach-omap2/clkt_clksel.c |    2 +-
 arch/arm/mach-omap2/clkt_dpll.c   |    2 +-
 arch/arm/mach-omap2/clock.h       |    4 ++--
 drivers/clk/clk-mux.c             |    2 +-
 drivers/clk/clk.c                 |   16 +++++++++++++++-
 include/linux/clk-provider.h      |    6 +++---
 6 files changed, 23 insertions(+), 9 deletions(-)
Signature · 1 line
1.7.4.1