mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-02-23 14:11:31 -05:00
media: imx-mipi-csis: avoid logging while holding spinlock
Refactor mipi_csis_log_counters() to prevent calling dev_info() while IRQs are disabled. This reduces crucial IRQs off time to a bare minimum. Signed-off-by: Matthias Fend <matthias.fend@emfend.at> Reviewed-by: Rui Miguel Silva <rmfrfs@gmail.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Link: https://lore.kernel.org/r/20240723060909.534584-1-matthias.fend@emfend.at Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
This commit is contained in:
committed by
Laurent Pinchart
parent
a043ea54bb
commit
3f6a2f8768
@@ -861,18 +861,21 @@ static void mipi_csis_log_counters(struct mipi_csis_device *csis, bool non_error
|
||||
{
|
||||
unsigned int num_events = non_errors ? MIPI_CSIS_NUM_EVENTS
|
||||
: MIPI_CSIS_NUM_EVENTS - 8;
|
||||
unsigned int counters[MIPI_CSIS_NUM_EVENTS];
|
||||
unsigned long flags;
|
||||
unsigned int i;
|
||||
|
||||
spin_lock_irqsave(&csis->slock, flags);
|
||||
for (i = 0; i < num_events; ++i)
|
||||
counters[i] = csis->events[i].counter;
|
||||
spin_unlock_irqrestore(&csis->slock, flags);
|
||||
|
||||
for (i = 0; i < num_events; ++i) {
|
||||
if (csis->events[i].counter > 0 || csis->debug.enable)
|
||||
if (counters[i] > 0 || csis->debug.enable)
|
||||
dev_info(csis->dev, "%s events: %d\n",
|
||||
csis->events[i].name,
|
||||
csis->events[i].counter);
|
||||
counters[i]);
|
||||
}
|
||||
spin_unlock_irqrestore(&csis->slock, flags);
|
||||
}
|
||||
|
||||
static int mipi_csis_dump_regs(struct mipi_csis_device *csis)
|
||||
|
||||
Reference in New Issue
Block a user