All of lore.kernel.org
 help / color / mirror / Atom feed
From: vani.ganji@intel.com
To: alsa-devel@alsa-project.org
Cc: vani.ganji@intel.com
Subject: [alsa-devel] [PATCH] ASoC: Intel: Reduce Resource notification trace to once per minute.
Date: Wed, 23 Oct 2019 21:52:35 +0530	[thread overview]
Message-ID: <20191023162235.12539-1-vani.ganji@intel.com> (raw)

From: Vani Ganji <vani.ganji@intel.com>

Resource notification trace "MCPS Budget violation" observed very
frequently which might cause losing critical debug information.
Added a counter to print trace on first instance and once per minute.
It is required to be notified when module resource is used more than
a threshold so enabled once per minute.

Suggested-by: Grant Grundler <grundler@google.com>
Signed-off-by: Vani Ganji <vani.ganji@intel.com>
---
 sound/soc/intel/skylake/skl-sst-ipc.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/sound/soc/intel/skylake/skl-sst-ipc.c b/sound/soc/intel/skylake/skl-sst-ipc.c
index 667cdddc289f..03ff0d8cea3e 100644
--- a/sound/soc/intel/skylake/skl-sst-ipc.c
+++ b/sound/soc/intel/skylake/skl-sst-ipc.c
@@ -346,6 +346,7 @@ int skl_ipc_process_notification(struct sst_generic_ipc *ipc,
 		struct skl_ipc_header header)
 {
 	struct skl_dev *skl = container_of(ipc, struct skl_dev, ipc);
+	static unsigned long j;
 
 	if (IPC_GLB_NOTIFY_MSG_TYPE(header.primary)) {
 		switch (IPC_GLB_NOTIFY_TYPE(header.primary)) {
@@ -355,12 +356,17 @@ int skl_ipc_process_notification(struct sst_generic_ipc *ipc,
 			break;
 
 		case IPC_GLB_NOTIFY_RESOURCE_EVENT:
-			dev_err(ipc->dev, "MCPS Budget Violation: %x\n",
+			/*Print trace on first instance and for every minute*/
+			if (printk_timed_ratelimit(&j, 60000)) {
+				dev_err(ipc->dev, "MCPS Budget Violation: %x\n",
 						header.primary);
+			}
 			break;
 
 		case IPC_GLB_NOTIFY_FW_READY:
 			skl->boot_complete = true;
+			/* reset timer on every FW load */
+			j = 0;
 			wake_up(&skl->boot_wait);
 			break;
 
-- 
2.17.1

_______________________________________________
Alsa-devel mailing list
Alsa-devel@alsa-project.org
https://mailman.alsa-project.org/mailman/listinfo/alsa-devel

                 reply	other threads:[~2019-10-23 16:21 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20191023162235.12539-1-vani.ganji@intel.com \
    --to=vani.ganji@intel.com \
    --cc=alsa-devel@alsa-project.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.