Skip to content

Commit 01b72c6

Browse files
ziyao233NipaLocal
authored andcommitted
wifi: iwlwifi: Implement settime64 as stub for MVM/MLD PTP
Since commit dfb073d ("ptp: Return -EINVAL on ptp_clock_register if required ops are NULL"), PTP clock registered through ptp_clock_register is required to have ptp_clock_info.settime64 set, however, neither MVM nor MLD's PTP clock implementation sets it, resulting in warnings when the interface starts up, like WARNING: drivers/ptp/ptp_clock.c:325 at ptp_clock_register+0x2c8/0x6b8, CPU#1: wpa_supplicant/469 CPU: 1 UID: 0 PID: 469 Comm: wpa_supplicant Not tainted 6.18.0+ torvalds#101 PREEMPT(full) ra: ffff800002732cd4 iwl_mvm_ptp_init+0x114/0x188 [iwlmvm] ERA: 9000000002fdc468 ptp_clock_register+0x2c8/0x6b8 iwlwifi 0000:01:00.0: Failed to register PHC clock (-22) I don't find an appropriate firmware interface to implement settime64() for iwlwifi MLD/MVM, thus instead create a stub that returns -EOPTNOTSUPP only, suppressing the warning and allowing the PTP clock to be registered. Reported-by: Nathan Chancellor <nathan@kernel.org> Closes: https://lore.kernel.org/all/20251108044822.GA3262936@ax162/ Signed-off-by: Yao Zi <ziyao@disroot.org> Signed-off-by: NipaLocal <nipa@local>
1 parent 1243d14 commit 01b72c6

File tree

2 files changed

+14
-0
lines changed
  • drivers/net/wireless/intel/iwlwifi

2 files changed

+14
-0
lines changed

drivers/net/wireless/intel/iwlwifi/mld/ptp.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,12 @@ static int iwl_mld_ptp_gettime(struct ptp_clock_info *ptp,
121121
return 0;
122122
}
123123

124+
static int iwl_mld_ptp_settime(struct ptp_clock_info *ptp,
125+
const struct timespec64 *ts)
126+
{
127+
return -EOPNOTSUPP;
128+
}
129+
124130
static int iwl_mld_ptp_adjtime(struct ptp_clock_info *ptp, s64 delta)
125131
{
126132
struct iwl_mld *mld = container_of(ptp, struct iwl_mld,
@@ -279,6 +285,7 @@ void iwl_mld_ptp_init(struct iwl_mld *mld)
279285

280286
mld->ptp_data.ptp_clock_info.owner = THIS_MODULE;
281287
mld->ptp_data.ptp_clock_info.gettime64 = iwl_mld_ptp_gettime;
288+
mld->ptp_data.ptp_clock_info.settime64 = iwl_mld_ptp_settime;
282289
mld->ptp_data.ptp_clock_info.max_adj = 0x7fffffff;
283290
mld->ptp_data.ptp_clock_info.adjtime = iwl_mld_ptp_adjtime;
284291
mld->ptp_data.ptp_clock_info.adjfine = iwl_mld_ptp_adjfine;

drivers/net/wireless/intel/iwlwifi/mvm/ptp.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -220,6 +220,12 @@ static int iwl_mvm_ptp_gettime(struct ptp_clock_info *ptp,
220220
return 0;
221221
}
222222

223+
static int iwl_mvm_ptp_settime(struct ptp_clock_info *ptp,
224+
const struct timespec64 *ts)
225+
{
226+
return -EOPNOTSUPP;
227+
}
228+
223229
static int iwl_mvm_ptp_adjtime(struct ptp_clock_info *ptp, s64 delta)
224230
{
225231
struct iwl_mvm *mvm = container_of(ptp, struct iwl_mvm,
@@ -281,6 +287,7 @@ void iwl_mvm_ptp_init(struct iwl_mvm *mvm)
281287
mvm->ptp_data.ptp_clock_info.adjfine = iwl_mvm_ptp_adjfine;
282288
mvm->ptp_data.ptp_clock_info.adjtime = iwl_mvm_ptp_adjtime;
283289
mvm->ptp_data.ptp_clock_info.gettime64 = iwl_mvm_ptp_gettime;
290+
mvm->ptp_data.ptp_clock_info.settime64 = iwl_mvm_ptp_settime;
284291
mvm->ptp_data.scaled_freq = SCALE_FACTOR;
285292

286293
/* Give a short 'friendly name' to identify the PHC clock */

0 commit comments

Comments
 (0)