Skip to content

Commit e810f1f

Browse files
committed
Merge tag 'opp-updates-7.1-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/vireshk/pm
Pull OPP updates for 7.1 from Viresh Kumar: "- Use performance level if available to distinguish between rates in debugfs (Manivannan Sadhasivam). - Fix scoped_guard in dev_pm_opp_xlate_required_opp() (Viresh Kumar)." * tag 'opp-updates-7.1-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/vireshk/pm: OPP: Move break out of scoped_guard in dev_pm_opp_xlate_required_opp() OPP: debugfs: Use performance level if available to distinguish between rates
2 parents 591cd65 + 3d2398f commit e810f1f

2 files changed

Lines changed: 12 additions & 10 deletions

File tree

drivers/opp/core.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2742,8 +2742,8 @@ struct dev_pm_opp *dev_pm_opp_xlate_required_opp(struct opp_table *src_table,
27422742
break;
27432743
}
27442744
}
2745-
break;
27462745
}
2746+
break;
27472747
}
27482748

27492749
if (IS_ERR(dest_opp)) {

drivers/opp/debugfs.c

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -130,22 +130,24 @@ void opp_debug_create_one(struct dev_pm_opp *opp, struct opp_table *opp_table)
130130
{
131131
struct dentry *pdentry = opp_table->dentry;
132132
struct dentry *d;
133-
unsigned long id;
134-
char name[25]; /* 20 chars for 64 bit value + 5 (opp:\0) */
133+
char name[36]; /* "opp:"(4) + u64(20) + "-" (1) + u32(10) + NULL(1) */
135134

136135
/*
137136
* Get directory name for OPP.
138137
*
139-
* - Normally rate is unique to each OPP, use it to get unique opp-name.
138+
* - Normally rate is unique to each OPP, use it to get unique opp-name,
139+
* together with performance level if available.
140140
* - For some devices rate isn't available or there are multiple, use
141141
* index instead for them.
142142
*/
143-
if (likely(opp_table->clk_count == 1 && opp->rates[0]))
144-
id = opp->rates[0];
145-
else
146-
id = _get_opp_count(opp_table);
147-
148-
snprintf(name, sizeof(name), "opp:%lu", id);
143+
if (likely(opp_table->clk_count == 1 && opp->rates[0])) {
144+
if (opp->level == OPP_LEVEL_UNSET)
145+
snprintf(name, sizeof(name), "opp:%lu", opp->rates[0]);
146+
else
147+
snprintf(name, sizeof(name), "opp:%lu-%u", opp->rates[0], opp->level);
148+
} else {
149+
snprintf(name, sizeof(name), "opp:%u", _get_opp_count(opp_table));
150+
}
149151

150152
/* Create per-opp directory */
151153
d = debugfs_create_dir(name, pdentry);

0 commit comments

Comments
 (0)