* [PATCH 1/2] ARM: tegra: fix return value for debugfs init
@ 2012-09-06 14:55 Peter De Schrijver
2012-09-06 14:55 ` [PATCH 2/2] ARM: tegra: fix debugfs entry for Tegra30 Peter De Schrijver
2012-09-06 18:24 ` [PATCH 1/2] ARM: tegra: fix return value for debugfs init Stephen Warren
0 siblings, 2 replies; 3+ messages in thread
From: Peter De Schrijver @ 2012-09-06 14:55 UTC (permalink / raw)
To: Peter De Schrijver
Cc: Colin Cross, Olof Johansson, Stephen Warren, Russell King,
linux-tegra, linux-arm-kernel, linux-kernel
tegra_powergate_debugfs_init() always returns -ENOMEM. It shouldn't do that
when registering the debugfs entry succeeded.
Signed-off-by: Peter De Schrijver <pdeschrijver@nvidia.com>
---
arch/arm/mach-tegra/powergate.c | 3 +--
1 files changed, 1 insertions(+), 2 deletions(-)
diff --git a/arch/arm/mach-tegra/powergate.c b/arch/arm/mach-tegra/powergate.c
index 15d5065..27aee4a 100644
--- a/arch/arm/mach-tegra/powergate.c
+++ b/arch/arm/mach-tegra/powergate.c
@@ -237,14 +237,13 @@ static const struct file_operations powergate_fops = {
int __init tegra_powergate_debugfs_init(void)
{
struct dentry *d;
- int err = -ENOMEM;
d = debugfs_create_file("powergate", S_IRUGO, NULL, NULL,
&powergate_fops);
if (!d)
return -ENOMEM;
- return err;
+ return 0;
}
#endif
--
1.7.7.rc0.72.g4b5ea.dirty
^ permalink raw reply related [flat|nested] 3+ messages in thread
* [PATCH 2/2] ARM: tegra: fix debugfs entry for Tegra30
2012-09-06 14:55 [PATCH 1/2] ARM: tegra: fix return value for debugfs init Peter De Schrijver
@ 2012-09-06 14:55 ` Peter De Schrijver
2012-09-06 18:24 ` [PATCH 1/2] ARM: tegra: fix return value for debugfs init Stephen Warren
1 sibling, 0 replies; 3+ messages in thread
From: Peter De Schrijver @ 2012-09-06 14:55 UTC (permalink / raw)
To: Peter De Schrijver
Cc: Colin Cross, Olof Johansson, Stephen Warren, Russell King,
linux-tegra, linux-arm-kernel, linux-kernel
Tegra30 has more powerdomains than Tegra20. The debugfs code did not take this
into account.
Signed-off-by: Peter De Schrijver <pdeschrijver@nvidia.com>
---
arch/arm/mach-tegra/powergate.c | 40 ++++++++++++++++++++++++++++++++++----
1 files changed, 35 insertions(+), 5 deletions(-)
diff --git a/arch/arm/mach-tegra/powergate.c b/arch/arm/mach-tegra/powergate.c
index 27aee4a..de0662d 100644
--- a/arch/arm/mach-tegra/powergate.c
+++ b/arch/arm/mach-tegra/powergate.c
@@ -199,7 +199,9 @@ int __init tegra_powergate_init(void)
#ifdef CONFIG_DEBUG_FS
-static const char * const powergate_name[] = {
+static const char * const *powergate_name;
+
+static const char * const powergate_name_t20[] = {
[TEGRA_POWERGATE_CPU] = "cpu",
[TEGRA_POWERGATE_3D] = "3d",
[TEGRA_POWERGATE_VENC] = "venc",
@@ -209,6 +211,23 @@ static const char * const powergate_name[] = {
[TEGRA_POWERGATE_MPE] = "mpe",
};
+static const char * const powergate_name_t30[] = {
+ [TEGRA_POWERGATE_CPU] = "cpu0",
+ [TEGRA_POWERGATE_3D] = "3d0",
+ [TEGRA_POWERGATE_VENC] = "venc",
+ [TEGRA_POWERGATE_VDEC] = "vdec",
+ [TEGRA_POWERGATE_PCIE] = "pcie",
+ [TEGRA_POWERGATE_L2] = "l2",
+ [TEGRA_POWERGATE_MPE] = "mpe",
+ [TEGRA_POWERGATE_HEG] = "heg",
+ [TEGRA_POWERGATE_SATA] = "sata",
+ [TEGRA_POWERGATE_CPU1] = "cpu1",
+ [TEGRA_POWERGATE_CPU2] = "cpu2",
+ [TEGRA_POWERGATE_CPU3] = "cpu3",
+ [TEGRA_POWERGATE_CELP] = "celp",
+ [TEGRA_POWERGATE_3D1] = "3d1",
+};
+
static int powergate_show(struct seq_file *s, void *data)
{
int i;
@@ -238,10 +257,21 @@ int __init tegra_powergate_debugfs_init(void)
{
struct dentry *d;
- d = debugfs_create_file("powergate", S_IRUGO, NULL, NULL,
- &powergate_fops);
- if (!d)
- return -ENOMEM;
+ switch (tegra_chip_id) {
+ case TEGRA20:
+ powergate_name = powergate_name_t20;
+ break;
+ case TEGRA30:
+ powergate_name = powergate_name_t30;
+ break;
+ }
+
+ if (powergate_name) {
+ d = debugfs_create_file("powergate", S_IRUGO, NULL, NULL,
+ &powergate_fops);
+ if (!d)
+ return -ENOMEM;
+ }
return 0;
}
--
1.7.7.rc0.72.g4b5ea.dirty
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH 1/2] ARM: tegra: fix return value for debugfs init
2012-09-06 14:55 [PATCH 1/2] ARM: tegra: fix return value for debugfs init Peter De Schrijver
2012-09-06 14:55 ` [PATCH 2/2] ARM: tegra: fix debugfs entry for Tegra30 Peter De Schrijver
@ 2012-09-06 18:24 ` Stephen Warren
1 sibling, 0 replies; 3+ messages in thread
From: Stephen Warren @ 2012-09-06 18:24 UTC (permalink / raw)
To: Peter De Schrijver
Cc: Colin Cross, Olof Johansson, Russell King, linux-tegra,
linux-arm-kernel, linux-kernel
On 09/06/2012 08:55 AM, Peter De Schrijver wrote:
> tegra_powergate_debugfs_init() always returns -ENOMEM. It shouldn't do that
> when registering the debugfs entry succeeded.
Thanks, applied the series to Tegra's for-3.7/fixes branch.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2012-09-06 18:24 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-09-06 14:55 [PATCH 1/2] ARM: tegra: fix return value for debugfs init Peter De Schrijver
2012-09-06 14:55 ` [PATCH 2/2] ARM: tegra: fix debugfs entry for Tegra30 Peter De Schrijver
2012-09-06 18:24 ` [PATCH 1/2] ARM: tegra: fix return value for debugfs init Stephen Warren
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).