media: rp1: csi2: Track CSI-2 errors
authorTomi Valkeinen <tomi.valkeinen@ideasonboard.com>
Thu, 21 Sep 2023 15:18:53 +0000 (18:18 +0300)
committerDom Cobley <popcornmix@gmail.com>
Mon, 19 Feb 2024 11:35:02 +0000 (11:35 +0000)
commite770e7248871c49751e0ca60e5f87a1962ba53ef
treebed051748690a2cf57060dd76cd4a3b661563614
parente61df453add7ee781c01c502997f3a949fa89abe
media: rp1: csi2: Track CSI-2 errors

Track the errors from the CSI-2 receiver: overflows and discards. These
are recorded in a table which can be read by the userspace via debugfs.

As tracking the errors may cause much more interrupt load, the tracking
needs to be enabled with a module parameter.

Note that the recording is not perfect: we only record the last
discarded DT for each discard type, instead of recording all of them.
This means that e.g. if the device is discarding two unmatched DTs, the
debugfs file only shows the last one recorded. Recording all of them
would need a more sophisticated recording system to avoid the need of a
very large table, or dynamic allocation.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
drivers/media/platform/raspberrypi/rp1_cfe/csi2.c
drivers/media/platform/raspberrypi/rp1_cfe/csi2.h