diff options
author | Russell King <rmk@dyn-67.arm.linux.org.uk> | 2008-04-19 12:17:34 -0400 |
---|---|---|
committer | Russell King <rmk+kernel@arm.linux.org.uk> | 2008-04-19 12:17:34 -0400 |
commit | cf816ecb533ab96b883dfdc0db174598b5b5c4d2 (patch) | |
tree | 1b7705db288ae2917105e624b01fdf81e0882bf1 /include/asm-arm | |
parent | adf6d34e460387ee3e8f1e1875d52bff51212c7d (diff) | |
parent | 15f7d677ccff6f0f5de8a1ee43a792567e9f9de9 (diff) |
Merge branch 'merge-fixes' into devel
Diffstat (limited to 'include/asm-arm')
-rw-r--r-- | include/asm-arm/arch-iop13xx/adma.h | 5 | ||||
-rw-r--r-- | include/asm-arm/arch-s3c2410/spi.h | 1 | ||||
-rw-r--r-- | include/asm-arm/hardware/iop3xx-adma.h | 8 | ||||
-rw-r--r-- | include/asm-arm/hardware/iop_adma.h | 2 | ||||
-rw-r--r-- | include/asm-arm/ide.h | 8 | ||||
-rw-r--r-- | include/asm-arm/semaphore-helper.h | 84 | ||||
-rw-r--r-- | include/asm-arm/semaphore.h | 99 |
7 files changed, 2 insertions, 205 deletions
diff --git a/include/asm-arm/arch-iop13xx/adma.h b/include/asm-arm/arch-iop13xx/adma.h index efd9a5eb1008..90d14ee564f5 100644 --- a/include/asm-arm/arch-iop13xx/adma.h +++ b/include/asm-arm/arch-iop13xx/adma.h | |||
@@ -454,11 +454,6 @@ static inline void iop_chan_append(struct iop_adma_chan *chan) | |||
454 | __raw_writel(adma_accr, ADMA_ACCR(chan)); | 454 | __raw_writel(adma_accr, ADMA_ACCR(chan)); |
455 | } | 455 | } |
456 | 456 | ||
457 | static inline void iop_chan_idle(int busy, struct iop_adma_chan *chan) | ||
458 | { | ||
459 | do { } while (0); | ||
460 | } | ||
461 | |||
462 | static inline u32 iop_chan_get_status(struct iop_adma_chan *chan) | 457 | static inline u32 iop_chan_get_status(struct iop_adma_chan *chan) |
463 | { | 458 | { |
464 | return __raw_readl(ADMA_ACSR(chan)); | 459 | return __raw_readl(ADMA_ACSR(chan)); |
diff --git a/include/asm-arm/arch-s3c2410/spi.h b/include/asm-arm/arch-s3c2410/spi.h index 7ca0ed97a6d0..352d33860b63 100644 --- a/include/asm-arm/arch-s3c2410/spi.h +++ b/include/asm-arm/arch-s3c2410/spi.h | |||
@@ -15,6 +15,7 @@ | |||
15 | 15 | ||
16 | struct s3c2410_spi_info { | 16 | struct s3c2410_spi_info { |
17 | unsigned long pin_cs; /* simple gpio cs */ | 17 | unsigned long pin_cs; /* simple gpio cs */ |
18 | unsigned int num_cs; /* total chipselects */ | ||
18 | 19 | ||
19 | void (*set_cs)(struct s3c2410_spi_info *spi, int cs, int pol); | 20 | void (*set_cs)(struct s3c2410_spi_info *spi, int cs, int pol); |
20 | }; | 21 | }; |
diff --git a/include/asm-arm/hardware/iop3xx-adma.h b/include/asm-arm/hardware/iop3xx-adma.h index 5c529e6a5e3b..84d635b0a71a 100644 --- a/include/asm-arm/hardware/iop3xx-adma.h +++ b/include/asm-arm/hardware/iop3xx-adma.h | |||
@@ -767,20 +767,12 @@ static inline int iop_desc_get_zero_result(struct iop_adma_desc_slot *desc) | |||
767 | static inline void iop_chan_append(struct iop_adma_chan *chan) | 767 | static inline void iop_chan_append(struct iop_adma_chan *chan) |
768 | { | 768 | { |
769 | u32 dma_chan_ctrl; | 769 | u32 dma_chan_ctrl; |
770 | /* workaround dropped interrupts on 3xx */ | ||
771 | mod_timer(&chan->cleanup_watchdog, jiffies + msecs_to_jiffies(3)); | ||
772 | 770 | ||
773 | dma_chan_ctrl = __raw_readl(DMA_CCR(chan)); | 771 | dma_chan_ctrl = __raw_readl(DMA_CCR(chan)); |
774 | dma_chan_ctrl |= 0x2; | 772 | dma_chan_ctrl |= 0x2; |
775 | __raw_writel(dma_chan_ctrl, DMA_CCR(chan)); | 773 | __raw_writel(dma_chan_ctrl, DMA_CCR(chan)); |
776 | } | 774 | } |
777 | 775 | ||
778 | static inline void iop_chan_idle(int busy, struct iop_adma_chan *chan) | ||
779 | { | ||
780 | if (!busy) | ||
781 | del_timer(&chan->cleanup_watchdog); | ||
782 | } | ||
783 | |||
784 | static inline u32 iop_chan_get_status(struct iop_adma_chan *chan) | 776 | static inline u32 iop_chan_get_status(struct iop_adma_chan *chan) |
785 | { | 777 | { |
786 | return __raw_readl(DMA_CSR(chan)); | 778 | return __raw_readl(DMA_CSR(chan)); |
diff --git a/include/asm-arm/hardware/iop_adma.h b/include/asm-arm/hardware/iop_adma.h index ca8e71f44346..cb7e3611bcba 100644 --- a/include/asm-arm/hardware/iop_adma.h +++ b/include/asm-arm/hardware/iop_adma.h | |||
@@ -51,7 +51,6 @@ struct iop_adma_device { | |||
51 | * @common: common dmaengine channel object members | 51 | * @common: common dmaengine channel object members |
52 | * @last_used: place holder for allocation to continue from where it left off | 52 | * @last_used: place holder for allocation to continue from where it left off |
53 | * @all_slots: complete domain of slots usable by the channel | 53 | * @all_slots: complete domain of slots usable by the channel |
54 | * @cleanup_watchdog: workaround missed interrupts on iop3xx | ||
55 | * @slots_allocated: records the actual size of the descriptor slot pool | 54 | * @slots_allocated: records the actual size of the descriptor slot pool |
56 | * @irq_tasklet: bottom half where iop_adma_slot_cleanup runs | 55 | * @irq_tasklet: bottom half where iop_adma_slot_cleanup runs |
57 | */ | 56 | */ |
@@ -65,7 +64,6 @@ struct iop_adma_chan { | |||
65 | struct dma_chan common; | 64 | struct dma_chan common; |
66 | struct iop_adma_desc_slot *last_used; | 65 | struct iop_adma_desc_slot *last_used; |
67 | struct list_head all_slots; | 66 | struct list_head all_slots; |
68 | struct timer_list cleanup_watchdog; | ||
69 | int slots_allocated; | 67 | int slots_allocated; |
70 | struct tasklet_struct irq_tasklet; | 68 | struct tasklet_struct irq_tasklet; |
71 | }; | 69 | }; |
diff --git a/include/asm-arm/ide.h b/include/asm-arm/ide.h index f348fcf3150b..88f4d231ce4f 100644 --- a/include/asm-arm/ide.h +++ b/include/asm-arm/ide.h | |||
@@ -17,14 +17,6 @@ | |||
17 | #define MAX_HWIFS 4 | 17 | #define MAX_HWIFS 4 |
18 | #endif | 18 | #endif |
19 | 19 | ||
20 | #if !defined(CONFIG_ARCH_L7200) | ||
21 | # ifdef CONFIG_ARCH_CLPS7500 | ||
22 | # define ide_default_io_ctl(base) ((base) + 0x206) /* obsolete */ | ||
23 | # else | ||
24 | # define ide_default_io_ctl(base) (0) | ||
25 | # endif | ||
26 | #endif /* !ARCH_L7200 */ | ||
27 | |||
28 | #define __ide_mm_insw(port,addr,len) readsw(port,addr,len) | 20 | #define __ide_mm_insw(port,addr,len) readsw(port,addr,len) |
29 | #define __ide_mm_insl(port,addr,len) readsl(port,addr,len) | 21 | #define __ide_mm_insl(port,addr,len) readsl(port,addr,len) |
30 | #define __ide_mm_outsw(port,addr,len) writesw(port,addr,len) | 22 | #define __ide_mm_outsw(port,addr,len) writesw(port,addr,len) |
diff --git a/include/asm-arm/semaphore-helper.h b/include/asm-arm/semaphore-helper.h deleted file mode 100644 index 1d7f1987edb9..000000000000 --- a/include/asm-arm/semaphore-helper.h +++ /dev/null | |||
@@ -1,84 +0,0 @@ | |||
1 | #ifndef ASMARM_SEMAPHORE_HELPER_H | ||
2 | #define ASMARM_SEMAPHORE_HELPER_H | ||
3 | |||
4 | /* | ||
5 | * These two _must_ execute atomically wrt each other. | ||
6 | */ | ||
7 | static inline void wake_one_more(struct semaphore * sem) | ||
8 | { | ||
9 | unsigned long flags; | ||
10 | |||
11 | spin_lock_irqsave(&semaphore_wake_lock, flags); | ||
12 | if (atomic_read(&sem->count) <= 0) | ||
13 | sem->waking++; | ||
14 | spin_unlock_irqrestore(&semaphore_wake_lock, flags); | ||
15 | } | ||
16 | |||
17 | static inline int waking_non_zero(struct semaphore *sem) | ||
18 | { | ||
19 | unsigned long flags; | ||
20 | int ret = 0; | ||
21 | |||
22 | spin_lock_irqsave(&semaphore_wake_lock, flags); | ||
23 | if (sem->waking > 0) { | ||
24 | sem->waking--; | ||
25 | ret = 1; | ||
26 | } | ||
27 | spin_unlock_irqrestore(&semaphore_wake_lock, flags); | ||
28 | return ret; | ||
29 | } | ||
30 | |||
31 | /* | ||
32 | * waking non zero interruptible | ||
33 | * 1 got the lock | ||
34 | * 0 go to sleep | ||
35 | * -EINTR interrupted | ||
36 | * | ||
37 | * We must undo the sem->count down_interruptible() increment while we are | ||
38 | * protected by the spinlock in order to make this atomic_inc() with the | ||
39 | * atomic_read() in wake_one_more(), otherwise we can race. -arca | ||
40 | */ | ||
41 | static inline int waking_non_zero_interruptible(struct semaphore *sem, | ||
42 | struct task_struct *tsk) | ||
43 | { | ||
44 | unsigned long flags; | ||
45 | int ret = 0; | ||
46 | |||
47 | spin_lock_irqsave(&semaphore_wake_lock, flags); | ||
48 | if (sem->waking > 0) { | ||
49 | sem->waking--; | ||
50 | ret = 1; | ||
51 | } else if (signal_pending(tsk)) { | ||
52 | atomic_inc(&sem->count); | ||
53 | ret = -EINTR; | ||
54 | } | ||
55 | spin_unlock_irqrestore(&semaphore_wake_lock, flags); | ||
56 | return ret; | ||
57 | } | ||
58 | |||
59 | /* | ||
60 | * waking_non_zero_try_lock: | ||
61 | * 1 failed to lock | ||
62 | * 0 got the lock | ||
63 | * | ||
64 | * We must undo the sem->count down_interruptible() increment while we are | ||
65 | * protected by the spinlock in order to make this atomic_inc() with the | ||
66 | * atomic_read() in wake_one_more(), otherwise we can race. -arca | ||
67 | */ | ||
68 | static inline int waking_non_zero_trylock(struct semaphore *sem) | ||
69 | { | ||
70 | unsigned long flags; | ||
71 | int ret = 1; | ||
72 | |||
73 | spin_lock_irqsave(&semaphore_wake_lock, flags); | ||
74 | if (sem->waking <= 0) | ||
75 | atomic_inc(&sem->count); | ||
76 | else { | ||
77 | sem->waking--; | ||
78 | ret = 0; | ||
79 | } | ||
80 | spin_unlock_irqrestore(&semaphore_wake_lock, flags); | ||
81 | return ret; | ||
82 | } | ||
83 | |||
84 | #endif | ||
diff --git a/include/asm-arm/semaphore.h b/include/asm-arm/semaphore.h index 1c8b441f89e3..d9b2034ed1d2 100644 --- a/include/asm-arm/semaphore.h +++ b/include/asm-arm/semaphore.h | |||
@@ -1,98 +1 @@ | |||
1 | /* | #include <linux/semaphore.h> | |
2 | * linux/include/asm-arm/semaphore.h | ||
3 | */ | ||
4 | #ifndef __ASM_ARM_SEMAPHORE_H | ||
5 | #define __ASM_ARM_SEMAPHORE_H | ||
6 | |||
7 | #include <linux/linkage.h> | ||
8 | #include <linux/spinlock.h> | ||
9 | #include <linux/wait.h> | ||
10 | #include <linux/rwsem.h> | ||
11 | |||
12 | #include <asm/atomic.h> | ||
13 | #include <asm/locks.h> | ||
14 | |||
15 | struct semaphore { | ||
16 | atomic_t count; | ||
17 | int sleepers; | ||
18 | wait_queue_head_t wait; | ||
19 | }; | ||
20 | |||
21 | #define __SEMAPHORE_INIT(name, cnt) \ | ||
22 | { \ | ||
23 | .count = ATOMIC_INIT(cnt), \ | ||
24 | .wait = __WAIT_QUEUE_HEAD_INITIALIZER((name).wait), \ | ||
25 | } | ||
26 | |||
27 | #define __DECLARE_SEMAPHORE_GENERIC(name,count) \ | ||
28 | struct semaphore name = __SEMAPHORE_INIT(name,count) | ||
29 | |||
30 | #define DECLARE_MUTEX(name) __DECLARE_SEMAPHORE_GENERIC(name,1) | ||
31 | |||
32 | static inline void sema_init(struct semaphore *sem, int val) | ||
33 | { | ||
34 | atomic_set(&sem->count, val); | ||
35 | sem->sleepers = 0; | ||
36 | init_waitqueue_head(&sem->wait); | ||
37 | } | ||
38 | |||
39 | static inline void init_MUTEX(struct semaphore *sem) | ||
40 | { | ||
41 | sema_init(sem, 1); | ||
42 | } | ||
43 | |||
44 | static inline void init_MUTEX_LOCKED(struct semaphore *sem) | ||
45 | { | ||
46 | sema_init(sem, 0); | ||
47 | } | ||
48 | |||
49 | /* | ||
50 | * special register calling convention | ||
51 | */ | ||
52 | asmlinkage void __down_failed(void); | ||
53 | asmlinkage int __down_interruptible_failed(void); | ||
54 | asmlinkage int __down_trylock_failed(void); | ||
55 | asmlinkage void __up_wakeup(void); | ||
56 | |||
57 | extern void __down(struct semaphore * sem); | ||
58 | extern int __down_interruptible(struct semaphore * sem); | ||
59 | extern int __down_trylock(struct semaphore * sem); | ||
60 | extern void __up(struct semaphore * sem); | ||
61 | |||
62 | /* | ||
63 | * This is ugly, but we want the default case to fall through. | ||
64 | * "__down" is the actual routine that waits... | ||
65 | */ | ||
66 | static inline void down(struct semaphore * sem) | ||
67 | { | ||
68 | might_sleep(); | ||
69 | __down_op(sem, __down_failed); | ||
70 | } | ||
71 | |||
72 | /* | ||
73 | * This is ugly, but we want the default case to fall through. | ||
74 | * "__down_interruptible" is the actual routine that waits... | ||
75 | */ | ||
76 | static inline int down_interruptible (struct semaphore * sem) | ||
77 | { | ||
78 | might_sleep(); | ||
79 | return __down_op_ret(sem, __down_interruptible_failed); | ||
80 | } | ||
81 | |||
82 | static inline int down_trylock(struct semaphore *sem) | ||
83 | { | ||
84 | return __down_op_ret(sem, __down_trylock_failed); | ||
85 | } | ||
86 | |||
87 | /* | ||
88 | * Note! This is subtle. We jump to wake people up only if | ||
89 | * the semaphore was negative (== somebody was waiting on it). | ||
90 | * The default case (no contention) will result in NO | ||
91 | * jumps for both down() and up(). | ||
92 | */ | ||
93 | static inline void up(struct semaphore * sem) | ||
94 | { | ||
95 | __up_op(sem, __up_wakeup); | ||
96 | } | ||
97 | |||
98 | #endif | ||