From a289f4afa60f20ae48b3a0a833b55fb15ec05a88 Mon Sep 17 00:00:00 2001 From: scyto Date: Sat, 13 Jun 2026 20:22:59 -0700 Subject: [PATCH] kdriver: gate fops_read/fops_write timeout logs behind DEBUG memx_fops_read() and memx_fops_write() log an info-level message on every wait_event_interruptible_timeout() timeout ("wait timeout N(s), retrying again") and then re-arm. These are the only un-guarded pr_info() calls in the two ioctl wait loops -- every other diagnostic in this file, including the success-side "received ofmap/ifmap ... done" logs immediately after each loop, is already wrapped in #ifdef DEBUG. In a non-DEBUG build the read-side message floods the kernel log: an idle but open device (e.g. Frigate holding the accelerator between motion-gated detections) has no output feature map to return, so the 10s read timeout fires every ~10s indefinitely on a perfectly healthy device. It is pure log noise, not an error -- inference resumes normally as soon as work arrives. Wrap both timeout logs in #ifdef DEBUG to match the surrounding convention, so they remain available in debug builds (the Makefile passes -DDEBUG) and are silent otherwise. Applied to both the kdriver and 32bit_driver copies. No functional change: the wait loops are driven by the while (wq_status < 1) condition; the gated if/pr_info was diagnostic only. Co-Authored-By: Claude Opus 4.8 (1M context) --- 32bit_driver/kdriver/linux/pcie/memx_cascade_pciemain.c | 4 ++++ kdriver/linux/pcie/memx_cascade_pciemain.c | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/32bit_driver/kdriver/linux/pcie/memx_cascade_pciemain.c b/32bit_driver/kdriver/linux/pcie/memx_cascade_pciemain.c index 287be0d..b723130 100644 --- a/32bit_driver/kdriver/linux/pcie/memx_cascade_pciemain.c +++ b/32bit_driver/kdriver/linux/pcie/memx_cascade_pciemain.c @@ -471,8 +471,10 @@ static ssize_t memx_fops_read(struct file *filp, char __user *buf, size_t count, break; } +#ifdef DEBUG if (wq_status < 1) pr_info("memryx: fops_read: wait timeout 10(s), retrying again\n"); +#endif } while (wq_status < 1); if (wq_status >= 1) { @@ -555,8 +557,10 @@ static ssize_t memx_fops_write(struct file *filp, const char __user *buf, size_t pr_warn("memryx: fops_write: cancelled by interrupt signal\n"); break; } +#ifdef DEBUG if (wq_status < 1) pr_info("memryx: fops_write: wait timeout 1(s), retrying again\n"); +#endif } while (wq_status < 1); if (wq_status >= 1) { diff --git a/kdriver/linux/pcie/memx_cascade_pciemain.c b/kdriver/linux/pcie/memx_cascade_pciemain.c index 79cfa39..0eb9167 100644 --- a/kdriver/linux/pcie/memx_cascade_pciemain.c +++ b/kdriver/linux/pcie/memx_cascade_pciemain.c @@ -470,8 +470,10 @@ static ssize_t memx_fops_read(struct file *filp, char __user *buf, size_t count, break; } +#ifdef DEBUG if (wq_status < 1) pr_info("memryx: fops_read: wait timeout 10(s), retrying again\n"); +#endif } while (wq_status < 1); if (wq_status >= 1) { @@ -564,8 +566,10 @@ static ssize_t memx_fops_write(struct file *filp, const char __user *buf, size_t pr_warn("memryx: fops_write: cancelled by interrupt signal\n"); break; } +#ifdef DEBUG if (wq_status < 1) pr_info("memryx: fops_write: wait timeout 1(s), retrying again\n"); +#endif } while (wq_status < 1); if (wq_status >= 1) {