LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
From: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
To: alsa-devel@alsa-project.org
Cc: linux-kernel@vger.kernel.org, tiwai@suse.de, broonie@kernel.org,
	vkoul@kernel.org, gregkh@linuxfoundation.org, jank@cadence.com,
	srinivas.kandagatla@linaro.org,
	Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>,
	Sanyog Kale <sanyog.r.kale@intel.com>
Subject: [PATCH v2 10/15] soundwire: cadence_master: use rate_limited dynamic debug
Date: Wed, 22 May 2019 14:47:26 -0500	[thread overview]
Message-ID: <20190522194732.25704-11-pierre-louis.bossart@linux.intel.com> (raw)
In-Reply-To: <20190522194732.25704-1-pierre-louis.bossart@linux.intel.com>

When commands start failing, e.g. due to a bad electrical connection
or bus conflicts, the dmesg log is flooded. This should not happen for
production devices but it's quite frequent when bringing-up a new
platform.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
---
 drivers/soundwire/cadence_master.c | 24 ++++++++++++------------
 1 file changed, 12 insertions(+), 12 deletions(-)

diff --git a/drivers/soundwire/cadence_master.c b/drivers/soundwire/cadence_master.c
index 682789bb8ab3..6f4184f5256c 100644
--- a/drivers/soundwire/cadence_master.c
+++ b/drivers/soundwire/cadence_master.c
@@ -236,19 +236,19 @@ cdns_fill_msg_resp(struct sdw_cdns *cdns,
 	for (i = 0; i < count; i++) {
 		if (!(cdns->response_buf[i] & CDNS_MCP_RESP_ACK)) {
 			no_ack = 1;
-			dev_dbg(cdns->dev, "Msg Ack not received\n");
+			dev_dbg_ratelimited(cdns->dev, "Msg Ack not received\n");
 			if (cdns->response_buf[i] & CDNS_MCP_RESP_NACK) {
 				nack = 1;
-				dev_err(cdns->dev, "Msg NACK received\n");
+				dev_err_ratelimited(cdns->dev, "Msg NACK received\n");
 			}
 		}
 	}
 
 	if (nack) {
-		dev_err(cdns->dev, "Msg NACKed for Slave %d\n", msg->dev_num);
+		dev_err_ratelimited(cdns->dev, "Msg NACKed for Slave %d\n", msg->dev_num);
 		return SDW_CMD_FAIL;
 	} else if (no_ack) {
-		dev_dbg(cdns->dev, "Msg ignored for Slave %d\n", msg->dev_num);
+		dev_dbg_ratelimited(cdns->dev, "Msg ignored for Slave %d\n", msg->dev_num);
 		return SDW_CMD_IGNORED;
 	}
 
@@ -356,12 +356,12 @@ cdns_program_scp_addr(struct sdw_cdns *cdns, struct sdw_msg *msg)
 
 	/* For NACK, NO ack, don't return err if we are in Broadcast mode */
 	if (nack) {
-		dev_err(cdns->dev,
-			"SCP_addrpage NACKed for Slave %d\n", msg->dev_num);
+		dev_err_ratelimited(cdns->dev,
+				    "SCP_addrpage NACKed for Slave %d\n", msg->dev_num);
 		return SDW_CMD_FAIL;
 	} else if (no_ack) {
-		dev_dbg(cdns->dev,
-			"SCP_addrpage ignored for Slave %d\n", msg->dev_num);
+		dev_dbg_ratelimited(cdns->dev,
+				    "SCP_addrpage ignored for Slave %d\n", msg->dev_num);
 		return SDW_CMD_IGNORED;
 	}
 
@@ -524,9 +524,9 @@ static int cdns_update_slave_status(struct sdw_cdns *cdns,
 
 		/* first check if Slave reported multiple status */
 		if (set_status > 1) {
-			dev_warn(cdns->dev,
-				 "Slave reported multiple Status: %d\n",
-				 status[i]);
+			dev_warn_ratelimited(cdns->dev,
+					     "Slave reported multiple Status: %d\n",
+					     status[i]);
 			/*
 			 * TODO: we need to reread the status here by
 			 * issuing a PING cmd
@@ -612,7 +612,7 @@ irqreturn_t sdw_cdns_thread(int irq, void *dev_id)
 	struct sdw_cdns *cdns = dev_id;
 	u32 slave0, slave1;
 
-	dev_dbg(cdns->dev, "Slave status change\n");
+	dev_dbg_ratelimited(cdns->dev, "Slave status change\n");
 
 	slave0 = cdns_readl(cdns, CDNS_MCP_SLAVE_INTSTAT0);
 	slave1 = cdns_readl(cdns, CDNS_MCP_SLAVE_INTSTAT1);
-- 
2.20.1


  parent reply	other threads:[~2019-05-22 19:48 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-05-22 19:47 [PATCH v2 00/15] soundwire: corrections to ACPI/DisCo/Intel support Pierre-Louis Bossart
2019-05-22 19:47 ` [PATCH v2 01/15] soundwire: intel: filter SoundWire controller device search Pierre-Louis Bossart
2019-05-22 19:47 ` [PATCH v2 02/15] soundwire: mipi_disco: fix master/link error Pierre-Louis Bossart
2019-05-22 19:47 ` [PATCH v2 03/15] soundwire: add port-related definitions Pierre-Louis Bossart
2019-05-22 19:47 ` [PATCH v2 04/15] soundwire: remove master data port properties Pierre-Louis Bossart
2019-05-22 19:47 ` [PATCH v2 05/15] soundwire: mipi-disco: remove master_count property for masters Pierre-Louis Bossart
2019-05-22 19:47 ` [PATCH v2 06/15] soundwire: rename 'freq' fields Pierre-Louis Bossart
2019-05-22 19:47 ` [PATCH v2 07/15] soundwire: mipi-disco: fix clock stop modes Pierre-Louis Bossart
2019-05-22 19:47 ` [PATCH v2 08/15] soundwire: clarify comment Pierre-Louis Bossart
2019-05-22 19:47 ` [PATCH v2 09/15] soundwire: rename/clarify MIPI DisCo properties Pierre-Louis Bossart
2019-05-22 19:47 ` Pierre-Louis Bossart [this message]
2019-05-22 19:47 ` [PATCH v2 11/15] soundwire: cadence_master: log Slave status mask on errors Pierre-Louis Bossart
2019-05-22 19:47 ` [PATCH v2 12/15] soundwire: cadence_master: check the number of bidir PDIs Pierre-Louis Bossart
2019-05-22 19:47 ` [PATCH v2 13/15] soundwire: Intel: add log for number of PCM and PDM PDIs Pierre-Louis Bossart
2019-05-22 19:47 ` [PATCH v2 14/15] soundwire: fix typo in comments Pierre-Louis Bossart
2019-05-22 19:47 ` [PATCH v2 15/15] soundwire: intel_init: add checks on link numbers Pierre-Louis Bossart
2019-05-27  5:23 ` [PATCH v2 00/15] soundwire: corrections to ACPI/DisCo/Intel support Vinod Koul

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=20190522194732.25704-11-pierre-louis.bossart@linux.intel.com \
    --to=pierre-louis.bossart@linux.intel.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=broonie@kernel.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=jank@cadence.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=sanyog.r.kale@intel.com \
    --cc=srinivas.kandagatla@linaro.org \
    --cc=tiwai@suse.de \
    --cc=vkoul@kernel.org \
    --subject='Re: [PATCH v2 10/15] soundwire: cadence_master: use rate_limited dynamic debug' \
    /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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).