Skip to contentSkip to conversation

is dynamic tick working?

DISCUSSION David Brownell 5 participants 15 messages May 13, 2006 – May 26, 2006

Subsystems (5)
lore
Share & tools
lore
#0 lore raw

On an OSK, using today's GIT tree, I turned on dynamic tick using sysfs and thought the IRQ rate (32 KHz timer) was odd. So I did

grep tim /proc/int*; sleep 60; grep tim /proc/int*

and saw 104551 IRQs, which is 1742 per second. Too many!! When I turned dyntick off (on/off via sysfs) the same measurement gave a more reasonable 7701 IRQs, making 128 per second.

In short, enabling dyntick got me 14x as many IRQs, instead of shrinking the number of IRQs. Known bug?

- Dave

reviewer
#1 lore raw
Quoted 11 lines · David Brownell

On an OSK, using today's GIT tree, I turned on dynamic tick using sysfs and thought the IRQ rate (32 KHz timer) was odd. So I did

grep tim /proc/int*; sleep 60; grep tim /proc/int*

and saw 104551 IRQs, which is 1742 per second. Too many!! When I turned dyntick off (on/off via sysfs) the same measurement gave a more reasonable 7701 IRQs, making 128 per second.

In short, enabling dyntick got me 14x as many IRQs, instead of shrinking the number of IRQs. Known bug?

Is this with touchscreen enabled? I saw something similar last week where SPI was generating interrupts continuously. I think Imre has a patch for that already available.

With dyntick the timer interrupt handler is being called also from other interrupt handlers to update time. So doing something like:

$ cat /proc/interrupts; sleep 10; cat /proc/interrupts

might give you a clue which device interrupt is stuck.

In general dyntick should work, and you should see about 4-6HZ idle tick rate.

Regards,

Tony

#2 lore raw
Quoted 7 lines · Tony Lindgren
Quoted 2 lines · David Brownell

In short, enabling dyntick got me 14x as many IRQs, instead of shrinking the number of IRQs. Known bug?

Is this with touchscreen enabled? I saw something similar last week where SPI was generating interrupts continuously. I think Imre has a patch for that already available.

It was, but I don't think I've seen such a patch yet.

I had noticed that the ads7846 code grew a glitch whereby its timer polls for position even when the "pen" isn't down. That's oddly similar to a glitch in omap-keyboard, where it keeps a timer active even when no Mistral key is pressed.

Quoted 2 lines

In general dyntick should work, and you should see about 4-6HZ idle tick rate.

Depending on drivers, it seems ... ;)

I have a patch to get rid of the OHCI root hub polling, which will get rid of one 4Hz timer.

- Dave

#3 lore raw
Quoted 4 lines · ext David Brownell
Quoted 3 lines · Tony Lindgren
Quoted 2 lines · David Brownell

In short, enabling dyntick got me 14x as many IRQs, instead of shrinking the number of IRQs. Known bug?

Quoted 8 lines
Quoted 3 lines

Is this with touchscreen enabled? I saw something similar last week where SPI was generating interrupts continuously. I think Imre has a patch for that already available.

It was, but I don't think I've seen such a patch yet.

I had noticed that the ads7846 code grew a glitch whereby its timer polls for position even when the "pen" isn't down.

The problem is caused by the ads7846 generating interrupts during the measurement, which do not signal an actual pen down. Though the IRQ line is disabled it will still be latched and serviced at the end of the measurement when the IRQ line is reenabled. This will start another round of measurements..

To solve this we have to check the state of the IRQ line at the time of the interrupt if it's a "real one". The patch is already in the mainline tree, I've also sent it to Tony after I noticed it's missing from the OMAP tree. My fault, I should've kept the driver up-to-date in both trees..

--Imre

Quoted 17 lines

That's oddly similar to a glitch in omap-keyboard, where it keeps a timer active even when no Mistral key is pressed.

Quoted 2 lines

