Skip to contentSkip to conversation

arm: add default value for PHYS_OFFSET Kconfig setting

PATCH In review Paul Gortmaker 5 participants 12 messages Dec 1, 2011 – Dec 2, 2011 Arm (32-bit)

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 arm: add default value for PHYS_OFFSET Kconfig setting

Commit 1b9f95f8ade9efc2bd49f0e7b9dc61a038ac3eef introduced the new Kconfig for PHYS_OFFSET but it did not specify a default value.

This has the undesired side effect of breaking an implictly used trick for updating defconfigs on the fly for routine buildtesting across all arch and all platforms, i.e.

cp /path/to/somedefconfig .config ; yes "" | make oldconfig

In particular, the at91x40_defconfig will enter an infinite loop with the above, since there is no default value, and conf will just keep asking for one, and "yes" will keep feeding in a line return.

arch/arm/Kconfig +1 -0
index 44789ef..90a475e 100644
@@ -221,6 +221,7 @@ config NEED_MACH_MEMORY_H
 
 config PHYS_OFFSET
 	hex "Physical address of main memory"
+	default 0x00000000
 	depends on !ARM_PATCH_PHYS_VIRT && !NEED_MACH_MEMORY_H
 	help
 	  Please provide the physical address corresponding to the
Signature · 1 line
1.7.7.2
#1 lore raw

Hello.

Quoted 1 line · Paul Gortmaker

Commit 1b9f95f8ade9efc2bd49f0e7b9dc61a038ac3eef introduced the new

Please also cite that commit's summary in parens.

Quoted 6 lines

Kconfig for PHYS_OFFSET but it did not specify a default value.

This has the undesired side effect of breaking an implictly used trick for updating defconfigs on the fly for routine buildtesting across all arch and all platforms, i.e.

Quoted 7 lines

cp /path/to/somedefconfig .config ; yes "" | make oldconfig

In particular, the at91x40_defconfig will enter an infinite loop with the above, since there is no default value, and conf will just keep asking for one, and "yes" will keep feeding in a line return.

WBR, Sergei

#2 lore raw
In reply to Paul Gortmaker
Quoted 9 lines · Paul Gortmaker

Commit 1b9f95f8ade9efc2bd49f0e7b9dc61a038ac3eef introduced the new Kconfig for PHYS_OFFSET but it did not specify a default value.

This has the undesired side effect of breaking an implictly used trick for updating defconfigs on the fly for routine buildtesting across all arch and all platforms, i.e.

cp /path/to/somedefconfig .config ; yes "" | make oldconfig

FWIW, a better way to achieve the above is using

make KCONFIG_ALLCONFIG=/path/to/somedefconfig listnewconfig alldefconfig

which does not have this problem.

Your patch looks still ok, but you might want to update your scripts to be more robust.

Arnd

#3 lore raw
Quoted 11 lines · Arnd Bergmann
Quoted 9 lines · Paul Gortmaker

Commit 1b9f95f8ade9efc2bd49f0e7b9dc61a038ac3eef introduced the new Kconfig for PHYS_OFFSET but it did not specify a default value.

This has the undesired side effect of breaking an implictly used trick for updating defconfigs on the fly for routine buildtesting across all arch and all platforms, i.e.

? cp /path/to/somedefconfig .config ; yes "" | make oldconfig

Quoted 8 lines

FWIW, a better way to achieve the above is using

make KCONFIG_ALLCONFIG=/path/to/somedefconfig listnewconfig alldefconfig

which does not have this problem.

Your patch looks still ok, but you might want to update your scripts to be more robust.

Thanks -- but on the other hand, the above use case does actually emulate exactly what happens when someone runs the "make oldconfig" and simply holds down the Enter key. (yes it happens probably way more than we want to know...)

So, I guess what I'm trying to say is that the above "script" is intentionally fragile. :) As a use case, we shouldn't break it.

Thanks,
Paul.

Quoted 7 lines

? ? ? ?Arnd
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo at vger.kernel.org
More majordomo info at ?http://vger.kernel.org/majordomo-info.html Please read the FAQ at ?http://www.tux.org/lkml/

#4 lore raw
Quoted 21 lines · Paul Gortmaker
Quoted 11 lines · Arnd Bergmann
Quoted 9 lines · Paul Gortmaker

Commit 1b9f95f8ade9efc2bd49f0e7b9dc61a038ac3eef introduced the new Kconfig for PHYS_OFFSET but it did not specify a default value.

