Loading drivers/scsi/ufs/ufs-qcom-debugfs.c +44 −0 Original line number Diff line number Diff line Loading @@ -219,6 +219,39 @@ static const struct file_operations ufs_qcom_dbg_dbg_regs_desc = { .read = seq_read, }; static int ufs_qcom_dbg_pm_qos_show(struct seq_file *file, void *data) { struct ufs_qcom_host *host = (struct ufs_qcom_host *)file->private; unsigned long flags; int i; spin_lock_irqsave(host->hba->host->host_lock, flags); seq_printf(file, "enabled: %d\n", host->pm_qos.is_enabled); for (i = 0; i < host->pm_qos.num_groups && host->pm_qos.groups; i++) seq_printf(file, "CPU Group #%d(mask=0x%lx): active_reqs=%d, state=%d, latency=%d\n", i, host->pm_qos.groups[i].mask.bits[0], host->pm_qos.groups[i].active_reqs, host->pm_qos.groups[i].state, host->pm_qos.groups[i].latency_us); spin_unlock_irqrestore(host->hba->host->host_lock, flags); return 0; } static int ufs_qcom_dbg_pm_qos_open(struct inode *inode, struct file *file) { return single_open(file, ufs_qcom_dbg_pm_qos_show, inode->i_private); } static const struct file_operations ufs_qcom_dbg_pm_qos_desc = { .open = ufs_qcom_dbg_pm_qos_open, .read = seq_read, }; void ufs_qcom_dbg_add_debugfs(struct ufs_hba *hba, struct dentry *root) { struct ufs_qcom_host *host; Loading Loading @@ -307,6 +340,17 @@ void ufs_qcom_dbg_add_debugfs(struct ufs_hba *hba, struct dentry *root) goto err; } host->debugfs_files.pm_qos = debugfs_create_file("pm_qos", S_IRUSR, host->debugfs_files.debugfs_root, host, &ufs_qcom_dbg_pm_qos_desc); if (!host->debugfs_files.dbg_regs) { dev_err(host->hba->dev, "%s: failed create dbg_regs debugfs entry\n", __func__); goto err; } return; err: Loading drivers/scsi/ufs/ufs-qcom.h +1 −0 Original line number Diff line number Diff line Loading @@ -227,6 +227,7 @@ struct qcom_debugfs_files { struct dentry *testbus_cfg; struct dentry *testbus_bus; struct dentry *dbg_regs; struct dentry *pm_qos; }; #endif Loading Loading
drivers/scsi/ufs/ufs-qcom-debugfs.c +44 −0 Original line number Diff line number Diff line Loading @@ -219,6 +219,39 @@ static const struct file_operations ufs_qcom_dbg_dbg_regs_desc = { .read = seq_read, }; static int ufs_qcom_dbg_pm_qos_show(struct seq_file *file, void *data) { struct ufs_qcom_host *host = (struct ufs_qcom_host *)file->private; unsigned long flags; int i; spin_lock_irqsave(host->hba->host->host_lock, flags); seq_printf(file, "enabled: %d\n", host->pm_qos.is_enabled); for (i = 0; i < host->pm_qos.num_groups && host->pm_qos.groups; i++) seq_printf(file, "CPU Group #%d(mask=0x%lx): active_reqs=%d, state=%d, latency=%d\n", i, host->pm_qos.groups[i].mask.bits[0], host->pm_qos.groups[i].active_reqs, host->pm_qos.groups[i].state, host->pm_qos.groups[i].latency_us); spin_unlock_irqrestore(host->hba->host->host_lock, flags); return 0; } static int ufs_qcom_dbg_pm_qos_open(struct inode *inode, struct file *file) { return single_open(file, ufs_qcom_dbg_pm_qos_show, inode->i_private); } static const struct file_operations ufs_qcom_dbg_pm_qos_desc = { .open = ufs_qcom_dbg_pm_qos_open, .read = seq_read, }; void ufs_qcom_dbg_add_debugfs(struct ufs_hba *hba, struct dentry *root) { struct ufs_qcom_host *host; Loading Loading @@ -307,6 +340,17 @@ void ufs_qcom_dbg_add_debugfs(struct ufs_hba *hba, struct dentry *root) goto err; } host->debugfs_files.pm_qos = debugfs_create_file("pm_qos", S_IRUSR, host->debugfs_files.debugfs_root, host, &ufs_qcom_dbg_pm_qos_desc); if (!host->debugfs_files.dbg_regs) { dev_err(host->hba->dev, "%s: failed create dbg_regs debugfs entry\n", __func__); goto err; } return; err: Loading
drivers/scsi/ufs/ufs-qcom.h +1 −0 Original line number Diff line number Diff line Loading @@ -227,6 +227,7 @@ struct qcom_debugfs_files { struct dentry *testbus_cfg; struct dentry *testbus_bus; struct dentry *dbg_regs; struct dentry *pm_qos; }; #endif Loading