From aecb9e1422e904d1950620d90c589a141cb32196 Mon Sep 17 00:00:00 2001 From: Thomas Gleixner Date: Fri, 7 Dec 2012 16:49:47 +0200 Subject: ARM: OMAP: make wakeupgen_lock raw When applying RT patch on top of Linux, spinlocks are implemented as RT-mutexes, which means they are preemptable. Current GIC implementation on OMAP is using a spinlock to protect against preemption. As it turns out, we need to convert that lock into a raw_spinlock so that OMAP's interrupt controller works as expected after RT-patch is applied. This patch is simply to decrease the amount of changes RT-team needs to carry out of tree. It doesn't cause any changes in behavior. Signed-off-by: Thomas Gleixner Signed-off-by: Felipe Balbi Acked-by: Santosh Shilimkar Signed-off-by: Tony Lindgren --- arch/arm/mach-omap2/omap-wakeupgen.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'arch/arm') diff --git a/arch/arm/mach-omap2/omap-wakeupgen.c b/arch/arm/mach-omap2/omap-wakeupgen.c index 5d3b4f4f81ae..8633a43acae2 100644 --- a/arch/arm/mach-omap2/omap-wakeupgen.c +++ b/arch/arm/mach-omap2/omap-wakeupgen.c @@ -46,7 +46,7 @@ static void __iomem *wakeupgen_base; static void __iomem *sar_base; -static DEFINE_SPINLOCK(wakeupgen_lock); +static DEFINE_RAW_SPINLOCK(wakeupgen_lock); static unsigned int irq_target_cpu[MAX_IRQS]; static unsigned int irq_banks = MAX_NR_REG_BANKS; static unsigned int max_irqs = MAX_IRQS; @@ -134,9 +134,9 @@ static void wakeupgen_mask(struct irq_data *d) { unsigned long flags; - spin_lock_irqsave(&wakeupgen_lock, flags); + raw_spin_lock_irqsave(&wakeupgen_lock, flags); _wakeupgen_clear(d->irq, irq_target_cpu[d->irq]); - spin_unlock_irqrestore(&wakeupgen_lock, flags); + raw_spin_unlock_irqrestore(&wakeupgen_lock, flags); } /* @@ -146,9 +146,9 @@ static void wakeupgen_unmask(struct irq_data *d) { unsigned long flags; - spin_lock_irqsave(&wakeupgen_lock, flags); + raw_spin_lock_irqsave(&wakeupgen_lock, flags); _wakeupgen_set(d->irq, irq_target_cpu[d->irq]); - spin_unlock_irqrestore(&wakeupgen_lock, flags); + raw_spin_unlock_irqrestore(&wakeupgen_lock, flags); } #ifdef CONFIG_HOTPLUG_CPU @@ -189,7 +189,7 @@ static void wakeupgen_irqmask_all(unsigned int cpu, unsigned int set) { unsigned long flags; - spin_lock_irqsave(&wakeupgen_lock, flags); + raw_spin_lock_irqsave(&wakeupgen_lock, flags); if (set) { _wakeupgen_save_masks(cpu); _wakeupgen_set_all(cpu, WKG_MASK_ALL); @@ -197,7 +197,7 @@ static void wakeupgen_irqmask_all(unsigned int cpu, unsigned int set) _wakeupgen_set_all(cpu, WKG_UNMASK_ALL); _wakeupgen_restore_masks(cpu); } - spin_unlock_irqrestore(&wakeupgen_lock, flags); + raw_spin_unlock_irqrestore(&wakeupgen_lock, flags); } #endif -- cgit v1.2.3 From e78f96060fff8545d21360cfa5590e266a595bb9 Mon Sep 17 00:00:00 2001 From: Chen Gang Date: Fri, 11 Jan 2013 13:39:18 +0800 Subject: ARM: OMAP: Fix the use of uninitialized dma_lch_count 'omap_dma_reserve_channels' when used is suppose to be from command. so, it alreay has value before 1st call of omap_system_dma_probe. and it will never be changed again during running (not from ioctl). but 'dma_lch_count' is zero before 1st call of omap_system_dma_probe. so it will be failed for omap_dma_reserve_channels, when 1st call. so, need use 'd->lch_count' instead of 'dma_lch_count' for judging. Signed-off-by: Chen Gang Signed-off-by: Santosh Shilimkar Signed-off-by: Tony Lindgren --- arch/arm/plat-omap/dma.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'arch/arm') diff --git a/arch/arm/plat-omap/dma.c b/arch/arm/plat-omap/dma.c index 4136b20cba3c..e06c34bdc34a 100644 --- a/arch/arm/plat-omap/dma.c +++ b/arch/arm/plat-omap/dma.c @@ -2019,7 +2019,7 @@ static int omap_system_dma_probe(struct platform_device *pdev) errata = p->errata; if ((d->dev_caps & RESERVE_CHANNEL) && omap_dma_reserve_channels - && (omap_dma_reserve_channels <= dma_lch_count)) + && (omap_dma_reserve_channels < d->lch_count)) d->lch_count = omap_dma_reserve_channels; dma_lch_count = d->lch_count; -- cgit v1.2.3 From 61338d598eec1477455294f006793ee54eead795 Mon Sep 17 00:00:00 2001 From: Jon Hunter Date: Tue, 29 Jan 2013 14:23:11 -0600 Subject: ARM: OMAP2+: Fix selection of clockevent timer when using device-tree Commit 9725f44 (ARM: OMAP: Add DT support for timer driver) added device-tree support for selecting a clockevent timer by property. However, the code is currently ignoring the property passed and selecting the first available timer found. Hence, for the OMAP3 beagle board timer-12 is not being selected as expected. Fix this problem by ensuring the timer property is passed to omap_get_timer_dt(). Signed-off-by: Jon Hunter Acked-by: Santosh Shilimkar Tested-by: Vaibhav Bedia Signed-off-by: Tony Lindgren --- arch/arm/mach-omap2/timer.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'arch/arm') diff --git a/arch/arm/mach-omap2/timer.c b/arch/arm/mach-omap2/timer.c index b8ad6e632bb8..265de51b43d9 100644 --- a/arch/arm/mach-omap2/timer.c +++ b/arch/arm/mach-omap2/timer.c @@ -228,7 +228,7 @@ static int __init omap_dm_timer_init_one(struct omap_dm_timer *timer, int r = 0; if (of_have_populated_dt()) { - np = omap_get_timer_dt(omap_timer_match, NULL); + np = omap_get_timer_dt(omap_timer_match, property); if (!np) return -ENODEV; -- cgit v1.2.3 From c8d4bafe503ca767bbc8f3c54e4acd344ef26346 Mon Sep 17 00:00:00 2001 From: Chen Gang Date: Wed, 30 Jan 2013 19:46:49 +0800 Subject: ARM: OMAP2+: using strlcpy instead of strncpy the fields must be null-terminated: the caller may use it as null-terminted string, next. Signed-off-by: Chen Gang Acked-by: Peter Ujfalusi Signed-off-by: Tony Lindgren --- arch/arm/mach-omap2/twl-common.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'arch/arm') diff --git a/arch/arm/mach-omap2/twl-common.c b/arch/arm/mach-omap2/twl-common.c index e49b40b4c90a..6a7aec6d1174 100644 --- a/arch/arm/mach-omap2/twl-common.c +++ b/arch/arm/mach-omap2/twl-common.c @@ -23,6 +23,7 @@ #include #include #include +#include #include #include @@ -56,7 +57,7 @@ void __init omap_pmic_init(int bus, u32 clkrate, struct twl4030_platform_data *pmic_data) { omap_mux_init_signal("sys_nirq", OMAP_PIN_INPUT_PULLUP | OMAP_PIN_OFF_WAKEUPENABLE); - strncpy(pmic_i2c_board_info.type, pmic_type, + strlcpy(pmic_i2c_board_info.type, pmic_type, sizeof(pmic_i2c_board_info.type)); pmic_i2c_board_info.irq = pmic_irq; pmic_i2c_board_info.platform_data = pmic_data; -- cgit v1.2.3