From f10c1497babaf3010def44a999092a4b55e84460 Mon Sep 17 00:00:00 2001 From: root Date: Wed, 3 Mar 2021 10:35:16 +0000 Subject: fix hang when ptp clock rolls over during fetch --- app/Makefile | 3 +++ app/ptp.c | 3 ++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/app/Makefile b/app/Makefile index 526a58f..4b7d33a 100644 --- a/app/Makefile +++ b/app/Makefile @@ -119,6 +119,9 @@ ds: debug: ${PROG}.elf ${PREFIX}-gdb -x gdb.script ${PROG}.elf +debugfl: ${PROG}.elf + ${PREFIX}-gdb -x gdbfl.script ${PROG}.elf + # openocd protos: ${CSRCS} diff --git a/app/ptp.c b/app/ptp.c index 264918f..c05d0c3 100644 --- a/app/ptp.c +++ b/app/ptp.c @@ -80,11 +80,12 @@ uint64_t ptp_get (void) { uint32_t pl, ph; - ph = ETH_PTPTSHR; do { + ph = ETH_PTPTSHR; compiler_mb(); pl = ETH_PTPTSLR; + compiler_mb(); } while (ph != ETH_PTPTSHR); return ptp_to_u64 (pl, ph); -- cgit v1.2.3