dpll: zl3073x: Refactor state management
Status from this message: This series was applied to netdev/net-next.git (main)
Get series with b4
b4 am [email protected]Versions newest first · linked by author and title
- v2 posting 2/26 patches 0 repliesApplied 6/6
- v3 Latest6 patches 0 repliesApplied 6/6
- v2 posting 1/26 patches 3 repliesSuperseded
Earlier versions · 1
| Version | Posted | Patches | Replies | Status |
|---|---|---|---|---|
| v1 | 6 patches | 0 replies | Superseded |
Changes in v3 from the cover letter
- replaced confusing memcpy in zl3073x_ref_state_fetch() [Vadim] v2:
- addressed issues found by patchwork bot (details in each patch)
Patches in v3 All 6 applied
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/6 | dpll: zl3073x: Store raw register values instead of parsed statedrivers/ drivers/ | +60 | 0 replies | Applied |
| 2/6 | dpll: zl3073x: Split ref, out, and synth logic from coredrivers/ drivers/ drivers/ +8 more | +584 | 0 replies | Applied |
| 3/6 | dpll: zl3073x: Cache reference monitor statusdrivers/ drivers/ drivers/ +1 more | +68 | 0 replies | Applied |
| 4/6 | dpll: zl3073x: Cache all reference properties in zl3073x_refdrivers/ drivers/ drivers/ +1 more | +239 | 0 replies | Applied |
| 5/6 | dpll: zl3073x: Cache all output properties in zl3073x_outdrivers/ drivers/ drivers/ | +193 | 0 replies | Applied |
| 6/6 | dpll: zl3073x: Remove unused dev wrappersdrivers/ | +0 | 0 replies | Applied |
Reviews trailers per patch
All 6 patches have a Reviewed-by or Acked-by.
| Patch | Petr Oros | Prathosh Satish |
|---|---|---|
| 1/6 | R-b | T-b |
| 2/6 | R-b | T-b |
| 3/6 | R-b | T-b |
| 4/6 | R-b | T-b |
| 5/6 | R-b | T-b |
| 6/6 | R-b | T-b |
Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.
Cover letter [PATCH net-next v3 0/6] dpll: zl3073x: Refactor state management
This patch set is a refactoring of the zl3073x driver to clean up state management, improve modularity, and significantly reduce on-demand I/O.
The driver's dpll.c implementation previously performed on-demand register reads and writes (wrapped in mailbox operations) to get or set properties like frequency, phase, and embedded-sync settings. This cluttered the DPLL logic with low-level I/O, duplicated locking, and led to inefficient bus traffic.
This series addresses this by:
1. Splitting the monolithic 'core.c' into logical units ('ref.c', 'out.c', 'synth.c').
2. Implementing a full read/write-back cache for 'zl3073x_ref' and 'zl3073x_out' structures.
All state is now read once during '_state_fetch()' (and status updated periodically). DPLL get callbacks read from this cache. Set callbacks modify a copy of the state, which is then committed via a new '..._state_set()' function. These '_state_set' functions compare the new state to the cached state and write *only* the modified register values back to the hardware, all within a single mailbox sequence.
The result is a much cleaner 'dpll.c' that is almost entirely free of direct register I/O, and all state logic is properly encapsulated in its respective file.
The series is broken down as follows:
* Patch 1: Changes the state structs to store raw register values (e.g., 'config', 'ctrl') instead of parsed booleans, centralizing parsing logic into the helpers.
* Patch 2: Splits the logic from 'core.c' into new 'ref.c', 'out.c' and 'synth.c' files, creating a 'zl3073x_dev_...' abstraction layer.
* Patch 3: Introduces the caching concept by reading and caching the reference monitor status periodically, removing scattered reads from 'dpll.c'.
* Patch 4: Expands the 'zl3073x_ref' struct to cache *all* reference properties and adds 'zl3073x_ref_state_set()' to write back changes.
* Patch 5: Does the same for the 'zl3073x_out' struct, caching all output properties and adding 'zl3073x_out_state_set()'.
* Patch 6: A final cleanup that removes the 'zl3073x_dev_...' wrapper functions that became redundant after the refactoring.
Changes:
v3:
- replaced confusing memcpy in zl3073x_ref_state_fetch() [Vadim] v2:
- addressed issues found by patchwork bot (details in each patch)
Ivan Vecera (6):
dpll: zl3073x: Store raw register values instead of parsed state
dpll: zl3073x: Split ref, out, and synth logic from core
dpll: zl3073x: Cache reference monitor status
dpll: zl3073x: Cache all reference properties in zl3073x_ref
dpll: zl3073x: Cache all output properties in zl3073x_out
dpll: zl3073x: Remove unused dev wrappers
drivers/dpll/zl3073x/Makefile | 3 +- drivers/dpll/zl3073x/core.c | 243 +---------- drivers/dpll/zl3073x/core.h | 184 +++----- drivers/dpll/zl3073x/dpll.c | 776 ++++++++-------------------------- drivers/dpll/zl3073x/out.c | 157 +++++++ drivers/dpll/zl3073x/out.h | 93 ++++ drivers/dpll/zl3073x/prop.c | 12 +- drivers/dpll/zl3073x/ref.c | 204 +++++++++ drivers/dpll/zl3073x/ref.h | 134 ++++++ drivers/dpll/zl3073x/synth.c | 87 ++++ drivers/dpll/zl3073x/synth.h | 72 ++++ 11 files changed, 1019 insertions(+), 946 deletions(-) create mode 100644 drivers/dpll/zl3073x/out.c create mode 100644 drivers/dpll/zl3073x/out.h create mode 100644 drivers/dpll/zl3073x/ref.c create mode 100644 drivers/dpll/zl3073x/ref.h create mode 100644 drivers/dpll/zl3073x/synth.c create mode 100644 drivers/dpll/zl3073x/synth.h
Signature · 1 line
2.51.0