Skip to contentSkip to conversation

Still more omap fixes for current -rc series

PATCH In review Tony Lindgren 1 participant 6 messages Mar 4, 2009 – Mar 7, 2009

Subsystems (3)
lore
Share & tools
lore

Tony Lindgren

author maintainer
#0 lore raw

cover Still more omap fixes for current -rc series

This should be it for the omap fixes for this -rc cycle. Hopefully we can still get these in.

Regards,

Tony

---

Aaro Koskinen (2):
ARM: OMAP: Allow I2C bus driver to be compiled as a module
ARM: OMAP: sched_clock() corrected

David Brownell (1):
ARM: OMAP: Fix compile error if pm.h is included

Koen Kooi (1):
ARM: OMAP: board-omap3beagle: set i2c-3 to 100kHz

 arch/arm/mach-omap2/board-omap3beagle.c  |    4 +++-
 arch/arm/plat-omap/Makefile              |    3 ++-
 arch/arm/plat-omap/common.c              |   14 +++++---------
 arch/arm/plat-omap/include/mach/common.h |    2 +-
 arch/arm/plat-omap/include/mach/pm.h     |    2 +-
 5 files changed, 12 insertions(+), 13 deletions(-)
Signature · 1 line
Signature
author maintainer
#1 lore raw

PATCH 1/4 ARM: OMAP: Fix compile error if pm.h is included

From: David Brownell <[email protected]>

Change the error to a warning.

---
 arch/arm/plat-omap/include/mach/pm.h |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
arch/arm/plat-omap/include/mach/pm.h +1 -1
index 2a9c27a..37e2f0f 100644
@@ -108,7 +108,7 @@
 	!defined(CONFIG_ARCH_OMAP15XX) && \
 	!defined(CONFIG_ARCH_OMAP16XX) && \
 	!defined(CONFIG_ARCH_OMAP24XX)
-#error "Power management for this processor not implemented yet"
+#warning "Power management for this processor not implemented yet"
 #endif
 
 #ifndef __ASSEMBLER__
author maintainer
#2 lore raw

PATCH 2/4 ARM: OMAP: sched_clock() corrected

In reply to Tony Lindgren

From: Aaro Koskinen <[email protected]>

After my OMAP3 board has been running for a while, I'm seeing weird latency traces like this:

      sh-1574    0d.h2  153us : do_timer (tick_do_update_jiffies64)
      sh-1574    0d.h2  153us : update_wall_time (do_timer)
      sh-1574    0d.h2  153us!: omap_32k_read (update_wall_time)
      sh-1574    0d.h2 1883us : update_xtime_cache (update_wall_time)
      sh-1574    0d.h2 1883us : clocksource_get_next (update_wall_time)
      sh-1574    0d.h2 1883us+: _spin_lock_irqsave (clocksource_get_next)

and after a while:

      sh-17818   0d.h3  153us : do_timer (tick_do_update_jiffies64)
      sh-17818   0d.h3  153us : update_wall_time (do_timer)
      sh-17818   0d.h3  153us!: omap_32k_read (update_wall_time)
      sh-17818   0d.h3 1915us : update_xtime_cache (update_wall_time)
      sh-17818   0d.h3 1915us+: clocksource_get_next (update_wall_time)
      sh-17818   0d.h3 1945us : _spin_lock_irqsave (clocksource_get_next)

Turns out that sched_clock() is using cyc2ns(), which returns NTP adjusted time. The sched_clock() frequency should not be adjusted. The patch deletes omap_32k_ticks_to_nsecs() and rewrites sched_clock() to do the conversion using the constant multiplier.

---
 arch/arm/plat-omap/common.c |   14 +++++---------
 1 files changed, 5 insertions(+), 9 deletions(-)
arch/arm/plat-omap/common.c +5 -9
index 0843b88..6825fbb 100644
@@ -200,20 +200,16 @@ static struct clocksource clocksource_32k = {
 };
 
 /*
- * Rounds down to nearest nsec.
- */
-unsigned long long omap_32k_ticks_to_nsecs(unsigned long ticks_32k)
-{
-	return cyc2ns(&clocksource_32k, ticks_32k);
-}
-
-/*
  * Returns current time from boot in nsecs. It's OK for this to wrap
  * around for now, as it's just a relative time stamp.
  */
 unsigned long long sched_clock(void)
 {
-	return omap_32k_ticks_to_nsecs(omap_32k_read());
+	unsigned long long ret;
+
+	ret = (unsigned long long)omap_32k_read();
+	ret = (ret * clocksource_32k.mult_orig) >> clocksource_32k.shift;
+	return ret;
 }
 
 static int __init omap_init_clocksource_32k(void)
author maintainer
#3 lore raw