This has the undesired side effect of breaking an implictly used trick for updating defconfigs on the fly for routine buildtesting across all arch and all platforms, i.e.

? cp /path/to/somedefconfig .config ; yes "" | make oldconfig

Quoted 8 lines

FWIW, a better way to achieve the above is using

make KCONFIG_ALLCONFIG=/path/to/somedefconfig listnewconfig alldefconfig

which does not have this problem.

Your patch looks still ok, but you might want to update your scripts to be more robust.

Quoted 7 lines

Thanks -- but on the other hand, the above use case does actually emulate exactly what happens when someone runs the "make oldconfig" and simply holds down the Enter key. (yes it happens probably way more than we want to know...)

So, I guess what I'm trying to say is that the above "script" is intentionally fragile. :) As a use case, we shouldn't break it.

Well... I took a while before replying because I'm also modifying things around this, but those changes are good for a merge window not a -rc period.

Still, I don't think your patch is good, even as a temporary measure. The fact is that we can't just pick a random default value since it is likely to be wrong for the majority of the boards as the right answer for this option is quite varied. So the fact that the config system insists on your entering a proper value is actually a good thing.

In the at91x40_defconfig case, it has CONFIG_EMBEDDED=y. If it was not selected then you'd get CONFIG_ARM_PATCH_PHYS_VIRT=y by default and then no CONFIG_PHYS_OFFSET would be presented.

So the right fix here would actually consist of adding to at91x40_defconfig either CONFIG_ARM_PATCH_PHYS_VIRT=y, or a default value for CONFIG_PHYS_OFFSET which is the right value for that platform.

Nicolas

#5 lore raw
Quoted 41 lines · Nicolas Pitre
Quoted 21 lines · Paul Gortmaker
Quoted 11 lines · Arnd Bergmann
Quoted 9 lines · Paul Gortmaker

Commit 1b9f95f8ade9efc2bd49f0e7b9dc61a038ac3eef introduced the new Kconfig for PHYS_OFFSET but it did not specify a default value.

This has the undesired side effect of breaking an implictly used trick for updating defconfigs on the fly for routine buildtesting across all arch and all platforms, i.e.

? cp /path/to/somedefconfig .config ; yes "" | make oldconfig

Quoted 8 lines

FWIW, a better way to achieve the above is using

make KCONFIG_ALLCONFIG=/path/to/somedefconfig listnewconfig alldefconfig

which does not have this problem.

Your patch looks still ok, but you might want to update your scripts to be more robust.

Quoted 7 lines

Thanks -- but on the other hand, the above use case does actually emulate exactly what happens when someone runs the "make oldconfig" and simply holds down the Enter key. (yes it happens probably way more than we want to know...)

So, I guess what I'm trying to say is that the above "script" is intentionally fragile. :) As a use case, we shouldn't break it.

Well... I took a while before replying because I'm also modifying things around this, but those changes are good for a merge window not a -rc period.

Still, I don't think your patch is good, even as a temporary measure. The fact is that we can't just pick a random default value since it is likely to be wrong for the majority of the boards as the right answer for this option is quite varied. So the fact that the config system insists on your entering a proper value is actually a good thing.

Quoted 7 lines

In the at91x40_defconfig case, it has CONFIG_EMBEDDED=y. If it was not selected then you'd get CONFIG_ARM_PATCH_PHYS_VIRT=y by default and then no CONFIG_PHYS_OFFSET would be presented.

So the right fix here would actually consist of adding to at91x40_defconfig either CONFIG_ARM_PATCH_PHYS_VIRT=y, or a default value for CONFIG_PHYS_OFFSET which is the right value for that platform.

And it seems that at91x40 is the only defconfig with MMU=n, so the only option is really to provide a default CONFIG_PHYS_OFFSET. So what about this:

arch/arm/Kconfig +1 -0
index e084b7e981..a24672924f 100644
@@ -222,6 +222,7 @@ config NEED_MACH_MEMORY_H
 config PHYS_OFFSET
 	hex "Physical address of main memory"
 	depends on !ARM_PATCH_PHYS_VIRT && !NEED_MACH_MEMORY_H
+	default DRAM_BASE if !MMU
 	help
 	  Please provide the physical address corresponding to the
 	  location of main memory in your system.

Eventually the DRAM_BASE config option could simply be replaced by PHYS_OFFSET directly, but that's a larger change.

Nicolas

