From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=170.10.133.124 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796321213; b=GA9XINgJSrvsGSkG9a7XImdTYzzLMWY9hUlb0xiepQhJKVzcTg6QNdAkXAj35u4VWCk9 Qyplmyk2woG4X29JP72wW8KKV4WxkxN9GTLdm7ebtqeq9JYeU5/d7wkPjT383MiMMuLSf T4P8P+kjyV8c+ry1mSQVj3yPSFcc4QzKFBJXU9pS6IWQqzWxZ1MMVIeRobGdYGEshrqVG tN7m+hy2L32IpVZghhQF960eX/QCr4ndZu8SJ3mtf3dyN9ZFtL6MsWD8g2PqXi0Th+xoy VtwTiaalN6yQMMAdTFJppQv1dsHgR8DN3UcNE0yBDLUQlht9F7rkLP+qEGXWu9aUs8w== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796321213; h=DMARC-Filter:DKIM-Signature:Received:X-MC-Unique: X-Mimecast-MFC-AGG-ID:Received:Received:From:To:Cc:Subject:Date: Message-ID:In-Reply-To:References:MIME-Version: Content-Transfer-Encoding:X-Scanned-By; bh=6oBapNgjRbGqhPIvXR4aQMvKfropRwCORHKvXEx7kUQ=; b=l37v7VcYjAXIxKPtXt9ckpvDp0nIWO+4rePkLsqXgk1M0XRDFPLDvRezVlo1oPqiCaOf GiS0+qVinX8BHBjW5stPNOKcXGRNLF0FSABHikwKU4xlW+WY9L/qtK34EiJkmAEKWgtNZ RDZLW+gMKSx/mgSq+A+6ZseK2Aq6ervMTEiD6xemDeyJAmbYudElVjJsFnTNwD51lMwvD F/MS24h2k3jYw9rXKAALcLjUhn9NEK86agERvswPlpLLk0H/GMQfi3PygQGc1ZWu2aFyP 5bvhBLsokUpCzIo/s0oSCeCPtY8Qy4gDVlKTNERU9S/EDc3DAPAPO/ry/WLLUg9tOmg== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=cbiBGSgC; arc=none smtp.remote-ip=170.10.133.124 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 788B8606A32D for ; Thu, 3 Dec 2026 18:06:52 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 788B8606A32D Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=cbiBGSgC DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1796321212; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=6oBapNgjRbGqhPIvXR4aQMvKfropRwCORHKvXEx7kUQ=; b=cbiBGSgCsDcrcoLSwYJAxVTh1Rfgoou7YHPexzuUIRi3MUegF2hhlVoZfActunHZCCuop8 I2gC5kme0uLVgSvhSWLq90iwrSDNRgw+KRyEt+BzrFpR/T7bxiWPGLwZQX9cF5tOQDgL1o dC85qj2nWIX6ewiw7ilbI2b/dfeviLc= Received: from mx-prod-mc-03.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-618-zRdE98VfOoGoHGAwAOmpuA-1; Thu, 3 Dec 2026 18:06:45 +0000 X-MC-Unique: zRdE98VfOoGoHGAwAOmpuA-1 X-Mimecast-MFC-AGG-ID: zRdE98VfOoGoHGAwAOmpuA_1796321203 Received: from mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id C2591189D55A; Thu, 3 Dec 2026 18:06:42 +0000 (UTC) Received: from ivecera-thinkpadp16vgen1.tpbc.csb (headnet04.pony-001.prod.iad2.dc.redhat.com [10.2.32.116]) by mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id AAD993002D0F; Thu, 3 Dec 2026 18:06:38 +0000 (UTC) From: Ivan Vecera To: netdev@vger.kernel.org Cc: Jiri Pirko , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Simon Horman , Jonathan Corbet , Shuah Khan , Randy Dunlap , Min Li , Vadim Fedorenko , Arkadiusz Kubalewski , linux-doc@vger.kernel.org Subject: [PATCH net-next 2/3] dpll: zl3073x: always fetch device state on start Date: Thu, 3 Dec 2026 19:06:26 +0100 Message-ID: <20261203180627.215256-3-ivecera@redhat.com> In-Reply-To: <20261203180627.215256-1-ivecera@redhat.com> References: <20261203180627.215256-1-ivecera@redhat.com> X-Mailing-List: netdev@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.4 zl3073x_dev_start() fetches the device state and sets up the phase offset measurement block only when asked for a full start. Probe and the devlink flash update ask for it, the devlink DRIVER_REINIT reload does not, as a 'clock_id' change does not change the device state. The devlink FW_ACTIVATE reload, added later in this series, resets the device, which reloads the whole configuration from flash. If the restart after the reset fails, a following DRIVER_REINIT reload would register the DPLLs with cached state that predates the reset, and would not set up the phase offset measurement block again. The device CPU reset at the end of a flash update already allows the same. Always fetch the device state and set up the phase offset measurement block on start, and drop the 'full' parameter. A DRIVER_REINIT reload is rare, so fetching the state again there costs little. Reviewed-by: Min Li Tested-by: Min Li Signed-off-by: Ivan Vecera --- drivers/dpll/zl3073x/core.c | 33 ++++++++++++++------------------- drivers/dpll/zl3073x/core.h | 2 +- drivers/dpll/zl3073x/devlink.c | 6 +++--- 3 files changed, 18 insertions(+), 23 deletions(-) diff --git a/drivers/dpll/zl3073x/core.c b/drivers/dpll/zl3073x/core.c index 27a55d810d5b05..5495d2c67848ac 100644 --- a/drivers/dpll/zl3073x/core.c +++ b/drivers/dpll/zl3073x/core.c @@ -860,16 +860,14 @@ zl3073x_dev_phase_meas_setup(struct zl3073x_dev *zldev) /** * zl3073x_dev_start - Start normal operation * @zldev: zl3073x device pointer - * @full: perform full initialization * - * The function starts normal operation, which means registering all DPLLs and - * their pins, and starting monitoring. If full initialization is requested, - * the function additionally initializes the phase offset measurement block and - * fetches hardware-invariant parameters. + * The function starts normal operation, which means fetching the device + * state, initializing the phase offset measurement block, registering all + * DPLLs and their pins, and starting monitoring. * * Return: 0 on success, <0 on error */ -int zl3073x_dev_start(struct zl3073x_dev *zldev, bool full) +int zl3073x_dev_start(struct zl3073x_dev *zldev) { struct zl3073x_dpll *zldpll; u8 info; @@ -895,19 +893,16 @@ int zl3073x_dev_start(struct zl3073x_dev *zldev, bool full) return 0; } - if (full) { - /* Fetch device state */ - rc = zl3073x_dev_state_fetch(zldev); - if (rc) - return rc; + /* Fetch device state */ + rc = zl3073x_dev_state_fetch(zldev); + if (rc) + return rc; - /* Setup phase offset measurement block */ - rc = zl3073x_dev_phase_meas_setup(zldev); - if (rc) { - dev_err(zldev->dev, - "Failed to setup phase measurement\n"); - return rc; - } + /* Setup phase offset measurement block */ + rc = zl3073x_dev_phase_meas_setup(zldev); + if (rc) { + dev_err(zldev->dev, "Failed to setup phase measurement\n"); + return rc; } /* Register all DPLLs */ @@ -1012,7 +1007,7 @@ zl3073x_devm_dpll_init(struct zl3073x_dev *zldev) zldev->kworker = kworker; /* Start normal operation */ - rc = zl3073x_dev_start(zldev, true); + rc = zl3073x_dev_start(zldev); if (rc) { dev_err_probe(zldev->dev, rc, "Failed to start device\n"); goto error; diff --git a/drivers/dpll/zl3073x/core.h b/drivers/dpll/zl3073x/core.h index 4d979543500c4e..728782e33332ba 100644 --- a/drivers/dpll/zl3073x/core.h +++ b/drivers/dpll/zl3073x/core.h @@ -106,7 +106,7 @@ extern const struct regmap_config zl3073x_regmap_config; struct zl3073x_dev *zl3073x_devm_alloc(struct device *dev); int zl3073x_dev_probe(struct zl3073x_dev *zldev); -int zl3073x_dev_start(struct zl3073x_dev *zldev, bool full); +int zl3073x_dev_start(struct zl3073x_dev *zldev); void zl3073x_dev_stop(struct zl3073x_dev *zldev); static inline u8 zl3073x_dev_phase_avg_factor_get(struct zl3073x_dev *zldev) diff --git a/drivers/dpll/zl3073x/devlink.c b/drivers/dpll/zl3073x/devlink.c index 218b08fd8a3065..10143ec81a1167 100644 --- a/drivers/dpll/zl3073x/devlink.c +++ b/drivers/dpll/zl3073x/devlink.c @@ -125,7 +125,7 @@ zl3073x_devlink_reload_up(struct devlink *devlink, } /* Restart normal operation */ - rc = zl3073x_dev_start(zldev, false); + rc = zl3073x_dev_start(zldev); if (rc) dev_warn(zldev->dev, "Failed to re-start normal operation\n"); @@ -180,7 +180,7 @@ zl3073x_devlink_flash_prepare(struct zl3073x_dev *zldev, NULL, 0, 0); /* Resume normal operation */ - zl3073x_dev_start(zldev, true); + zl3073x_dev_start(zldev); return rc; } @@ -208,7 +208,7 @@ zl3073x_devlink_flash_finish(struct zl3073x_dev *zldev, zl3073x_flash_mode_leave(zldev, extack); /* Resume normal operation */ - rc = zl3073x_dev_start(zldev, true); + rc = zl3073x_dev_start(zldev); if (rc) zl3073x_devlink_flash_notify(zldev, "Failed to start normal operation", -- 2.56.1