]> rtime.felk.cvut.cz Git - sojka/nv-tegra/linux-3.10.git/commitdiff
platform: tegra: mcerr: Silence UART logging
authorAlex Waterman <alexw@nvidia.com>
Fri, 6 Mar 2015 18:42:41 +0000 (10:42 -0800)
committerKrishna Reddy <vdumpa@nvidia.com>
Fri, 20 Mar 2015 17:52:45 +0000 (10:52 -0700)
Allow the UART logging to be silenced by a debugfs node:

  /d/mc/err/quiet

To stop mc-errs from being printed on the UART:

  # echo 1 > /d/mc/err/quiet

To re-enable UART logging:

  # echo 0 > /d/mc/err/quiet

This will stop all prints from the mcerr driver, both to
trace_printk() and pr_err(). It does not stop actual accounting
of the errors in /d/mc/err/mcerr

Bug 200082185

Change-Id: Icda803e971ff546aad6a7702d813d97075338893
Signed-off-by: Alex Waterman <alexw@nvidia.com>
Reviewed-on: http://git-master/r/714825
Reviewed-by: Krishna Reddy <vdumpa@nvidia.com>
drivers/platform/tegra/mc/mcerr.c

index 53ed5544fc740871ec26847db6cd7ace71c341b9..0d81ec2597e6eb6646bb2c63423ea6a06e58d9c9 100644 (file)
 #include <tegra/mc.h>
 #include <tegra/mcerr.h>
 
-#define mcerr_pr(fmt, ...)                             \
-       do {                                            \
-               trace_printk(fmt, ##__VA_ARGS__);       \
-               pr_err(fmt, ##__VA_ARGS__);             \
+#define mcerr_pr(fmt, ...)                                     \
+       do {                                                    \
+               if (!mcerr_silenced) {                          \
+                       trace_printk(fmt, ##__VA_ARGS__);       \
+                       pr_err(fmt, ##__VA_ARGS__);             \
+               }                                               \
        } while (0)
 
 static bool mcerr_throttle_enabled = true;
+static u32  mcerr_silenced;
 
 static int arb_intr_mma_set(const char *arg, const struct kernel_param *kp);
 static int arb_intr_mma_get(char *buff, const struct kernel_param *kp);
@@ -500,6 +503,9 @@ int tegra_mcerr_init(struct dentry *mc_parent, struct platform_device *pdev)
                goto done;
        }
 
+       if (!mc_parent)
+               goto done;
+
        mcerr_debugfs_dir = debugfs_create_dir("err", mc_parent);
        if (mcerr_debugfs_dir == NULL) {
                pr_err("Failed to make debugfs node: %ld\n",
@@ -511,6 +517,7 @@ int tegra_mcerr_init(struct dentry *mc_parent, struct platform_device *pdev)
        debugfs_create_file("mcerr_throttle", S_IRUGO | S_IWUSR,
                            mcerr_debugfs_dir, NULL,
                            &mcerr_throttle_debugfs_fops);
+       debugfs_create_u32("quiet", 0644, mcerr_debugfs_dir, &mcerr_silenced);
 
 done:
        return 0;