mmc: sdhci: rate limit sdhci_dumpregs() prints
Rate limit sdhci_dumpregs() prints to avoid unnecessary and exessive logging which can sometimes lead to watchdog timeouts (especially due to bad cards). Change-Id: Ib6be6d563e47c2d2e9e1b6b0410c2c45712a9b17 Signed-off-by: Sahitya Tummala <stummala@codeaurora.org>
This commit is contained in:
parent
e5bd1357a1
commit
7c957dec83
2 changed files with 8 additions and 3 deletions
|
@ -48,6 +48,9 @@
|
|||
|
||||
#define MAX_TUNING_LOOP 40
|
||||
|
||||
#define SDHCI_DBG_DUMP_RS_INTERVAL (10 * HZ)
|
||||
#define SDHCI_DBG_DUMP_RS_BURST 2
|
||||
|
||||
static unsigned int debug_quirks = 0;
|
||||
static unsigned int debug_quirks2;
|
||||
|
||||
|
@ -2804,7 +2807,7 @@ static void sdhci_data_irq(struct sdhci_host *host, u32 intmask)
|
|||
} else {
|
||||
pr_msg = true;
|
||||
}
|
||||
if (pr_msg) {
|
||||
if (pr_msg && __ratelimit(&host->dbg_dump_rs)) {
|
||||
pr_err("%s: data txfr (0x%08x) error: %d after %lld ms\n",
|
||||
mmc_hostname(host->mmc), intmask,
|
||||
host->data->error, ktime_to_ms(ktime_sub(
|
||||
|
@ -3209,6 +3212,8 @@ struct sdhci_host *sdhci_alloc_host(struct device *dev,
|
|||
host->mmc = mmc;
|
||||
|
||||
spin_lock_init(&host->lock);
|
||||
ratelimit_state_init(&host->dbg_dump_rs, SDHCI_DBG_DUMP_RS_INTERVAL,
|
||||
SDHCI_DBG_DUMP_RS_BURST);
|
||||
|
||||
return host;
|
||||
}
|
||||
|
|
|
@ -18,7 +18,7 @@
|
|||
#include <linux/types.h>
|
||||
#include <linux/io.h>
|
||||
#include <linux/pm_qos.h>
|
||||
|
||||
#include <linux/ratelimit.h>
|
||||
#include <linux/mmc/host.h>
|
||||
|
||||
/*
|
||||
|
@ -597,7 +597,7 @@ struct sdhci_host {
|
|||
enum sdhci_power_policy power_policy;
|
||||
|
||||
u32 auto_cmd_err_sts;
|
||||
|
||||
struct ratelimit_state dbg_dump_rs;
|
||||
unsigned long private[0] ____cacheline_aligned;
|
||||
};
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue