From 5ad43ff98ac926e37ecbdef04ba7d4d104604028 Mon Sep 17 00:00:00 2001 From: Daniel Walker Date: Tue, 27 Jul 2010 14:04:30 -0700 Subject: drivers: video: msm: fix hang on disable_irq MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit There's a resource race around disable_irq. Using the nosync version allows the function to continue and prevents the hang. Adapted from Arve Hjønnevåg changes in the Google tree. Signed-off-by: Daniel Walker diff --git a/drivers/video/msm/mdp.c b/drivers/video/msm/mdp.c index 3c28db0..2b5bf79 100644 --- a/drivers/video/msm/mdp.c +++ b/drivers/video/msm/mdp.c @@ -90,7 +90,7 @@ static int locked_disable_mdp_irq(struct mdp_info *mdp, uint32_t mask) mdp_irq_mask &= ~(mask); /* if no one is waiting on the interrupt, disable it */ if (!mdp_irq_mask) { - disable_irq(mdp->irq); + disable_irq_nosync(mdp->irq); if (clk) clk_disable(clk); } -- cgit v0.10.2 From d601c795c41c0016790ff1a92f2307fd4ff29791 Mon Sep 17 00:00:00 2001 From: Daniel Walker Date: Tue, 27 Jul 2010 14:04:31 -0700 Subject: drivers: msm: video: add dev_set_name call MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This is required before the driver can successfully be registered. Adapted from Arve Hjønnevåg changes in the Google tree. Signed-off-by: Daniel Walker diff --git a/drivers/video/msm/mdp.c b/drivers/video/msm/mdp.c index 2b5bf79..c3636d5 100644 --- a/drivers/video/msm/mdp.c +++ b/drivers/video/msm/mdp.c @@ -482,6 +482,7 @@ int mdp_probe(struct platform_device *pdev) /* register mdp device */ mdp->mdp_dev.dev.parent = &pdev->dev; mdp->mdp_dev.dev.class = mdp_class; + dev_set_name(&mdp->mdp_dev.dev, "mdp%d", pdev->id); /* if you can remove the platform device you'd have to implement * this: -- cgit v0.10.2 From 17f52ed7358dc54e5534f9ad495e90306c68cfcf Mon Sep 17 00:00:00 2001 From: Joe Perches Date: Mon, 25 Oct 2010 19:44:27 -0700 Subject: drivers/video/msm/mddi.c: Remove multiple KERN_ uses Signed-off-by: Joe Perches Signed-off-by: Daniel Walker diff --git a/drivers/video/msm/mddi.c b/drivers/video/msm/mddi.c index 7c316c3..b66d86a 100644 --- a/drivers/video/msm/mddi.c +++ b/drivers/video/msm/mddi.c @@ -318,7 +318,7 @@ static long mddi_wait_interrupt_timeout(struct mddi_info *mddi, static void mddi_wait_interrupt(struct mddi_info *mddi, uint32_t intmask) { if (mddi_wait_interrupt_timeout(mddi, intmask, HZ/10) == 0) - printk(KERN_INFO KERN_ERR "mddi_wait_interrupt %d, timeout " + printk(KERN_INFO "mddi_wait_interrupt %d, timeout " "waiting for %x, INT = %x, STAT = %x gotint = %x\n", current->pid, intmask, mddi_readl(INT), mddi_readl(STAT), mddi->got_int); @@ -465,8 +465,7 @@ static int __init mddi_get_client_caps(struct mddi_info *mddi) if (mddi->flags & FLAG_HAVE_CAPS) break; - printk(KERN_INFO KERN_ERR "mddi_init, timeout waiting for " - "caps\n"); + printk(KERN_INFO "mddi_init, timeout waiting for caps\n"); } return mddi->flags & FLAG_HAVE_CAPS; } -- cgit v0.10.2 From 79d98313e0985fa754fc50ea639cbafdfc0860a6 Mon Sep 17 00:00:00 2001 From: Daniel Walker Date: Mon, 11 Oct 2010 15:46:52 -0700 Subject: msm: fix compile failure on struct membank node member In commit be370302742ff9948f2a42b15cb2ba174d97b930 "ARM: Remove DISCONTIGMEM support", it removed this "node" member which cased the following compile failure in mach-msm, linux/arch/arm/mach-msm/board-halibut.c: In function 'halibut_fixup': linux/arch/arm/mach-msm/board-halibut.c:86: error: 'struct membank' has no member named 'node' linux/arch/arm/mach-msm/board-halibut.c:86: error: implicit declaration of function 'PHYS_TO_NID' I've removed the access to the node member which corrects the compile failure. Signed-off-by: Daniel Walker diff --git a/arch/arm/mach-msm/board-halibut.c b/arch/arm/mach-msm/board-halibut.c index 59edecb..75dabb1 100644 --- a/arch/arm/mach-msm/board-halibut.c +++ b/arch/arm/mach-msm/board-halibut.c @@ -83,7 +83,6 @@ static void __init halibut_fixup(struct machine_desc *desc, struct tag *tags, { mi->nr_banks=1; mi->bank[0].start = PHYS_OFFSET; - mi->bank[0].node = PHYS_TO_NID(PHYS_OFFSET); mi->bank[0].size = (101*1024*1024); } -- cgit v0.10.2 From efdfb2b118cc11c88adcbcb8036795eb34f419a8 Mon Sep 17 00:00:00 2001 From: Daniel Walker Date: Tue, 12 Oct 2010 11:52:14 -0700 Subject: msm: fix Kconfig target board selection This prevents build failures since it's currently possible to select 8x50, 7x30, or 7x00 without selecting a specific board. These changes just force a target selection, which is currently defaulting to the most common one (7x30 only has one). Signed-off-by: Daniel Walker diff --git a/arch/arm/mach-msm/Kconfig b/arch/arm/mach-msm/Kconfig index 3115a29..3d74a73 100644 --- a/arch/arm/mach-msm/Kconfig +++ b/arch/arm/mach-msm/Kconfig @@ -6,6 +6,7 @@ choice config ARCH_MSM7X00A bool "MSM7x00A / MSM7x01A" + select MACH_TROUT if !MACH_HALIBUT select ARCH_MSM_ARM11 select MSM_SMD select MSM_SMD_PKG3 @@ -15,6 +16,7 @@ config ARCH_MSM7X00A config ARCH_MSM7X30 bool "MSM7x30" + select MACH_MSM7X30_SURF # if ! select ARCH_MSM_SCORPION select MSM_SMD select MSM_VIC @@ -26,6 +28,7 @@ config ARCH_MSM7X30 config ARCH_QSD8X50 bool "QSD8X50" + select MACH_QSD8X50_SURF if !MACH_QSD8X50A_ST1_5 select ARCH_MSM_SCORPION select MSM_SMD select MSM_VIC @@ -37,12 +40,12 @@ config ARCH_QSD8X50 config ARCH_MSM8X60 bool "MSM8X60" + select MACH_MSM8X60_SURF if (!MACH_MSM8X60_RUMI3 && !MACH_MSM8X60_SIM \ + && !MACH_MSM8X60_FFA) select ARM_GIC select CPU_V7 select MSM_V2_TLMM select MSM_GPIOMUX - select MACH_MSM8X60_SURF if (!MACH_MSM8X60_RUMI3 && !MACH_MSM8X60_SIM \ - && !MACH_MSM8X60_FFA) endchoice -- cgit v0.10.2 From a86c44d48a03dcd73972ddadb55a77e6b308fa0b Mon Sep 17 00:00:00 2001 From: Vasiliy Kulikov Date: Sun, 17 Oct 2010 18:51:37 +0400 Subject: arm: mach-msm: fix error handling in msm_iommu_probe() msm_iommu_probe() didn't free mem_region and mapped IO. Also if request_mem_region() failed then error handling code dereferenced NULL pointer. Signed-off-by: Vasiliy Kulikov Acked-by: Stepan Moskovchenko Signed-off-by: Daniel Walker diff --git a/arch/arm/mach-msm/iommu_dev.c b/arch/arm/mach-msm/iommu_dev.c index c33ae78..9019cee 100644 --- a/arch/arm/mach-msm/iommu_dev.c +++ b/arch/arm/mach-msm/iommu_dev.c @@ -128,7 +128,7 @@ static void msm_iommu_reset(void __iomem *base) static int msm_iommu_probe(struct platform_device *pdev) { - struct resource *r; + struct resource *r, *r2; struct clk *iommu_clk; struct msm_iommu_drvdata *drvdata; struct msm_iommu_dev *iommu_dev = pdev->dev.platform_data; @@ -183,27 +183,27 @@ static int msm_iommu_probe(struct platform_device *pdev) len = r->end - r->start + 1; - r = request_mem_region(r->start, len, r->name); - if (!r) { + r2 = request_mem_region(r->start, len, r->name); + if (!r2) { pr_err("Could not request memory region: " "start=%p, len=%d\n", (void *) r->start, len); ret = -EBUSY; goto fail; } - regs_base = ioremap(r->start, len); + regs_base = ioremap(r2->start, len); if (!regs_base) { pr_err("Could not ioremap: start=%p, len=%d\n", - (void *) r->start, len); + (void *) r2->start, len); ret = -EBUSY; - goto fail; + goto fail_mem; } irq = platform_get_irq_byname(pdev, "secure_irq"); if (irq < 0) { ret = -ENODEV; - goto fail; + goto fail_io; } mb(); @@ -211,14 +211,14 @@ static int msm_iommu_probe(struct platform_device *pdev) if (GET_IDR(regs_base) == 0) { pr_err("Invalid IDR value detected\n"); ret = -ENODEV; - goto fail; + goto fail_io; } ret = request_irq(irq, msm_iommu_fault_handler, 0, "msm_iommu_secure_irpt_handler", drvdata); if (ret) { pr_err("Request IRQ %d failed with ret=%d\n", irq, ret); - goto fail; + goto fail_io; } msm_iommu_reset(regs_base); @@ -237,6 +237,10 @@ static int msm_iommu_probe(struct platform_device *pdev) return 0; +fail_io: + iounmap(regs_base); +fail_mem: + release_mem_region(r->start, len); fail: kfree(drvdata); return ret; -- cgit v0.10.2 From 6f9419619ef6de9d7781c1a312cf6099e5b44789 Mon Sep 17 00:00:00 2001 From: Jeff Ohlstein Date: Thu, 21 Oct 2010 02:25:45 -0700 Subject: msm: timer: Decrease shift on timer clocksource The shift of 24 causes the shift and multiply operation to sometimes overflow, resulting in incorrect timer values and poor performance. Signed-off-by: Jeff Ohlstein Signed-off-by: Daniel Walker diff --git a/arch/arm/mach-msm/timer.c b/arch/arm/mach-msm/timer.c index 7689848..950100f 100644 --- a/arch/arm/mach-msm/timer.c +++ b/arch/arm/mach-msm/timer.c @@ -137,7 +137,7 @@ static struct msm_clock msm_clocks[] = { .rating = 200, .read = msm_gpt_read, .mask = CLOCKSOURCE_MASK(32), - .shift = 24, + .shift = 17, .flags = CLOCK_SOURCE_IS_CONTINUOUS, }, .irq = { -- cgit v0.10.2 From bcd72c3e0aff4b68d648d37ece423f2ccaf95337 Mon Sep 17 00:00:00 2001 From: Daniel Walker Date: Wed, 27 Oct 2010 15:25:59 -0700 Subject: msm: fix debug-macro.S build failure Originally there was an ifdef case to handle when no debug uart was selected. In commit 0ea1293009826da45e1019f45dfde1e557bb30df that case was removed which causes the following build failure, linux-2.6/arch/arm/kernel/debug.S: Assembler messages: linux-2.6/arch/arm/kernel/debug.S:174: Error: bad instruction `addruart r1,r2' linux-2.6/arch/arm/kernel/debug.S:176: Error: bad instruction `waituart r2,r3' linux-2.6/arch/arm/kernel/debug.S:177: Error: bad instruction `senduart r1,r3' linux-2.6/arch/arm/kernel/debug.S:178: Error: bad instruction `busyuart r2,r3' linux-2.6/arch/arm/kernel/debug.S:190: Error: bad instruction `addruart r1,r2' This is a partial revert to add back the case which was removed with two caveats. First the API for the addruart macro was updated, and the new addruart case now return 0xfff00000 so that a know IO mapping is created instead of a random one. Cc: Jeremy Kerr Cc: Lorenzo Pieralisi Cc: Jason Wang Cc: Tony Lindgren Cc: Nicolas Pitre Cc: Russell King - ARM Linux Signed-off-by: Daniel Walker diff --git a/arch/arm/mach-msm/include/mach/debug-macro.S b/arch/arm/mach-msm/include/mach/debug-macro.S index fbd5d90..f792e01 100644 --- a/arch/arm/mach-msm/include/mach/debug-macro.S +++ b/arch/arm/mach-msm/include/mach/debug-macro.S @@ -36,7 +36,18 @@ tst \rd, #0x04 beq 1001b .endm +#else + .macro addruart, rp, rv + mov \rv, #0xff000000 + orr \rv, \rv, #0x00f00000 + .endm - .macro busyuart,rd,rx + .macro senduart,rd,rx + .endm + + .macro waituart,rd,rx .endm #endif + + .macro busyuart,rd,rx + .endm -- cgit v0.10.2 From 06125ff051d535eaa993d83db66ab893248861af Mon Sep 17 00:00:00 2001 From: Daniel Walker Date: Wed, 27 Oct 2010 13:04:58 -0700 Subject: msm: fix compile failure when no debug uart is selected If the board has a debug uart the user is given a choice of which uart to use. The user can also select NONE, which means not to use one. In most of our header files when NONE is selected nothing is defined for MSM_DEBUG_UART_PHYS or MSM_DEBUG_UART_BASE. This causes a compile failure in debug-macro.S which expect something to be defined there. Example of the failure, arch/arm/kernel/built-in.o: In function `hexbuf': linux-2.6/arch/arm/kernel/debug.S:186: undefined reference to `MSM_DEBUG_UART_PHYS' linux-2.6/arch/arm/kernel/debug.S:186: undefined reference to `MSM_DEBUG_UART_BASE' This fixes the compile failure by adding an ifdef to debug-macro.S that removes all the debug uart code in the case of NONE. Signed-off-by: Daniel Walker diff --git a/arch/arm/mach-msm/include/mach/debug-macro.S b/arch/arm/mach-msm/include/mach/debug-macro.S index f792e01..646b99e 100644 --- a/arch/arm/mach-msm/include/mach/debug-macro.S +++ b/arch/arm/mach-msm/include/mach/debug-macro.S @@ -19,7 +19,7 @@ #include #include -#ifdef CONFIG_HAS_MSM_DEBUG_UART_PHYS +#if defined(CONFIG_HAS_MSM_DEBUG_UART_PHYS) && !defined(CONFIG_MSM_DEBUG_UART_NONE) .macro addruart, rp, rv ldr \rp, =MSM_DEBUG_UART_PHYS ldr \rv, =MSM_DEBUG_UART_BASE -- cgit v0.10.2 From 4ee7a6c2d1e8679fc557ee5af1aee96393acb1dc Mon Sep 17 00:00:00 2001 From: Daniel Walker Date: Wed, 27 Oct 2010 13:10:34 -0700 Subject: msm: Kconfig: drop unused config options These two config options don't exist, and aren't ever going to. So I simply delete them. Signed-off-by: Daniel Walker diff --git a/arch/arm/mach-msm/Kconfig b/arch/arm/mach-msm/Kconfig index 3d74a73..dbbcfeb 100644 --- a/arch/arm/mach-msm/Kconfig +++ b/arch/arm/mach-msm/Kconfig @@ -21,7 +21,6 @@ config ARCH_MSM7X30 select MSM_SMD select MSM_VIC select CPU_V7 - select MSM_REMOTE_SPINLOCK_DEKKERS select MSM_GPIOMUX select MSM_PROC_COMM select HAS_MSM_DEBUG_UART_PHYS @@ -33,7 +32,6 @@ config ARCH_QSD8X50 select MSM_SMD select MSM_VIC select CPU_V7 - select MSM_REMOTE_SPINLOCK_LDREX select MSM_GPIOMUX select MSM_PROC_COMM select HAS_MSM_DEBUG_UART_PHYS -- cgit v0.10.2