Skip to contentSkip to conversation

Can PYSMAP_COMPAT go?

DISCUSSION Wolfram Sang 3 participants 8 messages Apr 20, 2010 – Apr 21, 2010 Memory technology devices (MTD)

lore
Share & tools
lore
#0 lore raw

Hi,

triggered by bug-report #15729 (thread at [1]), I wondered where default "0" for MTD_PHYSMAP_LEN came from and found 73566edf9b91dd085ddb12033d0ea7288979dd10. Its description says:

Once all physmap users have been converted to instantiate their own platform devices, the compat code can go. (Or we decide that we can change all the in-tree users at the same time, and never merge the compat code.)

Grepping for current users:

~/Kernel/linux-2.6/arch$ grep -r 'MAP_COMPAT' * | grep -v 'is not set' sh/configs/polaris_defconfig:CONFIG_MTD_PHYSMAP_COMPAT=y

This one could be fixed and then the compat code could be removed. I'd pick up the job, if I get a sign that this has a chance to go in. Or shall compat stay for a reason?

Regards,

Wolfram

[1] http://marc.info/?l=linux-kernel&m=127024096210230&w=2

Signature · 2 lines
Pengutronix e.K.                           | Wolfram Sang                |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
#1 lore raw
Quoted 9 lines · Wolfram Sang

triggered by bug-report #15729 (thread at [1]), I wondered where default "0" for MTD_PHYSMAP_LEN came from and found 73566edf9b91dd085ddb12033d0ea7288979dd10. Its description says:

Once all physmap users have been converted to instantiate their own platform devices, the compat code can go. (Or we decide that we can change all the in-tree users at the same time, and never merge the compat code.)

Quoted 8 lines

Grepping for current users:

~/Kernel/linux-2.6/arch$ grep -r 'MAP_COMPAT' * | grep -v 'is not set' sh/configs/polaris_defconfig:CONFIG_MTD_PHYSMAP_COMPAT=y

This one could be fixed and then the compat code could be removed. I'd pick up the job, if I get a sign that this has a chance to go in. Or shall compat stay for a reason?

COMPAT needs to die. There are at least two other ways of specifying the same info (device tree or manual instantiation of a platform device from your platform code), and we really shouldn't allow specifying this in the .config as that will just give people other crazy ideas.

#2 lore raw
Quoted 4 lines · Lennert Buytenhek

COMPAT needs to die. There are at least two other ways of specifying the same info (device tree or manual instantiation of a platform device from your platform code), and we really shouldn't allow specifying this in the .config as that will just give people other crazy ideas.

If we take it away, they'll get crazier ideas. I've seen a fully-fledged driver for a new board, including a bizarrely hacked-up copy of all the CFI code and a special char device interface of its own, which could have been supported by a simple PHYSMAP setup.

And this was i386, which unfortunately doesn't use the device-tree yet, although on these embedded SoC devices it really _should_ be doing so. And it doesn't have 'platform code' either.

If you explicitly configure your kernel to tell it that there is a flash device at a certain address, then it's reasonable for the kernel to look there for it. Aunt Tillie can go screw herself.

Signature · 1 line
dwmw2
#3 lore raw
Quoted 4 lines

And this was i386, which unfortunately doesn't use the device-tree yet, although on these embedded SoC devices it really _should_ be doing so. And it doesn't have 'platform code' either.

Okay, so unless i386 gets device-tree support ;), how about at least this?

From: Wolfram Sang <[email protected]>
Subject: [PATCH] mtd/physmap: Use sensible default value for MTD_PHYSMAP_LEN

Commit 73566edf9b91dd085ddb12033d0ea7288979dd10 made it necessary to be 0, but commit dcb3e137ce9be1dfc86e306182b23e3ae5e239c4 obsoleted that requirement. Restore the old value to get a meaningful default.

---
 drivers/mtd/maps/Kconfig |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/mtd/maps/Kconfig +1 -1
index aa2807d..213c615 100644
@@ -47,7 +47,7 @@ config MTD_PHYSMAP_START
 config MTD_PHYSMAP_LEN
 	hex "Physical length of flash mapping"
 	depends on MTD_PHYSMAP_COMPAT
-	default "0"
+	default "0x4000000"
 	help
 	  This is the total length of the mapping of the flash chips on
 	  your particular board. If there is space, or aliases, in the
Signature · 6 lines
1.7.0


-- 
Pengutronix e.K.                           | Wolfram Sang                |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
#4 lore raw
Quoted 2 lines · Wolfram Sang

Okay, so unless i386 gets device-tree support ;), how about at least this?

I'd love to see i386 get device-tree support. OLPC could benefit from it immediately, and we could start using it on the embedded toys which are coming out now.

I really don't think 0x4000000 is a 'sensible' default. Zero was better -- at least the user has to set it to something else. With Hartley's patch applied, the kernel will no longer crash if it tries to register a device with zero length (and perhaps it could bail out even sooner if the length is zero, rather than waiting and noticing the error?).

Signature · 2 lines
David Woodhouse                            Open Source Technology Centre
[email protected]                              Intel Corporation
#5 lore raw
Quoted 7 lines · David Woodhouse
Quoted 2 lines · Wolfram Sang

Okay, so unless i386 gets device-tree support ;), how about at least this?

I'd love to see i386 get device-tree support. OLPC could benefit from it immediately, and we could start using it on the embedded toys which are coming out now.

True. It was the "unless" I was pointing for. I'd think it will take a long while...

Quoted 1 line

I really don't think 0x4000000 is a 'sensible' default. Zero was better

Okay. I just wanted to remove the inconsistency (all these options could be 0 then). But it's probably now worth the fuss.

Signature · 2 lines
Pengutronix e.K.                           | Wolfram Sang                |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
#6 lore raw
In reply to David Woodhouse
Quoted 2 lines

-- at least the user has to set it to something else. With Hartley's patch applied, the kernel will no longer crash if it tries to register a

BTW will you pick it up or who should do?

Signature · 2 lines
Pengutronix e.K.                           | Wolfram Sang                |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
#7 lore raw
Quoted 4 lines · Wolfram Sang
Quoted 2 lines

-- at least the user has to set it to something else. With Hartley's patch applied, the kernel will no longer crash if it tries to register a

BTW will you pick it up or who should do?

I already did. Although it looks like I forgot to push.... fixed.

Signature · 2 lines
David Woodhouse                            Open Source Technology Centre
[email protected]                              Intel Corporation