dpll: fix LLM nit picks from the spec scan
Subsystems (4)
Jakub Kicinski
maintainercover dpll: fix LLM nit picks from the spec scan
Fix issues found by an LLM scan of the Netlink spec for DPLL.
Jakub Kicinski (3):
dpll: do not truncate the requested pin frequency before checking it
netlink: specs: dpll: declare pad in the nests which carry 64-bit
values
netlink: specs: dpll: drop the reference to DPLL_MODE_DETACHED
Documentation/netlink/specs/dpll.yaml | 7 +++++-- include/uapi/linux/dpll.h | 3 +-- drivers/dpll/dpll_netlink.c | 2 +- 3 files changed, 7 insertions(+), 5 deletions(-)
Signature · 1 line
2.55.0
Jakub Kicinski
maintainerPATCH 1/3 dpll: do not truncate the requested pin frequency before checking it
DPLL_A_PIN_FREQUENCY is a u64 on the wire and dpll_pin_freq_set() keeps it as one, but dpll_pin_is_freq_supported() takes a u32 while the ranges it compares against are u64. The supported-frequency check therefore only looks at the low 32 bits, and the full value is what reaches the driver.
Nothing is hitting this today. Reaching it at all needs a pin-set above U32_MAX, which no sane caller sends, and the outcome is mild: a pin advertising 10 kHz accepts 0x1_0000_2710, ice narrows it straight back to 10 kHz in ice_dpll_pin_freq_set(), so the hardware still ends up on an advertised frequency and only the "frequency is not supported by the device" rejection goes missing. The other direction - a legitimate request above U32_MAX wrapping out of the pin's range - needs a driver advertising such a range, and none does; zl3073x_pin_check_freq() refuses one outright.
So this is types rather than a live bug. Widen the check to match the attribute, the ranges and the driver callback instead of adding a U32_MAX rejection, so that the second case stays right if such a driver appears. dpll_pin_esync_set() already keeps u64 throughout its equivalent loop.
--- drivers/dpll/dpll_netlink.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/dpll/dpll_netlink.c +1 -1
@@ -608,7 +608,7 @@ dpll_msg_add_pin_ref_sync(struct sk_buff *msg, struct dpll_pin *pin,return -EMSGSIZE ; } -static bool dpll_pin_is_freq_supported (struct dpll_pin *pin,u32 freq) +static bool dpll_pin_is_freq_supported (struct dpll_pin *pin,u64 freq) {int fs;
Signature · 1 line
2.55.0
Re: [PATCH net-next 1/3] dpll: do not truncate the requested pin frequency before checking it
Quoted 29 lines · Jakub Kicinski
DPLL_A_PIN_FREQUENCYis a u64 on the wire anddpll_pin_freq_set()keeps it as one, butdpll_pin_is_freq_supported()takes a u32 while the ranges it compares against are u64. The supported-frequency check therefore only looks at the low 32 bits, and the full value is what reaches the driver.Nothing is hitting this today. Reaching it at all needs a pin-set above
U32_MAX, which no sane caller sends, and the outcome is mild: a pin advertising 10 kHz accepts 0x1_0000_2710, ice narrows it straight back to 10 kHz inice_dpll_pin_freq_set(), so the hardware still ends up on an advertised frequency and only the "frequency is not supported by the device" rejection goes missing. The other direction - a legitimate request aboveU32_MAXwrapping out of the pin's range - needs a driver advertising such a range, and none does;zl3073x_pin_check_freq()refuses one outright.So this is types rather than a live bug. Widen the check to match the attribute, the ranges and the driver callback instead of adding a
U32_MAXrejection, so that the second case stays right if such a driver appears.dpll_pin_esync_set()already keeps u64 throughout its equivalent loop.Signed-off-by Jakub Kicinski <[email protected]>--- drivers/dpll/dpll_netlink.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/dpll/dpll_netlink.c +0
-0
drivers/dpll/dpll_netlink.c dpll_msg_add_pin_ref_sync(struct sk_buff *msg, struct dpll_pin *pin, · line 614
Quoted 8 lines
drivers/dpll/dpll_netlink.c +1
-1@@ -608,7 +608,7 @@ dpll_msg_add_pin_ref_sync(struct sk_buff *msg, struct dpll_pin *pin,return -EMSGSIZE ; } -static bool dpll_pin_is_freq_supported (struct dpll_pin *pin,u32 freq) +static bool dpll_pin_is_freq_supported (struct dpll_pin *pin,u64 freq) {int fs;
Jakub Kicinski
maintainerPATCH 2/3 netlink: specs: dpll: declare pad in the nests which carry 64-bit values
In reply to Jakub KicinskiPads need to be propagated to subsets if they are used. Otherwise Python YNL can fail with:
YnlException: Space 'frequency-range' has no attribute with value '4'
This affects only platforms which care about alignment so not much real impact.
--- Documentation/netlink/specs/dpll.yaml | 4 ++++ 1 file changed, 4 insertions(+)
Documentation/netlink/specs/dpll.yaml +4 -0
@@ -550,6 +550,8 @@ doc: DPLL subsystem. attributes: - name: parent-id + - + name: pad - name: direction -
@@ -576,6 +578,8 @@ doc: DPLL subsystem. name: frequency-range subset-of: pin attributes: + - + name: pad - name: frequency-min -
Signature · 1 line
2.55.0
Re: [PATCH net-next 2/3] netlink: specs: dpll: declare pad in the nests which carry 64-bit values
Quoted 27 lines · Jakub Kicinski
Pads need to be propagated to subsets if they are used. Otherwise Python YNL can fail with:
YnlException: Space 'frequency-range' has no attribute with value '4'
This affects only platforms which care about alignment so not much real impact.
Signed-off-by Jakub Kicinski <[email protected]>--- Documentation/netlink/specs/dpll.yaml | 4 ++++ 1 file changed, 4 insertions(+)Documentation/netlink/specs/dpll.yaml +2
-0@@ -550,6 +550,8 @@ doc: DPLL subsystem. attributes: - name: parent-id + - + name: pad - name: direction -
Documentation/netlink/specs/dpll.yaml doc: DPLL subsystem. · line 585
Quoted 8 lines
Documentation/netlink/specs/dpll.yaml +2
-0@@ -576,6 +578,8 @@ doc: DPLL subsystem. name: frequency-range subset-of: pin attributes: + - + name: pad - name: frequency-min -
Jakub Kicinski
maintainerPATCH 3/3 netlink: specs: dpll: drop the reference to DPLL_MODE_DETACHED
In reply to Jakub KicinskiThe lock-status doc tells userspace that DPLL_LOCK_STATUS_UNLOCKED can be forced by setting DPLL_A_MODE to DPLL_MODE_DETACHED. But no such value has been defined so far. enum dpll_mode has only MANUAL and AUTOMATIC. Let's make sure the doc reflects current reality.
--- Documentation/netlink/specs/dpll.yaml | 3 +-- include/uapi/linux/dpll.h | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-)
Documentation/netlink/specs/dpll.yaml +1 -2
@@ -31,8 +31,7 @@ doc: DPLL subsystem. - name: unlocked doc: | - dpll was not yet locked to any valid input (or forced by setting - DPLL_A_MODE to DPLL_MODE_DETACHED) + dpll was not yet locked to any valid input value: 1 - name: locked
include/uapi/linux/dpll.h +1 -2
@@ -29,8 +29,7 @@ enum dpll_mode {/** * enum dpll_lock_status - provides information of dpll device lock status, * valid values for DPLL_A_LOCK_STATUS attribute -* @DPLL_LOCK_STATUS_UNLOCKED: dpll was not yet locked to any valid input (or -* forced by setting DPLL_A_MODE to DPLL_MODE_DETACHED) +* @DPLL_LOCK_STATUS_UNLOCKED: dpll was not yet locked to any valid input * @DPLL_LOCK_STATUS_LOCKED: dpll is locked to a valid signal, but no holdover * available * @DPLL_LOCK_STATUS_LOCKED_HO_ACQ: dpll is locked and holdover acquired
Signature · 1 line
2.55.0
Re: [PATCH net-next 3/3] netlink: specs: dpll: drop the reference to DPLL_MODE_DETACHED
Quoted 31 lines · Jakub Kicinski
The lock-status doc tells userspace that
DPLL_LOCK_STATUS_UNLOCKEDcan be forced by settingDPLL_A_MODEtoDPLL_MODE_DETACHED. But no such value has been defined so far. enumdpll_modehas only MANUAL and AUTOMATIC. Let's make sure the doc reflects current reality.Signed-off-by Jakub Kicinski <[email protected]>--- Documentation/netlink/specs/dpll.yaml | 3 +-- include/uapi/linux/dpll.h | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-)Documentation/netlink/specs/dpll.yaml +1
-2@@ -31,8 +31,7 @@ doc: DPLL subsystem. - name: unlocked doc: | - dpll was not yet locked to any valid input (or forced by setting - DPLL_A_MODE to DPLL_MODE_DETACHED) + dpll was not yet locked to any valid input value: 1 - name: lockedinclude/uapi/linux/dpll.h +0
-0
include/uapi/linux/dpll.h enum dpll_mode { · line 35
Quoted 9 lines
include/uapi/linux/dpll.h +1
-2@@ -29,8 +29,7 @@ enum dpll_mode {/** * enum dpll_lock_status - provides information of dpll device lock status, * valid values for DPLL_A_LOCK_STATUS attribute -* @DPLL_LOCK_STATUS_UNLOCKED: dpll was not yet locked to any valid input (or -* forced by setting DPLL_A_MODE to DPLL_MODE_DETACHED) +* @DPLL_LOCK_STATUS_UNLOCKED: dpll was not yet locked to any valid input * @DPLL_LOCK_STATUS_LOCKED: dpll is locked to a valid signal, but no holdover * available * @DPLL_LOCK_STATUS_LOCKED_HO_ACQ: dpll is locked and holdover acquired
This series was applied to netdev/net-next.git (main) by Jakub Kicinski <[email protected]>:
Hello:
This series was applied to netdev/net-next.git (main) by Jakub Kicinski <[email protected]>:
Quoted 9 lines · On Thu, 24 Sep 2026 16:12:08 -0700 you wrote:
Fix issues found by an LLM scan of the Netlink spec for DPLL.
Jakub Kicinski (3):
dpll: do not truncate the requested pin frequency before checking it
netlink: specs: dpll: declare pad in the nests which carry 64-bit
values
netlink: specs: dpll: drop the reference toDPLL_MODE_DETACHED[...]
Here is the summary with links:
- [net-next,1/3] dpll: do not truncate the requested pin frequency before checking it
https://git.kernel.org/netdev/net-next/c/7f92b7f381ff - [net-next,2/3] netlink: specs: dpll: declare pad in the nests which carry 64-bit values https://git.kernel.org/netdev/net-next/c/398f802dba01 - [net-next,3/3] netlink: specs: dpll: drop the reference to DPLL_MODE_DETACHED https://git.kernel.org/netdev/net-next/c/863da457b407
You are awesome, thank you!
Signature · 2 lines
Deet-doot-dot, I am a bot. https://korg.docs.kernel.org/patchwork/pwbot.html