In general dyntick should work, and you should see about 4-6HZ idle tick rate.

Depending on drivers, it seems ... ;)

I have a patch to get rid of the OHCI root hub polling, which will get rid of one 4Hz timer.

- Dave
_______________________________________________
Linux-omap-open-source mailing list
[email protected]
http://linux.omap.com/mailman/listinfo/linux-omap-open-source

#4 lore raw
Quoted 3 lines · Imre Deak

The patch is already in the mainline
tree, I've also sent it to Tony after I noticed it's missing from the OMAP tree. My fault, I should've kept the driver up-to-date in both trees..

Understandable, given how long it took to get those patches merged upstream! Plus the fact that the version in the OMAP tree was working around byteswap bugs on the Microwire SPI driver ... I'm not sure I'd have expected Tony to resolve all the merge conflicts right unless he were more involved in sorting out those issues.

So let's see. Other than those recent patches resolving those byteswap bugs, and the hwmon features (not all merged upstream yet, sigh), are there any reasons left for the OMAP version of that driver to differ from the upstream one?

My understanding is that thanks (!) mostly to your updates, we're almost ready to say OMAP can use the same version of ads7846 that's upstream, and that the omap_uwire driver could also go upstream. And given an OSK version of that new routine, that Mistral support could also go upstream. Does that sound right?

- Dave

#5 lore raw
Quoted 9 lines · ext David Brownell
Quoted 2 lines · Imre Deak

The patch is already in the mainline
tree, I've also sent it to Tony after I noticed it's missing from the OMAP tree. My fault, I should've kept the driver up-to-date in both trees..

Understandable, given how long it took to get those patches merged upstream! Plus the fact that the version in the OMAP tree was working around byteswap bugs on the Microwire SPI driver ... I'm not sure I'd have expected Tony to resolve all the merge conflicts right unless he were more involved in sorting out those issues.

Yep, to make it work I fixed the thing in the wrong place.

Quoted 5 lines

So let's see. Other than those recent patches resolving those byteswap bugs, and the hwmon features (not all merged upstream yet, sigh), are there any reasons left for the OMAP version of that driver to differ from the upstream one?

No, they must be in sync now. Since the changes went to mainline and to the OMAP tree through different changesets (b/c the above wrong fix et al) and now the OMAP version is out of sync, I've sent a patchset to Tony to bring it up-to-date.

Quoted 6 lines

My understanding is that thanks (!) mostly to your updates, we're almost ready to say OMAP can use the same version of ads7846 that's upstream, and that the omap_uwire driver could also go upstream. And given an OSK version of that new routine, that Mistral support could also go upstream. Does that sound right?

Yes, the ads7846 and omap_uwire should be ok - and identical with upstream after the above patches.

--Imre

Quoted 2 lines

- Dave

reviewer
#6 lore raw
Quoted 27 lines · Imre Deak
Quoted 11 lines · ext David Brownell
Quoted 4 lines · Imre Deak

The patch is already in the mainline
tree, I've also sent it to Tony after I noticed it's missing from the OMAP tree. My fault, I should've kept the driver up-to-date in both trees..

Understandable, given how long it took to get those patches merged upstream! Plus the fact that the version in the OMAP tree was working around byteswap bugs on the Microwire SPI driver ... I'm not sure I'd have expected Tony to resolve all the merge conflicts right unless he were more involved in sorting out those issues.

Yep, to make it work I fixed the thing in the wrong place.

Quoted 5 lines

So let's see. Other than those recent patches resolving those byteswap bugs, and the hwmon features (not all merged upstream yet, sigh), are there any reasons left for the OMAP version of that driver to differ from the upstream one?

No, they must be in sync now. Since the changes went to mainline and to the OMAP tree through different changesets (b/c the above wrong fix et al) and now the OMAP version is out of sync, I've sent a patchset to Tony to bring it up-to-date.

