summaryrefslogtreecommitdiff
path: root/include/linux
diff options
context:
space:
mode:
authorDov Levenglick <dovl@codeaurora.org>2015-01-05 17:48:45 +0200
committerDavid Keitel <dkeitel@codeaurora.org>2016-03-22 10:58:29 -0700
commit6021822ecaf116058f1099992ba8d4fce9e08d6b (patch)
treeaca3c41584b999aefb0eaa758f4f1c4ada90111b /include/linux
parenta422990e68840887e2835dbfeb3a665411d478e5 (diff)
scsi: ufs-qcom: add print suppressing debugfs mechanism
Provide a mechanism for the userspace to suppress specific debug prints via debugfs. This is useful in order to avoid cases where too much printing would cause watchdog timers to expire. Change-Id: I2500b7621b631e260d98595ed8cfe7d5a496dc10 Signed-off-by: Dov Levenglick <dovl@codeaurora.org>
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/scsi/ufs/ufs-qcom.h18
-rw-r--r--include/linux/scsi/ufs/ufshcd.h6
2 files changed, 24 insertions, 0 deletions
diff --git a/include/linux/scsi/ufs/ufs-qcom.h b/include/linux/scsi/ufs/ufs-qcom.h
index dee92b9ee54f..e00f0b935227 100644
--- a/include/linux/scsi/ufs/ufs-qcom.h
+++ b/include/linux/scsi/ufs/ufs-qcom.h
@@ -15,6 +15,7 @@
#define UFS_QCOM_H_
#include <linux/phy/phy.h>
+#include <linux/scsi/ufs/ufshcd.h>
#define MAX_UFS_QCOM_HOSTS 1
#define MAX_U32 (~(u32)0)
@@ -120,6 +121,11 @@ struct ufs_qcom_phy_vreg {
bool enabled;
};
+/* QCOM UFS debug print bit mask */
+#define UFS_QCOM_DBG_PRINT_REGS_EN BIT(0)
+
+#define UFS_QCOM_DBG_PRINT_ALL UFS_QCOM_DBG_PRINT_REGS_EN
+
static inline void
ufs_qcom_get_controller_revision(struct ufs_hba *hba,
u8 *major, u16 *minor, u16 *step)
@@ -189,6 +195,13 @@ struct ufs_hw_version {
u8 major;
};
+#ifdef CONFIG_DEBUG_FS
+struct qcom_debugfs_files {
+ struct dentry *debugfs_root;
+ struct dentry *dbg_print_en;
+};
+#endif
+
struct ufs_qcom_host {
/*
* Set this capability if host controller supports the QUniPro mode
@@ -213,6 +226,11 @@ struct ufs_qcom_host {
void __iomem *dev_ref_clk_ctrl_mmio;
bool is_dev_ref_clk_enabled;
struct ufs_hw_version hw_ver;
+#ifdef CONFIG_DEBUG_FS
+ struct qcom_debugfs_files debugfs_files;
+#endif
+ /* Bitmask for enabling debug prints */
+ u32 dbg_print_en;
};
#define ufs_qcom_is_link_off(hba) ufshcd_is_link_off(hba)
diff --git a/include/linux/scsi/ufs/ufshcd.h b/include/linux/scsi/ufs/ufshcd.h
index b4d7b5f60995..ad3d250a7018 100644
--- a/include/linux/scsi/ufs/ufshcd.h
+++ b/include/linux/scsi/ufs/ufshcd.h
@@ -312,6 +312,8 @@ struct ufs_pwr_mode_info {
* @crypto_engine_reset_err: resets the saved error status of
* the cryptographic engine
* @dbg_register_dump: used to dump controller debug information
+ * @add_debugfs: used to add debugfs entries
+ * @remove_debugfs: used to remove debugfs entries
*/
struct ufs_hba_variant_ops {
const char *name;
@@ -340,6 +342,10 @@ struct ufs_hba_variant_ops {
int (*crypto_engine_get_err)(struct ufs_hba *);
void (*crypto_engine_reset_err)(struct ufs_hba *);
void (*dbg_register_dump)(struct ufs_hba *hba);
+#ifdef CONFIG_DEBUG_FS
+ void (*add_debugfs)(struct ufs_hba *hba, struct dentry *root);
+ void (*remove_debugfs)(struct ufs_hba *hba);
+#endif
};
/* clock gating state */