#6 lore raw

Hello Nicolas,

Quoted 68 lines · Nicolas Pitre
Quoted 41 lines · Nicolas Pitre
Quoted 21 lines · Paul Gortmaker
Quoted 11 lines · Arnd Bergmann
Quoted 9 lines · Paul Gortmaker

Commit 1b9f95f8ade9efc2bd49f0e7b9dc61a038ac3eef introduced the new Kconfig for PHYS_OFFSET but it did not specify a default value.

This has the undesired side effect of breaking an implictly used trick for updating defconfigs on the fly for routine buildtesting across all arch and all platforms, i.e.

? cp /path/to/somedefconfig .config ; yes "" | make oldconfig

Quoted 8 lines

FWIW, a better way to achieve the above is using

make KCONFIG_ALLCONFIG=/path/to/somedefconfig listnewconfig alldefconfig

which does not have this problem.

Your patch looks still ok, but you might want to update your scripts to be more robust.

Quoted 7 lines

Thanks -- but on the other hand, the above use case does actually emulate exactly what happens when someone runs the "make oldconfig" and simply holds down the Enter key. (yes it happens probably way more than we want to know...)

So, I guess what I'm trying to say is that the above "script" is intentionally fragile. :) As a use case, we shouldn't break it.

Well... I took a while before replying because I'm also modifying things around this, but those changes are good for a merge window not a -rc period.

Still, I don't think your patch is good, even as a temporary measure. The fact is that we can't just pick a random default value since it is likely to be wrong for the majority of the boards as the right answer for this option is quite varied. So the fact that the config system insists on your entering a proper value is actually a good thing.

Quoted 7 lines

In the at91x40_defconfig case, it has CONFIG_EMBEDDED=y. If it was not selected then you'd get CONFIG_ARM_PATCH_PHYS_VIRT=y by default and then no CONFIG_PHYS_OFFSET would be presented.

So the right fix here would actually consist of adding to at91x40_defconfig either CONFIG_ARM_PATCH_PHYS_VIRT=y, or a default value for CONFIG_PHYS_OFFSET which is the right value for that platform.

And it seems that at91x40 is the only defconfig with MMU=n, so the only option is really to provide a default CONFIG_PHYS_OFFSET. So what about this:

arch/arm/Kconfig +1 -0
index e084b7e981..a24672924f 100644
@@ -222,6 +222,7 @@ config NEED_MACH_MEMORY_H
 config PHYS_OFFSET
 	hex "Physical address of main memory"
 	depends on !ARM_PATCH_PHYS_VIRT && !NEED_MACH_MEMORY_H
+	default DRAM_BASE if !MMU
 	help
 	  Please provide the physical address corresponding to the
 	  location of main memory in your system.
Quoted 2 lines

Eventually the DRAM_BASE config option could simply be replaced by PHYS_OFFSET directly, but that's a larger change.

I'm working on a MMU-less machine, too and had that change already in my working copy. I was about to commit and it send out later today.

So: Acked-by: Uwe Kleine-K?nig <[email protected]>

Best regards
Uwe

Signature · 2 lines
Pengutronix e.K.                           | Uwe Kleine-K?nig            |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
#7 lore raw
Quoted 3 lines · Uwe Kleine-K?nig

Hello Nicolas,

On Fri, Dec 02, 2011 at 12:33:26AM -0500, Nicolas Pitre wrote:

[...]

Quoted 17 lines
Quoted 17 lines

And it seems that at91x40 is the only defconfig with MMU=n, so the only option is really to provide a default CONFIG_PHYS_OFFSET. So what about this:

arch/arm/Kconfig +1 -0
index e084b7e981..a24672924f 100644
@@ -222,6 +222,7 @@ config NEED_MACH_MEMORY_H
 config PHYS_OFFSET
 	hex "Physical address of main memory"
 	depends on !ARM_PATCH_PHYS_VIRT && !NEED_MACH_MEMORY_H
+	default DRAM_BASE if !MMU
 	help
 	  Please provide the physical address corresponding to the
 	  location of main memory in your system.
Quoted 6 lines
Quoted 2 lines

Eventually the DRAM_BASE config option could simply be replaced by PHYS_OFFSET directly, but that's a larger change.

I'm working on a MMU-less machine, too and had that change already in my working copy. I was about to commit and it send out later today.

So: Acked-by: Uwe Kleine-K?nig <[email protected]>

