Skip to content

Commit e9a7795

Browse files
leitaokuba-moo
authored andcommitted
ptp: Use ratelimite for freerun error message
Replace pr_err() with pr_err_ratelimited() in ptp_clock_settime() to prevent log flooding when the physical clock is free running, which happens on some of my hosts. This ensures error messages are rate-limited and improves kernel log readability. Signed-off-by: Breno Leitao <[email protected]> Reviewed-by: Simon Horman <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
1 parent de74998 commit e9a7795

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/ptp/ptp_clock.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ static int ptp_clock_settime(struct posix_clock *pc, const struct timespec64 *tp
9696
struct ptp_clock *ptp = container_of(pc, struct ptp_clock, clock);
9797

9898
if (ptp_clock_freerun(ptp)) {
99-
pr_err("ptp: physical clock is free running\n");
99+
pr_err_ratelimited("ptp: physical clock is free running\n");
100100
return -EBUSY;
101101
}
102102

0 commit comments

Comments
 (0)