Skip to contentSkip to conversation

iavf: Implement settime64 with -EOPNOTSUPP

PATCH Applied Michal Schmidt 4 participants 4 messages Nov 26, 2025 – Nov 28, 2025

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 iavf: Implement settime64 with -EOPNOTSUPP

ptp_clock_settime() assumes every ptp_clock has implemented settime64(). Stub it with -EOPNOTSUPP to prevent a NULL dereference.

The fix is similar to commit 329d050bbe63 ("gve: Implement settime64 with -EOPNOTSUPP").

Fixes d734223b2f0d ("iavf: add initial framework for registering PTP clock")
---
 drivers/net/ethernet/intel/iavf/iavf_ptp.c | 7 +++++++
 1 file changed, 7 insertions(+)
drivers/net/ethernet/intel/iavf/iavf_ptp.c +7 -0
index b4d5eda2e84f..9cbd8c154031 100644
@@ -252,6 +252,12 @@ static int iavf_ptp_gettimex64(struct ptp_clock_info *info,
 	return iavf_read_phc_indirect(adapter, ts, sts);
 }
 
+static int iavf_ptp_settime64(struct ptp_clock_info *info,
+			      const struct timespec64 *ts)
+{
+	return -EOPNOTSUPP;
+}
+
 /**
  * iavf_ptp_cache_phc_time - Cache PHC time for performing timestamp extension
  * @adapter: private adapter structure
@@ -320,6 +326,7 @@ 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->settime64 = iavf_ptp_settime64;
 	ptp_info->do_aux_work = iavf_ptp_do_aux_work;
 
 	clock = ptp_clock_register(ptp_info, dev);
Signature · 1 line
2.51.1
Reviewed-by on v1 1/1
#1 lore raw
Quoted 59 lines

-----Original Message-----
From: Intel-wired-lan <[email protected]> On Behalf Of Michal Schmidt
Sent: Wednesday, November 26, 2025 10:49 AM
To: Nguyen, Anthony L <[email protected]>; Kitszel, Przemyslaw <[email protected]>; Andrew Lunn <[email protected]>; David S. Miller <[email protected]>; Eric Dumazet <[email protected]>; Jakub Kicinski <[email protected]>; Paolo Abeni <[email protected]>; Richard Cochran <[email protected]>; Mateusz Polchlopek <[email protected]>; Sai Krishna <[email protected]>; Simon Horman <[email protected]>; Keller, Jacob E <[email protected]>
Cc: Tim Hostetler <[email protected]>; Ahmed Zaki <[email protected]>; [email protected]; [email protected]; linux- [email protected]
Subject: [Intel-wired-lan] [PATCH net] iavf: Implement settime64 with - EOPNOTSUPP

ptp_clock_settime() assumes every ptp_clock has implemented settime64(). Stub it with -EOPNOTSUPP to prevent a NULL dereference.

The fix is similar to commit 329d050bbe63 ("gve: Implement settime64 with - EOPNOTSUPP").

Fixes d734223b2f0d ("iavf: add initial framework for registering PTP

clock")

---
 drivers/net/ethernet/intel/iavf/iavf_ptp.c | 7 +++++++
 1 file changed, 7 insertions(+)
drivers/net/ethernet/intel/iavf/iavf_ptp.c +6 -0
index b4d5eda2e84f..9cbd8c154031 100644
@@ -252,6 +252,12 @@ static int iavf_ptp_gettimex64(struct ptp_clock_info
 *info,
 	return iavf_read_phc_indirect(adapter, ts, sts);  }
 
+static int iavf_ptp_settime64(struct ptp_clock_info *info,
+			      const struct timespec64 *ts)
+{
+	return -EOPNOTSUPP;
+}
+
 /**
  * iavf_ptp_cache_phc_time - Cache PHC time for performing timestamp

extension
* @adapter: private adapter structure

drivers/net/ethernet/intel/iavf/iavf_ptp.c +1 -0
@@ -320,6 +326,7 @@ 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->settime64 = iavf_ptp_settime64;
 	ptp_info->do_aux_work = iavf_ptp_do_aux_work;
 
Quoted 3 lines

clock = ptp_clock_register(ptp_info, dev);
--
2.51.1

Reviewed-by on v1 1/1
#2 lore raw
In reply to Michal Schmidt
Quoted 9 lines · Michal Schmidt

ptp_clock_settime() assumes every ptp_clock has implemented settime64(). Stub it with -EOPNOTSUPP to prevent a NULL dereference.

The fix is similar to commit 329d050bbe63 ("gve: Implement settime64 with -EOPNOTSUPP").

Fixes d734223b2f0d ("iavf: add initial framework for registering PTP clock")
#3 lore raw
In reply to Michal Schmidt
This patch was applied to netdev/net.git (main) by Jakub Kicinski <[email protected]>:

Hello:

This patch was applied to netdev/net.git (main)
by Jakub Kicinski <[email protected]>:

Quoted 10 lines · On Wed, 26 Nov 2025 10:48:49 +0100 you wrote:

ptp_clock_settime() assumes every ptp_clock has implemented settime64(). Stub it with -EOPNOTSUPP to prevent a NULL dereference.

The fix is similar to commit 329d050bbe63 ("gve: Implement settime64 with -EOPNOTSUPP").

Fixes d734223b2f0d ("iavf: add initial framework for registering PTP clock")

[...]

Here is the summary with links:
- [net] iavf: Implement settime64 with -EOPNOTSUPP

    https://git.kernel.org/netdev/net/c/1e43ebcd5152

You are awesome, thank you!

Signature · 2 lines
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html