Quoted 1 line
Quoted 8 lines
Quoted 5 lines

My understanding is that thanks (!) mostly to your updates, we're almost ready to say OMAP can use the same version of ads7846 that's upstream, and that the omap_uwire driver could also go upstream. And given an OSK version of that new routine, that Mistral support could also go upstream. Does that sound right?

Yes, the ads7846 and omap_uwire should be ok - and identical with upstream after the above patches.

OK, I've pushed Imre's patches. Can you check that everything got patched OK?

Regards,

Tony

#7 lore raw
Quoted 3 lines · Tony Lindgren

OK, I've pushed Imre's patches. Can you check that everything got patched OK?

I attach three patches:

- To make Mistral work better needs new callback), which worked for me (modulo writing the "disable" file wedging, gotta retest that);

- A quickie bitbang SPI adapter for the 1510-Innovator FPGA hookup to ads7846, untested beyond compiling (no Innovator here!);

- Removing the old OMAP-specific Mistral and Innovator touchscreen drivers; this may be a trifle premature given the lack of Innovator testing

Anyway, with the first of these patches I saw tick rates of about 27 Hz; the issue seems to be the omap_ts driver keeping a timer active (among other misbehaviors).

In short: yes, it's better now.

- Dave

Syncing the ads7846 code with mainstream means that the Mistral support needs to include a callback to read the pendown state.

arch/arm/mach-omap1/board-osk.c +6 -1
Index: osk/arch/arm/mach-omap1/board-osk.c
===================================================================
@@ -299,12 +299,17 @@ static struct platform_device *mistral_d
 	&osk5912_lcd_device,
 };
 
