From bbe5c661400e032fa5ec96898ef26cc9d65c55fc Mon Sep 17 00:00:00 2001 From: =?utf8?q?Michal=20Mal=C3=BD?= Date: Fri, 25 Jul 2014 21:00:01 +0200 Subject: [PATCH] Add some debugging output, this shall be useful quite soon --- klgd.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/klgd.c b/klgd.c index feb2484..86c9f53 100644 --- a/klgd.c +++ b/klgd.c @@ -131,12 +131,16 @@ void klgd_notify_commands_sent(struct klgd_main *ctx) if (atomic_read(&priv->send_asap)) { unsigned long flags; + pr_debug("Command stream processed, send a new one immediately\n"); + spin_lock_irqsave(&priv->stream_lock, flags); klgd_build_command_stream(ctx); spin_unlock_irqrestore(&priv->stream_lock, flags); atomic_set(&priv->send_asap, 0); - } else + } else { + pr_debug("Command stream processed, wait for timer\n"); atomic_set(&priv->can_send_commands, 1); + } } int klgd_post_event(struct klgd_main *ctx, size_t idx, void *data) @@ -208,11 +212,15 @@ void klgd_timer_fired(unsigned long ctx) if (atomic_read(&priv->can_send_commands)) { unsigned long flags; + pr_debug("Timer fired, can send commands now\n"); + spin_lock_irqsave(&priv->stream_lock, flags); klgd_build_command_stream(m); spin_unlock_irqrestore(&priv->stream_lock, flags); - } else + } else { + pr_debug("Timer fired, last stream of commands is still being processed\n"); atomic_set(&priv->send_asap, 1); + } klgd_schedule_update(ctx); } \ No newline at end of file -- 2.43.5