Skip to content

Commit bdfc7b5

Browse files
minaanguy11
authored andcommitted
idpf: read lower clock bits inside the time sandwich
PCIe reads need to be done inside the time sandwich because PCIe writes may get buffered in the PCIe fabric and posted to the device after the _postts completes. Doing the PCIe read inside the time sandwich guarantees that the write gets flushed before the _postts timestamp is taken. Cc: lrizzo@google.com Cc: namangulati@google.com Cc: willemb@google.com Cc: intel-wired-lan@lists.osuosl.org Cc: milena.olech@intel.com Cc: jacob.e.keller@intel.com Fixes: 5cb8805 ("idpf: negotiate PTP capabilities and get PTP clock") Suggested-by: Shachar Raindel <shacharr@google.com> Signed-off-by: Mina Almasry <almasrymina@google.com> Reviewed-by: Jacob Keller <jacob.e.keller@intel.com> Reviewed-by: Aleksandr Loktionov <aleksandr.loktionov@intel.com> Tested-by: Samuel Salin <Samuel.salin@intel.com> Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
1 parent d3f867e commit bdfc7b5

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

drivers/net/ethernet/intel/idpf/idpf_ptp.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,11 +108,11 @@ static u64 idpf_ptp_read_src_clk_reg_direct(struct idpf_adapter *adapter,
108108
ptp_read_system_prets(sts);
109109

110110
idpf_ptp_enable_shtime(adapter);
111+
lo = readl(ptp->dev_clk_regs.dev_clk_ns_l);
111112

112113
/* Read the system timestamp post PHC read */
113114
ptp_read_system_postts(sts);
114115

115-
lo = readl(ptp->dev_clk_regs.dev_clk_ns_l);
116116
hi = readl(ptp->dev_clk_regs.dev_clk_ns_h);
117117

118118
spin_unlock(&ptp->read_dev_clk_lock);

0 commit comments

Comments
 (0)