+static int mistral_get_pendown_state(void)
+{
+	return !omap_get_gpio_datain(4);
+}
+
 static const struct ads7846_platform_data mistral_ts_info = {
 	.model			= 7846,
 	.vref_delay_usecs	= 100,	/* internal, no capacitor */
 	.x_plate_ohms		= 419,
 	.y_plate_ohms		= 486,
-	// .{x,y,pressure}_{min,max}
+	.get_pendown_state	= mistral_get_pendown_state,
 };
 
 static struct spi_board_info __initdata mistral_boardinfo[] = { {

Add bitbang SPI driver for Innovator 1510 touchscreen, using the new framework. Compile-tested only.

arch/arm/mach-omap1/board-innovator.c +37 -0
Index: osk/arch/arm/mach-omap1/board-innovator.c
===================================================================
@@ -139,6 +139,10 @@ static struct platform_device innovator_
 
 #ifdef CONFIG_ARCH_OMAP15XX
 
+#include <linux/spi/spi.h>
+#include <linux/spi/ads7846.h>
+
+
 /* Only FPGA needs to be mapped here. All others are done with ioremap */
 static struct map_desc innovator1510_io_desc[] __initdata = {
 	{
@@ -174,13 +178,44 @@ static struct platform_device innovator1
 	.id		= -1,
 };
 
+static struct platform_device innovator1510_spi_device = {
+	.name		= "spi_inn1510",
+	.id		= -1,
+};
+
 static struct platform_device *innovator1510_devices[] __initdata = {
 	&innovator_flash_device,
 	&innovator1510_smc91x_device,
 	&innovator_kp_device,
 	&innovator1510_lcd_device,
+	&innovator1510_spi_device,
 };
 
+static int innovator_get_pendown_state(void)
+{
+	return !(fpga_read(OMAP1510_FPGA_TOUCHSCREEN) & (1 << 5));
+}
+
+static const struct ads7846_platform_data innovator1510_ts_info = {
+	.model			= 7846,
+	.vref_delay_usecs	= 100,	/* internal, no capacitor */
+	.x_plate_ohms		= 419,
+	.y_plate_ohms		= 486,
+	.get_pendown_state	= innovator_get_pendown_state,
+};
+
+static struct spi_board_info __initdata innovator1510_boardinfo[] = { {
+	/* FPGA (bus "10") CS0 has an ads7846e */
+	.modalias		= "ads7846",
+	.platform_data		= &innovator1510_ts_info,
+	.irq			= OMAP1510_INT_FPGA_TS,
+	.max_speed_hz		= 120000 /* max sample rate at 3V */
+					* 26 /* command + data + overhead */,
+	.bus_num		= 10,
+	.chip_select		= 0,
+} };
+
+
 #endif /* CONFIG_ARCH_OMAP15XX */
 
 #ifdef CONFIG_ARCH_OMAP16XX
@@ -311,6 +346,8 @@ static void __init innovator_init(void)
 #ifdef CONFIG_ARCH_OMAP15XX
 	if (cpu_is_omap1510()) {
 		platform_add_devices(innovator1510_devices, ARRAY_SIZE(innovator1510_devices));
+		spi_register_board_info(innovator1510_boardinfo,
+				ARRAY_SIZE(innovator1510_boardinfo));
 	}
 #endif
 #ifdef CONFIG_ARCH_OMAP16XX
drivers/spi/Kconfig +7 -0
Index: osk/drivers/spi/Kconfig
===================================================================
@@ -85,6 +85,13 @@ config SPI_BUTTERFLY
 	  inexpensive battery powered microcontroller evaluation board.
 	  This same cable can be used to flash new firmware.
 
+config SPI_OMAP_INN1510
+	tristate "OMAP Innovator 1510 Bitbang SPI, for touchscreen"
+	depends on SPI_MASTER && MACH_OMAP_INNOVATOR
+	select SPI_BITBANG
+	help
+	  This provides bitbang access to the Innovator touchscreen.
+
 config SPI_OMAP_UWIRE
 	tristate "OMAP MicroWire"
 	depends on SPI_MASTER && ARCH_OMAP
drivers/spi/Makefile +1 -0
Index: osk/drivers/spi/Makefile
===================================================================
@@ -14,6 +14,7 @@ obj-$(CONFIG_SPI_MASTER)		+= spi.o
 obj-$(CONFIG_SPI_BITBANG)		+= spi_bitbang.o
 obj-$(CONFIG_SPI_BUTTERFLY)		+= spi_butterfly.o
 obj-$(CONFIG_SPI_OMAP24XX)		+= omap2_mcspi.o
+obj-$(CONFIG_SPI_OMAP_INN1510)		+= spi_inn1510.o
 obj-$(CONFIG_SPI_OMAP_UWIRE)		+= omap_uwire.o
 # 	... add above this line ...
 
drivers/spi/spi_inn1510.c new file +194 -0

194 lines not on this page · raw message

Remove OSK/Mistral and Innovator support for the old OMAP-specfic touchscreen framework; both of those board should be able to use the new SPI framework with the ads7846 touchscreen driver that's now in the upstream kernels.

drivers/input/touchscreen/Kconfig +3 -3
Index: osk/drivers/input/touchscreen/Kconfig
===================================================================
@@ -114,13 +114,13 @@ config TOUCHSCREEN_HP600
 endif
 config TOUCHSCREEN_OMAP
 	tristate "OMAP touchscreen input driver"
-	depends on INPUT && INPUT_TOUCHSCREEN && ARCH_OMAP
+	depends on INPUT && INPUT_TOUCHSCREEN && (MACH_OMAP_H2 || MACH_OMAP_H3)
 	help
 	  Say Y here if you have an OMAP based board with touchscreen
-	  attached to it, e.g. OMAP Innovator, OSK, H2 or H3
+	  attached to it, e.g. OMAP H2 or H3
 
 	  If unsure, or you're using drivers in the newer SPI
-	  framework, say N.
+	  framework (as with Innovator or OSK/Mistral), say N.
 
 	  To compile this driver as a module, choose M here: the
 	  module will be called omap_ts.
drivers/input/touchscreen/omap/Makefile +0 -2
Index: osk/drivers/input/touchscreen/omap/Makefile
===================================================================
@@ -6,7 +6,5 @@ obj-$(CONFIG_TOUCHSCREEN_OMAP) += omapts
 
 objs-$(CONFIG_ARCH_OMAP16XX)$(CONFIG_MACH_OMAP_H2) += ts_hx.o
 objs-$(CONFIG_ARCH_OMAP16XX)$(CONFIG_MACH_OMAP_H3) += ts_hx.o
-objs-$(CONFIG_ARCH_OMAP15XX)$(CONFIG_MACH_OMAP_INNOVATOR) += ts_inn1510.o
-objs-$(CONFIG_ARCH_OMAP16XX)$(CONFIG_MACH_OMAP_OSK) += ts_osk.o
 
 omapts-objs := omap_ts.o $(objs-yy)
drivers/input/touchscreen/omap/omap_ts.c +3 -6
Index: osk/drivers/input/touchscreen/omap/omap_ts.c
===================================================================
@@ -49,12 +49,6 @@ static struct ts_device *__initdata ts_d
 #if defined(CONFIG_MACH_OMAP_H2) || defined(CONFIG_MACH_OMAP_H3)
 	&hx_ts,
 #endif
-#ifdef CONFIG_MACH_OMAP_OSK
-	&osk_ts,
-#endif
-#if defined(CONFIG_MACH_OMAP_INNOVATOR) && defined(CONFIG_ARCH_OMAP15XX)
-	&innovator1510_ts,
-#endif
 };
 
 static struct omap_ts_t ts_omap;
@@ -245,6 +239,9 @@ static int __init omap_ts_init(void)
 {
 	int ret;
 
+	if (machine_is_omap_osk() || machine_is_omap_innovator())
+		return -ENODEV;
+
 	ret = platform_device_register(&omap_ts_device);
 	if (ret != 0)
 		return -ENODEV;
drivers/input/touchscreen/omap/omap_ts.h +0 -2
Index: osk/drivers/input/touchscreen/omap/omap_ts.h
===================================================================
@@ -53,7 +53,5 @@ struct omap_ts_t{
 };
 
 extern struct ts_device hx_ts;
-extern struct ts_device osk_ts;
-extern struct ts_device innovator1510_ts;
 
 #endif /* __OMAP_TS_H */
drivers/input/touchscreen/omap/ts_osk.c deleted +0 -158

158 lines not on this page · raw message

drivers/input/touchscreen/omap/ts_inn1510.c deleted +0 -219

219 lines not on this page · raw message

drivers/input/touchscreen/omap/ads7846.h deleted +0 -53

53 lines not on this page · raw message

reviewer
#8 lore raw
Quoted 9 lines · David Brownell
Quoted 3 lines · Tony Lindgren

OK, I've pushed Imre's patches. Can you check that everything got patched OK?

I attach three patches:

- To make Mistral work better needs new callback), which worked for me (modulo writing the "disable" file wedging, gotta retest that);

I'll push this patch today.

Quoted 5 lines

- A quickie bitbang SPI adapter for the 1510-Innovator FPGA hookup to ads7846, untested beyond compiling (no Innovator here!);

- Removing the old OMAP-specific Mistral and Innovator touchscreen drivers; this may be a trifle premature given the lack of Innovator testing

Let's try these patches out before pushing. Can somebody with an Innovator test these patches?

Quoted 5 lines

Anyway, with the first of these patches I saw tick rates of about 27 Hz; the issue seems to be the omap_ts driver keeping a timer active (among other misbehaviors).

In short: yes, it's better now.

AFAIK omap_ts should only need a timer when pen is down.

Tony

reviewer
#9 lore raw
Quoted 13 lines · Tony Lindgren
Quoted 9 lines · David Brownell
Quoted 3 lines · Tony Lindgren

OK, I've pushed Imre's patches. Can you check that everything got patched OK?

I attach three patches:

- To make Mistral work better needs new callback), which worked for me (modulo writing the "disable" file wedging, gotta retest that);

I'll push this patch today.

Quoted 8 lines
Quoted 5 lines

- A quickie bitbang SPI adapter for the 1510-Innovator FPGA hookup to ads7846, untested beyond compiling (no Innovator here!);

- Removing the old OMAP-specific Mistral and Innovator touchscreen drivers; this may be a trifle premature given the lack of Innovator testing

Let's try these patches out before pushing. Can somebody with an Innovator test these patches?

Pushed the Innovator patches too, nobody complained in time :)

