Lines Matching +full:sub +full:- +full:sampled

1 // SPDX-License-Identifier: GPL-2.0
10 * ice_set_tx_tstamp - Enable or disable Tx timestamping
26 if (!vsi->tx_rings[i]) in ice_set_tx_tstamp()
28 vsi->tx_rings[i]->ptp_tx = on; in ice_set_tx_tstamp()
32 val = rd32(&pf->hw, PFINT_OICR_ENA); in ice_set_tx_tstamp()
37 wr32(&pf->hw, PFINT_OICR_ENA, val); in ice_set_tx_tstamp()
41 * ice_set_rx_tstamp - Enable or disable Rx timestamping
56 if (!vsi->rx_rings[i]) in ice_set_rx_tstamp()
58 vsi->rx_rings[i]->ptp_rx = on; in ice_set_rx_tstamp()
63 * ice_ptp_cfg_timestamp - Configure timestamp for init/deinit
76 pf->ptp.tstamp_config.rx_filter = HWTSTAMP_FILTER_ALL; in ice_ptp_cfg_timestamp()
77 pf->ptp.tstamp_config.tx_type = HWTSTAMP_TX_ON; in ice_ptp_cfg_timestamp()
79 pf->ptp.tstamp_config.rx_filter = HWTSTAMP_FILTER_NONE; in ice_ptp_cfg_timestamp()
80 pf->ptp.tstamp_config.tx_type = HWTSTAMP_TX_OFF; in ice_ptp_cfg_timestamp()
85 * ice_get_ptp_clock_index - Get the PTP clock index
95 * Returns: the index of the PTP clock associated with this device, or -1 if
102 struct ice_hw *hw = &pf->hw; in ice_get_ptp_clock_index()
108 if (pf->ptp.clock) in ice_get_ptp_clock_index()
109 return ptp_clock_index(pf->ptp.clock); in ice_get_ptp_clock_index()
111 tmr_idx = hw->func_caps.ts_func_info.tmr_index_assoc; in ice_get_ptp_clock_index()
120 err, ice_aq_str(hw->adminq.sq_last_status)); in ice_get_ptp_clock_index()
121 return -1; in ice_get_ptp_clock_index()
129 return -1; in ice_get_ptp_clock_index()
135 * ice_set_ptp_clock_index - Set the PTP clock index
148 struct ice_hw *hw = &pf->hw; in ice_set_ptp_clock_index()
153 if (!pf->ptp.clock) in ice_set_ptp_clock_index()
156 tmr_idx = hw->func_caps.ts_func_info.tmr_index_assoc; in ice_set_ptp_clock_index()
162 value = (u32)ptp_clock_index(pf->ptp.clock); in ice_set_ptp_clock_index()
172 err, ice_aq_str(hw->adminq.sq_last_status)); in ice_set_ptp_clock_index()
177 * ice_clear_ptp_clock_index - Clear the PTP clock index
188 struct ice_hw *hw = &pf->hw; in ice_clear_ptp_clock_index()
193 if (!hw->func_caps.ts_func_info.src_tmr_owned) in ice_clear_ptp_clock_index()
196 tmr_idx = hw->func_caps.ts_func_info.tmr_index_assoc; in ice_clear_ptp_clock_index()
205 err, ice_aq_str(hw->adminq.sq_last_status)); in ice_clear_ptp_clock_index()
210 * ice_ptp_read_src_clk_reg - Read the source clock register
218 struct ice_hw *hw = &pf->hw; in ice_ptp_read_src_clk_reg()
248 * ice_ptp_update_cached_phctime - Update the cached PHC time values
267 WRITE_ONCE(pf->ptp.cached_phc_time, systime); in ice_ptp_update_cached_phctime()
270 struct ice_vsi *vsi = pf->vsi[i]; in ice_ptp_update_cached_phctime()
276 if (vsi->type != ICE_VSI_PF) in ice_ptp_update_cached_phctime()
280 if (!vsi->rx_rings[j]) in ice_ptp_update_cached_phctime()
282 WRITE_ONCE(vsi->rx_rings[j]->cached_phctime, systime); in ice_ptp_update_cached_phctime()
288 * ice_ptp_extend_32b_ts - Convert a 32b nanoseconds timestamp to 64b
295 * 8 bits are sub-nanoseconds and generally discarded.
336 delta = (in_tstamp - phc_time_lo); in ice_ptp_extend_32b_ts()
345 delta = (phc_time_lo - in_tstamp); in ice_ptp_extend_32b_ts()
346 ns = cached_phc_time - delta; in ice_ptp_extend_32b_ts()
355 * ice_ptp_extend_40b_ts - Convert a 40b timestamp to 64b nanoseconds
360 * nanoseconds, 7 bits of sub-nanoseconds, and a valid bit.
362 * *--------------------------------------------------------------*
363 * | 32 bits of nanoseconds | 7 high bits of sub ns underflow | v |
364 * *--------------------------------------------------------------*
367 * 7 bits are a capture of the upper 7 bits of the sub-nanosecond underflow,
384 return ice_ptp_extend_32b_ts(pf->ptp.cached_phc_time, in ice_ptp_extend_40b_ts()
389 * ice_ptp_read_time - Read the time from the device
409 * ice_ptp_write_init - Set PHC time to provided value
418 struct ice_hw *hw = &pf->hw; in ice_ptp_write_init()
424 * ice_ptp_write_adj - Adjust PHC clock time atomically
433 struct ice_hw *hw = &pf->hw; in ice_ptp_write_adj()
439 * ice_ptp_adjfine - Adjust clock increment rate
441 * @scaled_ppm: Parts per million with 16-bit fractional field
450 struct ice_hw *hw = &pf->hw; in ice_ptp_adjfine()
459 scaled_ppm = -scaled_ppm; in ice_ptp_adjfine()
474 incval -= diff; in ice_ptp_adjfine()
482 return -EIO; in ice_ptp_adjfine()
489 * ice_ptp_extts_work - Workqueue task function
499 struct ice_hw *hw = &pf->hw; in ice_ptp_extts_work()
503 tmr_idx = hw->func_caps.ts_func_info.tmr_index_owned; in ice_ptp_extts_work()
505 * GLTSYN_EVNT_L: 32 LSB of sampled time event in ice_ptp_extts_work()
506 * GLTSYN_EVNT_H: 32 MSB of sampled time event in ice_ptp_extts_work()
511 if (pf->ptp.ext_ts_irq & (1 << chan)) { in ice_ptp_extts_work()
519 ptp_clock_event(pf->ptp.clock, &event); in ice_ptp_extts_work()
520 pf->ptp.ext_ts_irq &= ~(1 << chan); in ice_ptp_extts_work()
526 * ice_ptp_cfg_extts - Configure EXTTS pin and channel
529 * @chan: GPIO channel (0-3)
538 struct ice_hw *hw = &pf->hw; in ice_ptp_cfg_extts()
541 if (chan > (unsigned int)pf->ptp.info.n_ext_ts) in ice_ptp_cfg_extts()
542 return -EINVAL; in ice_ptp_cfg_extts()
544 tmr_idx = hw->func_caps.ts_func_info.tmr_index_owned; in ice_ptp_cfg_extts()
563 * 0x1 is input sampled by EVENT register(channel) in ice_ptp_cfg_extts()
569 pf->ptp.ext_ts_chan |= (1 << chan); in ice_ptp_cfg_extts()
574 pf->ptp.ext_ts_chan &= ~(1 << chan); in ice_ptp_cfg_extts()
575 if (!pf->ptp.ext_ts_chan) in ice_ptp_cfg_extts()
587 * ice_ptp_cfg_clkout - Configure clock to generate periodic wave
589 * @chan: GPIO channel (0-3)
600 struct ice_hw *hw = &pf->hw; in ice_ptp_cfg_clkout()
604 tmr_idx = hw->func_caps.ts_func_info.tmr_index_owned; in ice_ptp_cfg_clkout()
612 if (!config || !config->ena) { in ice_ptp_cfg_clkout()
618 gpio_pin = pf->ptp.perout_channels[chan].gpio_pin; in ice_ptp_cfg_clkout()
623 memset(&pf->ptp.perout_channels[chan], 0, in ice_ptp_cfg_clkout()
628 period = config->period; in ice_ptp_cfg_clkout()
629 start_time = config->start_time; in ice_ptp_cfg_clkout()
631 gpio_pin = config->gpio_pin; in ice_ptp_cfg_clkout()
659 start_time = div64_u64(current_time + NSEC_PER_SEC - 1, in ice_ptp_cfg_clkout()
662 start_time -= E810_OUT_PROP_DELAY_NS; in ice_ptp_cfg_clkout()
680 memcpy(&pf->ptp.perout_channels[chan], config, in ice_ptp_cfg_clkout()
682 pf->ptp.perout_channels[chan].start_time = phase; in ice_ptp_cfg_clkout()
688 return -EFAULT; in ice_ptp_cfg_clkout()
692 * ice_ptp_disable_all_clkout - Disable all currently configured outputs
697 * re-enable the clocks again.
703 for (i = 0; i < pf->ptp.info.n_per_out; i++) in ice_ptp_disable_all_clkout()
704 if (pf->ptp.perout_channels[i].ena) in ice_ptp_disable_all_clkout()
709 * ice_ptp_enable_all_clkout - Enable all configured periodic clock outputs
720 for (i = 0; i < pf->ptp.info.n_per_out; i++) in ice_ptp_enable_all_clkout()
721 if (pf->ptp.perout_channels[i].ena) in ice_ptp_enable_all_clkout()
722 ice_ptp_cfg_clkout(pf, i, &pf->ptp.perout_channels[i], in ice_ptp_enable_all_clkout()
727 * ice_ptp_gpio_enable_e810 - Enable/disable ancillary features of PHC
742 switch (rq->type) { in ice_ptp_gpio_enable_e810()
744 chan = rq->perout.index; in ice_ptp_gpio_enable_e810()
750 clk_cfg.period = ((rq->perout.period.sec * NSEC_PER_SEC) + in ice_ptp_gpio_enable_e810()
751 rq->perout.period.nsec); in ice_ptp_gpio_enable_e810()
752 clk_cfg.start_time = ((rq->perout.start.sec * NSEC_PER_SEC) + in ice_ptp_gpio_enable_e810()
753 rq->perout.start.nsec); in ice_ptp_gpio_enable_e810()
759 chan = rq->extts.index; in ice_ptp_gpio_enable_e810()
763 rq->extts.flags); in ice_ptp_gpio_enable_e810()
766 return -EOPNOTSUPP; in ice_ptp_gpio_enable_e810()
773 * ice_ptp_gettimex64 - Get the time of the clock
787 struct ice_hw *hw = &pf->hw; in ice_ptp_gettimex64()
791 return -EBUSY; in ice_ptp_gettimex64()
801 * ice_ptp_settime64 - Set the time of the clock
813 struct ice_hw *hw = &pf->hw; in ice_ptp_settime64()
817 err = -EBUSY; in ice_ptp_settime64()
842 * ice_ptp_adjtime_nonatomic - Do a non-atomic clock adjustment
858 * ice_ptp_adjtime - Adjust the time of the clock by the indicated delta
865 struct ice_hw *hw = &pf->hw; in ice_ptp_adjtime()
871 /* Hardware only supports atomic adjustments using signed 32-bit in ice_ptp_adjtime()
873 * a non-atomic get->adjust->set flow. in ice_ptp_adjtime()
876 dev_dbg(dev, "delta = %lld, adjtime non-atomic\n", delta); in ice_ptp_adjtime()
882 return -EBUSY; in ice_ptp_adjtime()
906 * ice_ptp_get_ts_config - ioctl interface to read the timestamping config
916 if (!test_bit(ICE_FLAG_PTP, pf->flags)) in ice_ptp_get_ts_config()
917 return -EIO; in ice_ptp_get_ts_config()
919 config = &pf->ptp.tstamp_config; in ice_ptp_get_ts_config()
921 return copy_to_user(ifr->ifr_data, config, sizeof(*config)) ? in ice_ptp_get_ts_config()
922 -EFAULT : 0; in ice_ptp_get_ts_config()
926 * ice_ptp_set_timestamp_mode - Setup driver for requested timestamp mode
934 if (config->flags) in ice_ptp_set_timestamp_mode()
935 return -EINVAL; in ice_ptp_set_timestamp_mode()
937 switch (config->tx_type) { in ice_ptp_set_timestamp_mode()
945 return -ERANGE; in ice_ptp_set_timestamp_mode()
948 switch (config->rx_filter) { in ice_ptp_set_timestamp_mode()
966 config->rx_filter = HWTSTAMP_FILTER_ALL; in ice_ptp_set_timestamp_mode()
970 return -ERANGE; in ice_ptp_set_timestamp_mode()
977 * ice_ptp_set_ts_config - ioctl interface to control the timestamping
988 if (!test_bit(ICE_FLAG_PTP, pf->flags)) in ice_ptp_set_ts_config()
989 return -EAGAIN; in ice_ptp_set_ts_config()
991 if (copy_from_user(&config, ifr->ifr_data, sizeof(config))) in ice_ptp_set_ts_config()
992 return -EFAULT; in ice_ptp_set_ts_config()
999 pf->ptp.tstamp_config = config; in ice_ptp_set_ts_config()
1001 return copy_to_user(ifr->ifr_data, &config, sizeof(config)) ? in ice_ptp_set_ts_config()
1002 -EFAULT : 0; in ice_ptp_set_ts_config()
1006 * ice_ptp_rx_hwtstamp - Check for an Rx timestamp
1022 if (rx_desc->wb.time_stamp_low & ICE_PTP_TS_VALID) { in ice_ptp_rx_hwtstamp()
1025 /* Use ice_ptp_extend_32b_ts directly, using the ring-specific in ice_ptp_rx_hwtstamp()
1031 ts_high = le32_to_cpu(rx_desc->wb.flex_ts.ts_high); in ice_ptp_rx_hwtstamp()
1032 ts_ns = ice_ptp_extend_32b_ts(rx_ring->cached_phctime, ts_high); in ice_ptp_rx_hwtstamp()
1036 hwtstamps->hwtstamp = ns_to_ktime(ts_ns); in ice_ptp_rx_hwtstamp()
1041 * ice_ptp_setup_pins_e810 - Setup PTP pins in sysfs
1046 info->n_per_out = E810_N_PER_OUT; in ice_ptp_setup_pins_e810()
1047 info->n_ext_ts = E810_N_EXT_TS; in ice_ptp_setup_pins_e810()
1051 * ice_ptp_set_funcs_e810 - Set specialized functions for E810 support
1063 info->enable = ice_ptp_gpio_enable_e810; in ice_ptp_set_funcs_e810()
1069 * ice_ptp_set_caps - Set PTP capabilities
1074 struct ptp_clock_info *info = &pf->ptp.info; in ice_ptp_set_caps()
1077 snprintf(info->name, sizeof(info->name) - 1, "%s-%s-clk", in ice_ptp_set_caps()
1079 info->owner = THIS_MODULE; in ice_ptp_set_caps()
1080 info->max_adj = 999999999; in ice_ptp_set_caps()
1081 info->adjtime = ice_ptp_adjtime; in ice_ptp_set_caps()
1082 info->adjfine = ice_ptp_adjfine; in ice_ptp_set_caps()
1083 info->gettimex64 = ice_ptp_gettimex64; in ice_ptp_set_caps()
1084 info->settime64 = ice_ptp_settime64; in ice_ptp_set_caps()
1090 * ice_ptp_create_clock - Create PTP clock device for userspace
1105 if (pf->ptp.clock) in ice_ptp_create_clock()
1110 info = &pf->ptp.info; in ice_ptp_create_clock()
1118 pf->ptp.clock = clock; in ice_ptp_create_clock()
1124 * ice_ptp_tx_tstamp_work - Process Tx timestamps for a port
1138 * After looping, if we still have waiting SKBs, then re-queue the work. This
1145 * checking if we need to re-queue this task. The only place where bits can be
1151 * will notice it at the end when we re-queue the work item. If a Tx thread
1152 * starts a new timestamp just after this function exits without re-queuing,
1166 if (!tx->init) in ice_ptp_tx_tstamp_work()
1171 hw = &pf->hw; in ice_ptp_tx_tstamp_work()
1173 for_each_set_bit(idx, tx->in_use, tx->len) { in ice_ptp_tx_tstamp_work()
1175 u8 phy_idx = idx + tx->quad_offset; in ice_ptp_tx_tstamp_work()
1180 err = ice_read_phy_tstamp(hw, tx->quad, phy_idx, in ice_ptp_tx_tstamp_work()
1190 * again when re-used. in ice_ptp_tx_tstamp_work()
1192 ice_clear_phy_tstamp(hw, tx->quad, phy_idx); in ice_ptp_tx_tstamp_work()
1197 spin_lock(&tx->lock); in ice_ptp_tx_tstamp_work()
1198 clear_bit(idx, tx->in_use); in ice_ptp_tx_tstamp_work()
1199 skb = tx->tstamps[idx].skb; in ice_ptp_tx_tstamp_work()
1200 tx->tstamps[idx].skb = NULL; in ice_ptp_tx_tstamp_work()
1201 spin_unlock(&tx->lock); in ice_ptp_tx_tstamp_work()
1217 /* Check if we still have work to do. If so, re-queue this task to in ice_ptp_tx_tstamp_work()
1220 spin_lock(&tx->lock); in ice_ptp_tx_tstamp_work()
1221 if (!bitmap_empty(tx->in_use, tx->len)) in ice_ptp_tx_tstamp_work()
1222 kthread_queue_work(pf->ptp.kworker, &tx->work); in ice_ptp_tx_tstamp_work()
1223 spin_unlock(&tx->lock); in ice_ptp_tx_tstamp_work()
1227 * ice_ptp_request_ts - Request an available Tx timestamp index
1236 if (!tx->init) in ice_ptp_request_ts()
1237 return -1; in ice_ptp_request_ts()
1239 spin_lock(&tx->lock); in ice_ptp_request_ts()
1241 idx = find_first_zero_bit(tx->in_use, tx->len); in ice_ptp_request_ts()
1242 if (idx < tx->len) { in ice_ptp_request_ts()
1247 set_bit(idx, tx->in_use); in ice_ptp_request_ts()
1248 tx->tstamps[idx].start = jiffies; in ice_ptp_request_ts()
1249 tx->tstamps[idx].skb = skb_get(skb); in ice_ptp_request_ts()
1250 skb_shinfo(skb)->tx_flags |= SKBTX_IN_PROGRESS; in ice_ptp_request_ts()
1253 spin_unlock(&tx->lock); in ice_ptp_request_ts()
1255 /* return the appropriate PHY timestamp register index, -1 if no in ice_ptp_request_ts()
1258 if (idx >= tx->len) in ice_ptp_request_ts()
1259 return -1; in ice_ptp_request_ts()
1261 return idx + tx->quad_offset; in ice_ptp_request_ts()
1265 * ice_ptp_process_ts - Spawn kthread work to handle timestamps
1273 if (pf->ptp.port.tx.init) in ice_ptp_process_ts()
1274 kthread_queue_work(pf->ptp.kworker, &pf->ptp.port.tx.work); in ice_ptp_process_ts()
1278 * ice_ptp_alloc_tx_tracker - Initialize tracking for Tx timestamps
1287 tx->tstamps = kcalloc(tx->len, sizeof(*tx->tstamps), GFP_KERNEL); in ice_ptp_alloc_tx_tracker()
1288 if (!tx->tstamps) in ice_ptp_alloc_tx_tracker()
1289 return -ENOMEM; in ice_ptp_alloc_tx_tracker()
1291 tx->in_use = bitmap_zalloc(tx->len, GFP_KERNEL); in ice_ptp_alloc_tx_tracker()
1292 if (!tx->in_use) { in ice_ptp_alloc_tx_tracker()
1293 kfree(tx->tstamps); in ice_ptp_alloc_tx_tracker()
1294 tx->tstamps = NULL; in ice_ptp_alloc_tx_tracker()
1295 return -ENOMEM; in ice_ptp_alloc_tx_tracker()
1298 spin_lock_init(&tx->lock); in ice_ptp_alloc_tx_tracker()
1299 kthread_init_work(&tx->work, ice_ptp_tx_tstamp_work); in ice_ptp_alloc_tx_tracker()
1301 tx->init = 1; in ice_ptp_alloc_tx_tracker()
1307 * ice_ptp_flush_tx_tracker - Flush any remaining timestamps from the tracker
1316 for (idx = 0; idx < tx->len; idx++) { in ice_ptp_flush_tx_tracker()
1317 u8 phy_idx = idx + tx->quad_offset; in ice_ptp_flush_tx_tracker()
1319 spin_lock(&tx->lock); in ice_ptp_flush_tx_tracker()
1320 if (tx->tstamps[idx].skb) { in ice_ptp_flush_tx_tracker()
1321 dev_kfree_skb_any(tx->tstamps[idx].skb); in ice_ptp_flush_tx_tracker()
1322 tx->tstamps[idx].skb = NULL; in ice_ptp_flush_tx_tracker()
1324 clear_bit(idx, tx->in_use); in ice_ptp_flush_tx_tracker()
1325 spin_unlock(&tx->lock); in ice_ptp_flush_tx_tracker()
1328 if (!pf->hw.reset_ongoing) in ice_ptp_flush_tx_tracker()
1329 ice_clear_phy_tstamp(&pf->hw, tx->quad, phy_idx); in ice_ptp_flush_tx_tracker()
1334 * ice_ptp_release_tx_tracker - Release allocated memory for Tx tracker
1343 tx->init = 0; in ice_ptp_release_tx_tracker()
1345 kthread_cancel_work_sync(&tx->work); in ice_ptp_release_tx_tracker()
1349 kfree(tx->tstamps); in ice_ptp_release_tx_tracker()
1350 tx->tstamps = NULL; in ice_ptp_release_tx_tracker()
1352 kfree(tx->in_use); in ice_ptp_release_tx_tracker()
1353 tx->in_use = NULL; in ice_ptp_release_tx_tracker()
1355 tx->len = 0; in ice_ptp_release_tx_tracker()
1359 * ice_ptp_init_tx_e810 - Initialize tracking for Tx timestamps
1369 tx->quad = pf->hw.port_info->lport; in ice_ptp_init_tx_e810()
1370 tx->quad_offset = 0; in ice_ptp_init_tx_e810()
1371 tx->len = INDEX_PER_QUAD; in ice_ptp_init_tx_e810()
1377 * ice_ptp_tx_tstamp_cleanup - Cleanup old timestamp requests that got dropped
1390 if (!tx->init) in ice_ptp_tx_tstamp_cleanup()
1393 for_each_set_bit(idx, tx->in_use, tx->len) { in ice_ptp_tx_tstamp_cleanup()
1397 if (time_is_after_jiffies(tx->tstamps[idx].start + 2 * HZ)) in ice_ptp_tx_tstamp_cleanup()
1400 spin_lock(&tx->lock); in ice_ptp_tx_tstamp_cleanup()
1401 skb = tx->tstamps[idx].skb; in ice_ptp_tx_tstamp_cleanup()
1402 tx->tstamps[idx].skb = NULL; in ice_ptp_tx_tstamp_cleanup()
1403 clear_bit(idx, tx->in_use); in ice_ptp_tx_tstamp_cleanup()
1404 spin_unlock(&tx->lock); in ice_ptp_tx_tstamp_cleanup()
1416 if (!test_bit(ICE_FLAG_PTP, pf->flags)) in ice_ptp_periodic_work()
1421 ice_ptp_tx_tstamp_cleanup(&pf->ptp.port.tx); in ice_ptp_periodic_work()
1424 kthread_queue_delayed_work(ptp->kworker, &ptp->work, in ice_ptp_periodic_work()
1429 * ice_ptp_init_owner - Initialize PTP_1588_CLOCK device
1439 struct ice_hw *hw = &pf->hw; in ice_ptp_init_owner()
1447 src_idx = hw->func_caps.ts_func_info.tmr_index_owned; in ice_ptp_init_owner()
1462 err = -EBUSY; in ice_ptp_init_owner()
1495 pf->ptp.clock = NULL; in ice_ptp_init_owner()
1503 * ice_ptp_init - Initialize the PTP support after device probe or reset
1514 struct ice_hw *hw = &pf->hw; in ice_ptp_init()
1522 if (hw->func_caps.ts_func_info.src_tmr_owned) { in ice_ptp_init()
1532 ice_ptp_init_tx_e810(pf, &pf->ptp.port.tx); in ice_ptp_init()
1535 kthread_init_delayed_work(&pf->ptp.work, ice_ptp_periodic_work); in ice_ptp_init()
1536 kthread_init_work(&pf->ptp.extts_work, ice_ptp_extts_work); in ice_ptp_init()
1541 kworker = kthread_create_worker(0, "ice-ptp-%s", dev_name(dev)); in ice_ptp_init()
1546 pf->ptp.kworker = kworker; in ice_ptp_init()
1548 set_bit(ICE_FLAG_PTP, pf->flags); in ice_ptp_init()
1551 kthread_queue_delayed_work(pf->ptp.kworker, &pf->ptp.work, 0); in ice_ptp_init()
1558 if (pf->ptp.clock) { in ice_ptp_init()
1559 ptp_clock_unregister(pf->ptp.clock); in ice_ptp_init()
1560 pf->ptp.clock = NULL; in ice_ptp_init()
1566 * ice_ptp_release - Disable the driver/HW support and unregister the clock
1574 if (!test_bit(ICE_FLAG_PTP, pf->flags)) in ice_ptp_release()
1580 ice_ptp_release_tx_tracker(pf, &pf->ptp.port.tx); in ice_ptp_release()
1582 clear_bit(ICE_FLAG_PTP, pf->flags); in ice_ptp_release()
1584 kthread_cancel_delayed_work_sync(&pf->ptp.work); in ice_ptp_release()
1586 if (pf->ptp.kworker) { in ice_ptp_release()
1587 kthread_destroy_worker(pf->ptp.kworker); in ice_ptp_release()
1588 pf->ptp.kworker = NULL; in ice_ptp_release()
1591 if (!pf->ptp.clock) in ice_ptp_release()
1598 ptp_clock_unregister(pf->ptp.clock); in ice_ptp_release()
1599 pf->ptp.clock = NULL; in ice_ptp_release()