Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1604273 > unrolled thread

[PATCH] soc/tegra: fix link errors with PMC disabled

Started byArnd Bergmann <arnd@arndb.de>
First post2017-03-20 10:30 +0100
Last post2017-03-20 13:50 +0100
Articles 4 — 3 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH] soc/tegra: fix link errors with PMC disabled Arnd Bergmann <arnd@arndb.de> - 2017-03-20 10:30 +0100
    Re: [PATCH] soc/tegra: fix link errors with PMC disabled Jon Hunter <jonathanh@nvidia.com> - 2017-03-20 11:00 +0100
      Re: [PATCH] soc/tegra: fix link errors with PMC disabled Thierry Reding <thierry.reding@gmail.com> - 2017-03-20 12:20 +0100
    Re: [PATCH] soc/tegra: fix link errors with PMC disabled Thierry Reding <thierry.reding@gmail.com> - 2017-03-20 13:50 +0100

#1604273 — [PATCH] soc/tegra: fix link errors with PMC disabled

FromArnd Bergmann <arnd@arndb.de>
Date2017-03-20 10:30 +0100
Subject[PATCH] soc/tegra: fix link errors with PMC disabled
Message-ID<tn1Nv-2FR-13@gated-at.bofh.it>
With the new Tegra186 PMC driver merged, anything that relies on the previous
PMC driver fails to link when that is disabled:

arch/arm/mach-tegra/pm.o: In function `tegra_pm_set':
pm.c:(.text.tegra_pm_set+0x3c): undefined reference to `tegra_pmc_enter_suspend_mode'
arch/arm/mach-tegra/pm.o: In function `tegra_suspend_enter':
pm.c:(.text.tegra_suspend_enter+0x4): undefined reference to `tegra_pmc_get_suspend_mode'
arch/arm/mach-tegra/pm.o: In function `tegra_init_suspend':
pm.c:(.init.text+0x1c): undefined reference to `tegra_pmc_get_suspend_mode'
pm.c:(.init.text+0x74): undefined reference to `tegra_pmc_set_suspend_mode'

ERROR: tegra_powergate_sequence_power_up [drivers/ata/ahci_tegra.ko] undefined!
ERROR: tegra_powergate_power_off [drivers/ata/ahci_tegra.ko] undefined!

Making the definition depend on the presence of the driver makes it build
again, though that might not be the correct fix.

Fixes: 854014236290 ("soc/tegra: Implement Tegra186 PMC support")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
 include/soc/tegra/pmc.h | 29 +++++++++++++++++++++--------
 1 file changed, 21 insertions(+), 8 deletions(-)

diff --git a/include/soc/tegra/pmc.h b/include/soc/tegra/pmc.h
index 2f271d1b9cea..1c3982bc558f 100644
--- a/include/soc/tegra/pmc.h
+++ b/include/soc/tegra/pmc.h
@@ -26,12 +26,6 @@
 struct clk;
 struct reset_control;
 
-#ifdef CONFIG_PM_SLEEP
-enum tegra_suspend_mode tegra_pmc_get_suspend_mode(void);
-void tegra_pmc_set_suspend_mode(enum tegra_suspend_mode mode);
-void tegra_pmc_enter_suspend_mode(enum tegra_suspend_mode mode);
-#endif /* CONFIG_PM_SLEEP */
-
 #ifdef CONFIG_SMP
 bool tegra_pmc_cpu_is_powered(unsigned int cpuid);
 int tegra_pmc_cpu_power_on(unsigned int cpuid);
@@ -144,7 +138,7 @@ enum tegra_io_pad_voltage {
 	TEGRA_IO_PAD_3300000UV,
 };
 
-#ifdef CONFIG_ARCH_TEGRA
+#ifdef CONFIG_SOC_TEGRA_PMC
 int tegra_powergate_is_powered(unsigned int id);
 int tegra_powergate_power_on(unsigned int id);
 int tegra_powergate_power_off(unsigned int id);
@@ -163,6 +157,11 @@ int tegra_io_pad_get_voltage(enum tegra_io_pad id);
 /* deprecated, use tegra_io_pad_power_{enable,disable}() instead */
 int tegra_io_rail_power_on(unsigned int id);
 int tegra_io_rail_power_off(unsigned int id);
+
+enum tegra_suspend_mode tegra_pmc_get_suspend_mode(void);
+void tegra_pmc_set_suspend_mode(enum tegra_suspend_mode mode);
+void tegra_pmc_enter_suspend_mode(enum tegra_suspend_mode mode);
+
 #else
 static inline int tegra_powergate_is_powered(unsigned int id)
 {
@@ -221,6 +220,20 @@ static inline int tegra_io_rail_power_off(unsigned int id)
 {
 	return -ENOSYS;
 }
-#endif /* CONFIG_ARCH_TEGRA */
+
+static inline enum tegra_suspend_mode tegra_pmc_get_suspend_mode(void)
+{
+	return TEGRA_SUSPEND_NONE;
+}
+
+static inline void tegra_pmc_set_suspend_mode(enum tegra_suspend_mode mode)
+{
+}
+
+static inline void tegra_pmc_enter_suspend_mode(enum tegra_suspend_mode mode)
+{
+}
+
+#endif /* CONFIG_SOC_TEGRA_PMC */
 
 #endif /* __SOC_TEGRA_PMC_H__ */
-- 
2.9.0

[toc] | [next] | [standalone]


#1604305

FromJon Hunter <jonathanh@nvidia.com>
Date2017-03-20 11:00 +0100
Message-ID<tn2gy-2R9-23@gated-at.bofh.it>
In reply to#1604273
Hi Arnd,

On 20/03/17 09:13, Arnd Bergmann wrote:
> With the new Tegra186 PMC driver merged, anything that relies on the previous
> PMC driver fails to link when that is disabled:
> 
> arch/arm/mach-tegra/pm.o: In function `tegra_pm_set':
> pm.c:(.text.tegra_pm_set+0x3c): undefined reference to `tegra_pmc_enter_suspend_mode'
> arch/arm/mach-tegra/pm.o: In function `tegra_suspend_enter':
> pm.c:(.text.tegra_suspend_enter+0x4): undefined reference to `tegra_pmc_get_suspend_mode'
> arch/arm/mach-tegra/pm.o: In function `tegra_init_suspend':
> pm.c:(.init.text+0x1c): undefined reference to `tegra_pmc_get_suspend_mode'
> pm.c:(.init.text+0x74): undefined reference to `tegra_pmc_set_suspend_mode'
> 
> ERROR: tegra_powergate_sequence_power_up [drivers/ata/ahci_tegra.ko] undefined!
> ERROR: tegra_powergate_power_off [drivers/ata/ahci_tegra.ko] undefined!
> 
> Making the definition depend on the presence of the driver makes it build
> again, though that might not be the correct fix.
> 
> Fixes: 854014236290 ("soc/tegra: Implement Tegra186 PMC support")
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>

