linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/5] Few misc patches for v2.6.38 merge window
@ 2010-12-04 21:29 Tony Lindgren
  2010-12-04 21:29 ` [PATCH 1/5] Fix undefined reference to omap2_i2c_mux_pins Tony Lindgren
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: Tony Lindgren @ 2010-12-04 21:29 UTC (permalink / raw)
  To: linux-arm-kernel

Hi,

Here are some misc patches for review.

Regards,

Tony

---

Evgeny Kuznetsov (1):
      omap: Ptr "isr_reg" tracked as NULL was dereferenced

Jarkko Nikula (1):
      omap: McBSP: Fix potential memory leak in omap_mcbsp_remove

Shubhrajyoti D (1):
      omap: McBSP: Make the free variable update more readable

Tony Lindgren (2):
      Fix undefined reference to omap2_i2c_mux_pins
      omap: Don't select mux by default for each board


 arch/arm/mach-omap2/Kconfig |    4 ----
 arch/arm/plat-omap/gpio.c   |    5 +++++
 arch/arm/plat-omap/i2c.c    |    7 +++++++
 arch/arm/plat-omap/mcbsp.c  |   16 +++++-----------
 4 files changed, 17 insertions(+), 15 deletions(-)

-- 
Signature

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [PATCH 1/5] Fix undefined reference to omap2_i2c_mux_pins
  2010-12-04 21:29 [PATCH 0/5] Few misc patches for v2.6.38 merge window Tony Lindgren
@ 2010-12-04 21:29 ` Tony Lindgren
  2010-12-04 21:29 ` [PATCH 2/5] omap: Ptr "isr_reg" tracked as NULL was dereferenced Tony Lindgren
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: Tony Lindgren @ 2010-12-04 21:29 UTC (permalink / raw)
  To: linux-arm-kernel

In some cases we can get error function `omap2_i2c_add_bus':
arch/arm/plat-omap/i2c.c:136: undefined reference to `omap2_i2c_mux_pins'
arch/arm/plat-omap/i2c.c:141: undefined reference to `omap_hwmod_lookup'
arch/arm/plat-omap/i2c.c:157: undefined reference to `omap_device_build'

Signed-off-by: Tony Lindgren <tony@atomide.com>
---
 arch/arm/plat-omap/i2c.c |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)

diff --git a/arch/arm/plat-omap/i2c.c b/arch/arm/plat-omap/i2c.c
index a5bff9c..21fc937 100644
--- a/arch/arm/plat-omap/i2c.c
+++ b/arch/arm/plat-omap/i2c.c
@@ -125,6 +125,7 @@ static struct omap_device_pm_latency omap_i2c_latency[] = {
 	},
 };
 
+#ifdef CONFIG_ARCH_OMAP2PLUS
 static inline int omap2_i2c_add_bus(int bus_id)
 {
 	int l;
@@ -161,6 +162,12 @@ static inline int omap2_i2c_add_bus(int bus_id)
 
 	return PTR_ERR(od);
 }
+#else
+static inline int omap2_i2c_add_bus(int bus_id)
+{
+	return 0;
+}
+#endif
 
 static int __init omap_i2c_add_bus(int bus_id)
 {

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [PATCH 2/5] omap: Ptr "isr_reg" tracked as NULL was dereferenced
  2010-12-04 21:29 [PATCH 0/5] Few misc patches for v2.6.38 merge window Tony Lindgren
  2010-12-04 21:29 ` [PATCH 1/5] Fix undefined reference to omap2_i2c_mux_pins Tony Lindgren
@ 2010-12-04 21:29 ` Tony Lindgren
  2010-12-04 21:29 ` [PATCH 3/5] omap: McBSP: Fix potential memory leak in omap_mcbsp_remove Tony Lindgren
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: Tony Lindgren @ 2010-12-04 21:29 UTC (permalink / raw)
  To: linux-arm-kernel

From: Evgeny Kuznetsov <ext-eugeny.kuznetsov@nokia.com>

Value of "isr_reg" pointer is depend on configuration and GPIO method.
Potentially it may have NULL value and it is dereferenced later
in code. Warning and exit from function are added in this case.

Signed-off-by: Evgeny Kuznetsov <EXT-Eugeny.Kuznetsov@nokia.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
---
 arch/arm/plat-omap/gpio.c |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/arch/arm/plat-omap/gpio.c b/arch/arm/plat-omap/gpio.c