Looks fine to me as well; I had no particular attachment to the original patch, and you guys have a much better understanding of the specifics of the system.

Thanks,
Paul.

Quoted 4 lines

Best regards
Uwe

#8 lore raw

Hello,

Quoted 29 lines · Paul Gortmaker
Quoted 3 lines · Uwe Kleine-K?nig

Hello Nicolas,

On Fri, Dec 02, 2011 at 12:33:26AM -0500, Nicolas Pitre wrote:

[...]

Quoted 22 lines
Quoted 17 lines

And it seems that at91x40 is the only defconfig with MMU=n, so the only option is really to provide a default CONFIG_PHYS_OFFSET. So what about this:

arch/arm/Kconfig +1 -0
index e084b7e981..a24672924f 100644
@@ -222,6 +222,7 @@ config NEED_MACH_MEMORY_H
 config PHYS_OFFSET
 	hex "Physical address of main memory"
 	depends on !ARM_PATCH_PHYS_VIRT && !NEED_MACH_MEMORY_H
+	default DRAM_BASE if !MMU
 	help
 	  Please provide the physical address corresponding to the
 	  location of main memory in your system.
Quoted 2 lines

Eventually the DRAM_BASE config option could simply be replaced by PHYS_OFFSET directly, but that's a larger change.

I'm working on a MMU-less machine, too and had that change already in my working copy. I was about to commit and it send out later today.

Quoted 5 lines
Quoted 1 line

So: Acked-by: Uwe Kleine-K?nig <[email protected]>

Looks fine to me as well; I had no particular attachment to the original patch, and you guys have a much better understanding of the specifics of the system.

A post-ack comment: would it make sense to make this:

	config PHYS_OFFSET
		hex "Physical address of main memory" if MMU
	...

such that !MMU build don't get a chance to misconfigure it?

Best regards
Uwe

Signature · 2 lines
Pengutronix e.K.                           | Uwe Kleine-K?nig            |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
#9 lore raw
Quoted 37 lines · Uwe Kleine-K?nig

Hello,

Quoted 29 lines · Paul Gortmaker
Quoted 3 lines · Uwe Kleine-K?nig

Hello Nicolas,

On Fri, Dec 02, 2011 at 12:33:26AM -0500, Nicolas Pitre wrote:

[...]

Quoted 22 lines
Quoted 17 lines

And it seems that at91x40 is the only defconfig with MMU=n, so the only option is really to provide a default CONFIG_PHYS_OFFSET. So what about this:

arch/arm/Kconfig +1 -0
index e084b7e981..a24672924f 100644
@@ -222,6 +222,7 @@ config NEED_MACH_MEMORY_H
 config PHYS_OFFSET
 	hex "Physical address of main memory"
 	depends on !ARM_PATCH_PHYS_VIRT && !NEED_MACH_MEMORY_H
+	default DRAM_BASE if !MMU
 	help
 	  Please provide the physical address corresponding to the
 	  location of main memory in your system.
Quoted 2 lines

Eventually the DRAM_BASE config option could simply be replaced by PHYS_OFFSET directly, but that's a larger change.

I'm working on a MMU-less machine, too and had that change already in my working copy. I was about to commit and it send out later today.

Quoted 5 lines
Quoted 1 line

So: Acked-by: Uwe Kleine-K?nig <[email protected]>

Looks fine to me as well; I had no particular attachment to the original patch, and you guys have a much better understanding of the specifics of the system.

Quoted 7 lines

A post-ack comment: would it make sense to make this:

	config PHYS_OFFSET
		hex "Physical address of main memory" if MMU
	...

such that !MMU build don't get a chance to misconfigure it?

Sure.

Nicolas

#10 lore raw

PATCH 1/1 ARM: determine PHYS_OFFSET automatically for no-mmu configs

From: Nicolas Pitre <[email protected]>

---
 arch/arm/Kconfig |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
arch/arm/Kconfig +2 -1
index 44789ef..763de24 100644
@@ -220,8 +220,9 @@ config NEED_MACH_MEMORY_H
 	  be avoided when possible.
 
 config PHYS_OFFSET
-	hex "Physical address of main memory"
+	hex "Physical address of main memory" if MMU
 	depends on !ARM_PATCH_PHYS_VIRT && !NEED_MACH_MEMORY_H
+	default DRAM_BASE if !MMU
 	help
 	  Please provide the physical address corresponding to the
 	  location of main memory in your system.
Signature · 1 line
1.7.7.3