Commit 1e43ebcd authored by Michal Schmidt's avatar Michal Schmidt Committed by Jakub Kicinski
Browse files

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 329d050b ("gve: Implement settime64
with -EOPNOTSUPP").

Fixes: d734223b ("iavf: add initial framework for registering PTP clock")
Signed-off-by: default avatarMichal Schmidt <mschmidt@redhat.com>
Reviewed-by: default avatarAleksandr Loktionov <aleksandr.loktionov@intel.com>
Reviewed-by: default avatarTim Hostetler <thostet@google.com>
Link: https://patch.msgid.link/20251126094850.2842557-1-mschmidt@redhat.com


Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
parent 1f5e808a
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -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);