rtc/i2c-mpc stops working with 2.6.27 on Linkstation HG (powerpc)
Hello,
with 2.6.27(-gentoo) the rtc (Ricoh 5c372) is no longer found on my Linkstation HG. It seems, the i2c-mpc driver doesn't even find the I2C controller.
Could this be related to commit #0d1cde235874b00905bce23f659690d060ebf475 (powerpc/i2c: Convert i2c-mpc into an of_platform driver,
http://kerneltrap.org/mailarchive/git-commits-head/2008/7/16/2522594/thread)?
What do I need to do, to make it work again?
The configs are virtually identical. The kernels are loaded with their respective dtb files. The dtb and dts files are identical anyways.
Signature · 2 lines
Thanks, Micha
Quoted 11 lines · Michael Weiser
Hello,
with 2.6.27(-gentoo) the rtc (Ricoh 5c372) is no longer found on my Linkstation HG. It seems, the i2c-mpc driver doesn't even find the I2C controller.
Could this be related to commit #0d1cde235874b00905bce23f659690d060ebf475 (powerpc/i2c: Convert i2c-mpc into an
of_platformdriver,
http://kerneltrap.org/mailarchive/git-commits-head/2008/7/16/2522594/thread)?
Quoted 4 lines
What do I need to do, to make it work again?
The configs are virtually identical. The kernels are loaded with their respective dtb files. The dtb and dts files are identical anyways.
This is a known regression, see, e.g., here:
http://ozlabs.org/pipermail/linuxppc-dev/2008-October/064318.html
waiting for someone to find time to fix it.
Thanks
Guennadi
---
Guennadi Liakhovetski, Ph.D.
Freelance Open-Source Software Developer
Quoted 9 lines · Guennadi Liakhovetski
Quoted 3 lines
with 2.6.27(-gentoo) the rtc (Ricoh 5c372) is no longer found on my Linkstation HG. It seems, the i2c-mpc driver doesn't even find the I2C controller.
This is a known regression, see, e.g., here:
http://ozlabs.org/pipermail/linuxppc-dev/2008-October/064318.html
waiting for someone to find time to fix it.
Cheers. I found the thread but not the pertinent posts - the web mail archive I googled into must have been lagging. Sorry for the duplication.
Signature · 1 line
bye, Michael
PATCH 1/1 fix i2c on PPC linkstation / kurobox machines
i2c is broken on linkstation / kurobox machines since at least 2.6.27. Fix it. Also remove CONFIG_SERIAL_OF_PLATFORM, which, if enabled, breaks the serial console after the "console handover: boot [udbg0] -> real [ttyS1]" message.
---
No, I do not really understand why I have to remove CONFIG_SERIAL_OF_PLATFORM now after adding a call to of_platform_bus_probe(), but it works this way. It must have something to do with the legacy serial driver... If accepted in this form, I'll also forward it to stable.
arch/powerpc/configs/linkstation_defconfig +3 -4
@@ -1,7 +1,7 @@ # # Automatically generated make config: don't edit -# Linux kernel version: 2.6.27-rc4 -# Thu Aug 21 00:52:05 2008 +# Linux kernel version: 2.6.27 +# Fri Oct 24 00:42:39 2008 # # CONFIG_PPC64 is not set
@@ -934,7 +934,7 @@ CONFIG_SERIAL_8250_RUNTIME_UARTS=4 CONFIG_SERIAL_CORE=y CONFIG_SERIAL_CORE_CONSOLE=y # CONFIG_SERIAL_JSM is not set -CONFIG_SERIAL_OF_PLATFORM=y +# CONFIG_SERIAL_OF_PLATFORM is not set CONFIG_UNIX98_PTYS=y CONFIG_LEGACY_PTYS=y CONFIG_LEGACY_PTY_COUNT=256
@@ -1211,7 +1211,6 @@ CONFIG_USB_STORAGE=m # CONFIG_USB_STORAGE_ALAUDA is not set # CONFIG_USB_STORAGE_ONETOUCH is not set # CONFIG_USB_STORAGE_KARMA is not set -# CONFIG_USB_STORAGE_SIERRA is not set # CONFIG_USB_STORAGE_CYPRESS_ATACB is not set # CONFIG_USB_LIBUSUAL is not set
arch/powerpc/platforms/embedded6xx/linkstation.c +14 -0
@@ -13,6 +13,7 @@#include <linux/kernel.h> #include <linux/initrd.h> #include <linux/mtd/physmap.h> +#include <linux/of_platform.h> #include <asm/time.h> #include <asm/prom.h>
@@ -54,6 +55,19 @@ static struct mtd_partition linkstation_physmap_partitions[] = { }, }; +static __initdata struct of_device_id of_bus_ids[] = { + { .type ="soc" , }, + { .compatible ="simple-bus" , }, + {}, +}; + +static int __init declare_of_platform_devices (void ) +{ +of_platform_bus_probe (NULL , of_bus_ids,NULL ); +return 0 ; +} +machine_device_initcall (linkstation, declare_of_platform_devices); +static int __init linkstation_add_bridge (struct device_node *dev) {#ifdef CONFIG_PCI
Re: [PATCH] fix i2c on PPC linkstation / kurobox machines
Quoted 6 lines · Guennadi Liakhovetski
i2c is broken on linkstation / kurobox machines since at least 2.6.27. Fix it. Also remove
CONFIG_SERIAL_OF_PLATFORM, which, if enabled, breaks the serial console after the "console handover: boot [udbg0] -> real [ttyS1]" message.Signed-off-by Guennadi Liakhovetski <[email protected]>
You may want to use udbg_printf() to track down what's up. There's some fishy code there indeed, what happens is that the legacy serial code creates a platform device at boot time. Then, the of_serial attaches to the device node for the same device and tries to register it. It's supposed to "detect" that it's the same device but yeah, it may be buggy, I've seen problems with it in the past, among others, I think it can lose some state.
In the meantime, removing SERIAL_OF_PLATFORM is a good solution.
Ben.
Re: [PATCH] fix i2c on PPC linkstation / kurobox machines
Quoted 16 lines · Benjamin Herrenschmidt
Quoted 6 lines · Guennadi Liakhovetski
i2c is broken on linkstation / kurobox machines since at least 2.6.27. Fix it. Also remove
CONFIG_SERIAL_OF_PLATFORM, which, if enabled, breaks the serial console after the "console handover: boot [udbg0] -> real [ttyS1]" message.Signed-off-by Guennadi Liakhovetski <[email protected]>You may want to use
udbg_printf()to track down what's up. There's some fishy code there indeed, what happens is that the legacy serial code creates a platform device at boot time. Then, theof_serialattaches to the device node for the same device and tries to register it. It's supposed to "detect" that it's the same device but yeah, it may be buggy, I've seen problems with it in the past, among others, I think it can lose some state.
Quoted 3 lines
In the meantime, removing
SERIAL_OF_PLATFORMis a good solution.Ben.
I think, this needs an acked-by for -stable.
Thanks
Guennadi
---
Guennadi Liakhovetski, Ph.D.
Freelance Open-Source Software Developer
Kumar Gala
AppliedRe: [PATCH] fix i2c on PPC linkstation / kurobox machines
In reply to Guennadi LiakhovetskiQuoted 9 lines · Guennadi Liakhovetski
i2c is broken on linkstation / kurobox machines since at least 2.6.27. Fix it. Also remove
CONFIG_SERIAL_OF_PLATFORM, which, if enabled, breaks the serial console after the "console handover: boot [udbg0] -> real [ttyS1]" message.Signed-off-by Guennadi Liakhovetski <[email protected]>---
Quoted 7 lines
No, I do not really understand why I have to remove
CONFIG_SERIAL_OF_PLATFORMnow after adding a call toof_platform_bus_probe(), but it works this way. It must have something to do with the legacy serial driver... If accepted in this form, I'll also forward it to stable.diff --git
applied to merge.
- k
Re: [PATCH] fix i2c on PPC linkstation / kurobox machines
Quoted 18 lines · Kumar Gala
Quoted 15 lines · Guennadi Liakhovetski
i2c is broken on linkstation / kurobox machines since at least 2.6.27. Fix it. Also remove
CONFIG_SERIAL_OF_PLATFORM, which, if enabled, breaks the serial console after the "console handover: boot [udbg0] -> real [ttyS1]" message.Signed-off-by Guennadi Liakhovetski <[email protected]>---
No, I do not really understand why I have to remove
CONFIG_SERIAL_OF_PLATFORMnow after adding a call toof_platform_bus_probe(), but it works this way. It must have something to do with the legacy serial driver... If accepted in this form, I'll also forward it to stable.
Quoted 4 lines
Quoted 1 line
diff --git
applied to merge.
Did you change the comment? I2C wasn't broken, the bus definition was broken.
Quoted 3 lines
- k
Signature · 2 lines
Jon Smirl [email protected]