Tony

reviewer
#10 lore raw
In reply to David Brownell
Quoted 9 lines · David Brownell
Quoted 2 lines · Tony Lindgren

In general dyntick should work, and you should see about 4-6HZ idle tick rate.

Depending on drivers, it seems ... ;)

I have a patch to get rid of the OHCI root hub polling, which will get rid of one 4Hz timer.

Cool. Last time I played with sub 4Hz idle tick, some timers stopped working properly... Might be different now though as the timer system has seen some changes since last fall.

Tony

#11 lore raw

Linux On TI Omap850

I would like to know if someone has information about running linux on TI omap850 platform. I have searched on google and I only found one or two posts regarding this topic. I would like to have maximum information on this processor.

Thanks

reviewer
#12 lore raw

Re: Linux On TI Omap850

Quoted 5 lines · Vince

I would like to know if someone has information about running linux on TI omap850 platform.
I have searched on google and I only found one or two posts regarding this topic.
I would like to have maximum information on this processor.

Try going to linux.omap.com, go to the mailing lists. Then select April 2006 archives by thread. There you see all the current 850 fsample patches. We integrated the core 850 fsample support patch yesterday, so the device driver patches are still missing.

Regards,

Tony

#13 lore raw

Re: Linux On TI Omap850

[Tony Lindgren <[email protected]>]

