From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796382415; b=irOr4JDyo9hSsWeDD1bAO9SzGyEfEIictopZi9eCJeGqKDk63Mji49SqhP7nsROzQ3rG 3uOOPyf2AH3UOjIA7W76tdPRhQopYC9R2Ldt3uFUOjH1Bzgh6d0ifkjrpML4VjIMKyYxJ k3KnIlIhw0YYXC5bnrdQx53cTCv4xA4tVmq2m4n0JuwAwt0g70+xgdfiJ8h9e9ejjvMa7 NGCfaHjgtRmYkjnx/BwrOEV/eVAvcrflRwRySwx7Klw7N2QZcpqTJf7YHA4Kf0UljTDAQ mDfTGVTSoILVwGTSQDKReqvoXow3f2c1cNZizsoR/ziFcU8jcnBJAQGIaM9bYJ/mskg== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796382415; h=Received:DKIM-Signature:From:To:Cc:Subject:Date:Message-ID:X-Mailer: In-Reply-To:References:User-Agent:X-stable:X-Patchwork-Hint: MIME-Version:Content-Transfer-Encoding; bh=5h/yRx9c69LGPsSaJSs4C8BODYnl+ZDwTC3RfCLOj0M=; b=0ag7DYIjcetJtRIH48A0OYJoTnqBtADYiJRlVrxKaKGSC+Rr81FiyjjmzVnNROJrQad9 SpwMKlEf7GnLldPAG8tngusARpR3r4w7NpvMyr1qVPqaqny+6KQEja07FsHkW8aipjhgJ 7rqYPUGqFunRxmbwH0Gzcn+5p/KtRikrmeVomYAAp8IVMS4PGyfgmMRluRapMPXb4wad3 IUQADFeLHmL+gmT0cO6rKMSGS8YDrE4MInifPxnNekChXphAPGdnlkD0EfcMqpFWTnygp FJM5ope96ROPmJM86GihvPSACG/sWnpWQVqwaXBT08YugcDart7XdH6KW1W/7cyqDKg== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=linuxfoundation.org header.i=@linuxfoundation.org header.a=rsa-sha256 header.s=korg header.b=eKdCAQsm; arc=none smtp.remote-ip=100.103.45.18 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 9FA06606A32F; Fri, 4 Dec 2026 11:06:55 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.a=rsa-sha256 header.s=korg header.b=eKdCAQsm Received: by smtp.kernel.org (Postfix) with ESMTPSA id 1DFD71F00A05; Fri, 4 Dec 2026 11:06:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1796382415; bh=5h/yRx9c69LGPsSaJSs4C8BODYnl+ZDwTC3RfCLOj0M=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=eKdCAQsmcGbn8BR3J9r+ndbLFklx3YLvwGL1fTVHNf3UYmHWUinlZwKXz0YPfByLC hYulwZMu7H4BkV3bL51bkvpcwewy/rcceK5rZa5U4L9ZX6zPgaE43b+ExQUwpFbBOz 5mBtWT/VIqiHNrgrdXZBSUi/YerNF0mzExGx5UwQ= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Xuanqiang Luo , Vadim Fedorenko , Jacob Keller , Rafal Romanowski , Tony Nguyen , Jakub Kicinski Subject: [PATCH 6.18 443/703] iavf: add missing PTP adjustment callbacks Date: Fri, 4 Dec 2026 19:05:42 +0900 Message-ID: <20261204100639.589898014@linuxfoundation.org> X-Mailer: git-send-email 2.56.1 In-Reply-To: <20261204100627.522266145@linuxfoundation.org> References: <20261204100627.522266145@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore X-Mailing-List: stable@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 6.18-stable review patch. If anyone has any objections, please let me know. ------------------ From: Xuanqiang Luo commit adbc4d0fff640541d7071421ac59dbd70da33b18 upstream. The PTP hardware clock documentation requires drivers to implement all callbacks and return -EOPNOTSUPP for unsupported features. The iavf driver registers a PHC without adjtime or adjfine callbacks. A userspace clock_adjtime(2) request reaches ptp_clock_adjtime(), where ADJ_SETOFFSET calls adjtime and ADJ_FREQUENCY calls adjfine. The missing callbacks can therefore cause a NULL dereference. Provide both callbacks and return -EOPNOTSUPP for the unsupported operations. Fixes: d734223b2f0d ("iavf: add initial framework for registering PTP clock") Link: https://docs.kernel.org/driver-api/ptp.html#writing-clock-drivers Link: https://lore.kernel.org/all/20260826101004.100979-1-xuanqiang.luo@linux.dev/ Cc: stable@vger.kernel.org Signed-off-by: Xuanqiang Luo Reviewed-by: Vadim Fedorenko Acked-by: Jacob Keller Tested-by: Rafal Romanowski Signed-off-by: Tony Nguyen Link: https://patch.msgid.link/20261113004602.129864-7-anthony.l.nguyen@intel.com Signed-off-by: Jakub Kicinski Signed-off-by: Greg Kroah-Hartman --- drivers/net/ethernet/intel/iavf/iavf_ptp.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/drivers/net/ethernet/intel/iavf/iavf_ptp.c b/drivers/net/ethernet/intel/iavf/iavf_ptp.c index 87b97e09df14..fcb273828bc1 100644 --- a/drivers/net/ethernet/intel/iavf/iavf_ptp.c +++ b/drivers/net/ethernet/intel/iavf/iavf_ptp.c @@ -252,6 +252,16 @@ static int iavf_ptp_gettimex64(struct ptp_clock_info *info, return iavf_read_phc_indirect(adapter, ts, sts); } +static int iavf_ptp_adjfine(struct ptp_clock_info *info, long scaled_ppm) +{ + return -EOPNOTSUPP; +} + +static int iavf_ptp_adjtime(struct ptp_clock_info *info, s64 delta) +{ + return -EOPNOTSUPP; +} + static int iavf_ptp_settime64(struct ptp_clock_info *info, const struct timespec64 *ts) { @@ -326,6 +336,8 @@ static int iavf_ptp_register_clock(struct iavf_adapter *adapter) KBUILD_MODNAME, dev_name(dev)); ptp_info->owner = THIS_MODULE; ptp_info->gettimex64 = iavf_ptp_gettimex64; + ptp_info->adjfine = iavf_ptp_adjfine; + ptp_info->adjtime = iavf_ptp_adjtime; ptp_info->settime64 = iavf_ptp_settime64; ptp_info->do_aux_work = iavf_ptp_do_aux_work; -- 2.56.1