Skip to content

Commit 388d037

Browse files
committed
dpll: zl3073x: Handle missing or corrupted flash configuration
jira KERNEL-318 Rebuild_History Non-Buildable kernel-6.12.0-124.20.1.el10_1 commit-author Ivan Vecera <ivecera@redhat.com> commit fcb8b32 If the internal flash contains missing or corrupted configuration, basic communication over the bus still functions, but the device is not capable of normal operation (for example, using mailboxes). This condition is indicated in the info register by the ready bit. If this bit is cleared, the probe procedure times out while fetching the device state. Handle this case by checking the ready bit value in zl3073x_dev_start() and skipping DPLL device and pin registration if it is cleared. Do not report this condition as an error, allowing the devlink device to be registered and enabling the user to flash the correct configuration. Prior this patch: [ 31.112299] zl3073x-i2c 1-0070: Failed to fetch input state: -ETIMEDOUT [ 31.116332] zl3073x-i2c 1-0070: error -ETIMEDOUT: Failed to start device [ 31.136881] zl3073x-i2c 1-0070: probe with driver zl3073x-i2c failed with error -110 After this patch: [ 41.011438] zl3073x-i2c 1-0070: FW not fully ready - missing or corrupted config Fixes: 75a71ec ("dpll: zl3073x: Register DPLL devices and pins") Signed-off-by: Ivan Vecera <ivecera@redhat.com> Reviewed-by: Simon Horman <horms@kernel.org> Link: https://patch.msgid.link/20251008141445.841113-1-ivecera@redhat.com Signed-off-by: Jakub Kicinski <kuba@kernel.org> (cherry picked from commit fcb8b32) Signed-off-by: Jonathan Maple <jmaple@ciq.com>
1 parent 83d687b commit 388d037

File tree

2 files changed

+24
-0
lines changed

2 files changed

+24
-0
lines changed

drivers/dpll/zl3073x/core.c

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -864,8 +864,29 @@ zl3073x_dev_phase_meas_setup(struct zl3073x_dev *zldev)
864864
int zl3073x_dev_start(struct zl3073x_dev *zldev, bool full)
865865
{
866866
struct zl3073x_dpll *zldpll;
867+
u8 info;
867868
int rc;
868869

870+
rc = zl3073x_read_u8(zldev, ZL_REG_INFO, &info);
871+
if (rc) {
872+
dev_err(zldev->dev, "Failed to read device status info\n");
873+
return rc;
874+
}
875+
876+
if (!FIELD_GET(ZL_INFO_READY, info)) {
877+
/* The ready bit indicates that the firmware was successfully
878+
* configured and is ready for normal operation. If it is
879+
* cleared then the configuration stored in flash is wrong
880+
* or missing. In this situation the driver will expose
881+
* only devlink interface to give an opportunity to flash
882+
* the correct config.
883+
*/
884+
dev_info(zldev->dev,
885+
"FW not fully ready - missing or corrupted config\n");
886+
887+
return 0;
888+
}
889+
869890
if (full) {
870891
/* Fetch device state */
871892
rc = zl3073x_dev_state_fetch(zldev);

drivers/dpll/zl3073x/regs.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,9 @@
6767
* Register Page 0, General
6868
**************************/
6969

70+
#define ZL_REG_INFO ZL_REG(0, 0x00, 1)
71+
#define ZL_INFO_READY BIT(7)
72+
7073
#define ZL_REG_ID ZL_REG(0, 0x01, 2)
7174
#define ZL_REG_REVISION ZL_REG(0, 0x03, 2)
7275
#define ZL_REG_FW_VER ZL_REG(0, 0x05, 2)

0 commit comments

Comments
 (0)