Quoted 11 lines · Vince
Quoted 5 lines

I would like to know if someone has information about running linux on TI omap850 platform.
I have searched on google and I only found one or two posts regarding this topic.
I would like to have maximum information on this processor.

Try going to linux.omap.com, go to the mailing lists. Then select April 2006 archives by thread. There you see all the current 850 fsample patches. We integrated the core 850 fsample support patch yesterday, so the device driver patches are still missing.

Speaking of the device driver patches, I still need to figure out how to have lcd_p2.c included for perseus2 or fsample, but not twice if you build a kernel for both...

obviously, something like this in drivers/video/Makefile is wrong:

objs-y$(CONFIG_MACH_OMAP_PERSEUS2) += lcd_p2.o
objs-y$(CONFIG_MACH_OMAP_FSAMPLE) += lcd_p2.o

Is the solution to have a CONFIG_FB_OMAP_LCD_P2?

Brian, unwise in the ways of kconfig

#14 lore raw
In reply to Tony Lindgren
Quoted 6 lines · ext Tony Lindgren
Quoted 5 lines · David Brownell
Quoted 2 lines · Tony Lindgren

In general dyntick should work, and you should see about 4-6HZ idle tick rate.

Quoted 8 lines
Quoted 4 lines

Depending on drivers, it seems ... ;)

I have a patch to get rid of the OHCI root hub polling, which will get rid of one 4Hz timer.

Cool. Last time I played with sub 4Hz idle tick, some timers stopped working properly... Might be different now though as the timer system has seen some changes since last fall.

On N770 I've found that the omap_udc is pushing up the tick-rate as well by HZ/3. It is a workaround to account for lost RX interrupts.

--Imre

Quoted 6 lines

Tony
_______________________________________________
Linux-omap-open-source mailing list
[email protected]
http://linux.omap.com/mailman/listinfo/linux-omap-open-source