clk : Fix SOCFPGA clk crash and some clean up
Get series with b4
b4 am [email protected]Versions newest first
- v1 Latest3 patches 4 repliesIn review
Patches in v1 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/3 | clk : Clean up checkpatch warningsdrivers/ | +18 | 1 reply | |
| 2/3 | clk: Prevent a hanging pointer being abuseddrivers/ | +4 | 1 reply | |
| 3/3 | clk: socfpga Change name look-up to not use the init pointerdrivers/ drivers/ drivers/ +1 more | +53 | 0 replies |
Reviews trailers per patch
2 of 3 patches have a Reviewed-by or Acked-by.
| Patch | Pavel Machek |
|---|---|
| 1/3 | A-b |
| 2/3 | A-b |
| 3/3 |
Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.
Cover letter [PATCH 0/3] clk : Fix SOCFPGA clk crash and some clean up
After some digging into a crash on the SOCFPGA initialisation it was determined that this was due to the SOCFPGA's name look-up dereferencing the clock init pointer. This is a bad thing to do because the init data is constructed on the stack and thus a pointer to the init data is no longer valid after clk_register() has been called.
Most, if not all, drivers create the init data on the stack. Thus init pointer should not be left hanging after it has been used in clk_register. Thus one of these patches NULLs the pointer so it can't be abused.
In the long term, it would be way, way better to pass the init pointer as an argument rather than as a pointer in hw.
Charles Manning (3):
clk : Clean up checkpatch warnings
clk: Prevent a hanging pointer being abused
clk: socfpga Change name look-up to not use the init pointer
drivers/clk/clk.c | 37 +++++++++++++++++++-------------- drivers/clk/socfpga/clk-gate.c | 44 ++++++++++++++++++++++++++-------------- drivers/clk/socfpga/clk-periph.c | 16 ++++++++++----- drivers/clk/socfpga/clk-pll.c | 13 ++++++++---- drivers/clk/socfpga/clk.h | 7 ++++--- 5 files changed, 75 insertions(+), 42 deletions(-)
Signature · 1 line
1.9.1