]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
dpll: zl3073x: fix REF_PHASE_OFFSET_COMP register width for some chip IDs
authorIvan Vecera <ivecera@redhat.com>
Fri, 20 Feb 2026 15:57:54 +0000 (16:57 +0100)
committerJakub Kicinski <kuba@kernel.org>
Tue, 24 Feb 2026 01:35:39 +0000 (17:35 -0800)
commit4cfe066a82cdf9e83e48b16000f55280efc98325
tree4bcc2e1b02f306b8b8deb3f5a861e89b0dc18142
parentca220141fa8ebae09765a242076b2b77338106b0
dpll: zl3073x: fix REF_PHASE_OFFSET_COMP register width for some chip IDs

The REF_PHASE_OFFSET_COMP register is 48-bit wide on most zl3073x chip
variants, but only 32-bit wide on chip IDs 0x0E30, 0x0E93..0x0E97 and
0x1F60. The driver unconditionally uses 48-bit read/write operations,
which on 32-bit variants causes reading 2 bytes past the register
boundary (corrupting the value) and writing 2 bytes into the adjacent
register.

Fix this by storing the chip ID in the device structure during probe
and adding a helper to detect the affected variants. Use the correct
register width for read/write operations and the matching sign extension
bit (31 vs 47) when interpreting the phase compensation value.

Fixes: 6287262f761e ("dpll: zl3073x: Add support to adjust phase")
Signed-off-by: Ivan Vecera <ivecera@redhat.com>
Reviewed-by: Simon Horman <horms@kernel.org>
Link: https://patch.msgid.link/20260220155755.448185-1-ivecera@redhat.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/dpll/zl3073x/core.c
drivers/dpll/zl3073x/core.h
drivers/dpll/zl3073x/dpll.c
drivers/dpll/zl3073x/ref.c
drivers/dpll/zl3073x/regs.h