* [PATCH 0/9] omap fixes for 2.6.33-rc6 @ 2010-02-03 2:25 Tony Lindgren 2010-02-03 2:25 ` [PATCH 1/9] omap: define _toggle_gpio_edge_triggering only for OMAP1 Tony Lindgren ` (8 more replies) 0 siblings, 9 replies; 16+ messages in thread From: Tony Lindgren @ 2010-02-03 2:25 UTC (permalink / raw) To: linux-arm-kernel Hi all, Here are some omap fixes for review. Regards, Tony --- Kevin Hilman (2): OMAP2/3: IRQ: ensure valid base address OMAP2/3: GPMC: ensure valid clock pointer Marek Skuczynski (1): omap: Fix access to already released memory in clk_debugfs_register_one() Sriram (1): ARCH OMAP : enable ARCH_HAS_HOLES_MEMORYMODEL for OMAP Tony Lindgren (4): omap: Remove old unused defines for OMAP_32KSYNCT_BASE omap: Fix 3630 mux errors omap: Fix arch/arm/mach-omap2/mux.c: Off by one error omap: Disable serial port autoidle by default Uwe Kleine-K?nig (1): omap: define _toggle_gpio_edge_triggering only for OMAP1 arch/arm/Kconfig | 1 + arch/arm/mach-omap2/gpmc.c | 5 +++- arch/arm/mach-omap2/irq.c | 4 ++- arch/arm/mach-omap2/mux.c | 10 +++++++- arch/arm/mach-omap2/mux34xx.c | 47 ++++++++++++++++++++++++++++++++++++++ arch/arm/mach-omap2/serial.c | 8 ++++++ arch/arm/plat-omap/clock.c | 4 ++- arch/arm/plat-omap/gpio.c | 4 ++- arch/arm/plat-omap/omap_device.c | 10 -------- 9 files changed, 75 insertions(+), 18 deletions(-) -- Signature ^ permalink raw reply [flat|nested] 16+ messages in thread
* [PATCH 1/9] omap: define _toggle_gpio_edge_triggering only for OMAP1 2010-02-03 2:25 [PATCH 0/9] omap fixes for 2.6.33-rc6 Tony Lindgren @ 2010-02-03 2:25 ` Tony Lindgren 2010-02-03 8:13 ` Uwe Kleine-König 2010-02-03 2:25 ` [PATCH 2/9] omap: Remove old unused defines for OMAP_32KSYNCT_BASE Tony Lindgren ` (7 subsequent siblings) 8 siblings, 1 reply; 16+ messages in thread From: Tony Lindgren @ 2010-02-03 2:25 UTC (permalink / raw) To: linux-arm-kernel From: Uwe Kleine-K?nig <u.kleine-koenig@pengutronix.de> The only usage of _toggle_gpio_edge_triggering is in an CONFIG_ARCH_OMAP1 is defined, too. This fixes a compiler warning: arch/arm/plat-omap/gpio.c:758: warning: '_toggle_gpio_edge_triggering' defined but not used when compiling for ARCH_OMAP2, ARCH_OMAP3 or ARCH_OMAP4. Signed-off-by: Uwe Kleine-K?nig <u.kleine-koenig@pengutronix.de> Acked-by: Kevin Hilman <khilman@deeprootsystems.com> Signed-off-by: Tony Lindgren <tony@atomide.com> --- arch/arm/plat-omap/gpio.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/arm/plat-omap/gpio.c b/arch/arm/plat-omap/gpio.c index d17620c..d2422c7 100644 --- a/arch/arm/plat-omap/gpio.c +++ b/arch/arm/plat-omap/gpio.c @@ -750,6 +750,7 @@ static inline void set_24xx_gpio_triggering(struct gpio_bank *bank, int gpio, } #endif +#ifdef CONFIG_ARCH_OMAP1 /* * This only applies to chips that can't do both rising and falling edge * detection at once. For all other chips, this function is a noop. @@ -760,11 +761,9 @@ static void _toggle_gpio_edge_triggering(struct gpio_bank *bank, int gpio) u32 l = 0; switch (bank->method) { -#ifdef CONFIG_ARCH_OMAP1 case METHOD_MPUIO: reg += OMAP_MPUIO_GPIO_INT_EDGE; break; -#endif #ifdef CONFIG_ARCH_OMAP15XX case METHOD_GPIO_1510: reg += OMAP1510_GPIO_INT_CONTROL; @@ -787,6 +786,7 @@ static void _toggle_gpio_edge_triggering(struct gpio_bank *bank, int gpio) __raw_writel(l, reg); } +#endif static int _set_gpio_triggering(struct gpio_bank *bank, int gpio, int trigger) { ^ permalink raw reply related [flat|nested] 16+ messages in thread
* [PATCH 1/9] omap: define _toggle_gpio_edge_triggering only for OMAP1 2010-02-03 2:25 ` [PATCH 1/9] omap: define _toggle_gpio_edge_triggering only for OMAP1 Tony Lindgren @ 2010-02-03 8:13 ` Uwe Kleine-König 2010-02-03 16:57 ` Tony Lindgren 0 siblings, 1 reply; 16+ messages in thread From: Uwe Kleine-König @ 2010-02-03 8:13 UTC (permalink / raw) To: linux-arm-kernel Hi Tony, On Tue, Feb 02, 2010 at 06:25:55PM -0800, Tony Lindgren wrote: > From: Uwe Kleine-K?nig <u.kleine-koenig@pengutronix.de> > > The only usage of _toggle_gpio_edge_triggering is in an > CONFIG_ARCH_OMAP1 is defined, too. This sentence is broken, isn't it? I guess git commit played tricks on me here and removed a line, something like: #ifdef CONFIG_ARCH_OMAP1 block, so only provide it if Can you add it back? I'd recommend doing the line break before the "an" in the first line instead of behind it. Thanks Uwe -- Pengutronix e.K. | Uwe Kleine-K?nig | Industrial Linux Solutions | http://www.pengutronix.de/ | ^ permalink raw reply [flat|nested] 16+ messages in thread
* [PATCH 1/9] omap: define _toggle_gpio_edge_triggering only for OMAP1 2010-02-03 8:13 ` Uwe Kleine-König @ 2010-02-03 16:57 ` Tony Lindgren 2010-02-03 17:10 ` Uwe Kleine-König 0 siblings, 1 reply; 16+ messages in thread From: Tony Lindgren @ 2010-02-03 16:57 UTC (permalink / raw) To: linux-arm-kernel * Uwe Kleine-K?nig <u.kleine-koenig@pengutronix.de> [100203 00:10]: > Hi Tony, > > On Tue, Feb 02, 2010 at 06:25:55PM -0800, Tony Lindgren wrote: > > From: Uwe Kleine-K?nig <u.kleine-koenig@pengutronix.de> > > > > The only usage of _toggle_gpio_edge_triggering is in an > > CONFIG_ARCH_OMAP1 is defined, too. > This sentence is broken, isn't it? I guess git commit played tricks on > me here and removed a line, something like: > > #ifdef CONFIG_ARCH_OMAP1 block, so only provide it if > > Can you add it back? I'd recommend doing the line break before the "an" > in the first line instead of behind it. Sure, updated patch below. The description makes more sense now :) BTW, looks like with "git show --pretty=email" the From: field gets messed up in the patch below. Author name shows OK in git though. I wonder if that's a git bug for --pretty=email? Using version 1.6.6.1 it seems. Tony ^ permalink raw reply [flat|nested] 16+ messages in thread
* [PATCH 1/9] omap: define _toggle_gpio_edge_triggering only for OMAP1 2010-02-03 16:57 ` Tony Lindgren @ 2010-02-03 17:10 ` Uwe Kleine-König 2010-02-03 17:25 ` Tony Lindgren 0 siblings, 1 reply; 16+ messages in thread From: Uwe Kleine-König @ 2010-02-03 17:10 UTC (permalink / raw) To: linux-arm-kernel Hello Tony, On Wed, Feb 03, 2010 at 08:57:55AM -0800, Tony Lindgren wrote: > BTW, looks like with "git show --pretty=email" the From: field gets > messed up in the patch below. Author name shows OK in git though. > > I wonder if that's a git bug for --pretty=email? Using version > 1.6.6.1 it seems. That's not a bug, but a feature. This is normal rfcforgotthenumber mail header quoting. (2822?) > > Tony > From 9198bcd39f558dd56823f1c9983e2252fc99a501 Mon Sep 17 00:00:00 2001 > From: =?UTF-8?q?Uwe=20Kleine-K=C3=B6nig?= <u.kleine-koenig@pengutronix.de> Thanks Uwe -- Pengutronix e.K. | Uwe Kleine-K?nig | Industrial Linux Solutions | http://www.pengutronix.de/ | ^ permalink raw reply [flat|nested] 16+ messages in thread
* [PATCH 1/9] omap: define _toggle_gpio_edge_triggering only for OMAP1 2010-02-03 17:10 ` Uwe Kleine-König @ 2010-02-03 17:25 ` Tony Lindgren 0 siblings, 0 replies; 16+ messages in thread From: Tony Lindgren @ 2010-02-03 17:25 UTC (permalink / raw) To: linux-arm-kernel * Uwe Kleine-K?nig <u.kleine-koenig@pengutronix.de> [100203 09:07]: > Hello Tony, > > On Wed, Feb 03, 2010 at 08:57:55AM -0800, Tony Lindgren wrote: > > BTW, looks like with "git show --pretty=email" the From: field gets > > messed up in the patch below. Author name shows OK in git though. > > > > I wonder if that's a git bug for --pretty=email? Using version > > 1.6.6.1 it seems. > That's not a bug, but a feature. This is normal rfcforgotthenumber mail > header quoting. (2822?) Oh right, the email headers need to be ASCII still. Was not aware of how umlauts should be encoded into the name though. It seems that all my fellow Finns have erased the umlauts from their email addresses, at least in my aliases file. Tony > > > > > Tony > > > From 9198bcd39f558dd56823f1c9983e2252fc99a501 Mon Sep 17 00:00:00 2001 > > From: =?UTF-8?q?Uwe=20Kleine-K=C3=B6nig?= <u.kleine-koenig@pengutronix.de> > > Thanks > Uwe > > -- > Pengutronix e.K. | Uwe Kleine-K?nig | > Industrial Linux Solutions | http://www.pengutronix.de/ | ^ permalink raw reply [flat|nested] 16+ messages in thread
* [PATCH 2/9] omap: Remove old unused defines for OMAP_32KSYNCT_BASE 2010-02-03 2:25 [PATCH 0/9] omap fixes for 2.6.33-rc6 Tony Lindgren 2010-02-03 2:25 ` [PATCH 1/9] omap: define _toggle_gpio_edge_triggering only for OMAP1 Tony Lindgren @ 2010-02-03 2:25 ` Tony Lindgren 2010-02-03 2:26 ` [PATCH 3/9] ARCH OMAP : enable ARCH_HAS_HOLES_MEMORYMODEL for OMAP Tony Lindgren ` (6 subsequent siblings) 8 siblings, 0 replies; 16+ messages in thread From: Tony Lindgren @ 2010-02-03 2:25 UTC (permalink / raw) To: linux-arm-kernel Remove old unused defines for OMAP_32KSYNCT_BASE Signed-off-by: Tony Lindgren <tony@atomide.com> --- arch/arm/plat-omap/omap_device.c | 10 ---------- 1 files changed, 0 insertions(+), 10 deletions(-) diff --git a/arch/arm/plat-omap/omap_device.c b/arch/arm/plat-omap/omap_device.c index 1e5648d..2ed7201 100644 --- a/arch/arm/plat-omap/omap_device.c +++ b/arch/arm/plat-omap/omap_device.c @@ -89,16 +89,6 @@ #define USE_WAKEUP_LAT 0 #define IGNORE_WAKEUP_LAT 1 -/* XXX this should be moved into a separate file */ -#if defined(CONFIG_ARCH_OMAP2420) -# define OMAP_32KSYNCT_BASE 0x48004000 -#elif defined(CONFIG_ARCH_OMAP2430) -# define OMAP_32KSYNCT_BASE 0x49020000 -#elif defined(CONFIG_ARCH_OMAP3430) -# define OMAP_32KSYNCT_BASE 0x48320000 -#else -# error Unknown OMAP device -#endif /* Private functions */ ^ permalink raw reply related [flat|nested] 16+ messages in thread
* [PATCH 3/9] ARCH OMAP : enable ARCH_HAS_HOLES_MEMORYMODEL for OMAP 2010-02-03 2:25 [PATCH 0/9] omap fixes for 2.6.33-rc6 Tony Lindgren 2010-02-03 2:25 ` [PATCH 1/9] omap: define _toggle_gpio_edge_triggering only for OMAP1 Tony Lindgren 2010-02-03 2:25 ` [PATCH 2/9] omap: Remove old unused defines for OMAP_32KSYNCT_BASE Tony Lindgren @ 2010-02-03 2:26 ` Tony Lindgren 2010-02-03 2:26 ` [PATCH 4/9] OMAP2/3: IRQ: ensure valid base address Tony Lindgren ` (5 subsequent siblings) 8 siblings, 0 replies; 16+ messages in thread From: Tony Lindgren @ 2010-02-03 2:26 UTC (permalink / raw) To: linux-arm-kernel From: Sriram <srk@ti.com> OMAP platforms(like OMAP3530) include DSP or other co-processors for media acceleration. when carving out memory for the accelerators we can end up creating a hole in the memory map of sort: <kernel memory><hole(memory for accelerator)><kernel memory> To handle such a memory configuration ARCH_HAS_HOLES_MEMORYMODEL has to be enabled. For further information refer discussion at: http://www.mail-archive.com/linux-omap at vger.kernel.org/msg15262.html. Signed-off-by: Sriramakrishnan <srk@ti.com> Signed-off-by: Tony Lindgren <tony@atomide.com> --- arch/arm/Kconfig | 1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig index 4c33ca8..184a6bd 100644 --- a/arch/arm/Kconfig +++ b/arch/arm/Kconfig @@ -702,6 +702,7 @@ config ARCH_OMAP select ARCH_HAS_CPUFREQ select GENERIC_TIME select GENERIC_CLOCKEVENTS + select ARCH_HAS_HOLES_MEMORYMODEL help Support for TI's OMAP platform (OMAP1 and OMAP2). ^ permalink raw reply related [flat|nested] 16+ messages in thread
* [PATCH 4/9] OMAP2/3: IRQ: ensure valid base address 2010-02-03 2:25 [PATCH 0/9] omap fixes for 2.6.33-rc6 Tony Lindgren ` (2 preceding siblings ...) 2010-02-03 2:26 ` [PATCH 3/9] ARCH OMAP : enable ARCH_HAS_HOLES_MEMORYMODEL for OMAP Tony Lindgren @ 2010-02-03 2:26 ` Tony Lindgren 2010-02-03 2:26 ` [PATCH 5/9] OMAP2/3: GPMC: ensure valid clock pointer Tony Lindgren ` (4 subsequent siblings) 8 siblings, 0 replies; 16+ messages in thread From: Tony Lindgren @ 2010-02-03 2:26 UTC (permalink / raw) To: linux-arm-kernel From: Kevin Hilman <khilman@deeprootsystems.com> Ensure valid base address during IRQ init. Fixes compiler warning about potential use of uninitialized variable. Signed-off-by: Kevin Hilman <khilman@deeprootsystems.com> Signed-off-by: Tony Lindgren <tony@atomide.com> --- arch/arm/mach-omap2/irq.c | 4 +++- 1 files changed, 3 insertions(+), 1 deletions(-) diff --git a/arch/arm/mach-omap2/irq.c b/arch/arm/mach-omap2/irq.c index 2705402..26aeef5 100644 --- a/arch/arm/mach-omap2/irq.c +++ b/arch/arm/mach-omap2/irq.c @@ -194,7 +194,7 @@ void __init omap_init_irq(void) int i; for (i = 0; i < ARRAY_SIZE(irq_banks); i++) { - unsigned long base; + unsigned long base = 0; struct omap_irq_bank *bank = irq_banks + i; if (cpu_is_omap24xx()) @@ -202,6 +202,8 @@ void __init omap_init_irq(void) else if (cpu_is_omap34xx()) base = OMAP34XX_IC_BASE; + BUG_ON(!base); + /* Static mapping, never released */ bank->base_reg = ioremap(base, SZ_4K); if (!bank->base_reg) { ^ permalink raw reply related [flat|nested] 16+ messages in thread
* [PATCH 5/9] OMAP2/3: GPMC: ensure valid clock pointer 2010-02-03 2:25 [PATCH 0/9] omap fixes for 2.6.33-rc6 Tony Lindgren ` (3 preceding siblings ...) 2010-02-03 2:26 ` [PATCH 4/9] OMAP2/3: IRQ: ensure valid base address Tony Lindgren @ 2010-02-03 2:26 ` Tony Lindgren 2010-02-03 2:26 ` [PATCH 6/9] omap: Fix 3630 mux errors Tony Lindgren ` (3 subsequent siblings) 8 siblings, 0 replies; 16+ messages in thread From: Tony Lindgren @ 2010-02-03 2:26 UTC (permalink / raw) To: linux-arm-kernel From: Kevin Hilman <khilman@deeprootsystems.com> Ensure valid clock pointer during GPMC init. Fixes compiler warning about potential use of uninitialized variable. Signed-off-by: Kevin Hilman <khilman@deeprootsystems.com> Signed-off-by: Tony Lindgren <tony@atomide.com> --- arch/arm/mach-omap2/gpmc.c | 5 ++++- 1 files changed, 4 insertions(+), 1 deletions(-) diff --git a/arch/arm/mach-omap2/gpmc.c b/arch/arm/mach-omap2/gpmc.c index 3f1334f..7027cdc 100644 --- a/arch/arm/mach-omap2/gpmc.c +++ b/arch/arm/mach-omap2/gpmc.c @@ -505,7 +505,7 @@ static void __init gpmc_mem_init(void) void __init gpmc_init(void) { u32 l; - char *ck; + char *ck = NULL; if (cpu_is_omap24xx()) { ck = "core_l3_ck"; @@ -521,6 +521,9 @@ void __init gpmc_init(void) l = OMAP44XX_GPMC_BASE; } + if (WARN_ON(!ck)) + return; + gpmc_l3_clk = clk_get(NULL, ck); if (IS_ERR(gpmc_l3_clk)) { printk(KERN_ERR "Could not get GPMC clock %s\n", ck); ^ permalink raw reply related [flat|nested] 16+ messages in thread
* [PATCH 6/9] omap: Fix 3630 mux errors 2010-02-03 2:25 [PATCH 0/9] omap fixes for 2.6.33-rc6 Tony Lindgren ` (4 preceding siblings ...) 2010-02-03 2:26 ` [PATCH 5/9] OMAP2/3: GPMC: ensure valid clock pointer Tony Lindgren @ 2010-02-03 2:26 ` Tony Lindgren 2010-02-03 2:26 ` [PATCH 7/9] omap: Fix arch/arm/mach-omap2/mux.c: Off by one error Tony Lindgren ` (2 subsequent siblings) 8 siblings, 0 replies; 16+ messages in thread From: Tony Lindgren @ 2010-02-03 2:26 UTC (permalink / raw) To: linux-arm-kernel 3630 has more mux signals than 34xx. The additional pins exist in omap36xx_cbp_subset, but are not initialized as the superset is missing these offsets. This causes the following errors during the boot: mux: Unknown entry offset 0x236 mux: Unknown entry offset 0x22e mux: Unknown entry offset 0x1ec mux: Unknown entry offset 0x1ee mux: Unknown entry offset 0x1f4 mux: Unknown entry offset 0x1f6 mux: Unknown entry offset 0x1f8 mux: Unknown entry offset 0x1fa mux: Unknown entry offset 0x1fc mux: Unknown entry offset 0x22a mux: Unknown entry offset 0x226 mux: Unknown entry offset 0x230 mux: Unknown entry offset 0x22c mux: Unknown entry offset 0x228 Fix this by adding the missing offsets to omap3 superset. Note that additionally the uninitialized pins need to be skipped on 34xx. Based on an earlier patch by Allen Pais <allen.pais@ti.com>. Reported-by: Allen Pais <allen.pais@ti.com> Signed-off-by: Tony Lindgren <tony@atomide.com> --- arch/arm/mach-omap2/mux.c | 7 ++++++ arch/arm/mach-omap2/mux34xx.c | 47 +++++++++++++++++++++++++++++++++++++++++ 2 files changed, 54 insertions(+), 0 deletions(-) diff --git a/arch/arm/mach-omap2/mux.c b/arch/arm/mach-omap2/mux.c index 3f59bd1..19001dd 100644 --- a/arch/arm/mach-omap2/mux.c +++ b/arch/arm/mach-omap2/mux.c @@ -968,6 +968,13 @@ static void __init omap_mux_init_list(struct omap_mux *superset) } #endif +#if defined(CONFIG_OMAP_MUX) && defined(CONFIG_DEBUG_FS) + if (!superset->muxnames || !superset->muxnames[0]) { + superset++; + continue; + } +#endif + entry = omap_mux_list_add(superset); if (!entry) { printk(KERN_ERR "mux: Could not add entry\n"); diff --git a/arch/arm/mach-omap2/mux34xx.c b/arch/arm/mach-omap2/mux34xx.c index 68e0a59..07aa7b3 100644 --- a/arch/arm/mach-omap2/mux34xx.c +++ b/arch/arm/mach-omap2/mux34xx.c @@ -649,6 +649,53 @@ static struct omap_mux __initdata omap3_muxmodes[] = { _OMAP3_MUXENTRY(UART3_TX_IRTX, 166, "uart3_tx_irtx", NULL, NULL, NULL, "gpio_166", NULL, NULL, "safe_mode"), + + /* Only on 3630, see omap36xx_cbp_subset for the signals */ + _OMAP3_MUXENTRY(GPMC_A11, 0, + NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL), + _OMAP3_MUXENTRY(SAD2D_MBUSFLAG, 0, + NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL), + _OMAP3_MUXENTRY(SAD2D_MREAD, 0, + NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL), + _OMAP3_MUXENTRY(SAD2D_MWRITE, 0, + NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL), + _OMAP3_MUXENTRY(SAD2D_SBUSFLAG, 0, + NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL), + _OMAP3_MUXENTRY(SAD2D_SREAD, 0, + NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL), + _OMAP3_MUXENTRY(SAD2D_SWRITE, 0, + NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL), + _OMAP3_MUXENTRY(GPMC_A11, 0, + NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL), + _OMAP3_MUXENTRY(SAD2D_MCAD28, 0, + NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL), + _OMAP3_MUXENTRY(SAD2D_MCAD29, 0, + NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL), + _OMAP3_MUXENTRY(SAD2D_MCAD32, 0, + NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL), + _OMAP3_MUXENTRY(SAD2D_MCAD33, 0, + NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL), + _OMAP3_MUXENTRY(SAD2D_MCAD34, 0, + NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL), + _OMAP3_MUXENTRY(SAD2D_MCAD35, 0, + NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL), + _OMAP3_MUXENTRY(SAD2D_MCAD36, 0, + NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL), { .reg_offset = OMAP_MUX_TERMINATOR }, }; ^ permalink raw reply related [flat|nested] 16+ messages in thread
* [PATCH 7/9] omap: Fix arch/arm/mach-omap2/mux.c: Off by one error 2010-02-03 2:25 [PATCH 0/9] omap fixes for 2.6.33-rc6 Tony Lindgren ` (5 preceding siblings ...) 2010-02-03 2:26 ` [PATCH 6/9] omap: Fix 3630 mux errors Tony Lindgren @ 2010-02-03 2:26 ` Tony Lindgren 2010-02-03 2:26 ` [PATCH 8/9] omap: Fix access to already released memory in clk_debugfs_register_one() Tony Lindgren 2010-02-03 2:26 ` [PATCH 9/9] omap: Disable serial port autoidle by default Tony Lindgren 8 siblings, 0 replies; 16+ messages in thread From: Tony Lindgren @ 2010-02-03 2:26 UTC (permalink / raw) To: linux-arm-kernel David Binderman ran the sourceforge tool cppcheck over the source code of the new Linux kernel 2.6.33-rc6: [./arm/mach-omap2/mux.c:492]: (error) Buffer access out-of-bounds 13 characters + 1 digit + 1 zero byte is more than 14 characters. Also add a comment on mode0 name length in case new omaps start using longer names. Reported-by: David Binderman <dcb314@hotmail.com> Signed-off-by: Tony Lindgren <tony@atomide.com> --- arch/arm/mach-omap2/mux.c | 3 ++- 1 files changed, 2 insertions(+), 1 deletions(-) diff --git a/arch/arm/mach-omap2/mux.c b/arch/arm/mach-omap2/mux.c index 19001dd..5fedc50 100644 --- a/arch/arm/mach-omap2/mux.c +++ b/arch/arm/mach-omap2/mux.c @@ -486,7 +486,7 @@ int __init omap_mux_init_signal(char *muxname, int val) static inline void omap_mux_decode(struct seq_file *s, u16 val) { char *flags[OMAP_MUX_MAX_NR_FLAGS]; - char mode[14]; + char mode[sizeof("OMAP_MUX_MODE") + 1]; int i = -1; sprintf(mode, "OMAP_MUX_MODE%d", val & 0x7); @@ -553,6 +553,7 @@ static int omap_mux_dbg_board_show(struct seq_file *s, void *unused) if (!m0_name) continue; + /* REVISIT: Needs to be updated if mode0 names get longer */ for (i = 0; i < OMAP_MUX_DEFNAME_LEN; i++) { if (m0_name[i] == '\0') { m0_def[i] = m0_name[i]; ^ permalink raw reply related [flat|nested] 16+ messages in thread
* [PATCH 8/9] omap: Fix access to already released memory in clk_debugfs_register_one() 2010-02-03 2:25 [PATCH 0/9] omap fixes for 2.6.33-rc6 Tony Lindgren ` (6 preceding siblings ...) 2010-02-03 2:26 ` [PATCH 7/9] omap: Fix arch/arm/mach-omap2/mux.c: Off by one error Tony Lindgren @ 2010-02-03 2:26 ` Tony Lindgren 2010-02-03 2:26 ` [PATCH 9/9] omap: Disable serial port autoidle by default Tony Lindgren 8 siblings, 0 replies; 16+ messages in thread From: Tony Lindgren @ 2010-02-03 2:26 UTC (permalink / raw) To: linux-arm-kernel From: Marek Skuczynski <mareksk7@gmail.com> I have found an access to already released memory in clk_debugfs_register_one() function. Signed-off-by: Marek Skuczynski <mareksk7@gmail.com> Acked-by: Paul Walmsley <paul@pwsan.com> Signed-off-by: Tony Lindgren <tony@atomide.com> --- arch/arm/plat-omap/clock.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/arm/plat-omap/clock.c b/arch/arm/plat-omap/clock.c index d9f8c84..4becbdd 100644 --- a/arch/arm/plat-omap/clock.c +++ b/arch/arm/plat-omap/clock.c @@ -391,7 +391,7 @@ static struct dentry *clk_debugfs_root; static int clk_debugfs_register_one(struct clk *c) { int err; - struct dentry *d, *child; + struct dentry *d, *child, *child_tmp; struct clk *pa = c->parent; char s[255]; char *p = s; @@ -423,7 +423,7 @@ static int clk_debugfs_register_one(struct clk *c) err_out: d = c->dent; - list_for_each_entry(child, &d->d_subdirs, d_u.d_child) + list_for_each_entry_safe(child, child_tmp, &d->d_subdirs, d_u.d_child) debugfs_remove(child); debugfs_remove(c->dent); return err; ^ permalink raw reply related [flat|nested] 16+ messages in thread
* [PATCH 9/9] omap: Disable serial port autoidle by default 2010-02-03 2:25 [PATCH 0/9] omap fixes for 2.6.33-rc6 Tony Lindgren ` (7 preceding siblings ...) 2010-02-03 2:26 ` [PATCH 8/9] omap: Fix access to already released memory in clk_debugfs_register_one() Tony Lindgren @ 2010-02-03 2:26 ` Tony Lindgren 2010-02-03 3:43 ` Tony Lindgren 8 siblings, 1 reply; 16+ messages in thread From: Tony Lindgren @ 2010-02-03 2:26 UTC (permalink / raw) To: linux-arm-kernel Currently the omap serial clocks are autoidled after 5 seconds. However, this causes lost characters on the serial ports. As this is considered non-standard behaviour for Linux, disable the timeout. Note that this will also cause blocking of any deeper omap sleep states. To enable the autoidling of the serial ports, do something like this for each serial port: # echo 5 > /sys/devices/platform/serial8250.0/sleep_timeout # echo 5 > /sys/devices/platform/serial8250.1/sleep_timeout ... Signed-off-by: Kevin Hilman <khilman@deeprootsystems.com> Signed-off-by: Tony Lindgren <tony@atomide.com> --- arch/arm/mach-omap2/serial.c | 8 +++++++- 1 files changed, 7 insertions(+), 1 deletions(-) diff --git a/arch/arm/mach-omap2/serial.c b/arch/arm/mach-omap2/serial.c index 8c964be..fa852f3 100644 --- a/arch/arm/mach-omap2/serial.c +++ b/arch/arm/mach-omap2/serial.c @@ -36,7 +36,13 @@ #define UART_OMAP_NO_EMPTY_FIFO_READ_IP_REV 0x52 #define UART_OMAP_WER 0x17 /* Wake-up enable register */ -#define DEFAULT_TIMEOUT (5 * HZ) +/* + * NOTE: By default the serial timeout is disabled as it causes lost characters + * over the serial ports. This means that the UART clocks will stay on until + * disabled via sysfs. This also causes that any deeper omap sleep states are + * blocked. + */ +#define DEFAULT_TIMEOUT 0 struct omap_uart_state { int num; ^ permalink raw reply related [flat|nested] 16+ messages in thread
* [PATCH 9/9] omap: Disable serial port autoidle by default 2010-02-03 2:26 ` [PATCH 9/9] omap: Disable serial port autoidle by default Tony Lindgren @ 2010-02-03 3:43 ` Tony Lindgren 2010-02-03 14:40 ` Kevin Hilman 0 siblings, 1 reply; 16+ messages in thread From: Tony Lindgren @ 2010-02-03 3:43 UTC (permalink / raw) To: linux-arm-kernel * Tony Lindgren <tony@atomide.com> [100202 18:23]: > Currently the omap serial clocks are autoidled after 5 seconds. > However, this causes lost characters on the serial ports. As this > is considered non-standard behaviour for Linux, disable the timeout. > > Note that this will also cause blocking of any deeper omap sleep > states. > > To enable the autoidling of the serial ports, do something like > this for each serial port: > > # echo 5 > /sys/devices/platform/serial8250.0/sleep_timeout > # echo 5 > /sys/devices/platform/serial8250.1/sleep_timeout > ... Turns out we also need to disable the timer in init, otherwise the very first character after boot can get corrupt. Updated version below, Kevin can you take one more look and see if your S-O-B is still valid? :) Regards, Tony ^ permalink raw reply [flat|nested] 16+ messages in thread
* [PATCH 9/9] omap: Disable serial port autoidle by default 2010-02-03 3:43 ` Tony Lindgren @ 2010-02-03 14:40 ` Kevin Hilman 0 siblings, 0 replies; 16+ messages in thread From: Kevin Hilman @ 2010-02-03 14:40 UTC (permalink / raw) To: linux-arm-kernel Tony Lindgren <tony@atomide.com> writes: > * Tony Lindgren <tony@atomide.com> [100202 18:23]: >> Currently the omap serial clocks are autoidled after 5 seconds. >> However, this causes lost characters on the serial ports. As this >> is considered non-standard behaviour for Linux, disable the timeout. >> >> Note that this will also cause blocking of any deeper omap sleep >> states. >> >> To enable the autoidling of the serial ports, do something like >> this for each serial port: >> >> # echo 5 > /sys/devices/platform/serial8250.0/sleep_timeout >> # echo 5 > /sys/devices/platform/serial8250.1/sleep_timeout >> ... > > Turns out we also need to disable the timer in init, otherwise > the very first character after boot can get corrupt. > > Updated version below, Kevin can you take one more look and see > if your S-O-B is still valid? :) Yeah, looks right. s-o-b still valid. Kevin > Regards, > > Tony > From ff7ce25ec59223bf987ad209c1eb183031811c07 Mon Sep 17 00:00:00 2001 > From: Tony Lindgren <tony@atomide.com> > Date: Mon, 1 Feb 2010 12:34:31 -0800 > Subject: [PATCH] omap: Disable serial port autoidle by default > > Currently the omap serial clocks are autoidled after 5 seconds. > However, this causes lost characters on the serial ports. As this > is considered non-standard behaviour for Linux, disable the timeout. > > Note that this will also cause blocking of any deeper omap sleep > states. > > To enable the autoidling of the serial ports, do something like > this for each serial port: > > # echo 5 > /sys/devices/platform/serial8250.0/sleep_timeout > # echo 5 > /sys/devices/platform/serial8250.1/sleep_timeout > ... > > Signed-off-by: Kevin Hilman <khilman@deeprootsystems.com> > Signed-off-by: Tony Lindgren <tony@atomide.com> > > diff --git a/arch/arm/mach-omap2/serial.c b/arch/arm/mach-omap2/serial.c > index 8c964be..e10a02d 100644 > --- a/arch/arm/mach-omap2/serial.c > +++ b/arch/arm/mach-omap2/serial.c > @@ -36,7 +36,13 @@ > #define UART_OMAP_NO_EMPTY_FIFO_READ_IP_REV 0x52 > #define UART_OMAP_WER 0x17 /* Wake-up enable register */ > > -#define DEFAULT_TIMEOUT (5 * HZ) > +/* > + * NOTE: By default the serial timeout is disabled as it causes lost characters > + * over the serial ports. This means that the UART clocks will stay on until > + * disabled via sysfs. This also causes that any deeper omap sleep states are > + * blocked. > + */ > +#define DEFAULT_TIMEOUT 0 > > struct omap_uart_state { > int num; > @@ -422,7 +428,8 @@ static void omap_uart_idle_init(struct omap_uart_state *uart) > uart->timeout = DEFAULT_TIMEOUT; > setup_timer(&uart->timer, omap_uart_idle_timer, > (unsigned long) uart); > - mod_timer(&uart->timer, jiffies + uart->timeout); > + if (uart->timeout) > + mod_timer(&uart->timer, jiffies + uart->timeout); > omap_uart_smart_idle_enable(uart, 0); > > if (cpu_is_omap34xx()) { ^ permalink raw reply [flat|nested] 16+ messages in thread
end of thread, other threads:[~2010-02-03 17:25 UTC | newest] Thread overview: 16+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2010-02-03 2:25 [PATCH 0/9] omap fixes for 2.6.33-rc6 Tony Lindgren 2010-02-03 2:25 ` [PATCH 1/9] omap: define _toggle_gpio_edge_triggering only for OMAP1 Tony Lindgren 2010-02-03 8:13 ` Uwe Kleine-König 2010-02-03 16:57 ` Tony Lindgren 2010-02-03 17:10 ` Uwe Kleine-König 2010-02-03 17:25 ` Tony Lindgren 2010-02-03 2:25 ` [PATCH 2/9] omap: Remove old unused defines for OMAP_32KSYNCT_BASE Tony Lindgren 2010-02-03 2:26 ` [PATCH 3/9] ARCH OMAP : enable ARCH_HAS_HOLES_MEMORYMODEL for OMAP Tony Lindgren 2010-02-03 2:26 ` [PATCH 4/9] OMAP2/3: IRQ: ensure valid base address Tony Lindgren 2010-02-03 2:26 ` [PATCH 5/9] OMAP2/3: GPMC: ensure valid clock pointer Tony Lindgren 2010-02-03 2:26 ` [PATCH 6/9] omap: Fix 3630 mux errors Tony Lindgren 2010-02-03 2:26 ` [PATCH 7/9] omap: Fix arch/arm/mach-omap2/mux.c: Off by one error Tony Lindgren 2010-02-03 2:26 ` [PATCH 8/9] omap: Fix access to already released memory in clk_debugfs_register_one() Tony Lindgren 2010-02-03 2:26 ` [PATCH 9/9] omap: Disable serial port autoidle by default Tony Lindgren 2010-02-03 3:43 ` Tony Lindgren 2010-02-03 14:40 ` Kevin Hilman
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for NNTP newsgroup(s).