A fix was also submitted by Krzysztof [0].

Thierry, what's your preference? Maybe Arnd's approach is better.

Jon

[0] http://marc.info/?l=linux-arm-kernel&m=148926404419311&w=2

-- 
nvpublic

[toc] | [prev] | [next] | [standalone]


#1604388

FromThierry Reding <thierry.reding@gmail.com>
Date2017-03-20 12:20 +0100
Message-ID<tn3vX-3VF-1@gated-at.bofh.it>
In reply to#1604305

[Multipart message — attachments visible in raw view] — view raw

On Mon, Mar 20, 2017 at 09:47:39AM +0000, Jon Hunter wrote:
> Hi Arnd,
> 
> On 20/03/17 09:13, Arnd Bergmann wrote:
> > With the new Tegra186 PMC driver merged, anything that relies on the previous
> > PMC driver fails to link when that is disabled:
> > 
> > arch/arm/mach-tegra/pm.o: In function `tegra_pm_set':
> > pm.c:(.text.tegra_pm_set+0x3c): undefined reference to `tegra_pmc_enter_suspend_mode'
> > arch/arm/mach-tegra/pm.o: In function `tegra_suspend_enter':
> > pm.c:(.text.tegra_suspend_enter+0x4): undefined reference to `tegra_pmc_get_suspend_mode'
> > arch/arm/mach-tegra/pm.o: In function `tegra_init_suspend':
> > pm.c:(.init.text+0x1c): undefined reference to `tegra_pmc_get_suspend_mode'
> > pm.c:(.init.text+0x74): undefined reference to `tegra_pmc_set_suspend_mode'
> > 
> > ERROR: tegra_powergate_sequence_power_up [drivers/ata/ahci_tegra.ko] undefined!
> > ERROR: tegra_powergate_power_off [drivers/ata/ahci_tegra.ko] undefined!
> > 
> > Making the definition depend on the presence of the driver makes it build
> > again, though that might not be the correct fix.
> > 
> > Fixes: 854014236290 ("soc/tegra: Implement Tegra186 PMC support")
> > Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> 
> A fix was also submitted by Krzysztof [0].
> 
> Thierry, what's your preference? Maybe Arnd's approach is better.

Yes, I prefer Arnd's patch because it is more consistent with how we
deal with this kind of dependency elsewhere.

Thierry

[toc] | [prev] | [next] | [standalone]


#1604491

FromThierry Reding <thierry.reding@gmail.com>
Date2017-03-20 13:50 +0100
Message-ID<tn4V3-4Nu-1@gated-at.bofh.it>
In reply to#1604273

[Multipart message — attachments visible in raw view] — view raw

On Mon, Mar 20, 2017 at 10:13:06AM +0100, Arnd Bergmann wrote:
> With the new Tegra186 PMC driver merged, anything that relies on the previous
> PMC driver fails to link when that is disabled:
> 
> arch/arm/mach-tegra/pm.o: In function `tegra_pm_set':
> pm.c:(.text.tegra_pm_set+0x3c): undefined reference to `tegra_pmc_enter_suspend_mode'
> arch/arm/mach-tegra/pm.o: In function `tegra_suspend_enter':
> pm.c:(.text.tegra_suspend_enter+0x4): undefined reference to `tegra_pmc_get_suspend_mode'
> arch/arm/mach-tegra/pm.o: In function `tegra_init_suspend':
> pm.c:(.init.text+0x1c): undefined reference to `tegra_pmc_get_suspend_mode'
> pm.c:(.init.text+0x74): undefined reference to `tegra_pmc_set_suspend_mode'
> 
> ERROR: tegra_powergate_sequence_power_up [drivers/ata/ahci_tegra.ko] undefined!
> ERROR: tegra_powergate_power_off [drivers/ata/ahci_tegra.ko] undefined!
> 
> Making the definition depend on the presence of the driver makes it build
> again, though that might not be the correct fix.
> 
> Fixes: 854014236290 ("soc/tegra: Implement Tegra186 PMC support")
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> ---
>  include/soc/tegra/pmc.h | 29 +++++++++++++++++++++--------
>  1 file changed, 21 insertions(+), 8 deletions(-)

Applied, thanks.

Thierry

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web