]> Gentwo Git Trees - linux/.git/commitdiff
iavf: Implement settime64 with -EOPNOTSUPP
authorMichal Schmidt <mschmidt@redhat.com>
Wed, 26 Nov 2025 09:48:49 +0000 (10:48 +0100)
committerJakub Kicinski <kuba@kernel.org>
Fri, 28 Nov 2025 01:47:28 +0000 (17:47 -0800)
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")
Signed-off-by: Michal Schmidt <mschmidt@redhat.com>
Reviewed-by: Aleksandr Loktionov <aleksandr.loktionov@intel.com>
Reviewed-by: Tim Hostetler <thostet@google.com>
Link: https://patch.msgid.link/20251126094850.2842557-1-mschmidt@redhat.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/ethernet/intel/iavf/iavf_ptp.c

index b4d5eda2e84fc103019ff2bad5d77217d157ade3..9cbd8c154031835a53e8f9bbbf6bc1eeaa4f11ea 100644 (file)
@@ -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);