PATCH 3/4 ARM: OMAP: Allow I2C bus driver to be compiled as a module

In reply to Tony Lindgren

From: Aaro Koskinen <[email protected]>

Fixes a linker error when OMAP I2C bus driver is compiled as a module:

ERROR: "i2c_register_board_info" [arch/arm/plat-omap/i2c.ko] undefined!

The I2C utility functions used for board initialization should be always built-in.

---
 arch/arm/plat-omap/Makefile              |    3 ++-
 arch/arm/plat-omap/include/mach/common.h |    2 +-
 2 files changed, 3 insertions(+), 2 deletions(-)
arch/arm/plat-omap/Makefile +2 -1
index deaff58..04a100c 100644
@@ -18,7 +18,8 @@ obj-$(CONFIG_CPU_FREQ) += cpu-omap.o
 obj-$(CONFIG_OMAP_DM_TIMER) += dmtimer.o
 obj-$(CONFIG_OMAP_DEBUG_DEVICES) += debug-devices.o
 obj-$(CONFIG_OMAP_DEBUG_LEDS) += debug-leds.o
-obj-$(CONFIG_I2C_OMAP) += i2c.o
+i2c-omap-$(CONFIG_I2C_OMAP) := i2c.o
+obj-y += $(i2c-omap-m) $(i2c-omap-y)
 
 # OMAP mailbox framework
 obj-$(CONFIG_OMAP_MBOX_FWK) += mailbox.o
arch/arm/plat-omap/include/mach/common.h +1 -1
index ef70e2b..e746ec7 100644
@@ -35,7 +35,7 @@ extern void omap_map_common_io(void);
 extern struct sys_timer omap_timer;
 extern void omap_serial_init(void);
 extern void omap_serial_enable_clocks(int enable);
-#ifdef CONFIG_I2C_OMAP
+#if defined(CONFIG_I2C_OMAP) || defined(CONFIG_I2C_OMAP_MODULE)
 extern int omap_register_i2c_bus(int bus_id, u32 clkrate,
 				 struct i2c_board_info const *info,
 				 unsigned len);
author maintainer
#4 lore raw

PATCH 4/4 ARM: OMAP: board-omap3beagle: set i2c-3 to 100kHz

In reply to Tony Lindgren

From: Koen Kooi <[email protected]>

Changing it do 100kHz is needed to make more devices works properly. Controlling the TI DLP Pico projector[1] doesn't work properly at 400kHz, 100kHz and lower work fine. EDID readout is unaffected by this change.

[1] http://focus.ti.com/dlpdmd/docs/dlpdiscovery.tsp?sectionId=60&tabId=2234

---
 arch/arm/mach-omap2/board-omap3beagle.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)
arch/arm/mach-omap2/board-omap3beagle.c +3 -1
index 38c88fb..e39cd2c 100644
@@ -178,7 +178,9 @@ static int __init omap3_beagle_i2c_init(void)
 #ifdef CONFIG_I2C2_OMAP_BEAGLE
 	omap_register_i2c_bus(2, 400, NULL, 0);
 #endif
-	omap_register_i2c_bus(3, 400, NULL, 0);
+	/* Bus 3 is attached to the DVI port where devices like the pico DLP
+	 * projector don't work reliably with 400kHz */
+	omap_register_i2c_bus(3, 100, NULL, 0);
 	return 0;
 }
 
author maintainer
#5 lore raw
In reply to Tony Lindgren
Quoted 2 lines · Tony Lindgren

This should be it for the omap fixes for this -rc cycle. Hopefully we can still get these in.

Russell, here's the pull request for you for these fixes.

Tony

The following changes since commit fec6c6fec3e20637bee5d276fb61dd8b49a3f9cc:
Linus Torvalds (1):

        Linux 2.6.29-rc7

are available in the git repository at:

git://git.kernel.org/pub/scm/linux/kernel/git/tmlind/linux-omap-2.6.git omap-fixes

Aaro Koskinen (2):
ARM: OMAP: sched_clock() corrected
ARM: OMAP: Allow I2C bus driver to be compiled as a module

David Brownell (1):
ARM: OMAP: Fix compile error if pm.h is included

Koen Kooi (1):
ARM: OMAP: board-omap3beagle: set i2c-3 to 100kHz

 arch/arm/mach-omap2/board-omap3beagle.c  |    4 +++-
 arch/arm/plat-omap/Makefile              |    3 ++-
 arch/arm/plat-omap/common.c              |   14 +++++---------
 arch/arm/plat-omap/include/mach/common.h |    2 +-
 arch/arm/plat-omap/include/mach/pm.h     |    2 +-
 5 files changed, 12 insertions(+), 13 deletions(-)