]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
ptp: Use ratelimite for freerun error message
authorBreno Leitao <leitao@debian.org>
Fri, 13 Jun 2025 17:15:46 +0000 (10:15 -0700)
committerJakub Kicinski <kuba@kernel.org>
Mon, 16 Jun 2025 22:10:28 +0000 (15:10 -0700)
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 <leitao@debian.org>
Reviewed-by: Simon Horman <horms@kernel.org>
Link: https://patch.msgid.link/20250613-ptp-v1-1-ee44260ce9e2@debian.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/ptp/ptp_clock.c

index 35a5994bf64f6373c08269d63aaeac3f4ab31ff0..335e88d3ebdff66d3d38f5b0b4b0f2b1e37bf0c7 100644 (file)
@@ -96,7 +96,7 @@ static int ptp_clock_settime(struct posix_clock *pc, const struct timespec64 *tp
        struct ptp_clock *ptp = container_of(pc, struct ptp_clock, clock);
 
        if (ptp_clock_freerun(ptp)) {
-               pr_err("ptp: physical clock is free running\n");
+               pr_err_ratelimited("ptp: physical clock is free running\n");
                return -EBUSY;
        }