index 28d28e4..28106b4 100644
--- a/arch/arm/plat-omap/gpio.c
+++ b/arch/arm/plat-omap/gpio.c
@@ -1171,6 +1171,10 @@ static void gpio_irq_handler(unsigned int irq, struct irq_desc *desc)
 	if (bank->method == METHOD_GPIO_44XX)
 		isr_reg = bank->base + OMAP4_GPIO_IRQSTATUS0;
 #endif
+
+	if (WARN_ON(!isr_reg))
+		goto exit;
+
 	while(1) {
 		u32 isr_saved, level_mask = 0;
 		u32 enabled;
@@ -1230,6 +1234,7 @@ static void gpio_irq_handler(unsigned int irq, struct irq_desc *desc)
 	configured, we must unmask the bank interrupt only after
 	handler(s) are executed in order to avoid spurious bank
 	interrupt */
+exit:
 	if (!unmasked)
 		desc->chip->unmask(irq);
 

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [PATCH 3/5] omap: McBSP: Fix potential memory leak in omap_mcbsp_remove
  2010-12-04 21:29 [PATCH 0/5] Few misc patches for v2.6.38 merge window Tony Lindgren
  2010-12-04 21:29 ` [PATCH 1/5] Fix undefined reference to omap2_i2c_mux_pins Tony Lindgren
  2010-12-04 21:29 ` [PATCH 2/5] omap: Ptr "isr_reg" tracked as NULL was dereferenced Tony Lindgren
@ 2010-12-04 21:29 ` Tony Lindgren
  2010-12-04 21:29 ` [PATCH 4/5] omap: McBSP: Make the free variable update more readable Tony Lindgren
  2010-12-04 21:29 ` [PATCH 5/5] omap: Don't select mux by default for each board Tony Lindgren
  4 siblings, 0 replies; 6+ messages in thread
From: Tony Lindgren @ 2010-12-04 21:29 UTC (permalink / raw)
  To: linux-arm-kernel

From: Jarkko Nikula <jhnikula@gmail.com>

Function omap_mcbsp_probe allocates struct omap_mcbsp *mcbsp but it is not
freed in omap_mcbsp_remove. Fix this, remove unneeded structure cleanups
and clk_disable calls since they are not needed here.

This is not problem currently but becomes if the mcbsp driver is ever
modularized.

Signed-off-by: Jarkko Nikula <jhnikula@gmail.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
---
 arch/arm/plat-omap/mcbsp.c |    8 +-------
 1 files changed, 1 insertions(+), 7 deletions(-)

diff --git a/arch/arm/plat-omap/mcbsp.c b/arch/arm/plat-omap/mcbsp.c
index eac4b97..f79090c 100644
--- a/arch/arm/plat-omap/mcbsp.c
+++ b/arch/arm/plat-omap/mcbsp.c
@@ -1836,17 +1836,11 @@ static int __devexit omap_mcbsp_remove(struct platform_device *pdev)
 
 		omap34xx_device_exit(mcbsp);
 
-		clk_disable(mcbsp->fclk);
-		clk_disable(mcbsp->iclk);
 		clk_put(mcbsp->fclk);
 		clk_put(mcbsp->iclk);
 
 		iounmap(mcbsp->io_base);
-
-		mcbsp->fclk = NULL;
-		mcbsp->iclk = NULL;
-		mcbsp->free = 0;
-		mcbsp->dev = NULL;
+		kfree(mcbsp);
 	}
 
 	return 0;

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [PATCH 4/5] omap: McBSP: Make the free variable update more readable
  2010-12-04 21:29 [PATCH 0/5] Few misc patches for v2.6.38 merge window Tony Lindgren
                   ` (2 preceding siblings ...)
  2010-12-04 21:29 ` [PATCH 3/5] omap: McBSP: Fix potential memory leak in omap_mcbsp_remove Tony Lindgren
@ 2010-12-04 21:29 ` Tony Lindgren
  2010-12-04 21:29 ` [PATCH 5/5] omap: Don't select mux by default for each board Tony Lindgren
  4 siblings, 0 replies; 6+ messages in thread
From: Tony Lindgren @ 2010-12-04 21:29 UTC (permalink / raw)
  To: linux-arm-kernel

From: Shubhrajyoti D <shubhrajyoti@ti.com>

Using true/false instead of 1/0 to update the free variable.

Signed-off-by: Shubhrajyoti D <shubhrajyoti@ti.com>
Acked-by: Jarkko Nikula <jhnikula@gmail.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
---
 arch/arm/plat-omap/mcbsp.c |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/arch/arm/plat-omap/mcbsp.c b/arch/arm/plat-omap/mcbsp.c
index f79090c..fdecd33 100644
--- a/arch/arm/plat-omap/mcbsp.c
+++ b/arch/arm/plat-omap/mcbsp.c
@@ -755,7 +755,7 @@ int omap_mcbsp_request(unsigned int id)
 		goto err_kfree;
 	}
 
-	mcbsp->free = 0;
+	mcbsp->free = false;
 	mcbsp->reg_cache = reg_cache;
 	spin_unlock(&mcbsp->lock);
 
@@ -815,7 +815,7 @@ err_clk_disable:
 	clk_disable(mcbsp->iclk);
 
 	spin_lock(&mcbsp->lock);
-	mcbsp->free = 1;
+	mcbsp->free = true;
 	mcbsp->reg_cache = NULL;
 err_kfree:
 	spin_unlock(&mcbsp->lock);
@@ -858,7 +858,7 @@ void omap_mcbsp_free(unsigned int id)
 	if (mcbsp->free)
 		dev_err(mcbsp->dev, "McBSP%d was not reserved\n", mcbsp->id);
 	else
-		mcbsp->free = 1;
+		mcbsp->free = true;
 	mcbsp->reg_cache = NULL;
 	spin_unlock(&mcbsp->lock);
 
@@ -1771,7 +1771,7 @@ static int __devinit omap_mcbsp_probe(struct platform_device *pdev)
 
 	spin_lock_init(&mcbsp->lock);
 	mcbsp->id = id + 1;
-	mcbsp->free = 1;
+	mcbsp->free = true;
 	mcbsp->dma_tx_lch = -1;
 	mcbsp->dma_rx_lch = -1;
 

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [PATCH 5/5] omap: Don't select mux by default for each board
  2010-12-04 21:29 [PATCH 0/5] Few misc patches for v2.6.38 merge window Tony Lindgren
                   ` (3 preceding siblings ...)
  2010-12-04 21:29 ` [PATCH 4/5] omap: McBSP: Make the free variable update more readable Tony Lindgren
@ 2010-12-04 21:29 ` Tony Lindgren
  4 siblings, 0 replies; 6+ messages in thread
From: Tony Lindgren @ 2010-12-04 21:29 UTC (permalink / raw)
  To: linux-arm-kernel

This should be only selected in CONFIG_ARCH_OMAP2PLUS_TYPICAL
to make it easy to disable.

Signed-off-by: Tony Lindgren <tony@atomide.com>
---
 arch/arm/mach-omap2/Kconfig |    4 ----
 1 files changed, 0 insertions(+), 4 deletions(-)

diff --git a/arch/arm/mach-omap2/Kconfig b/arch/arm/mach-omap2/Kconfig
index fc3a181..144e7bb 100644
--- a/arch/arm/mach-omap2/Kconfig
+++ b/arch/arm/mach-omap2/Kconfig
@@ -134,7 +134,6 @@ config MACH_DEVKIT8000
 	depends on ARCH_OMAP3
 	default y
 	select OMAP_PACKAGE_CUS
-	select OMAP_MUX
 
 config MACH_OMAP_LDP
 	bool "OMAP3 LDP board"
@@ -250,14 +249,12 @@ config MACH_CM_T35
 	depends on ARCH_OMAP3
 	default y
 	select OMAP_PACKAGE_CUS
-	select OMAP_MUX
 
 config MACH_CM_T3517
 	bool "CompuLab CM-T3517 module"
 	depends on ARCH_OMAP3
 	default y
 	select OMAP_PACKAGE_CBB
-	select OMAP_MUX
 
 config MACH_IGEP0020
 	bool "IGEP v2 board"
@@ -276,7 +273,6 @@ config MACH_SBC3530
 	depends on ARCH_OMAP3
 	default y
 	select OMAP_PACKAGE_CUS
-	select OMAP_MUX
 
 config MACH_OMAP_3630SDP
 	bool "OMAP3630 SDP board"

^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2010-12-04 21:29 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-12-04 21:29 [PATCH 0/5] Few misc patches for v2.6.38 merge window Tony Lindgren
2010-12-04 21:29 ` [PATCH 1/5] Fix undefined reference to omap2_i2c_mux_pins Tony Lindgren
2010-12-04 21:29 ` [PATCH 2/5] omap: Ptr "isr_reg" tracked as NULL was dereferenced Tony Lindgren
2010-12-04 21:29 ` [PATCH 3/5] omap: McBSP: Fix potential memory leak in omap_mcbsp_remove Tony Lindgren
2010-12-04 21:29 ` [PATCH 4/5] omap: McBSP: Make the free variable update more readable Tony Lindgren
2010-12-04 21:29 ` [PATCH 5/5] omap: Don't select mux by default for each board Tony Lindgren

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).