Loading drivers/scsi/ufs/debugfs.c +7 −7 Original line number Diff line number Diff line Loading @@ -28,6 +28,7 @@ static int ufsdbg_tag_stats_show(struct seq_file *file, void *data) int i; int max_depth; bool is_tag_empty = true; unsigned long flags; if (!hba) goto exit; Loading @@ -41,12 +42,12 @@ static int ufsdbg_tag_stats_show(struct seq_file *file, void *data) max_depth = hba->nutrs; mutex_lock(&ufs_stats->lock); pr_debug("%s: UFS tag statistics:\n", __func__); pr_debug("%s: Max tagged command queue depth is %d", __func__, max_depth); spin_lock_irqsave(hba->host->host_lock, flags); for (i = 0 ; i < max_depth ; ++i) { if (hba->ufs_stats.tag_stats[i] != 0) { is_tag_empty = false; Loading @@ -58,7 +59,7 @@ static int ufsdbg_tag_stats_show(struct seq_file *file, void *data) __func__, i, ufs_stats->tag_stats[i]); } } mutex_unlock(&ufs_stats->lock); spin_unlock_irqrestore(hba->host->host_lock, flags); if (is_tag_empty) pr_debug("%s: All tags statistics are empty", __func__); Loading @@ -80,6 +81,7 @@ static ssize_t ufsdbg_tag_stats_write(struct file *filp, struct ufs_stats *ufs_stats; int val = 0; int ret; unsigned long flags; ret = kstrtoint_from_user(ubuf, cnt, 0, &val); if (ret) { Loading @@ -88,7 +90,7 @@ static ssize_t ufsdbg_tag_stats_write(struct file *filp, } ufs_stats = &hba->ufs_stats; mutex_lock(&ufs_stats->lock); spin_lock_irqsave(hba->host->host_lock, flags); if (!val) { ufs_stats->enabled = false; Loading @@ -101,7 +103,7 @@ static ssize_t ufsdbg_tag_stats_write(struct file *filp, sizeof(unsigned int) * hba->nutrs); } mutex_unlock(&ufs_stats->lock); spin_unlock_irqrestore(hba->host->host_lock, flags); return cnt; } Loading @@ -115,8 +117,6 @@ static int ufshcd_init_tag_statistics(struct ufs_hba *hba) { int ret = 0; mutex_init(&hba->ufs_stats.lock); hba->ufs_stats.tag_stats = kzalloc(hba->nutrs * sizeof(u64), GFP_KERNEL); if (!hba->ufs_stats.tag_stats) { Loading drivers/scsi/ufs/ufshcd.c +0 −2 Original line number Diff line number Diff line Loading @@ -44,9 +44,7 @@ #define UFSHCD_UPDATE_TAG_STATS(hba, tag) \ do { \ if (hba->ufs_stats.enabled) { \ mutex_lock(&hba->ufs_stats.lock); \ hba->ufs_stats.tag_stats[tag]++; \ mutex_unlock(&hba->ufs_stats.lock); \ } \ } while (0); Loading drivers/scsi/ufs/ufshcd.h +0 −1 Original line number Diff line number Diff line Loading @@ -203,7 +203,6 @@ struct ufs_dev_cmd { #ifdef CONFIG_DEBUG_FS struct ufs_stats { u64 *tag_stats; struct mutex lock; bool enabled; }; Loading Loading
drivers/scsi/ufs/debugfs.c +7 −7 Original line number Diff line number Diff line Loading @@ -28,6 +28,7 @@ static int ufsdbg_tag_stats_show(struct seq_file *file, void *data) int i; int max_depth; bool is_tag_empty = true; unsigned long flags; if (!hba) goto exit; Loading @@ -41,12 +42,12 @@ static int ufsdbg_tag_stats_show(struct seq_file *file, void *data) max_depth = hba->nutrs; mutex_lock(&ufs_stats->lock); pr_debug("%s: UFS tag statistics:\n", __func__); pr_debug("%s: Max tagged command queue depth is %d", __func__, max_depth); spin_lock_irqsave(hba->host->host_lock, flags); for (i = 0 ; i < max_depth ; ++i) { if (hba->ufs_stats.tag_stats[i] != 0) { is_tag_empty = false; Loading @@ -58,7 +59,7 @@ static int ufsdbg_tag_stats_show(struct seq_file *file, void *data) __func__, i, ufs_stats->tag_stats[i]); } } mutex_unlock(&ufs_stats->lock); spin_unlock_irqrestore(hba->host->host_lock, flags); if (is_tag_empty) pr_debug("%s: All tags statistics are empty", __func__); Loading @@ -80,6 +81,7 @@ static ssize_t ufsdbg_tag_stats_write(struct file *filp, struct ufs_stats *ufs_stats; int val = 0; int ret; unsigned long flags; ret = kstrtoint_from_user(ubuf, cnt, 0, &val); if (ret) { Loading @@ -88,7 +90,7 @@ static ssize_t ufsdbg_tag_stats_write(struct file *filp, } ufs_stats = &hba->ufs_stats; mutex_lock(&ufs_stats->lock); spin_lock_irqsave(hba->host->host_lock, flags); if (!val) { ufs_stats->enabled = false; Loading @@ -101,7 +103,7 @@ static ssize_t ufsdbg_tag_stats_write(struct file *filp, sizeof(unsigned int) * hba->nutrs); } mutex_unlock(&ufs_stats->lock); spin_unlock_irqrestore(hba->host->host_lock, flags); return cnt; } Loading @@ -115,8 +117,6 @@ static int ufshcd_init_tag_statistics(struct ufs_hba *hba) { int ret = 0; mutex_init(&hba->ufs_stats.lock); hba->ufs_stats.tag_stats = kzalloc(hba->nutrs * sizeof(u64), GFP_KERNEL); if (!hba->ufs_stats.tag_stats) { Loading
drivers/scsi/ufs/ufshcd.c +0 −2 Original line number Diff line number Diff line Loading @@ -44,9 +44,7 @@ #define UFSHCD_UPDATE_TAG_STATS(hba, tag) \ do { \ if (hba->ufs_stats.enabled) { \ mutex_lock(&hba->ufs_stats.lock); \ hba->ufs_stats.tag_stats[tag]++; \ mutex_unlock(&hba->ufs_stats.lock); \ } \ } while (0); Loading
drivers/scsi/ufs/ufshcd.h +0 −1 Original line number Diff line number Diff line Loading @@ -203,7 +203,6 @@ struct ufs_dev_cmd { #ifdef CONFIG_DEBUG_FS struct ufs_stats { u64 *tag_stats; struct mutex lock; bool enabled; }; Loading