From fc0a75ce4835187a3f76d6b35f0644d1b168eef5 Mon Sep 17 00:00:00 2001 From: Nathan Scott Date: Thu, 6 Jul 2006 09:56:30 +0200 Subject: [PATCH] blktrace: fix barrier vs sync typo Signed-off-by: Nathan Scott Signed-off-by: Jens Axboe --- include/linux/blktrace_api.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include') diff --git a/include/linux/blktrace_api.h b/include/linux/blktrace_api.h index a7e8cef73d1..d95615fc6da 100644 --- a/include/linux/blktrace_api.h +++ b/include/linux/blktrace_api.h @@ -11,7 +11,7 @@ enum blktrace_cat { BLK_TC_READ = 1 << 0, /* reads */ BLK_TC_WRITE = 1 << 1, /* writes */ BLK_TC_BARRIER = 1 << 2, /* barrier */ - BLK_TC_SYNC = 1 << 3, /* barrier */ + BLK_TC_SYNC = 1 << 3, /* sync IO */ BLK_TC_QUEUE = 1 << 4, /* queueing/merging */ BLK_TC_REQUEUE = 1 << 5, /* requeueing */ BLK_TC_ISSUE = 1 << 6, /* issue */ -- cgit v1.2.3 From 40359ccb836866435b03a0cb57345002b587d875 Mon Sep 17 00:00:00 2001 From: Nathan Scott Date: Thu, 6 Jul 2006 10:03:28 +0200 Subject: [PATCH] blktrace: readahead support Provide the needed kernel support for distinguishing readahead from regular read requests when tracing block devices. Signed-off-by: Nathan Scott Signed-off-by: Jens Axboe --- include/linux/blktrace_api.h | 1 + 1 file changed, 1 insertion(+) (limited to 'include') diff --git a/include/linux/blktrace_api.h b/include/linux/blktrace_api.h index d95615fc6da..2346a1db856 100644 --- a/include/linux/blktrace_api.h +++ b/include/linux/blktrace_api.h @@ -19,6 +19,7 @@ enum blktrace_cat { BLK_TC_FS = 1 << 8, /* fs requests */ BLK_TC_PC = 1 << 9, /* pc requests */ BLK_TC_NOTIFY = 1 << 10, /* special message */ + BLK_TC_AHEAD = 1 << 11, /* readahead */ BLK_TC_END = 1 << 15, /* only 16-bits, reminder */ }; -- cgit v1.2.3 From 1959d21232931dfa686769a21161413f10d6652f Mon Sep 17 00:00:00 2001 From: Jens Axboe Date: Thu, 6 Jul 2006 10:18:05 +0200 Subject: [PATCH] Only the first two bits in bio->bi_rw and rq->flags match Not three, as assumed. This causes the barrier bit to be needlessly set for some IO. Signed-off-by: Jens Axboe --- include/linux/blktrace_api.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include') diff --git a/include/linux/blktrace_api.h b/include/linux/blktrace_api.h index 2346a1db856..7520cc1ff9e 100644 --- a/include/linux/blktrace_api.h +++ b/include/linux/blktrace_api.h @@ -148,7 +148,7 @@ static inline void blk_add_trace_rq(struct request_queue *q, struct request *rq, u32 what) { struct blk_trace *bt = q->blk_trace; - int rw = rq->flags & 0x07; + int rw = rq->flags & 0x03; if (likely(!bt)) return; -- cgit v1.2.3 From 89114afd435a486deb8583e89f490fc274444d18 Mon Sep 17 00:00:00 2001 From: Herbert Xu Date: Sat, 8 Jul 2006 13:34:32 -0700 Subject: [NET] gso: Add skb_is_gso This patch adds the wrapper function skb_is_gso which can be used instead of directly testing skb_shinfo(skb)->gso_size. This makes things a little nicer and allows us to change the primary key for indicating whether an skb is GSO (if we ever want to do that). Signed-off-by: Herbert Xu Signed-off-by: David S. Miller --- include/linux/netdevice.h | 2 +- include/linux/skbuff.h | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) (limited to 'include') diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h index 85f99f60dee..0359a643001 100644 --- a/include/linux/netdevice.h +++ b/include/linux/netdevice.h @@ -1001,7 +1001,7 @@ static inline int net_gso_ok(int features, int gso_type) static inline int skb_gso_ok(struct sk_buff *skb, int features) { - return net_gso_ok(features, skb_shinfo(skb)->gso_size ? + return net_gso_ok(features, skb_is_gso(skb) ? skb_shinfo(skb)->gso_type : 0); } diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h index 3597b4f1438..0bf31b83578 100644 --- a/include/linux/skbuff.h +++ b/include/linux/skbuff.h @@ -1455,5 +1455,10 @@ static inline void skb_init_secmark(struct sk_buff *skb) { } #endif +static inline int skb_is_gso(const struct sk_buff *skb) +{ + return skb_shinfo(skb)->gso_size; +} + #endif /* __KERNEL__ */ #endif /* _LINUX_SKBUFF_H */ -- cgit v1.2.3 From a430a43d087545c96542ee64573237919109d370 Mon Sep 17 00:00:00 2001 From: Herbert Xu Date: Sat, 8 Jul 2006 13:34:56 -0700 Subject: [NET] gso: Fix up GSO packets with broken checksums Certain subsystems in the stack (e.g., netfilter) can break the partial checksum on GSO packets. Until they're fixed, this patch allows this to work by recomputing the partial checksums through the GSO mechanism. Once they've all been converted to update the partial checksum instead of clearing it, this workaround can be removed. Signed-off-by: Herbert Xu Signed-off-by: David S. Miller --- include/linux/netdevice.h | 8 +++++--- include/net/protocol.h | 2 ++ include/net/tcp.h | 1 + 3 files changed, 8 insertions(+), 3 deletions(-) (limited to 'include') diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h index 0359a643001..76cc099c858 100644 --- a/include/linux/netdevice.h +++ b/include/linux/netdevice.h @@ -549,6 +549,7 @@ struct packet_type { struct net_device *); struct sk_buff *(*gso_segment)(struct sk_buff *skb, int features); + int (*gso_send_check)(struct sk_buff *skb); void *af_packet_priv; struct list_head list; }; @@ -1001,13 +1002,14 @@ static inline int net_gso_ok(int features, int gso_type) static inline int skb_gso_ok(struct sk_buff *skb, int features) { - return net_gso_ok(features, skb_is_gso(skb) ? - skb_shinfo(skb)->gso_type : 0); + return net_gso_ok(features, skb_shinfo(skb)->gso_type); } static inline int netif_needs_gso(struct net_device *dev, struct sk_buff *skb) { - return !skb_gso_ok(skb, dev->features); + return skb_is_gso(skb) && + (!skb_gso_ok(skb, dev->features) || + unlikely(skb->ip_summed != CHECKSUM_HW)); } #endif /* __KERNEL__ */ diff --git a/include/net/protocol.h b/include/net/protocol.h index a225d6371cb..c643bce64e5 100644 --- a/include/net/protocol.h +++ b/include/net/protocol.h @@ -36,6 +36,7 @@ struct net_protocol { int (*handler)(struct sk_buff *skb); void (*err_handler)(struct sk_buff *skb, u32 info); + int (*gso_send_check)(struct sk_buff *skb); struct sk_buff *(*gso_segment)(struct sk_buff *skb, int features); int no_policy; @@ -51,6 +52,7 @@ struct inet6_protocol int type, int code, int offset, __u32 info); + int (*gso_send_check)(struct sk_buff *skb); struct sk_buff *(*gso_segment)(struct sk_buff *skb, int features); diff --git a/include/net/tcp.h b/include/net/tcp.h index 3cd803b0d7a..0720bddff1e 100644 --- a/include/net/tcp.h +++ b/include/net/tcp.h @@ -1086,6 +1086,7 @@ extern struct request_sock_ops tcp_request_sock_ops; extern int tcp_v4_destroy_sock(struct sock *sk); +extern int tcp_v4_gso_send_check(struct sk_buff *skb); extern struct sk_buff *tcp_tso_segment(struct sk_buff *skb, int features); #ifdef CONFIG_PROC_FS -- cgit v1.2.3 From e2a3d40258fe20d205f8ed592e1e2c0d5529c2e1 Mon Sep 17 00:00:00 2001 From: Linus Torvalds Date: Sat, 8 Jul 2006 15:00:28 -0700 Subject: power: improve inline asm memory constraints Use "+m" rather than a combination of "=m" and "m" for improved clarity and consistency. Signed-off-by: Linus Torvalds --- include/asm-powerpc/atomic.h | 32 ++++++++++++++++---------------- include/asm-powerpc/bitops.h | 16 ++++++++-------- include/asm-powerpc/system.h | 16 ++++++++-------- 3 files changed, 32 insertions(+), 32 deletions(-) (limited to 'include') diff --git a/include/asm-powerpc/atomic.h b/include/asm-powerpc/atomic.h index bb3c0ab7e66..53283e2540b 100644 --- a/include/asm-powerpc/atomic.h +++ b/include/asm-powerpc/atomic.h @@ -27,8 +27,8 @@ static __inline__ void atomic_add(int a, atomic_t *v) PPC405_ERR77(0,%3) " stwcx. %0,0,%3 \n\ bne- 1b" - : "=&r" (t), "=m" (v->counter) - : "r" (a), "r" (&v->counter), "m" (v->counter) + : "=&r" (t), "+m" (v->counter) + : "r" (a), "r" (&v->counter) : "cc"); } @@ -63,8 +63,8 @@ static __inline__ void atomic_sub(int a, atomic_t *v) PPC405_ERR77(0,%3) " stwcx. %0,0,%3 \n\ bne- 1b" - : "=&r" (t), "=m" (v->counter) - : "r" (a), "r" (&v->counter), "m" (v->counter) + : "=&r" (t), "+m" (v->counter) + : "r" (a), "r" (&v->counter) : "cc"); } @@ -97,8 +97,8 @@ static __inline__ void atomic_inc(atomic_t *v) PPC405_ERR77(0,%2) " stwcx. %0,0,%2 \n\ bne- 1b" - : "=&r" (t), "=m" (v->counter) - : "r" (&v->counter), "m" (v->counter) + : "=&r" (t), "+m" (v->counter) + : "r" (&v->counter) : "cc"); } @@ -141,8 +141,8 @@ static __inline__ void atomic_dec(atomic_t *v) PPC405_ERR77(0,%2)\ " stwcx. %0,0,%2\n\ bne- 1b" - : "=&r" (t), "=m" (v->counter) - : "r" (&v->counter), "m" (v->counter) + : "=&r" (t), "+m" (v->counter) + : "r" (&v->counter) : "cc"); } @@ -253,8 +253,8 @@ static __inline__ void atomic64_add(long a, atomic64_t *v) add %0,%2,%0\n\ stdcx. %0,0,%3 \n\ bne- 1b" - : "=&r" (t), "=m" (v->counter) - : "r" (a), "r" (&v->counter), "m" (v->counter) + : "=&r" (t), "+m" (v->counter) + : "r" (a), "r" (&v->counter) : "cc"); } @@ -287,8 +287,8 @@ static __inline__ void atomic64_sub(long a, atomic64_t *v) subf %0,%2,%0\n\ stdcx. %0,0,%3 \n\ bne- 1b" - : "=&r" (t), "=m" (v->counter) - : "r" (a), "r" (&v->counter), "m" (v->counter) + : "=&r" (t), "+m" (v->counter) + : "r" (a), "r" (&v->counter) : "cc"); } @@ -319,8 +319,8 @@ static __inline__ void atomic64_inc(atomic64_t *v) addic %0,%0,1\n\ stdcx. %0,0,%2 \n\ bne- 1b" - : "=&r" (t), "=m" (v->counter) - : "r" (&v->counter), "m" (v->counter) + : "=&r" (t), "+m" (v->counter) + : "r" (&v->counter) : "cc"); } @@ -361,8 +361,8 @@ static __inline__ void atomic64_dec(atomic64_t *v) addic %0,%0,-1\n\ stdcx. %0,0,%2\n\ bne- 1b" - : "=&r" (t), "=m" (v->counter) - : "r" (&v->counter), "m" (v->counter) + : "=&r" (t), "+m" (v->counter) + : "r" (&v->counter) : "cc"); } diff --git a/include/asm-powerpc/bitops.h b/include/asm-powerpc/bitops.h index 76e2f08c3c8..c341063d080 100644 --- a/include/asm-powerpc/bitops.h +++ b/include/asm-powerpc/bitops.h @@ -65,8 +65,8 @@ static __inline__ void set_bit(int nr, volatile unsigned long *addr) PPC405_ERR77(0,%3) PPC_STLCX "%0,0,%3\n" "bne- 1b" - : "=&r"(old), "=m"(*p) - : "r"(mask), "r"(p), "m"(*p) + : "=&r" (old), "+m" (*p) + : "r" (mask), "r" (p) : "cc" ); } @@ -82,8 +82,8 @@ static __inline__ void clear_bit(int nr, volatile unsigned long *addr) PPC405_ERR77(0,%3) PPC_STLCX "%0,0,%3\n" "bne- 1b" - : "=&r"(old), "=m"(*p) - : "r"(mask), "r"(p), "m"(*p) + : "=&r" (old), "+m" (*p) + : "r" (mask), "r" (p) : "cc" ); } @@ -99,8 +99,8 @@ static __inline__ void change_bit(int nr, volatile unsigned long *addr) PPC405_ERR77(0,%3) PPC_STLCX "%0,0,%3\n" "bne- 1b" - : "=&r"(old), "=m"(*p) - : "r"(mask), "r"(p), "m"(*p) + : "=&r" (old), "+m" (*p) + : "r" (mask), "r" (p) : "cc" ); } @@ -179,8 +179,8 @@ static __inline__ void set_bits(unsigned long mask, unsigned long *addr) "or %0,%0,%2\n" PPC_STLCX "%0,0,%3\n" "bne- 1b" - : "=&r" (old), "=m" (*addr) - : "r" (mask), "r" (addr), "m" (*addr) + : "=&r" (old), "+m" (*addr) + : "r" (mask), "r" (addr) : "cc"); } diff --git a/include/asm-powerpc/system.h b/include/asm-powerpc/system.h index d075725bf44..c6569516ba3 100644 --- a/include/asm-powerpc/system.h +++ b/include/asm-powerpc/system.h @@ -220,8 +220,8 @@ __xchg_u32(volatile void *p, unsigned long val) " stwcx. %3,0,%2 \n\ bne- 1b" ISYNC_ON_SMP - : "=&r" (prev), "=m" (*(volatile unsigned int *)p) - : "r" (p), "r" (val), "m" (*(volatile unsigned int *)p) + : "=&r" (prev), "+m" (*(volatile unsigned int *)p) + : "r" (p), "r" (val) : "cc", "memory"); return prev; @@ -240,8 +240,8 @@ __xchg_u64(volatile void *p, unsigned long val) " stdcx. %3,0,%2 \n\ bne- 1b" ISYNC_ON_SMP - : "=&r" (prev), "=m" (*(volatile unsigned long *)p) - : "r" (p), "r" (val), "m" (*(volatile unsigned long *)p) + : "=&r" (prev), "+m" (*(volatile unsigned long *)p) + : "r" (p), "r" (val) : "cc", "memory"); return prev; @@ -299,8 +299,8 @@ __cmpxchg_u32(volatile unsigned int *p, unsigned long old, unsigned long new) ISYNC_ON_SMP "\n\ 2:" - : "=&r" (prev), "=m" (*p) - : "r" (p), "r" (old), "r" (new), "m" (*p) + : "=&r" (prev), "+m" (*p) + : "r" (p), "r" (old), "r" (new) : "cc", "memory"); return prev; @@ -322,8 +322,8 @@ __cmpxchg_u64(volatile unsigned long *p, unsigned long old, unsigned long new) ISYNC_ON_SMP "\n\ 2:" - : "=&r" (prev), "=m" (*p) - : "r" (p), "r" (old), "r" (new), "m" (*p) + : "=&r" (prev), "+m" (*p) + : "r" (p), "r" (old), "r" (new) : "cc", "memory"); return prev; -- cgit v1.2.3 From b862f3b099f3ea672c7438c0b282ce8201d39dfc Mon Sep 17 00:00:00 2001 From: Linus Torvalds Date: Sat, 8 Jul 2006 15:24:18 -0700 Subject: i386: improve and correct inline asm memory constraints Use "+m" rather than a combination of "=m" and "m" for improved clarity and consistency. This also fixes some inlines that incorrectly didn't tell the compiler that they read the old value at all, potentially causing the compiler to generate bogus code. It appear that all of those potential bugs were hidden by the use of extra "volatile" specifiers on the data structures in question, though. Signed-off-by: Linus Torvalds --- include/asm-i386/atomic.h | 30 ++++++++++++++---------------- include/asm-i386/futex.h | 10 +++++----- include/asm-i386/local.h | 14 ++++++-------- include/asm-i386/posix_types.h | 4 ++-- include/asm-i386/rwlock.h | 4 ++-- include/asm-i386/rwsem.h | 35 +++++++++++++++++------------------ include/asm-i386/semaphore.h | 8 ++++---- include/asm-i386/spinlock.h | 14 +++++++------- 8 files changed, 57 insertions(+), 62 deletions(-) (limited to 'include') diff --git a/include/asm-i386/atomic.h b/include/asm-i386/atomic.h index 4f061fa7379..51a16624252 100644 --- a/include/asm-i386/atomic.h +++ b/include/asm-i386/atomic.h @@ -46,8 +46,8 @@ static __inline__ void atomic_add(int i, atomic_t *v) { __asm__ __volatile__( LOCK_PREFIX "addl %1,%0" - :"=m" (v->counter) - :"ir" (i), "m" (v->counter)); + :"+m" (v->counter) + :"ir" (i)); } /** @@ -61,8 +61,8 @@ static __inline__ void atomic_sub(int i, atomic_t *v) { __asm__ __volatile__( LOCK_PREFIX "subl %1,%0" - :"=m" (v->counter) - :"ir" (i), "m" (v->counter)); + :"+m" (v->counter) + :"ir" (i)); } /** @@ -80,8 +80,8 @@ static __inline__ int atomic_sub_and_test(int i, atomic_t *v) __asm__ __volatile__( LOCK_PREFIX "subl %2,%0; sete %1" - :"=m" (v->counter), "=qm" (c) - :"ir" (i), "m" (v->counter) : "memory"); + :"+m" (v->counter), "=qm" (c) + :"ir" (i) : "memory"); return c; } @@ -95,8 +95,7 @@ static __inline__ void atomic_inc(atomic_t *v) { __asm__ __volatile__( LOCK_PREFIX "incl %0" - :"=m" (v->counter) - :"m" (v->counter)); + :"+m" (v->counter)); } /** @@ -109,8 +108,7 @@ static __inline__ void atomic_dec(atomic_t *v) { __asm__ __volatile__( LOCK_PREFIX "decl %0" - :"=m" (v->counter) - :"m" (v->counter)); + :"+m" (v->counter)); } /** @@ -127,8 +125,8 @@ static __inline__ int atomic_dec_and_test(atomic_t *v) __asm__ __volatile__( LOCK_PREFIX "decl %0; sete %1" - :"=m" (v->counter), "=qm" (c) - :"m" (v->counter) : "memory"); + :"+m" (v->counter), "=qm" (c) + : : "memory"); return c != 0; } @@ -146,8 +144,8 @@ static __inline__ int atomic_inc_and_test(atomic_t *v) __asm__ __volatile__( LOCK_PREFIX "incl %0; sete %1" - :"=m" (v->counter), "=qm" (c) - :"m" (v->counter) : "memory"); + :"+m" (v->counter), "=qm" (c) + : : "memory"); return c != 0; } @@ -166,8 +164,8 @@ static __inline__ int atomic_add_negative(int i, atomic_t *v) __asm__ __volatile__( LOCK_PREFIX "addl %2,%0; sets %1" - :"=m" (v->counter), "=qm" (c) - :"ir" (i), "m" (v->counter) : "memory"); + :"+m" (v->counter), "=qm" (c) + :"ir" (i) : "memory"); return c; } diff --git a/include/asm-i386/futex.h b/include/asm-i386/futex.h index 7b8ceefd010..946d97cfea2 100644 --- a/include/asm-i386/futex.h +++ b/include/asm-i386/futex.h @@ -20,8 +20,8 @@ .align 8\n\ .long 1b,3b\n\ .previous" \ - : "=r" (oldval), "=r" (ret), "=m" (*uaddr) \ - : "i" (-EFAULT), "m" (*uaddr), "0" (oparg), "1" (0)) + : "=r" (oldval), "=r" (ret), "+m" (*uaddr) \ + : "i" (-EFAULT), "0" (oparg), "1" (0)) #define __futex_atomic_op2(insn, ret, oldval, uaddr, oparg) \ __asm__ __volatile ( \ @@ -38,9 +38,9 @@ .align 8\n\ .long 1b,4b,2b,4b\n\ .previous" \ - : "=&a" (oldval), "=&r" (ret), "=m" (*uaddr), \ + : "=&a" (oldval), "=&r" (ret), "+m" (*uaddr), \ "=&r" (tem) \ - : "r" (oparg), "i" (-EFAULT), "m" (*uaddr), "1" (0)) + : "r" (oparg), "i" (-EFAULT), "1" (0)) static inline int futex_atomic_op_inuser (int encoded_op, int __user *uaddr) @@ -123,7 +123,7 @@ futex_atomic_cmpxchg_inatomic(int __user *uaddr, int oldval, int newval) " .long 1b,3b \n" " .previous \n" - : "=a" (oldval), "=m" (*uaddr) + : "=a" (oldval), "+m" (*uaddr) : "i" (-EFAULT), "r" (newval), "0" (oldval) : "memory" ); diff --git a/include/asm-i386/local.h b/include/asm-i386/local.h index 3b4998c51d0..12060e22f7e 100644 --- a/include/asm-i386/local.h +++ b/include/asm-i386/local.h @@ -17,32 +17,30 @@ static __inline__ void local_inc(local_t *v) { __asm__ __volatile__( "incl %0" - :"=m" (v->counter) - :"m" (v->counter)); + :"+m" (v->counter)); } static __inline__ void local_dec(local_t *v) { __asm__ __volatile__( "decl %0" - :"=m" (v->counter) - :"m" (v->counter)); + :"+m" (v->counter)); } static __inline__ void local_add(long i, local_t *v) { __asm__ __volatile__( "addl %1,%0" - :"=m" (v->counter) - :"ir" (i), "m" (v->counter)); + :"+m" (v->counter) + :"ir" (i)); } static __inline__ void local_sub(long i, local_t *v) { __asm__ __volatile__( "subl %1,%0" - :"=m" (v->counter) - :"ir" (i), "m" (v->counter)); + :"+m" (v->counter) + :"ir" (i)); } /* On x86, these are no better than the atomic variants. */ diff --git a/include/asm-i386/posix_types.h b/include/asm-i386/posix_types.h index 4e47ed059ad..133e31e7dfd 100644 --- a/include/asm-i386/posix_types.h +++ b/include/asm-i386/posix_types.h @@ -51,12 +51,12 @@ typedef struct { #undef __FD_SET #define __FD_SET(fd,fdsetp) \ __asm__ __volatile__("btsl %1,%0": \ - "=m" (*(__kernel_fd_set *) (fdsetp)):"r" ((int) (fd))) + "+m" (*(__kernel_fd_set *) (fdsetp)):"r" ((int) (fd))) #undef __FD_CLR #define __FD_CLR(fd,fdsetp) \ __asm__ __volatile__("btrl %1,%0": \ - "=m" (*(__kernel_fd_set *) (fdsetp)):"r" ((int) (fd))) + "+m" (*(__kernel_fd_set *) (fdsetp)):"r" ((int) (fd))) #undef __FD_ISSET #define __FD_ISSET(fd,fdsetp) (__extension__ ({ \ diff --git a/include/asm-i386/rwlock.h b/include/asm-i386/rwlock.h index 94f00195d54..96b0bef2ea5 100644 --- a/include/asm-i386/rwlock.h +++ b/include/asm-i386/rwlock.h @@ -37,7 +37,7 @@ "popl %%eax\n\t" \ "1:\n", \ "subl $1,%0\n\t", \ - "=m" (*(volatile int *)rw) : : "memory") + "+m" (*(volatile int *)rw) : : "memory") #define __build_read_lock(rw, helper) do { \ if (__builtin_constant_p(rw)) \ @@ -63,7 +63,7 @@ "popl %%eax\n\t" \ "1:\n", \ "subl $" RW_LOCK_BIAS_STR ",%0\n\t", \ - "=m" (*(volatile int *)rw) : : "memory") + "+m" (*(volatile int *)rw) : : "memory") #define __build_write_lock(rw, helper) do { \ if (__builtin_constant_p(rw)) \ diff --git a/include/asm-i386/rwsem.h b/include/asm-i386/rwsem.h index 2f07601562e..43113f5608e 100644 --- a/include/asm-i386/rwsem.h +++ b/include/asm-i386/rwsem.h @@ -111,8 +111,8 @@ LOCK_PREFIX " incl (%%eax)\n\t" /* adds 0x00000001, returns the old value " jmp 1b\n" LOCK_SECTION_END "# ending down_read\n\t" - : "=m"(sem->count) - : "a"(sem), "m"(sem->count) + : "+m" (sem->count) + : "a" (sem) : "memory", "cc"); } @@ -133,8 +133,8 @@ LOCK_PREFIX " cmpxchgl %2,%0\n\t" " jnz 1b\n\t" "2:\n\t" "# ending __down_read_trylock\n\t" - : "+m"(sem->count), "=&a"(result), "=&r"(tmp) - : "i"(RWSEM_ACTIVE_READ_BIAS) + : "+m" (sem->count), "=&a" (result), "=&r" (tmp) + : "i" (RWSEM_ACTIVE_READ_BIAS) : "memory", "cc"); return result>=0 ? 1 : 0; } @@ -161,8 +161,8 @@ LOCK_PREFIX " xadd %%edx,(%%eax)\n\t" /* subtract 0x0000ffff, returns the " jmp 1b\n" LOCK_SECTION_END "# ending down_write" - : "=m"(sem->count), "=d"(tmp) - : "a"(sem), "1"(tmp), "m"(sem->count) + : "+m" (sem->count), "=d" (tmp) + : "a" (sem), "1" (tmp) : "memory", "cc"); } @@ -205,8 +205,8 @@ LOCK_PREFIX " xadd %%edx,(%%eax)\n\t" /* subtracts 1, returns the old valu " jmp 1b\n" LOCK_SECTION_END "# ending __up_read\n" - : "=m"(sem->count), "=d"(tmp) - : "a"(sem), "1"(tmp), "m"(sem->count) + : "+m" (sem->count), "=d" (tmp) + : "a" (sem), "1" (tmp) : "memory", "cc"); } @@ -231,8 +231,8 @@ LOCK_PREFIX " xaddl %%edx,(%%eax)\n\t" /* tries to transition 0xffff0001 -> " jmp 1b\n" LOCK_SECTION_END "# ending __up_write\n" - : "=m"(sem->count) - : "a"(sem), "i"(-RWSEM_ACTIVE_WRITE_BIAS), "m"(sem->count) + : "+m" (sem->count) + : "a" (sem), "i" (-RWSEM_ACTIVE_WRITE_BIAS) : "memory", "cc", "edx"); } @@ -256,8 +256,8 @@ LOCK_PREFIX " addl %2,(%%eax)\n\t" /* transitions 0xZZZZ0001 -> 0xYYYY0001 " jmp 1b\n" LOCK_SECTION_END "# ending __downgrade_write\n" - : "=m"(sem->count) - : "a"(sem), "i"(-RWSEM_WAITING_BIAS), "m"(sem->count) + : "+m" (sem->count) + : "a" (sem), "i" (-RWSEM_WAITING_BIAS) : "memory", "cc"); } @@ -268,8 +268,8 @@ static inline void rwsem_atomic_add(int delta, struct rw_semaphore *sem) { __asm__ __volatile__( LOCK_PREFIX "addl %1,%0" - : "=m"(sem->count) - : "ir"(delta), "m"(sem->count)); + : "+m" (sem->count) + : "ir" (delta)); } /* @@ -280,10 +280,9 @@ static inline int rwsem_atomic_update(int delta, struct rw_semaphore *sem) int tmp = delta; __asm__ __volatile__( -LOCK_PREFIX "xadd %0,(%2)" - : "+r"(tmp), "=m"(sem->count) - : "r"(sem), "m"(sem->count) - : "memory"); +LOCK_PREFIX "xadd %0,%1" + : "+r" (tmp), "+m" (sem->count) + : : "memory"); return tmp+delta; } diff --git a/include/asm-i386/semaphore.h b/include/asm-i386/semaphore.h index f7a0f310c52..d51e800acf2 100644 --- a/include/asm-i386/semaphore.h +++ b/include/asm-i386/semaphore.h @@ -107,7 +107,7 @@ static inline void down(struct semaphore * sem) "call __down_failed\n\t" "jmp 1b\n" LOCK_SECTION_END - :"=m" (sem->count) + :"+m" (sem->count) : :"memory","ax"); } @@ -132,7 +132,7 @@ static inline int down_interruptible(struct semaphore * sem) "call __down_failed_interruptible\n\t" "jmp 1b\n" LOCK_SECTION_END - :"=a" (result), "=m" (sem->count) + :"=a" (result), "+m" (sem->count) : :"memory"); return result; @@ -157,7 +157,7 @@ static inline int down_trylock(struct semaphore * sem) "call __down_failed_trylock\n\t" "jmp 1b\n" LOCK_SECTION_END - :"=a" (result), "=m" (sem->count) + :"=a" (result), "+m" (sem->count) : :"memory"); return result; @@ -182,7 +182,7 @@ static inline void up(struct semaphore * sem) "jmp 1b\n" LOCK_SECTION_END ".subsection 0\n" - :"=m" (sem->count) + :"+m" (sem->count) : :"memory","ax"); } diff --git a/include/asm-i386/spinlock.h b/include/asm-i386/spinlock.h index 87c40f83065..d816c62a7a1 100644 --- a/include/asm-i386/spinlock.h +++ b/include/asm-i386/spinlock.h @@ -65,7 +65,7 @@ static inline void __raw_spin_lock(raw_spinlock_t *lock) alternative_smp( __raw_spin_lock_string, __raw_spin_lock_string_up, - "=m" (lock->slock) : : "memory"); + "+m" (lock->slock) : : "memory"); } /* @@ -79,7 +79,7 @@ static inline void __raw_spin_lock_flags(raw_spinlock_t *lock, unsigned long fla alternative_smp( __raw_spin_lock_string_flags, __raw_spin_lock_string_up, - "=m" (lock->slock) : "r" (flags) : "memory"); + "+m" (lock->slock) : "r" (flags) : "memory"); } #endif @@ -88,7 +88,7 @@ static inline int __raw_spin_trylock(raw_spinlock_t *lock) char oldval; __asm__ __volatile__( "xchgb %b0,%1" - :"=q" (oldval), "=m" (lock->slock) + :"=q" (oldval), "+m" (lock->slock) :"0" (0) : "memory"); return oldval > 0; } @@ -104,7 +104,7 @@ static inline int __raw_spin_trylock(raw_spinlock_t *lock) #define __raw_spin_unlock_string \ "movb $1,%0" \ - :"=m" (lock->slock) : : "memory" + :"+m" (lock->slock) : : "memory" static inline void __raw_spin_unlock(raw_spinlock_t *lock) @@ -118,7 +118,7 @@ static inline void __raw_spin_unlock(raw_spinlock_t *lock) #define __raw_spin_unlock_string \ "xchgb %b0, %1" \ - :"=q" (oldval), "=m" (lock->slock) \ + :"=q" (oldval), "+m" (lock->slock) \ :"0" (oldval) : "memory" static inline void __raw_spin_unlock(raw_spinlock_t *lock) @@ -199,13 +199,13 @@ static inline int __raw_write_trylock(raw_rwlock_t *lock) static inline void __raw_read_unlock(raw_rwlock_t *rw) { - asm volatile(LOCK_PREFIX "incl %0" :"=m" (rw->lock) : : "memory"); + asm volatile(LOCK_PREFIX "incl %0" :"+m" (rw->lock) : : "memory"); } static inline void __raw_write_unlock(raw_rwlock_t *rw) { asm volatile(LOCK_PREFIX "addl $" RW_LOCK_BIAS_STR ", %0" - : "=m" (rw->lock) : : "memory"); + : "+m" (rw->lock) : : "memory"); } #endif /* __ASM_SPINLOCK_H */ -- cgit v1.2.3 From c9fefeb26457b87f4a767faefcf77321bb90db52 Mon Sep 17 00:00:00 2001 From: James Bottomley Date: Sun, 2 Jul 2006 11:10:18 -0500 Subject: [SCSI] scsi_transport_sas: add unindexed ports Some SAS HBAs don't want to go to the trouble of tracking port numbers, so they'd simply like to say "add this port and give it a number". This is especially beneficial from the hotplug point of view, since tracking ports and the available number space can be a real pain. The current implementation uses an incrementing number per expander to add the port on. However, since there can never be more ports than there are phys, a later implementation will try to be more intelligent about this. Signed-off-by: James Bottomley --- include/scsi/scsi_transport_sas.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'include') diff --git a/include/scsi/scsi_transport_sas.h b/include/scsi/scsi_transport_sas.h index e3c503cd175..f5772ff61d0 100644 --- a/include/scsi/scsi_transport_sas.h +++ b/include/scsi/scsi_transport_sas.h @@ -106,6 +106,7 @@ struct sas_end_device { struct sas_expander_device { int level; + int next_port_id; #define SAS_EXPANDER_VENDOR_ID_LEN 8 char vendor_id[SAS_EXPANDER_VENDOR_ID_LEN+1]; @@ -127,7 +128,7 @@ struct sas_expander_device { struct sas_port { struct device dev; - u8 port_identifier; + int port_identifier; int num_phys; /* the other end of the link */ @@ -168,6 +169,7 @@ extern void sas_rphy_delete(struct sas_rphy *); extern int scsi_is_sas_rphy(const struct device *); struct sas_port *sas_port_alloc(struct device *, int); +struct sas_port *sas_port_alloc_num(struct device *); int sas_port_add(struct sas_port *); void sas_port_free(struct sas_port *); void sas_port_delete(struct sas_port *); -- cgit v1.2.3 From 953969ddf5b049361ed1e8471cc43dc4134d2a6f Mon Sep 17 00:00:00 2001 From: Linus Torvalds Date: Sun, 9 Jul 2006 08:47:46 -0700 Subject: Revert "ACPI: dock driver" This reverts commit a5e1b94008f2a96abf4a0c0371a55a56b320c13e. Adrian Bunk points out that it has build errors, and apparently no maintenance. Throw it out. Signed-off-by: Linus Torvalds --- include/acpi/acpi_bus.h | 2 +- include/acpi/acpi_drivers.h | 17 ----------------- 2 files changed, 1 insertion(+), 18 deletions(-) (limited to 'include') diff --git a/include/acpi/acpi_bus.h b/include/acpi/acpi_bus.h index f338e40bd54..a2b3e390a50 100644 --- a/include/acpi/acpi_bus.h +++ b/include/acpi/acpi_bus.h @@ -334,7 +334,7 @@ int acpi_bus_add(struct acpi_device **child, struct acpi_device *parent, acpi_handle handle, int type); int acpi_bus_trim(struct acpi_device *start, int rmdevice); int acpi_bus_start(struct acpi_device *device); -acpi_status acpi_bus_get_ejd(acpi_handle handle, acpi_handle *ejd); + int acpi_match_ids(struct acpi_device *device, char *ids); int acpi_create_dir(struct acpi_device *); void acpi_remove_dir(struct acpi_device *); diff --git a/include/acpi/acpi_drivers.h b/include/acpi/acpi_drivers.h index 6a5bdcefec6..b425f9bb6d4 100644 --- a/include/acpi/acpi_drivers.h +++ b/include/acpi/acpi_drivers.h @@ -110,21 +110,4 @@ int acpi_processor_set_thermal_limit(acpi_handle handle, int type); extern int acpi_specific_hotkey_enabled; -/*-------------------------------------------------------------------------- - Dock Station - -------------------------------------------------------------------------- */ -#if defined(CONFIG_ACPI_DOCK) || defined(CONFIG_ACPI_DOCK_MODULE) -extern int is_dock_device(acpi_handle handle); -extern int register_dock_notifier(struct notifier_block *nb); -extern void unregister_dock_notifier(struct notifier_block *nb); -extern int register_hotplug_dock_device(acpi_handle handle, - acpi_notify_handler handler, void *context); -extern void unregister_hotplug_dock_device(acpi_handle handle); -#else -#define is_dock_device(h) (0) -#define register_dock_notifier(nb) (-ENODEV) -#define unregister_dock_notifier(nb) do { } while(0) -#define register_hotplug_dock_device(h1, h2, c) (-ENODEV) -#define unregister_hotplug_dock_device(h) do { } while(0) -#endif #endif /*__ACPI_DRIVERS_H__*/ -- cgit v1.2.3 From 631c228cd09bd5b93090fa60bd9803ec14aa0586 Mon Sep 17 00:00:00 2001 From: Christoph Hellwig Date: Sat, 8 Jul 2006 20:42:15 +0200 Subject: [SCSI] hide EH backup data outside the scsi_cmnd Currently struct scsi_cmnd has various fields that are used to backup original data after the corresponding fields have been overridden for EH commands. This means drivers can easily get at it and misuse it. Due to the old_ naming this doesn't happen for most of them, but two that have different names have been used wrong a lot (see previous patch). Another downside is that they unessecarily bloat the scsi_cmnd size. This patch moves them onstack in scsi_send_eh_cmnd to fix those two issues aswell as allowing future EH fixes like moving the EH command submissions to use SG lists like everything else. Signed-off-by: Christoph Hellwig Signed-off-by: James Bottomley --- include/scsi/scsi_cmnd.h | 9 --------- 1 file changed, 9 deletions(-) (limited to 'include') diff --git a/include/scsi/scsi_cmnd.h b/include/scsi/scsi_cmnd.h index 371f70d9aa9..58e6444eebe 100644 --- a/include/scsi/scsi_cmnd.h +++ b/include/scsi/scsi_cmnd.h @@ -58,9 +58,7 @@ struct scsi_cmnd { int timeout_per_command; unsigned char cmd_len; - unsigned char old_cmd_len; enum dma_data_direction sc_data_direction; - enum dma_data_direction sc_old_data_direction; /* These elements define the operation we are about to perform */ #define MAX_COMMAND_SIZE 16 @@ -71,18 +69,11 @@ struct scsi_cmnd { void *request_buffer; /* Actual requested buffer */ /* These elements define the operation we ultimately want to perform */ - unsigned char data_cmnd[MAX_COMMAND_SIZE]; - unsigned short old_use_sg; /* We save use_sg here when requesting - * sense info */ unsigned short use_sg; /* Number of pieces of scatter-gather */ unsigned short sglist_len; /* size of malloc'd scatter-gather list */ - unsigned bufflen; /* Size of data buffer */ - void *buffer; /* Data buffer */ unsigned underflow; /* Return error if less than this amount is transferred */ - unsigned old_underflow; /* save underflow here when reusing the - * command for error handling */ unsigned transfersize; /* How much we are guaranteed to transfer with each SCSI transfer -- cgit v1.2.3 From f6dd9221dddb3550e60d32aee688588ec208312c Mon Sep 17 00:00:00 2001 From: Bob Moore Date: Fri, 7 Jul 2006 20:44:38 -0400 Subject: ACPI: ACPICA 20060707 Added the ACPI_PACKED_POINTERS_NOT_SUPPORTED macro to support C compilers that do not allow the initialization of address pointers within packed structures - even though the hardware itself may support misaligned transfers. Some of the debug data structures are packed by default to minimize size. Added an error message for the case where acpi_os_get_thread_id() returns zero. A non-zero value is required by the core ACPICA code to ensure the proper operation of AML mutexes and recursive control methods. The DSDT is now the only ACPI table that determines whether the AML interpreter is in 32-bit or 64-bit mode. Not really a functional change, but the hooks for per-table 32/64 switching have been removed from the code. A clarification to the ACPI specification is forthcoming in ACPI 3.0B. Fixed a possible leak of an Owner ID in the error path of tbinstal.c acpi_tb_init_table_descriptor() and migrated all table OwnerID deletion to a single place in acpi_tb_uninstall_table() to correct possible leaks when using the acpi_tb_delete_tables_by_type() interface (with assistance from Lance Ortiz.) Fixed a problem with Serialized control methods where the semaphore associated with the method could be over-signaled after multiple method invocations. Fixed two issues with the locking of the internal namespace data structure. Both the Unload() operator and acpi_unload_table() interface now lock the namespace during the namespace deletion associated with the table unload (with assistance from Linn Crosetto.) Fixed problem reports (Valery Podrezov) integrated: - Eliminate unnecessary memory allocation for CreateXxxxField http://bugzilla.kernel.org/show_bug.cgi?id=5426 Fixed problem reports (Fiodor Suietov) integrated: - Incomplete cleanup branches in AcpiTbGetTableRsdt (BZ 369) - On Address Space handler deletion, needless deactivation call (BZ 374) - AcpiRemoveAddressSpaceHandler: validate Device handle parameter (BZ 375) - Possible memory leak, Notify sub-objects of Processor, Power, ThermalZone (BZ 376) - AcpiRemoveAddressSpaceHandler: validate Handler parameter (BZ 378) - Minimum Length of RSDT should be validated (BZ 379) - AcpiRemoveNotifyHandler: return AE_NOT_EXIST if Processor Obj has no Handler (BZ (380) - AcpiUnloadTable: return AE_NOT_EXIST if no table of specified type loaded (BZ 381) Signed-off-by: Bob Moore Signed-off-by: Len Brown --- include/acpi/acconfig.h | 2 +- include/acpi/acinterp.h | 10 +++++++--- include/acpi/aclocal.h | 2 +- include/acpi/acresrc.h | 8 ++++++-- 4 files changed, 15 insertions(+), 7 deletions(-) (limited to 'include') diff --git a/include/acpi/acconfig.h b/include/acpi/acconfig.h index b492857fe72..9e6c23c360b 100644 --- a/include/acpi/acconfig.h +++ b/include/acpi/acconfig.h @@ -63,7 +63,7 @@ /* Current ACPICA subsystem version in YYYYMMDD format */ -#define ACPI_CA_VERSION 0x20060623 +#define ACPI_CA_VERSION 0x20060707 /* * OS name, used for the _OS object. The _OS object is essentially obsolete, diff --git a/include/acpi/acinterp.h b/include/acpi/acinterp.h index 216339a8f1f..91586d0d5bb 100644 --- a/include/acpi/acinterp.h +++ b/include/acpi/acinterp.h @@ -53,10 +53,14 @@ #define ACPI_EXD_TABLE_SIZE(name) (sizeof(name) / sizeof (struct acpi_exdump_info)) /* - * If possible, pack the following structure to byte alignment, since we - * don't care about performance for debug output + * If possible, pack the following structures to byte alignment, since we + * don't care about performance for debug output. Two cases where we cannot + * pack the structures: + * + * 1) Hardware does not support misaligned memory transfers + * 2) Compiler does not support pointers within packed structures */ -#ifndef ACPI_MISALIGNMENT_NOT_SUPPORTED +#if (!defined(ACPI_MISALIGNMENT_NOT_SUPPORTED) && !defined(ACPI_PACKED_POINTERS_NOT_SUPPORTED)) #pragma pack(1) #endif diff --git a/include/acpi/aclocal.h b/include/acpi/aclocal.h index 56b80248616..7010fea26b4 100644 --- a/include/acpi/aclocal.h +++ b/include/acpi/aclocal.h @@ -204,7 +204,7 @@ struct acpi_namespace_node { /* Namespace Node flags */ #define ANOBJ_END_OF_PEER_LIST 0x01 /* End-of-list, Peer field points to parent */ -#define ANOBJ_DATA_WIDTH_32 0x02 /* Parent table uses 32-bit math */ +#define ANOBJ_RESERVED 0x02 /* Available for future use */ #define ANOBJ_METHOD_ARG 0x04 /* Node is a method argument */ #define ANOBJ_METHOD_LOCAL 0x08 /* Node is a method local */ #define ANOBJ_SUBTREE_HAS_INI 0x10 /* Used to optimize device initialization */ diff --git a/include/acpi/acresrc.h b/include/acpi/acresrc.h index ad11fc13fbe..80a3b33571b 100644 --- a/include/acpi/acresrc.h +++ b/include/acpi/acresrc.h @@ -50,9 +50,13 @@ /* * If possible, pack the following structures to byte alignment, since we - * don't care about performance for debug output + * don't care about performance for debug output. Two cases where we cannot + * pack the structures: + * + * 1) Hardware does not support misaligned memory transfers + * 2) Compiler does not support pointers within packed structures */ -#ifndef ACPI_MISALIGNMENT_NOT_SUPPORTED +#if (!defined(ACPI_MISALIGNMENT_NOT_SUPPORTED) && !defined(ACPI_PACKED_POINTERS_NOT_SUPPORTED)) #pragma pack(1) #endif -- cgit v1.2.3 From ab8aa06a5c0b75974fb1949365cbb20a15cedf14 Mon Sep 17 00:00:00 2001 From: Len Brown Date: Fri, 7 Jul 2006 20:11:07 -0400 Subject: ACPI: acpi_os_get_thread_id() returns current Linux mutexes and the debug code that that reference acpi_os_get_thread_id() are happy with 0. But the AML mutexes in exmutex.c expect a unique non-zero number for each thread - as they track this thread_id to permit the mutex re-entrancy defined by the ACPI spec. http://bugzilla.kernel.org/show_bug.cgi?id=6687 Signed-off-by: Len Brown --- include/acpi/aclocal.h | 2 +- include/acpi/platform/aclinux.h | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) (limited to 'include') diff --git a/include/acpi/aclocal.h b/include/acpi/aclocal.h index 56b80248616..fbafee6e56d 100644 --- a/include/acpi/aclocal.h +++ b/include/acpi/aclocal.h @@ -127,7 +127,7 @@ typedef u8 acpi_owner_id; /* This Thread ID means that the mutex is not in use (unlocked) */ -#define ACPI_MUTEX_NOT_ACQUIRED (u32) -1 +#define ACPI_MUTEX_NOT_ACQUIRED (acpi_thread_id) 0 /* Table for the global mutexes */ diff --git a/include/acpi/platform/aclinux.h b/include/acpi/platform/aclinux.h index 3f853cabbd4..1cb51bf96ec 100644 --- a/include/acpi/platform/aclinux.h +++ b/include/acpi/platform/aclinux.h @@ -59,6 +59,7 @@ #include #include #include +#include /* Host-dependent types and defines */ @@ -100,8 +101,8 @@ #define acpi_cpu_flags unsigned long -#define acpi_thread_id u32 +#define acpi_thread_id struct task_struct * -static inline acpi_thread_id acpi_os_get_thread_id(void) { return 0; } +static inline acpi_thread_id acpi_os_get_thread_id(void) { return current; } #endif /* __ACLINUX_H__ */ -- cgit v1.2.3 From 3be91ec7388bae3cf1bfb4febcee5ab6c65f409f Mon Sep 17 00:00:00 2001 From: Zang Roy-r61911 Date: Fri, 30 Jun 2006 02:29:58 -0700 Subject: [SERIAL] 8250: add tsi108 serial support The following patch gets rid of CONFIG_TSI108_BRIDGE. I add UPIO_TSI to handle IIR and IER register in serial_in and serial_out. (1) the reason to rewrite serial_in: TSI108 rev Z1 version ERRATA. Reading the UART's Interrupt Identification Register (IIR) clears the Transmit Holding Register Empty (THRE) and Transmit buffer Empty (TEMP) interrupts even if they are not enabled in the Interrupt Enable Register (IER). This leads to loss of the interrupts. Interrupts are not cleared when reading UART registers as 32-bit word. (2) the reason to rewrite serial_out: Check for UART_IER_UUE bit in the autoconfig routine. This section of autoconfig is excluded for Tsi108/109 because bits 7 and 6 are reserved for internal use. They are R/W bits. In addition to incorrect identification, changing these bits (from 00) will make Tsi108/109 UART non-functional. Signed-off-by: Roy Zang Signed-off-by: Andrew Morton Signed-off-by: Russell King --- include/linux/serial_core.h | 1 + 1 file changed, 1 insertion(+) (limited to 'include') diff --git a/include/linux/serial_core.h b/include/linux/serial_core.h index 058cba70818..86501a3de2a 100644 --- a/include/linux/serial_core.h +++ b/include/linux/serial_core.h @@ -227,6 +227,7 @@ struct uart_port { #define UPIO_MEM (2) #define UPIO_MEM32 (3) #define UPIO_AU (4) /* Au1x00 type IO */ +#define UPIO_TSI (5) /* Tsi108/109 type IO */ unsigned int read_status_mask; /* driver specific */ unsigned int ignore_status_mask; /* driver specific */ -- cgit v1.2.3 From c8f7a62cdde461914c6457d5f4362538ed810bf4 Mon Sep 17 00:00:00 2001 From: Len Brown Date: Sun, 9 Jul 2006 17:22:28 -0400 Subject: Revert "Revert "ACPI: dock driver"" This reverts 953969ddf5b049361ed1e8471cc43dc4134d2a6f commit. --- include/acpi/acpi_bus.h | 2 +- include/acpi/acpi_drivers.h | 17 +++++++++++++++++ 2 files changed, 18 insertions(+), 1 deletion(-) (limited to 'include') diff --git a/include/acpi/acpi_bus.h b/include/acpi/acpi_bus.h index a2b3e390a50..f338e40bd54 100644 --- a/include/acpi/acpi_bus.h +++ b/include/acpi/acpi_bus.h @@ -334,7 +334,7 @@ int acpi_bus_add(struct acpi_device **child, struct acpi_device *parent, acpi_handle handle, int type); int acpi_bus_trim(struct acpi_device *start, int rmdevice); int acpi_bus_start(struct acpi_device *device); - +acpi_status acpi_bus_get_ejd(acpi_handle handle, acpi_handle *ejd); int acpi_match_ids(struct acpi_device *device, char *ids); int acpi_create_dir(struct acpi_device *); void acpi_remove_dir(struct acpi_device *); diff --git a/include/acpi/acpi_drivers.h b/include/acpi/acpi_drivers.h index b425f9bb6d4..6a5bdcefec6 100644 --- a/include/acpi/acpi_drivers.h +++ b/include/acpi/acpi_drivers.h @@ -110,4 +110,21 @@ int acpi_processor_set_thermal_limit(acpi_handle handle, int type); extern int acpi_specific_hotkey_enabled; +/*-------------------------------------------------------------------------- + Dock Station + -------------------------------------------------------------------------- */ +#if defined(CONFIG_ACPI_DOCK) || defined(CONFIG_ACPI_DOCK_MODULE) +extern int is_dock_device(acpi_handle handle); +extern int register_dock_notifier(struct notifier_block *nb); +extern void unregister_dock_notifier(struct notifier_block *nb); +extern int register_hotplug_dock_device(acpi_handle handle, + acpi_notify_handler handler, void *context); +extern void unregister_hotplug_dock_device(acpi_handle handle); +#else +#define is_dock_device(h) (0) +#define register_dock_notifier(nb) (-ENODEV) +#define unregister_dock_notifier(nb) do { } while(0) +#define register_hotplug_dock_device(h1, h2, c) (-ENODEV) +#define unregister_hotplug_dock_device(h) do { } while(0) +#endif #endif /*__ACPI_DRIVERS_H__*/ -- cgit v1.2.3 From b3cf257623fabd8f1ee6700a6d328cc1c5da5a1d Mon Sep 17 00:00:00 2001 From: Stephane Eranian Date: Sun, 9 Jul 2006 21:12:39 -0400 Subject: [PATCH] i386: use thread_info flags for debug regs and IO bitmaps Use thread info flags to track use of debug registers and IO bitmaps. - add TIF_DEBUG to track when debug registers are active - add TIF_IO_BITMAP to track when I/O bitmap is used - modify __switch_to() to use the new TIF flags Performance tested on Pentium II, ten runs of LMbench context switch benchmark (smaller is better:) before after avg 3.65 3.39 min 3.55 3.33 Signed-off-by: Stephane Eranian Signed-off-by: Chuck Ebbert <76306.1226@compuserve.com> Acked-by: Andi Kleen Signed-off-by: Linus Torvalds --- include/asm-i386/thread_info.h | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'include') diff --git a/include/asm-i386/thread_info.h b/include/asm-i386/thread_info.h index 2833fa2c0dd..54d6d7aea93 100644 --- a/include/asm-i386/thread_info.h +++ b/include/asm-i386/thread_info.h @@ -140,6 +140,8 @@ static inline struct thread_info *current_thread_info(void) #define TIF_SECCOMP 8 /* secure computing */ #define TIF_RESTORE_SIGMASK 9 /* restore signal mask in do_signal() */ #define TIF_MEMDIE 16 +#define TIF_DEBUG 17 /* uses debug registers */ +#define TIF_IO_BITMAP 18 /* uses I/O bitmap */ #define _TIF_SYSCALL_TRACE (1< Date: Mon, 10 Jul 2006 01:35:51 -0400 Subject: ACPI: acpi_os_allocate() fixes Replace acpi_in_resume with a more general hack to check irqs_disabled() on any kmalloc() from ACPI. While setting (system_state != SYSTEM_RUNNING) on resume seemed more general, Andrew Morton preferred this approach. http://bugzilla.kernel.org/show_bug.cgi?id=3469 Make acpi_os_allocate() into an inline function to allow /proc/slab_allocators to work. Delete some memset() that could fault on allocation failure. Signed-off-by: Len Brown --- include/acpi/acmacros.h | 8 +++++++- include/acpi/platform/aclinux.h | 22 ++++++++++++++++++++++ 2 files changed, 29 insertions(+), 1 deletion(-) (limited to 'include') diff --git a/include/acpi/acmacros.h b/include/acpi/acmacros.h index f1ac6109556..192fa095a51 100644 --- a/include/acpi/acmacros.h +++ b/include/acpi/acmacros.h @@ -724,9 +724,15 @@ /* Memory allocation */ +#ifndef ACPI_ALLOCATE #define ACPI_ALLOCATE(a) acpi_ut_allocate((acpi_size)(a),_COMPONENT,_acpi_module_name,__LINE__) +#endif +#ifndef ACPI_ALLOCATE_ZEROED #define ACPI_ALLOCATE_ZEROED(a) acpi_ut_allocate_zeroed((acpi_size)(a), _COMPONENT,_acpi_module_name,__LINE__) -#define ACPI_FREE(a) kfree(a) +#endif +#ifndef ACPI_FREE +#define ACPI_FREE(a) acpio_os_free(a) +#endif #define ACPI_MEM_TRACKING(a) #else diff --git a/include/acpi/platform/aclinux.h b/include/acpi/platform/aclinux.h index 3f853cabbd4..f0118262ac2 100644 --- a/include/acpi/platform/aclinux.h +++ b/include/acpi/platform/aclinux.h @@ -104,4 +104,26 @@ static inline acpi_thread_id acpi_os_get_thread_id(void) { return 0; } +/* + * The irqs_disabled() check is for resume from RAM. + * Interrupts are off during resume, just like they are for boot. + * However, boot has (system_state != SYSTEM_RUNNING) + * to quiet __might_sleep() in kmalloc() and resume does not. + */ +#include +static inline void *acpi_os_allocate(acpi_size size) { + return kmalloc(size, irqs_disabled() ? GFP_ATOMIC : GFP_KERNEL); +} +static inline void *acpi_os_allocate_zeroed(acpi_size size) { + return kzalloc(size, irqs_disabled() ? GFP_ATOMIC : GFP_KERNEL); +} + +static inline void *acpi_os_acquire_object(acpi_cache_t * cache) { + return kmem_cache_zalloc(cache, irqs_disabled() ? GFP_ATOMIC : GFP_KERNEL); +} + +#define ACPI_ALLOCATE(a) acpi_os_allocate(a) +#define ACPI_ALLOCATE_ZEROED(a) acpi_os_allocate_zeroed(a) +#define ACPI_FREE(a) kfree(a) + #endif /* __ACLINUX_H__ */ -- cgit v1.2.3 From e45b3b6af09dab2a28a7c88b340d0bcdd173e068 Mon Sep 17 00:00:00 2001 From: Andrew Morton Date: Mon, 10 Jul 2006 04:43:50 -0700 Subject: [PATCH] count_vm_events() fix Dopey bug. Causes hopelessly-wrong numbers from vmstat(8) and several other counters. Cc: Christoph Lameter Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- include/linux/vmstat.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include') diff --git a/include/linux/vmstat.h b/include/linux/vmstat.h index 3e0daf54133..d673b7b15c3 100644 --- a/include/linux/vmstat.h +++ b/include/linux/vmstat.h @@ -57,7 +57,7 @@ static inline void __count_vm_events(enum vm_event_item item, long delta) static inline void count_vm_events(enum vm_event_item item, long delta) { - get_cpu_var(vm_event_states.event[item])++; + get_cpu_var(vm_event_states.event[item]) += delta; put_cpu(); } -- cgit v1.2.3 From 5fca80e8b4bf5d69b900115b14342133ce81d79e Mon Sep 17 00:00:00 2001 From: Ingo Molnar Date: Mon, 10 Jul 2006 04:44:02 -0700 Subject: [PATCH] lockdep: add more rwsem.h documentation Add more documentation to rwsem.h. Signed-off-by: Ingo Molnar Cc: David Howells Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- include/linux/rwsem.h | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) (limited to 'include') diff --git a/include/linux/rwsem.h b/include/linux/rwsem.h index 658afb37c3f..7b524b4109a 100644 --- a/include/linux/rwsem.h +++ b/include/linux/rwsem.h @@ -61,12 +61,25 @@ extern void downgrade_write(struct rw_semaphore *sem); #ifdef CONFIG_DEBUG_LOCK_ALLOC /* - * nested locking: + * nested locking. NOTE: rwsems are not allowed to recurse + * (which occurs if the same task tries to acquire the same + * lock instance multiple times), but multiple locks of the + * same lock class might be taken, if the order of the locks + * is always the same. This ordering rule can be expressed + * to lockdep via the _nested() APIs, but enumerating the + * subclasses that are used. (If the nesting relationship is + * static then another method for expressing nested locking is + * the explicit definition of lock class keys and the use of + * lockdep_set_class() at lock initialization time. + * See Documentation/lockdep-design.txt for more details.) */ extern void down_read_nested(struct rw_semaphore *sem, int subclass); extern void down_write_nested(struct rw_semaphore *sem, int subclass); /* - * Take/release a lock when not the owner will release it: + * Take/release a lock when not the owner will release it. + * + * [ This API should be avoided as much as possible - the + * proper abstraction for this case is completions. ] */ extern void down_read_non_owner(struct rw_semaphore *sem); extern void up_read_non_owner(struct rw_semaphore *sem); -- cgit v1.2.3 From d6d897cec29252b8d0785198cfa6ca16d30c739d Mon Sep 17 00:00:00 2001 From: Ingo Molnar Date: Mon, 10 Jul 2006 04:44:04 -0700 Subject: [PATCH] lockdep: core, reduce per-lock class-cache size lockdep_map is embedded into every lock, which blows up data structure sizes all around the kernel. Reduce the class-cache to be for the default class only - that is used in 99.9% of the cases and even if we dont have a class cached, the lookup in the class-hash is lockless. This change reduces the per-lock dep_map overhead by 56 bytes on 64-bit platforms and by 28 bytes on 32-bit platforms. Signed-off-by: Ingo Molnar Cc: Arjan van de Ven Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- include/linux/lockdep.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include') diff --git a/include/linux/lockdep.h b/include/linux/lockdep.h index 316e0fb8d7b..c040a8c969a 100644 --- a/include/linux/lockdep.h +++ b/include/linux/lockdep.h @@ -120,7 +120,7 @@ struct lock_class { */ struct lockdep_map { struct lock_class_key *key; - struct lock_class *class[MAX_LOCKDEP_SUBCLASSES]; + struct lock_class *class_cache; const char *name; }; -- cgit v1.2.3 From f86bf9b7bcc5d325687a8b80da8ee3eb56e02da7 Mon Sep 17 00:00:00 2001 From: Ingo Molnar Date: Mon, 10 Jul 2006 04:44:05 -0700 Subject: [PATCH] lockdep: clean up completion initializer in smpboot.c Clean up lockdep on-stack-completion initializer. (This also removes the dependency on waitqueue_lock_key.) Signed-off-by: Ingo Molnar Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- include/linux/completion.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'include') diff --git a/include/linux/completion.h b/include/linux/completion.h index 251c41e3ddd..268c5a4a2bd 100644 --- a/include/linux/completion.h +++ b/include/linux/completion.h @@ -18,6 +18,9 @@ struct completion { #define COMPLETION_INITIALIZER(work) \ { 0, __WAIT_QUEUE_HEAD_INITIALIZER((work).wait) } +#define COMPLETION_INITIALIZER_ONSTACK(work) \ + ({ init_completion(&work); work; }) + #define DECLARE_COMPLETION(work) \ struct completion work = COMPLETION_INITIALIZER(work) @@ -28,7 +31,7 @@ struct completion { */ #ifdef CONFIG_LOCKDEP # define DECLARE_COMPLETION_ONSTACK(work) \ - struct completion work = ({ init_completion(&work); work; }) + struct completion work = COMPLETION_INITIALIZER_ONSTACK(work) #else # define DECLARE_COMPLETION_ONSTACK(work) DECLARE_COMPLETION(work) #endif -- cgit v1.2.3 From a8f340e394ff30b79ab5b03c67ab4c94b2ac3646 Mon Sep 17 00:00:00 2001 From: Jon Smirl Date: Mon, 10 Jul 2006 04:44:12 -0700 Subject: [PATCH] vt: Remove VT-specific declarations and definitions from tty.h MAX_NR_CONSOLES, fg_console, want_console and last_console are more of a function of the VT layer than the TTY one. Moving these to vt.h and vt_kern.h allows all of the framebuffer and VT console drivers to remove their dependency on tty.h. [akpm@osdl.org: fix alpha build] Signed-off-by: Jon Smirl Signed-off-by: Antonino Daplas Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- include/linux/console_struct.h | 1 + include/linux/fb.h | 1 - include/linux/tty.h | 11 ----------- include/linux/vt.h | 10 ++++++++++ include/linux/vt_kern.h | 1 + 5 files changed, 12 insertions(+), 12 deletions(-) (limited to 'include') diff --git a/include/linux/console_struct.h b/include/linux/console_struct.h index f8e5587a0f9..25423f79bf9 100644 --- a/include/linux/console_struct.h +++ b/include/linux/console_struct.h @@ -9,6 +9,7 @@ * to achieve effects such as fast scrolling by changing the origin. */ +#include #include struct vt_struct; diff --git a/include/linux/fb.h b/include/linux/fb.h index ffefeeeeca9..405f44e44e5 100644 --- a/include/linux/fb.h +++ b/include/linux/fb.h @@ -377,7 +377,6 @@ struct fb_cursor { #include #include -#include #include #include #include diff --git a/include/linux/tty.h b/include/linux/tty.h index b3b807e4b05..37937c8a11a 100644 --- a/include/linux/tty.h +++ b/include/linux/tty.h @@ -5,16 +5,6 @@ * 'tty.h' defines some structures used by tty_io.c and some defines. */ -/* - * These constants are also useful for user-level apps (e.g., VC - * resizing). - */ -#define MIN_NR_CONSOLES 1 /* must be at least 1 */ -#define MAX_NR_CONSOLES 63 /* serial lines start at 64 */ -#define MAX_NR_USER_CONSOLES 63 /* must be root to allocate above this */ - /* Note: the ioctl VT_GETSTATE does not work for - consoles 16 and higher (since it returns a short) */ - #ifdef __KERNEL__ #include #include @@ -270,7 +260,6 @@ struct tty_struct { extern void tty_write_flush(struct tty_struct *); extern struct termios tty_std_termios; -extern int fg_console, last_console, want_console; extern int kmsg_redirect; diff --git a/include/linux/vt.h b/include/linux/vt.h index 9f95b0bea5b..8ab334a4822 100644 --- a/include/linux/vt.h +++ b/include/linux/vt.h @@ -1,6 +1,16 @@ #ifndef _LINUX_VT_H #define _LINUX_VT_H +/* + * These constants are also useful for user-level apps (e.g., VC + * resizing). + */ +#define MIN_NR_CONSOLES 1 /* must be at least 1 */ +#define MAX_NR_CONSOLES 63 /* serial lines start at 64 */ +#define MAX_NR_USER_CONSOLES 63 /* must be root to allocate above this */ + /* Note: the ioctl VT_GETSTATE does not work for + consoles 16 and higher (since it returns a short) */ + /* 0x56 is 'V', to avoid collision with termios and kd */ #define VT_OPENQRY 0x5600 /* find available vt */ diff --git a/include/linux/vt_kern.h b/include/linux/vt_kern.h index 940d0261a54..918a29763ae 100644 --- a/include/linux/vt_kern.h +++ b/include/linux/vt_kern.h @@ -26,6 +26,7 @@ extern void kd_mksound(unsigned int hz, unsigned int ticks); extern int kbd_rate(struct kbd_repeat *rep); +extern int fg_console, last_console, want_console; /* console.c */ -- cgit v1.2.3 From 894673ee6122a3ce1958e1fe096901ba5356a96b Mon Sep 17 00:00:00 2001 From: Jon Smirl Date: Mon, 10 Jul 2006 04:44:13 -0700 Subject: [PATCH] tty: Remove include of screen_info.h from tty.h screen_info.h doesn't have anything to do with the tty layer and shouldn't be included by tty.h. This patches removes the include and modifies all users to directly include screen_info.h. struct screen_info is mainly used to communicate with the console drivers in drivers/video/console. Note that this patch touches every arch and I have no way of testing it. If there is a mistake the worst thing that will happen is a compile error. [akpm@osdl.org: fix arm build] [akpm@osdl.org: fix alpha build] Signed-off-by: Jon Smirl Signed-off-by: Antonino Daplas Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- include/linux/tty.h | 1 - 1 file changed, 1 deletion(-) (limited to 'include') diff --git a/include/linux/tty.h b/include/linux/tty.h index 37937c8a11a..e421d5e3481 100644 --- a/include/linux/tty.h +++ b/include/linux/tty.h @@ -12,7 +12,6 @@ #include #include #include -#include #include #include -- cgit v1.2.3 From ff4e8d9a9f46e3a7f89d14ade52fe5d53a82c022 Mon Sep 17 00:00:00 2001 From: NeilBrown Date: Mon, 10 Jul 2006 04:44:16 -0700 Subject: [PATCH] md: fix resync speed calculation for restarted resyncs We introduced 'io_sectors' recently so we could count the sectors that causes io during resync separate from sectors which didn't cause IO - there can be a difference if a bitmap is being used to accelerate resync. However when a speed is reported, we find the number of sectors processed recently by subtracting an oldish io_sectors count from a current 'curr_resync' count. This is wrong because curr_resync counts all sectors, not just io sectors. So, add a field to mddev to store the curren io_sectors separately from curr_resync, and use that in the calculations. Signed-off-by: Neil Brown Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- include/linux/raid/md_k.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'include') diff --git a/include/linux/raid/md_k.h b/include/linux/raid/md_k.h index c1e0ac55bab..d2889029585 100644 --- a/include/linux/raid/md_k.h +++ b/include/linux/raid/md_k.h @@ -148,9 +148,10 @@ struct mddev_s struct mdk_thread_s *thread; /* management thread */ struct mdk_thread_s *sync_thread; /* doing resync or reconstruct */ - sector_t curr_resync; /* blocks scheduled */ + sector_t curr_resync; /* last block scheduled */ unsigned long resync_mark; /* a recent timestamp */ sector_t resync_mark_cnt;/* blocks written at resync_mark */ + sector_t curr_mark_cnt; /* blocks scheduled now */ sector_t resync_max_sectors; /* may be set by personality */ -- cgit v1.2.3 From 868e81b8ada8fa05bdc08b5e6fa73307caaeab6d Mon Sep 17 00:00:00 2001 From: Yoshinori Sato Date: Mon, 10 Jul 2006 04:44:24 -0700 Subject: [PATCH] h8300 remove duplicate define Signed-off-by: Yoshinori Sato Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- include/asm-h8300/page.h | 1 - 1 file changed, 1 deletion(-) (limited to 'include') diff --git a/include/asm-h8300/page.h b/include/asm-h8300/page.h index f9f9d3eea8e..d673077d2fd 100644 --- a/include/asm-h8300/page.h +++ b/include/asm-h8300/page.h @@ -66,7 +66,6 @@ extern unsigned long memory_end; #define MAP_NR(addr) (((unsigned long)(addr)-PAGE_OFFSET) >> PAGE_SHIFT) #define virt_to_page(addr) (mem_map + (((unsigned long)(addr)-PAGE_OFFSET) >> PAGE_SHIFT)) -#define virt_to_page(addr) (mem_map + (((unsigned long)(addr)-PAGE_OFFSET) >> PAGE_SHIFT)) #define page_to_virt(page) ((((page) - mem_map) << PAGE_SHIFT) + PAGE_OFFSET) #define pfn_valid(page) (page < max_mapnr) -- cgit v1.2.3 From 7f4599e9cd6bca0efc1000359584d1cff68f9f13 Mon Sep 17 00:00:00 2001 From: Christoph Lameter Date: Mon, 10 Jul 2006 04:44:30 -0700 Subject: [PATCH] ZVC: add __inc_zone_state for !SMP configuration It turns out that there is a way to build a kernel with NUMA and no SMP. In that case we are missing one definition __inc_zone_state. Provide that missing __inc_zone_state. (akpm: NUMA && !SMP sounds odd, but I am told "But there is the concept of cpuless nodes. A NUMA system without SMP has a single processor but multiple memory nodes. This used to work before on IA64 (wasn't aware of it, never seen anyone with this kind of thing).") Acked-by: Tony Luck Signed-off-by: Christoph Lameter Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- include/linux/vmstat.h | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'include') diff --git a/include/linux/vmstat.h b/include/linux/vmstat.h index d673b7b15c3..1ab806c4751 100644 --- a/include/linux/vmstat.h +++ b/include/linux/vmstat.h @@ -186,11 +186,16 @@ static inline void __mod_zone_page_state(struct zone *zone, zone_page_state_add(delta, zone, item); } +static inline void __inc_zone_state(struct zone *zone, enum zone_stat_item item) +{ + atomic_long_inc(&zone->vm_stat[item]); + atomic_long_inc(&vm_stat[item]); +} + static inline void __inc_zone_page_state(struct page *page, enum zone_stat_item item) { - atomic_long_inc(&page_zone(page)->vm_stat[item]); - atomic_long_inc(&vm_stat[item]); + __inc_zone_state(page_zone(page), item); } static inline void __dec_zone_page_state(struct page *page, -- cgit v1.2.3 From 6e99e4582861578fb00d84d085f8f283569f51dd Mon Sep 17 00:00:00 2001 From: Benjamin Herrenschmidt Date: Mon, 10 Jul 2006 04:44:42 -0700 Subject: [PATCH] powerpc: fix trigger handling in the new irq code This patch slightly reworks the new irq code to fix a small design error. I removed the passing of the trigger to the map() calls entirely, it was not a good idea to have one call do two different things. It also fixes a couple of corner cases. Mapping a linux virtual irq to a physical irq now does only that. Setting the trigger is a different action which has a different call. The main changes are: - I no longer call host->ops->map() for an already mapped irq, I just return the virtual number that was already mapped. It was called before to give an opportunity to change the trigger, but that was causing issues as that could happen while the interrupt was in use by a device, and because of the trigger change, map would potentially muck around with things in a racy way. That was causing much burden on a given's controller implementation of map() to get it right. This is much simpler now. map() is only called on the initial mapping of an irq, meaning that you know that this irq is _not_ being used. You can initialize the hardware if you want (though you don't have to). - Controllers that can handle different type of triggers (level/edge/etc...) now implement the standard irq_chip->set_type() call as defined by the generic code. That means that you can use the standard set_irq_type() to configure an irq line manually if you wish or (though I don't like that interface), pass explicit trigger flags to request_irq() as defined by the generic kernel interfaces. Also, using those interfaces guarantees that your controller set_type callback is called with the descriptor lock held, thus providing locking against activity on the same interrupt (including mask/unmask/etc...) automatically. A result is that, for example, MPIC's own map() implementation calls irq_set_type(NONE) to configure the hardware to the default triggers. - To allow the above, the irq_map array entry for the new mapped interrupt is now set before map() callback is called for the controller. - The irq_create_of_mapping() (also used by irq_of_parse_and_map()) function for mapping interrupts from the device-tree now also call the separate set_irq_type(), and only does so if there is a change in the trigger type. - While I was at it, I changed pci_read_irq_line() (which is the helper I would expect most archs to use in their pcibios_fixup() to get the PCI interrupt routing from the device tree) to also handle a fallback when the DT mapping fails consisting of reading the PCI_INTERRUPT_PIN to know wether the device has an interrupt at all, and the the PCI_INTERRUPT_LINE to get an interrupt number from the device. That number is then mapped using the default controller, and the trigger is set to level low. That default behaviour works for several platforms that don't have a proper interrupt tree like Pegasos. If it doesn't work for your platform, then either provide a proper interrupt tree from the firmware so that fallback isn't needed, or don't call pci_read_irq_line() - Add back a bit that got dropped by my main rework patch for properly clearing pending IPIs on pSeries when using a kexec Signed-off-by: Benjamin Herrenschmidt Cc: Paul Mackerras Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- include/asm-powerpc/irq.h | 38 +++++++++++++------------------------- 1 file changed, 13 insertions(+), 25 deletions(-) (limited to 'include') diff --git a/include/asm-powerpc/irq.h b/include/asm-powerpc/irq.h index e0575475202..d903a62959d 100644 --- a/include/asm-powerpc/irq.h +++ b/include/asm-powerpc/irq.h @@ -83,25 +83,24 @@ struct irq_host_ops { int (*match)(struct irq_host *h, struct device_node *node); /* Create or update a mapping between a virtual irq number and a hw - * irq number. This can be called several times for the same mapping - * but with different flags, though unmap shall always be called - * before the virq->hw mapping is changed. + * irq number. This is called only once for a given mapping. */ - int (*map)(struct irq_host *h, unsigned int virq, - irq_hw_number_t hw, unsigned int flags); + int (*map)(struct irq_host *h, unsigned int virq, irq_hw_number_t hw); /* Dispose of such a mapping */ void (*unmap)(struct irq_host *h, unsigned int virq); /* Translate device-tree interrupt specifier from raw format coming * from the firmware to a irq_hw_number_t (interrupt line number) and - * trigger flags that can be passed to irq_create_mapping(). - * If no translation is provided, raw format is assumed to be one cell - * for interrupt line and default sense. + * type (sense) that can be passed to set_irq_type(). In the absence + * of this callback, irq_create_of_mapping() and irq_of_parse_and_map() + * will return the hw number in the first cell and IRQ_TYPE_NONE for + * the type (which amount to keeping whatever default value the + * interrupt controller has for that line) */ int (*xlate)(struct irq_host *h, struct device_node *ctrler, u32 *intspec, unsigned int intsize, - irq_hw_number_t *out_hwirq, unsigned int *out_flags); + irq_hw_number_t *out_hwirq, unsigned int *out_type); }; struct irq_host { @@ -193,25 +192,14 @@ extern void irq_set_virq_count(unsigned int count); * irq_create_mapping - Map a hardware interrupt into linux virq space * @host: host owning this hardware interrupt or NULL for default host * @hwirq: hardware irq number in that host space - * @flags: flags passed to the controller. contains the trigger type among - * others. Use IRQ_TYPE_* defined in include/linux/irq.h * * Only one mapping per hardware interrupt is permitted. Returns a linux - * virq number. The flags can be used to provide sense information to the - * controller (typically extracted from the device-tree). If no information - * is passed, the controller defaults will apply (for example, xics can only - * do edge so flags are irrelevant for some pseries specific irqs). - * - * The device-tree generally contains the trigger info in an encoding that is - * specific to a given type of controller. In that case, you can directly use - * host->ops->trigger_xlate() to translate that. - * - * It is recommended that new PICs that don't have existing OF bindings chose - * to use a representation of triggers identical to linux. + * virq number. + * If the sense/trigger is to be specified, set_irq_type() should be called + * on the number returned from that call. */ extern unsigned int irq_create_mapping(struct irq_host *host, - irq_hw_number_t hwirq, - unsigned int flags); + irq_hw_number_t hwirq); /*** @@ -295,7 +283,7 @@ extern void irq_free_virt(unsigned int virq, unsigned int count); * * This function is identical to irq_create_mapping except that it takes * as input informations straight from the device-tree (typically the results - * of the of_irq_map_*() functions + * of the of_irq_map_*() functions. */ extern unsigned int irq_create_of_mapping(struct device_node *controller, u32 *intspec, unsigned int intsize); -- cgit v1.2.3 From e01af0384f54023b4548b7742952da2ffcafd4cd Mon Sep 17 00:00:00 2001 From: Michael Hanselmann Date: Mon, 10 Jul 2006 04:44:45 -0700 Subject: [PATCH] powermac: Combined fixes for backlight code This patch fixes several problems: - pmac_backlight_key() is called under interrupt context, and therefore can't use mutexes or semaphores, so defer the backlight level for later, as it's not critical (original code by Aristeu S. Rozanski F. ). - Add exports for functions that might be called from modules - Fix Kconfig depdencies on PMAC_BACKLIGHT. - Fix locking issues on calls from inside the driver (reported by Aristeu S. Rozanski F., too) - Fix wrong calculation of backlight values in some of the drivers - Replace pmac_backlight_key_up/down by inline functions [akpm@osdl.org: fix function prototypes] Signed-off-by: Michael Hanselmann Acked-by: Aristeu S. Rozanski F. Acked-by: Rene Nussbaumer Cc: Benjamin Herrenschmidt Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- include/asm-powerpc/backlight.h | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'include') diff --git a/include/asm-powerpc/backlight.h b/include/asm-powerpc/backlight.h index a5e9e656e33..58d4b6f8d82 100644 --- a/include/asm-powerpc/backlight.h +++ b/include/asm-powerpc/backlight.h @@ -16,13 +16,19 @@ extern struct backlight_device *pmac_backlight; extern struct mutex pmac_backlight_mutex; -extern void pmac_backlight_calc_curve(struct fb_info*); extern int pmac_backlight_curve_lookup(struct fb_info *info, int value); extern int pmac_has_backlight_type(const char *type); -extern void pmac_backlight_key_up(void); -extern void pmac_backlight_key_down(void); +extern void pmac_backlight_key(int direction); +static inline void pmac_backlight_key_up(void) +{ + pmac_backlight_key(0); +} +static inline void pmac_backlight_key_down(void) +{ + pmac_backlight_key(1); +} extern int pmac_backlight_set_legacy_brightness(int brightness); extern int pmac_backlight_get_legacy_brightness(void); -- cgit v1.2.3 From 9dec17eb577169f78d642c5424e4264186d27115 Mon Sep 17 00:00:00 2001 From: David Howells Date: Mon, 10 Jul 2006 04:44:51 -0700 Subject: [PATCH] FRV: Fix FRV arch compile errors Fix some FRV arch compile errors, including: (*) Marking nr_kernel_pages as __meminitdata so that references to it end up being properly calculated rather than being assumed to be in the small data section (and thus calculated wrt the GP register). Not doing this causes the linker to emit errors as the offset is too big to fit into the load instruction. (*) Move pm_power_off into an unconditionally compiled .c file as it's now unconditionally accessed. (*) Declare frv_change_cmode() in a header file rather than in a .c file, and declare it asmlinkage. Signed-off-by: David Howells Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- include/linux/bootmem.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include') diff --git a/include/linux/bootmem.h b/include/linux/bootmem.h index 22866fa2d96..1021f508d82 100644 --- a/include/linux/bootmem.h +++ b/include/linux/bootmem.h @@ -91,7 +91,7 @@ static inline void *alloc_remap(int nid, unsigned long size) } #endif -extern unsigned long nr_kernel_pages; +extern unsigned long __meminitdata nr_kernel_pages; extern unsigned long nr_all_pages; extern void *__init alloc_large_system_hash(const char *tablename, -- cgit v1.2.3 From 01bf466e1866feeb7fce0319cbafe0166e29f5e4 Mon Sep 17 00:00:00 2001 From: David Howells Date: Mon, 10 Jul 2006 04:44:53 -0700 Subject: [PATCH] FDPIC: Define SEEK_* constants in the Linux kernel headers Add definitions for SEEK_SET, SEEK_CUR and SEEK_END to the kernel header files. Signed-off-by: David Howells Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- include/linux/fs.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'include') diff --git a/include/linux/fs.h b/include/linux/fs.h index 43aef9b230f..25610205c90 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h @@ -27,6 +27,10 @@ #define BLOCK_SIZE_BITS 10 #define BLOCK_SIZE (1< Date: Mon, 10 Jul 2006 04:44:54 -0700 Subject: [PATCH] FDPIC: Move roundup() into linux/kernel.h Move the roundup() macro from binfmt_elf.c into linux/kernel.h as it's generally useful. [akpm@osdl.org: nuke all the other implementations] Signed-off-by: David Howells Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- include/linux/kernel.h | 1 + 1 file changed, 1 insertion(+) (limited to 'include') diff --git a/include/linux/kernel.h b/include/linux/kernel.h index 5c1ec1f84ea..181c69cad4e 100644 --- a/include/linux/kernel.h +++ b/include/linux/kernel.h @@ -33,6 +33,7 @@ extern const char linux_banner[]; #define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0])) #define ALIGN(x,a) (((x)+(a)-1)&~((a)-1)) #define FIELD_SIZEOF(t, f) (sizeof(((t*)0)->f)) +#define roundup(x, y) ((((x) + ((y) - 1)) / (y)) * (y)) #define KERN_EMERG "<0>" /* system is unusable */ #define KERN_ALERT "<1>" /* action must be taken immediately */ -- cgit v1.2.3 From 6d8c4e3b0150ff537902477ed62f8a8e9e70007b Mon Sep 17 00:00:00 2001 From: David Howells Date: Mon, 10 Jul 2006 04:44:55 -0700 Subject: [PATCH] FDPIC: Add coredump capability for the ELF-FDPIC binfmt Add coredump capability for the ELF-FDPIC binfmt. Signed-off-by: David Howells Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- include/asm-frv/elf.h | 6 ++---- include/linux/elfcore.h | 10 ++++++++++ 2 files changed, 12 insertions(+), 4 deletions(-) (limited to 'include') diff --git a/include/asm-frv/elf.h b/include/asm-frv/elf.h index 38656da00e4..7df58a3e6e4 100644 --- a/include/asm-frv/elf.h +++ b/include/asm-frv/elf.h @@ -64,7 +64,7 @@ typedef unsigned long elf_greg_t; #define ELF_NGREG (sizeof(struct pt_regs) / sizeof(elf_greg_t)) typedef elf_greg_t elf_gregset_t[ELF_NGREG]; -typedef struct fpmedia_struct elf_fpregset_t; +typedef struct user_fpmedia_regs elf_fpregset_t; /* * This is used to ensure we don't load something for the wrong architecture. @@ -116,6 +116,7 @@ do { \ } while(0) #define USE_ELF_CORE_DUMP +#define ELF_FDPIC_CORE_EFLAGS EF_FRV_FDPIC #define ELF_EXEC_PAGESIZE 16384 /* This is the location that an ET_DYN program is loaded if exec'ed. Typical @@ -125,9 +126,6 @@ do { \ #define ELF_ET_DYN_BASE 0x08000000UL -#define ELF_CORE_COPY_REGS(pr_reg, regs) \ - memcpy(&pr_reg[0], ®s->sp, 31 * sizeof(uint32_t)); - /* This yields a mask that user programs can use to figure out what instruction set this cpu supports. */ diff --git a/include/linux/elfcore.h b/include/linux/elfcore.h index 0cf0bea010f..9631dddae34 100644 --- a/include/linux/elfcore.h +++ b/include/linux/elfcore.h @@ -60,6 +60,16 @@ struct elf_prstatus long pr_instr; /* Current instruction */ #endif elf_gregset_t pr_reg; /* GP registers */ +#ifdef CONFIG_BINFMT_ELF_FDPIC + /* When using FDPIC, the loadmap addresses need to be communicated + * to GDB in order for GDB to do the necessary relocations. The + * fields (below) used to communicate this information are placed + * immediately after ``pr_reg'', so that the loadmap addresses may + * be viewed as part of the register set if so desired. + */ + unsigned long pr_exec_fdpic_loadmap; + unsigned long pr_interp_fdpic_loadmap; +#endif int pr_fpvalid; /* True if math co-processor being used. */ }; -- cgit v1.2.3 From 84e8cd6dbc00b4979e8d1c15c80d91987aeb3417 Mon Sep 17 00:00:00 2001 From: David Howells Date: Mon, 10 Jul 2006 04:44:55 -0700 Subject: [PATCH] FRV: Introduce asm-offsets for FRV arch Introduce the use of asm-offsets into the FRV architecture. Signed-off-by: David Howells Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- include/asm-frv/gdb-stub.h | 22 ++++++++++ include/asm-frv/ptrace.h | 12 +----- include/asm-frv/registers.h | 97 +++++++++++++++++-------------------------- include/asm-frv/thread_info.h | 24 ++--------- 4 files changed, 65 insertions(+), 90 deletions(-) (limited to 'include') diff --git a/include/asm-frv/gdb-stub.h b/include/asm-frv/gdb-stub.h index c58479a4be9..24f9738670b 100644 --- a/include/asm-frv/gdb-stub.h +++ b/include/asm-frv/gdb-stub.h @@ -89,6 +89,7 @@ extern void gdbstub_do_rx(void); extern asmlinkage void __debug_stub_init_break(void); extern asmlinkage void __break_hijack_kernel_event(void); +extern asmlinkage void __break_hijack_kernel_event_breaks_here(void); extern asmlinkage void start_kernel(void); extern asmlinkage void gdbstub_rx_handler(void); @@ -114,5 +115,26 @@ extern void console_set_baud(unsigned baud); #define gdbstub_proto(FMT,...) ({ 0; }) #endif +/* + * we dedicate GR31 to keeping a pointer to the gdbstub exception frame + * - gr31 is destroyed on entry to the gdbstub if !MMU + * - gr31 is saved in scr3 on entry to the gdbstub if in !MMU + */ +register struct frv_frame0 *__debug_frame0 asm("gr31"); + +#define __debug_frame (&__debug_frame0->regs) +#define __debug_user_context (&__debug_frame0->uc) +#define __debug_regs (&__debug_frame0->debug) +#define __debug_reg(X) ((unsigned long *) ((unsigned long) &__debug_frame0 + (X))) + +struct frv_debug_status { + unsigned long bpsr; + unsigned long dcr; + unsigned long brr; + unsigned long nmar; +}; + +extern struct frv_debug_status __debug_status; + #endif /* _LANGUAGE_ASSEMBLY */ #endif /* __ASM_GDB_STUB_H */ diff --git a/include/asm-frv/ptrace.h b/include/asm-frv/ptrace.h index b2cce0718e5..7ff525162a7 100644 --- a/include/asm-frv/ptrace.h +++ b/include/asm-frv/ptrace.h @@ -62,18 +62,10 @@ #ifndef __ASSEMBLY__ /* - * dedicate GR28; to keeping the a pointer to the current exception frame + * we dedicate GR28 to keeping a pointer to the current exception frame + * - gr28 is destroyed on entry to the kernel from userspace */ register struct pt_regs *__frame asm("gr28"); -register struct pt_regs *__debug_frame asm("gr31"); - -#ifndef container_of -#define container_of(ptr, type, member) ({ \ - const typeof( ((type *)0)->member ) *__mptr = (ptr); \ - (type *)( (char *)__mptr - offsetof(type,member) );}) -#endif - -#define __debug_regs container_of(__debug_frame, struct pt_debug_regs, normal_regs) #define user_mode(regs) (!((regs)->psr & PSR_S)) #define instruction_pointer(regs) ((regs)->pc) diff --git a/include/asm-frv/registers.h b/include/asm-frv/registers.h index fccfd95cff6..9666119fcf6 100644 --- a/include/asm-frv/registers.h +++ b/include/asm-frv/registers.h @@ -23,7 +23,13 @@ * * +0x2000 +---------------------- * | union { - * | struct user_context + * | struct frv_frame0 { + * | struct user_context { + * | struct user_int_regs + * | struct user_fpmedia_regs + * | } + * | struct frv_debug_regs + * | } * | struct pt_regs [user exception] * | } * +---------------------- <-- __kernel_frame0_ptr (maybe GR28) @@ -51,11 +57,11 @@ #define _ASM_REGISTERS_H #ifndef __ASSEMBLY__ -#define __OFFSET(X) (X) +#define __OFFSET(X,N) ((X)+(N)*4) #define __OFFSETC(X,N) xxxxxxxxxxxxxxxxxxxxxxxx #else -#define __OFFSET(X) ((X)*4) -#define __OFFSETC(X,N) ((X)*4+(N)) +#define __OFFSET(X,N) ((X)+(N)*4) +#define __OFFSETC(X,N) ((X)+(N)) #endif /*****************************************************************************/ @@ -117,30 +123,13 @@ struct pt_regs { #endif -#define REG_PSR __OFFSET( 0) /* Processor Status Register */ -#define REG_ISR __OFFSET( 1) /* Integer Status Register */ -#define REG_CCR __OFFSET( 2) /* Condition Code Register */ -#define REG_CCCR __OFFSET( 3) /* Condition Code for Conditional Insns Register */ -#define REG_LR __OFFSET( 4) /* Link Register */ -#define REG_LCR __OFFSET( 5) /* Loop Count Register */ -#define REG_PC __OFFSET( 6) /* Program Counter */ - -#define REG__STATUS __OFFSET( 7) /* exception status */ #define REG__STATUS_STEP 0x00000001 /* - reenable single stepping on return */ #define REG__STATUS_STEPPED 0x00000002 /* - single step caused exception */ #define REG__STATUS_BROKE 0x00000004 /* - BREAK insn caused exception */ #define REG__STATUS_SYSC_ENTRY 0x40000000 /* - T on syscall entry (ptrace.c only) */ #define REG__STATUS_SYSC_EXIT 0x80000000 /* - T on syscall exit (ptrace.c only) */ -#define REG_SYSCALLNO __OFFSET( 8) /* syscall number or -1 */ -#define REG_ORIG_GR8 __OFFSET( 9) /* saved GR8 for signal handling */ -#define REG_GNER0 __OFFSET(10) -#define REG_GNER1 __OFFSET(11) -#define REG_IACC0 __OFFSET(12) - -#define REG_TBR __OFFSET(14) /* Trap Vector Register */ -#define REG_GR(R) __OFFSET((14+(R))) -#define REG__END REG_GR(32) +#define REG_GR(R) __OFFSET(REG_GR0, (R)) #define REG_SP REG_GR(1) #define REG_FP REG_GR(2) @@ -149,27 +138,21 @@ struct pt_regs { /*****************************************************************************/ /* - * extension tacked in front of the exception frame in debug mode + * debugging registers */ #ifndef __ASSEMBLY__ -struct pt_debug_regs +struct frv_debug_regs { - unsigned long bpsr; unsigned long dcr; - unsigned long brr; - unsigned long nmar; - struct pt_regs normal_regs; + unsigned long ibar[4] __attribute__((aligned(8))); + unsigned long dbar[4] __attribute__((aligned(8))); + unsigned long dbdr[4][4] __attribute__((aligned(8))); + unsigned long dbmr[4][4] __attribute__((aligned(8))); } __attribute__((aligned(8))); #endif -#define REG_NMAR __OFFSET(-1) -#define REG_BRR __OFFSET(-2) -#define REG_DCR __OFFSET(-3) -#define REG_BPSR __OFFSET(-4) -#define REG__DEBUG_XTRA __OFFSET(4) - /*****************************************************************************/ /* * userspace registers @@ -223,33 +206,27 @@ struct user_context void *extension; } __attribute__((aligned(8))); +struct frv_frame0 { + union { + struct pt_regs regs; + struct user_context uc; + }; + + struct frv_debug_regs debug; + +} __attribute__((aligned(32))); + #endif -#define NR_USER_INT_REGS (14 + 64) -#define NR_USER_FPMEDIA_REGS (64 + 2 + 2 + 8 + 8/4 + 1) -#define NR_USER_CONTEXT (NR_USER_INT_REGS + NR_USER_FPMEDIA_REGS + 1) - -#define USER_CONTEXT_SIZE (((NR_USER_CONTEXT + 1) & ~1) * 4) - -#define __THREAD_FRAME __OFFSET(0) -#define __THREAD_CURR __OFFSET(1) -#define __THREAD_SP __OFFSET(2) -#define __THREAD_FP __OFFSET(3) -#define __THREAD_LR __OFFSET(4) -#define __THREAD_PC __OFFSET(5) -#define __THREAD_GR(R) __OFFSET(6 + (R) - 16) -#define __THREAD_FRAME0 __OFFSET(19) -#define __THREAD_USER __OFFSET(19) - -#define __USER_INT __OFFSET(0) -#define __INT_GR(R) __OFFSET(14 + (R)) - -#define __USER_FPMEDIA __OFFSET(NR_USER_INT_REGS) -#define __FPMEDIA_FR(R) __OFFSET(NR_USER_INT_REGS + (R)) -#define __FPMEDIA_FNER(R) __OFFSET(NR_USER_INT_REGS + 64 + (R)) -#define __FPMEDIA_MSR(R) __OFFSET(NR_USER_INT_REGS + 66 + (R)) -#define __FPMEDIA_ACC(R) __OFFSET(NR_USER_INT_REGS + 68 + (R)) -#define __FPMEDIA_ACCG(R) __OFFSETC(NR_USER_INT_REGS + 76, (R)) -#define __FPMEDIA_FSR(R) __OFFSET(NR_USER_INT_REGS + 78 + (R)) +#define __INT_GR(R) __OFFSET(__INT_GR0, (R)) + +#define __FPMEDIA_FR(R) __OFFSET(__FPMEDIA_FR0, (R)) +#define __FPMEDIA_FNER(R) __OFFSET(__FPMEDIA_FNER0, (R)) +#define __FPMEDIA_MSR(R) __OFFSET(__FPMEDIA_MSR0, (R)) +#define __FPMEDIA_ACC(R) __OFFSET(__FPMEDIA_ACC0, (R)) +#define __FPMEDIA_ACCG(R) __OFFSETC(__FPMEDIA_ACCG0, (R)) +#define __FPMEDIA_FSR(R) __OFFSET(__FPMEDIA_FSR0, (R)) + +#define __THREAD_GR(R) __OFFSET(__THREAD_GR16, (R) - 16) #endif /* _ASM_REGISTERS_H */ diff --git a/include/asm-frv/thread_info.h b/include/asm-frv/thread_info.h index ea426abf01d..d66c48e6ef1 100644 --- a/include/asm-frv/thread_info.h +++ b/include/asm-frv/thread_info.h @@ -19,6 +19,8 @@ #include #endif +#define THREAD_SIZE 8192 + /* * low level task data that entry.S needs immediate access to * - this struct should fit entirely inside of one cache line @@ -46,15 +48,7 @@ struct thread_info { #else /* !__ASSEMBLY__ */ -/* offsets into the thread_info struct for assembly code access */ -#define TI_TASK 0x00000000 -#define TI_EXEC_DOMAIN 0x00000004 -#define TI_FLAGS 0x00000008 -#define TI_STATUS 0x0000000C -#define TI_CPU 0x00000010 -#define TI_PRE_COUNT 0x00000014 -#define TI_ADDR_LIMIT 0x00000018 -#define TI_RESTART_BLOCK 0x0000001C +#include #endif @@ -83,12 +77,6 @@ struct thread_info { #define init_thread_info (init_thread_union.thread_info) #define init_stack (init_thread_union.stack) -#ifdef CONFIG_SMALL_TASKS -#define THREAD_SIZE 4096 -#else -#define THREAD_SIZE 8192 -#endif - /* how to get the thread information struct from C */ register struct thread_info *__current_thread_info asm("gr15"); @@ -111,11 +99,7 @@ register struct thread_info *__current_thread_info asm("gr15"); #define free_thread_info(info) kfree(info) -#else /* !__ASSEMBLY__ */ - -#define THREAD_SIZE 8192 - -#endif +#endif /* __ASSEMBLY__ */ /* * thread information flags -- cgit v1.2.3 From 06c67befeeb16f2995c11b0e04a348103ddbfab1 Mon Sep 17 00:00:00 2001 From: Lennert Buytenhek Date: Mon, 10 Jul 2006 04:45:27 -0700 Subject: [PATCH] make valid_mmap_phys_addr_range() take a pfn Newer ARMs have a 40 bit physical address space, but mapping physical memory above 4G needs a special page table format which we (currently?) do not use for userspace mappings, so what happens instead is that mapping an address >= 4G will happily discard the upper bits and wrap. There is a valid_mmap_phys_addr_range() arch hook where we could check for >= 4G addresses and deny the mapping, but this hook takes an unsigned long address: static inline int valid_mmap_phys_addr_range(unsigned long addr, size_t size); And drivers/char/mem.c:mmap_mem() calls it like this: static int mmap_mem(struct file * file, struct vm_area_struct * vma) { size_t size = vma->vm_end - vma->vm_start; if (!valid_mmap_phys_addr_range(vma->vm_pgoff << PAGE_SHIFT, size)) So that's not much help either. This patch makes the hook take a pfn instead of a phys address. Signed-off-by: Lennert Buytenhek Cc: Bjorn Helgaas Cc: "Luck, Tony" Cc: Russell King Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- include/asm-ia64/io.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include') diff --git a/include/asm-ia64/io.h b/include/asm-ia64/io.h index 781ee2c7e8c..43bfff6c6b8 100644 --- a/include/asm-ia64/io.h +++ b/include/asm-ia64/io.h @@ -90,7 +90,7 @@ phys_to_virt (unsigned long address) #define ARCH_HAS_VALID_PHYS_ADDR_RANGE extern u64 kern_mem_attribute (unsigned long phys_addr, unsigned long size); extern int valid_phys_addr_range (unsigned long addr, size_t count); /* efi.c */ -extern int valid_mmap_phys_addr_range (unsigned long addr, size_t count); +extern int valid_mmap_phys_addr_range (unsigned long pfn, size_t count); /* * The following two macros are deprecated and scheduled for removal. -- cgit v1.2.3 From 38e0e8c0550eaed1af48ec5ad9ddb8a25e8b04ae Mon Sep 17 00:00:00 2001 From: "Maciej W. Rozycki" Date: Mon, 10 Jul 2006 04:45:30 -0700 Subject: [PATCH] char/rtc: Handle memory-mapped chips properly Handle memory-mapped chips properly, needed for example on DECstations. This support was in Linux 2.4 but for some reason got lost in 2.6. This patch is taken directly from the linux-mips repository. [akpm@osdl.org: cleanup] Signed-off-by: Maciej W. Rozycki Signed-off-by: Martin Michlmayr Cc: Paul Gortmaker Cc: Ralf Baechle Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- include/asm-mips/mach-dec/mc146818rtc.h | 2 ++ include/linux/mc146818rtc.h | 7 +++++++ 2 files changed, 9 insertions(+) (limited to 'include') diff --git a/include/asm-mips/mach-dec/mc146818rtc.h b/include/asm-mips/mach-dec/mc146818rtc.h index 6d37a567580..6724e99e43e 100644 --- a/include/asm-mips/mach-dec/mc146818rtc.h +++ b/include/asm-mips/mach-dec/mc146818rtc.h @@ -19,6 +19,8 @@ extern volatile u8 *dec_rtc_base; +#define ARCH_RTC_LOCATION + #define RTC_PORT(x) CPHYSADDR((long)dec_rtc_base) #define RTC_IO_EXTENT dec_kn_slot_size #define RTC_IOMAPPED 0 diff --git a/include/linux/mc146818rtc.h b/include/linux/mc146818rtc.h index bbc93ae217e..432b2fa2492 100644 --- a/include/linux/mc146818rtc.h +++ b/include/linux/mc146818rtc.h @@ -89,4 +89,11 @@ extern spinlock_t rtc_lock; /* serialize CMOS RAM access */ # define RTC_VRT 0x80 /* valid RAM and time */ /**********************************************************************/ +#ifndef ARCH_RTC_LOCATION /* Override by ? */ + +#define RTC_IO_EXTENT 0x8 +#define RTC_IOMAPPED 1 /* Default to I/O mapping. */ + +#endif /* ARCH_RTC_LOCATION */ + #endif /* _MC146818RTC_H */ -- cgit v1.2.3 From 21d71f513b6221f482ed6ad45e05f073ae67f319 Mon Sep 17 00:00:00 2001 From: Ingo Molnar Date: Mon, 10 Jul 2006 04:45:32 -0700 Subject: [PATCH] uninline init_waitqueue_head() allyesconfig vmlinux size delta: text data bss dec filename 20736884 6073834 3075176 29885894 vmlinux.before 20721009 6073966 3075176 29870151 vmlinux.after ~18 bytes per callsite, 15K of text size (~0.1%) saved. (as an added bonus this also removes a lockdep annotation.) Signed-off-by: Ingo Molnar Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- include/linux/wait.h | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) (limited to 'include') diff --git a/include/linux/wait.h b/include/linux/wait.h index 794be7af58a..b3b9048421d 100644 --- a/include/linux/wait.h +++ b/include/linux/wait.h @@ -77,17 +77,7 @@ struct task_struct; #define __WAIT_BIT_KEY_INITIALIZER(word, bit) \ { .flags = word, .bit_nr = bit, } -/* - * lockdep: we want one lock-class for all waitqueue locks. - */ -extern struct lock_class_key waitqueue_lock_key; - -static inline void init_waitqueue_head(wait_queue_head_t *q) -{ - spin_lock_init(&q->lock); - lockdep_set_class(&q->lock, &waitqueue_lock_key); - INIT_LIST_HEAD(&q->task_list); -} +extern void init_waitqueue_head(wait_queue_head_t *q); static inline void init_waitqueue_entry(wait_queue_t *q, struct task_struct *p) { -- cgit v1.2.3 From e2b209509ca33743864846aef2e1b2afc21f7915 Mon Sep 17 00:00:00 2001 From: Shankar Anand Date: Mon, 10 Jul 2006 04:45:44 -0700 Subject: [PATCH] knfsd: nfsd4: add per-operation server stats Add an nfs4 operations count array to nfsd_stats structure. The count is incremented in nfsd4_proc_compound() where all the operations are handled by the nfsv4 server. This count of individual nfsv4 operations is also entered into /proc filesystem. Signed-off-by: Shankar Anand Signed-off-by: Neil Brown Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- include/linux/nfs4.h | 6 ++++++ include/linux/nfsd/stats.h | 6 ++++++ 2 files changed, 12 insertions(+) (limited to 'include') diff --git a/include/linux/nfs4.h b/include/linux/nfs4.h index 5f681d53429..db05182ca0e 100644 --- a/include/linux/nfs4.h +++ b/include/linux/nfs4.h @@ -157,6 +157,12 @@ enum nfs_opnum4 { OP_ILLEGAL = 10044, }; +/*Defining first and last NFS4 operations implemented. +Needs to be updated if more operations are defined in future.*/ + +#define FIRST_NFS4_OP OP_ACCESS +#define LAST_NFS4_OP OP_RELEASE_LOCKOWNER + enum nfsstat4 { NFS4_OK = 0, NFS4ERR_PERM = 1, diff --git a/include/linux/nfsd/stats.h b/include/linux/nfsd/stats.h index b6f1e0cda4f..28a82fdd922 100644 --- a/include/linux/nfsd/stats.h +++ b/include/linux/nfsd/stats.h @@ -9,6 +9,8 @@ #ifndef LINUX_NFSD_STATS_H #define LINUX_NFSD_STATS_H +#include + struct nfsd_stats { unsigned int rchits; /* repcache hits */ unsigned int rcmisses; /* repcache hits */ @@ -27,6 +29,10 @@ struct nfsd_stats { unsigned int ra_size; /* size of ra cache */ unsigned int ra_depth[11]; /* number of times ra entry was found that deep * in the cache (10percentiles). [10] = not found */ +#ifdef CONFIG_NFSD_V4 + unsigned int nfs4_opcount[LAST_NFS4_OP + 1]; /* count of individual nfsv4 operations */ +#endif + }; /* thread usage wraps very million seconds (approx one fortnight) */ -- cgit v1.2.3 From aa0a9f373e3edb2c090f3fa0eb292712cfa97f81 Mon Sep 17 00:00:00 2001 From: Muli Ben-Yehuda Date: Mon, 10 Jul 2006 17:06:15 +0200 Subject: [PATCH] x86_64: Fix Calgary copyright statements per IBM guidelines Signed-off-by: Muli Ben-Yehuda Signed-off-by: Jon Mason Signed-off-by: Andi Kleen Signed-off-by: Linus Torvalds --- include/asm-x86_64/calgary.h | 6 ++++-- include/asm-x86_64/tce.h | 8 +++++--- 2 files changed, 9 insertions(+), 5 deletions(-) (limited to 'include') diff --git a/include/asm-x86_64/calgary.h b/include/asm-x86_64/calgary.h index 6e1654f3098..fbfb50136ed 100644 --- a/include/asm-x86_64/calgary.h +++ b/include/asm-x86_64/calgary.h @@ -1,8 +1,10 @@ /* * Derived from include/asm-powerpc/iommu.h * - * Copyright (C) 2006 Jon Mason , IBM Corporation - * Copyright (C) 2006 Muli Ben-Yehuda , IBM Corporation + * Copyright (C) IBM Corporation, 2006 + * + * Author: Jon Mason + * Author: Muli Ben-Yehuda * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/include/asm-x86_64/tce.h b/include/asm-x86_64/tce.h index ee51d31528d..53e9a68b333 100644 --- a/include/asm-x86_64/tce.h +++ b/include/asm-x86_64/tce.h @@ -1,9 +1,11 @@ /* - * Copyright (C) 2006 Muli Ben-Yehuda , IBM Corporation - * Copyright (C) 2006 Jon Mason , IBM Corporation - * * This file is derived from asm-powerpc/tce.h. * + * Copyright (C) IBM Corporation, 2006 + * + * Author: Muli Ben-Yehuda + * Author: Jon Mason + * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or -- cgit v1.2.3 From dc5bc8f1e96c32f28bddf32a14ef9251fb3071d0 Mon Sep 17 00:00:00 2001 From: Russell King Date: Mon, 10 Jul 2006 16:33:54 +0100 Subject: [ARM] Allow Versatile to be built for AB and PB If a configuration was chosen to support both the Versatile AB and PB boards, the result would write to registers not available on the PB version of the board. Resolve this by using machine_is_xxx(). Also, for the CLCD, despite how the code looks, both the AB and PB access the same location to control the clock rate - it's just called something different between the two board versions. Invent our own name for this location and use it unconditionally. Signed-off-by: Russell King --- include/asm-arm/arch-versatile/platform.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'include') diff --git a/include/asm-arm/arch-versatile/platform.h b/include/asm-arm/arch-versatile/platform.h index 72ef874567d..2af9d7c9c63 100644 --- a/include/asm-arm/arch-versatile/platform.h +++ b/include/asm-arm/arch-versatile/platform.h @@ -65,6 +65,8 @@ #define VERSATILE_SYS_OSC1_OFFSET 0x1C #endif +#define VERSATILE_SYS_OSCCLCD_OFFSET 0x1c + #define VERSATILE_SYS_LOCK_OFFSET 0x20 #define VERSATILE_SYS_100HZ_OFFSET 0x24 #define VERSATILE_SYS_CFGDATA1_OFFSET 0x28 -- cgit v1.2.3 From a0e1b6ef3b851fe6f1dcc259432e83de79ce5e7f Mon Sep 17 00:00:00 2001 From: James Bottomley Date: Sun, 9 Jul 2006 12:38:19 -0500 Subject: [SCSI] scsi_transport_sas: add expander backlink This patch adds the ability to add a backlink to a particular port. The idea is to represent properly ports on expanders that are used specifically for linking to the parent device in the topology. Signed-off-by: James Bottomley --- include/scsi/scsi_transport_sas.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'include') diff --git a/include/scsi/scsi_transport_sas.h b/include/scsi/scsi_transport_sas.h index f5772ff61d0..6cc2314098c 100644 --- a/include/scsi/scsi_transport_sas.h +++ b/include/scsi/scsi_transport_sas.h @@ -130,6 +130,8 @@ struct sas_port { int port_identifier; int num_phys; + /* port flags */ + unsigned int is_backlink:1; /* the other end of the link */ struct sas_rphy *rphy; @@ -175,6 +177,7 @@ void sas_port_free(struct sas_port *); void sas_port_delete(struct sas_port *); void sas_port_add_phy(struct sas_port *, struct sas_phy *); void sas_port_delete_phy(struct sas_port *, struct sas_phy *); +void sas_port_mark_backlink(struct sas_port *); int scsi_is_sas_port(const struct device *); extern struct scsi_transport_template * -- cgit v1.2.3 From f4a10b211ddb71d6b4e423fd529468691dec5cca Mon Sep 17 00:00:00 2001 From: Heiko Carstens Date: Wed, 12 Jul 2006 16:39:42 +0200 Subject: [S390] __builtin_trap() and gcc version. __builtin_trap() has the archictecture defined backend in gcc since gcc 3.3. To make sure the kernel builds with gcc 3.2 as well, use the old style BUG() statement if compiled with older gcc versions. Signed-off-by: Heiko Carstens Signed-off-by: Martin Schwidefsky --- include/asm-s390/bug.h | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'include') diff --git a/include/asm-s390/bug.h b/include/asm-s390/bug.h index 7ddaa05b98d..87689836394 100644 --- a/include/asm-s390/bug.h +++ b/include/asm-s390/bug.h @@ -5,9 +5,18 @@ #ifdef CONFIG_BUG +static inline __attribute__((noreturn)) void __do_illegal_op(void) +{ +#if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 3) + __builtin_trap(); +#else + asm volatile(".long 0"); +#endif +} + #define BUG() do { \ printk("kernel BUG at %s:%d!\n", __FILE__, __LINE__); \ - __builtin_trap(); \ + __do_illegal_op(); \ } while (0) #define HAVE_ARCH_BUG -- cgit v1.2.3 From 63f4f9e1281ea9b9a2304bd13d657ba9d401c9a7 Mon Sep 17 00:00:00 2001 From: Heiko Carstens Date: Wed, 12 Jul 2006 16:39:47 +0200 Subject: [S390] raw_local_save_flags/raw_local_irq_restore type check Make sure that raw_local_save_flags and raw_local_irq_restore always get an unsigned long parameter. raw_irqs_disabled should call raw_local_save_flags instead of local_save_flags. Signed-off-by: Heiko Carstens Signed-off-by: Martin Schwidefsky --- include/asm-s390/irqflags.h | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) (limited to 'include') diff --git a/include/asm-s390/irqflags.h b/include/asm-s390/irqflags.h index 65f4db627e7..3b566a5b3cc 100644 --- a/include/asm-s390/irqflags.h +++ b/include/asm-s390/irqflags.h @@ -25,16 +25,22 @@ __flags; \ }) -#define raw_local_save_flags(x) \ - __asm__ __volatile__("stosm 0(%1),0" : "=m" (x) : "a" (&x), "m" (x) ) - -#define raw_local_irq_restore(x) \ - __asm__ __volatile__("ssm 0(%0)" : : "a" (&x), "m" (x) : "memory") +#define raw_local_save_flags(x) \ +do { \ + typecheck(unsigned long, x); \ + __asm__ __volatile__("stosm 0(%1),0" : "=m" (x) : "a" (&x), "m" (x) ); \ +} while (0) + +#define raw_local_irq_restore(x) \ +do { \ + typecheck(unsigned long, x); \ + __asm__ __volatile__("ssm 0(%0)" : : "a" (&x), "m" (x) : "memory"); \ +} while (0) #define raw_irqs_disabled() \ ({ \ unsigned long flags; \ - local_save_flags(flags); \ + raw_local_save_flags(flags); \ !((flags >> __FLAG_SHIFT) & 3); \ }) -- cgit v1.2.3 From 13492c50f69bdf60a42debc6bd3ec49cc1dc941e Mon Sep 17 00:00:00 2001 From: Martin Schwidefsky Date: Wed, 12 Jul 2006 16:39:55 +0200 Subject: [S390] fix futex_atomic_cmpxchg_inatomic futex_atomic_cmpxchg_inatomic has the same bug as the other atomic futex operations: the operation needs to be done in the user address space, not the kernel address space. Add the missing sacf 256 & sacf 0. Signed-off-by: Martin Schwidefsky --- include/asm-s390/futex.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'include') diff --git a/include/asm-s390/futex.h b/include/asm-s390/futex.h index 1802775568b..ffedf14f89f 100644 --- a/include/asm-s390/futex.h +++ b/include/asm-s390/futex.h @@ -98,9 +98,10 @@ futex_atomic_cmpxchg_inatomic(int __user *uaddr, int oldval, int newval) if (! access_ok (VERIFY_WRITE, uaddr, sizeof(int))) return -EFAULT; - asm volatile(" cs %1,%4,0(%5)\n" + asm volatile(" sacf 256\n" + " cs %1,%4,0(%5)\n" "0: lr %0,%1\n" - "1:\n" + "1: sacf 0\n" #ifndef __s390x__ ".section __ex_table,\"a\"\n" " .align 4\n" -- cgit v1.2.3 From abdba61a4361e5d47c1633c9e7f56d32dbf4aae8 Mon Sep 17 00:00:00 2001 From: Heiko Carstens Date: Wed, 12 Jul 2006 16:39:58 +0200 Subject: [S390] cpu_relax() is supposed to have barrier() semantics. Signed-off-by: Heiko Carstens Signed-off-by: Martin Schwidefsky --- include/asm-s390/processor.h | 16 +++++++--------- include/asm-s390/setup.h | 3 ++- 2 files changed, 9 insertions(+), 10 deletions(-) (limited to 'include') diff --git a/include/asm-s390/processor.h b/include/asm-s390/processor.h index c5cbc4bd841..5b71d373172 100644 --- a/include/asm-s390/processor.h +++ b/include/asm-s390/processor.h @@ -199,15 +199,13 @@ unsigned long get_wchan(struct task_struct *p); /* * Give up the time slice of the virtual PU. */ -#ifndef __s390x__ -# define cpu_relax() asm volatile ("diag 0,0,68" : : : "memory") -#else /* __s390x__ */ -# define cpu_relax() \ - do { \ - if (MACHINE_HAS_DIAG44) \ - asm volatile ("diag 0,0,68" : : : "memory"); \ - } while (0) -#endif /* __s390x__ */ +static inline void cpu_relax(void) +{ + if (MACHINE_HAS_DIAG44) + asm volatile ("diag 0,0,68" : : : "memory"); + else + barrier(); +} /* * Set PSW to specified value. diff --git a/include/asm-s390/setup.h b/include/asm-s390/setup.h index da3fd4a7bb3..19e31979309 100644 --- a/include/asm-s390/setup.h +++ b/include/asm-s390/setup.h @@ -40,15 +40,16 @@ extern unsigned long machine_flags; #define MACHINE_IS_VM (machine_flags & 1) #define MACHINE_IS_P390 (machine_flags & 4) #define MACHINE_HAS_MVPG (machine_flags & 16) -#define MACHINE_HAS_DIAG44 (machine_flags & 32) #define MACHINE_HAS_IDTE (machine_flags & 128) #ifndef __s390x__ #define MACHINE_HAS_IEEE (machine_flags & 2) #define MACHINE_HAS_CSP (machine_flags & 8) +#define MACHINE_HAS_DIAG44 (1) #else /* __s390x__ */ #define MACHINE_HAS_IEEE (1) #define MACHINE_HAS_CSP (1) +#define MACHINE_HAS_DIAG44 (machine_flags & 32) #endif /* __s390x__ */ -- cgit v1.2.3 From 7e560814de1972e1bfc780616841d7a0032ca467 Mon Sep 17 00:00:00 2001 From: Cornelia Huck Date: Wed, 12 Jul 2006 16:40:19 +0200 Subject: [S390] path grouping and path verifications fixes. 1. Multipath devices for which SetPGID is not supported are not handled well. Use NOP ccws for path verification (sans path grouping) when SetPGID is not supported. 2. Check for PGIDs already set with SensePGID on _all_ paths (not just the first one) and try to find a common one. Moan if no common PGID can be found (and use NOP verification). If no PGIDs have been set, use the css global PGID (as before). (Rationale: SetPGID will get a command reject if the PGID it tries to set does not match the already set PGID.) 3. Immediately before reboot, issue RESET CHANNEL PATH (rcp) on all chpids. This will remove the old PGIDs. rcp will generate solicited CRWs which can be savely ignored by the machine check handler (all other actions create unsolicited CRWs). Signed-off-by: Cornelia Huck Signed-off-by: Martin Schwidefsky --- include/asm-s390/cio.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'include') diff --git a/include/asm-s390/cio.h b/include/asm-s390/cio.h index 2b161930635..28fdd6e2b8b 100644 --- a/include/asm-s390/cio.h +++ b/include/asm-s390/cio.h @@ -276,6 +276,8 @@ extern void wait_cons_dev(void); extern void clear_all_subchannels(void); +extern void cio_reset_channel_paths(void); + extern void css_schedule_reprobe(void); #endif -- cgit v1.2.3 From d2c993d845781d160a7ef759a3e65c6892c4a270 Mon Sep 17 00:00:00 2001 From: Heiko Carstens Date: Wed, 12 Jul 2006 16:41:55 +0200 Subject: [S390] Fix sparse warnings. Signed-off-by: Heiko Carstens Signed-off-by: Martin Schwidefsky --- include/asm-s390/ccwdev.h | 2 +- include/asm-s390/pgalloc.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'include') diff --git a/include/asm-s390/ccwdev.h b/include/asm-s390/ccwdev.h index 12456cb2f88..58c70acffc7 100644 --- a/include/asm-s390/ccwdev.h +++ b/include/asm-s390/ccwdev.h @@ -63,7 +63,7 @@ ccw_device_id_match(const struct ccw_device_id *array, return id; } - return 0; + return NULL; } /* The struct ccw device is our replacement for the globally accessible diff --git a/include/asm-s390/pgalloc.h b/include/asm-s390/pgalloc.h index 3002fda89d3..a78e853e0dd 100644 --- a/include/asm-s390/pgalloc.h +++ b/include/asm-s390/pgalloc.h @@ -142,7 +142,7 @@ pte_alloc_one(struct mm_struct *mm, unsigned long vmaddr) pte_t *pte = pte_alloc_one_kernel(mm, vmaddr); if (pte) return virt_to_page(pte); - return 0; + return NULL; } static inline void pte_free_kernel(pte_t *pte) -- cgit v1.2.3 From 562b590d4e838ecaca2cfd246fd4df55dc6db18a Mon Sep 17 00:00:00 2001 From: Clemens Ladisch Date: Wed, 5 Jul 2006 11:24:22 +0200 Subject: [ALSA] remove unused snd_minor.name field Drop the snd_minor structure's name field that was just a helper for devfs device deregistration. Signed-off-by: Clemens Ladisch Signed-off-by: Jaroslav Kysela --- include/sound/core.h | 2 -- 1 file changed, 2 deletions(-) (limited to 'include') diff --git a/include/sound/core.h b/include/sound/core.h index 5d184be0ff7..bab3ff457e4 100644 --- a/include/sound/core.h +++ b/include/sound/core.h @@ -188,8 +188,6 @@ struct snd_minor { int device; /* device number */ const struct file_operations *f_ops; /* file operations */ void *private_data; /* private data for f_ops->open */ - char name[0]; /* device name (keep at the end of - structure) */ }; /* sound.c */ -- cgit v1.2.3 From f40b68903ccd511ea9d658b4bce319dd032a265a Mon Sep 17 00:00:00 2001 From: Takashi Iwai Date: Wed, 5 Jul 2006 16:51:05 +0200 Subject: [ALSA] Fix section mismatch errors in ALSA PCI drivers Fixed 'section mismatch' errors in ALSA PCI drivers: - removed invalid __devinitdata from pci id tables - fix/remove __devinit of functions called in suspend/resume Signed-off-by: Takashi Iwai Signed-off-by: Jaroslav Kysela --- include/sound/cs46xx.h | 1 + 1 file changed, 1 insertion(+) (limited to 'include') diff --git a/include/sound/cs46xx.h b/include/sound/cs46xx.h index 80b2979c0cb..685928e6f65 100644 --- a/include/sound/cs46xx.h +++ b/include/sound/cs46xx.h @@ -1704,6 +1704,7 @@ struct snd_cs46xx { int acpi_port; struct snd_kcontrol *eapd_switch; /* for amplifier hack */ int accept_valid; /* accept mmap valid (for OSS) */ + int in_suspend; struct gameport *gameport; -- cgit v1.2.3 From f6dc8c5b8e04ce28720155383e971561a23899d5 Mon Sep 17 00:00:00 2001 From: Chase Venters Date: Sat, 8 Jul 2006 11:10:29 -0500 Subject: [PATCH] Make cpu_relax() imply barrier() on all arches During the recent discussion of taking 'volatile' off of the spinlock, I noticed that while most arches #define cpu_relax() such that it implies barrier(), some arches define cpu_relax() to be empty. This patch changes the definition of cpu_relax() for frv, h8300, m68knommu, sh, sh64, v850 and xtensa from an empty while(0) to the compiler barrier(). Signed-off-by: Chase Venters Acked-by: Arjan van de Ven Signed-off-by: Linus Torvalds --- include/asm-frv/processor.h | 3 ++- include/asm-h8300/processor.h | 3 ++- include/asm-m68knommu/processor.h | 3 ++- include/asm-sh/processor.h | 3 ++- include/asm-sh64/processor.h | 3 ++- include/asm-v850/processor.h | 3 ++- include/asm-xtensa/processor.h | 3 ++- 7 files changed, 14 insertions(+), 7 deletions(-) (limited to 'include') diff --git a/include/asm-frv/processor.h b/include/asm-frv/processor.h index 1c4dba1c5f5..3744f2e47f4 100644 --- a/include/asm-frv/processor.h +++ b/include/asm-frv/processor.h @@ -21,6 +21,7 @@ */ #define current_text_addr() ({ __label__ _l; _l: &&_l;}) +#include #include #include #include @@ -139,7 +140,7 @@ unsigned long get_wchan(struct task_struct *p); extern struct task_struct *alloc_task_struct(void); extern void free_task_struct(struct task_struct *p); -#define cpu_relax() do { } while (0) +#define cpu_relax() barrier() /* data cache prefetch */ #define ARCH_HAS_PREFETCH diff --git a/include/asm-h8300/processor.h b/include/asm-h8300/processor.h index c7e2f454b83..99b664aa208 100644 --- a/include/asm-h8300/processor.h +++ b/include/asm-h8300/processor.h @@ -17,6 +17,7 @@ */ #define current_text_addr() ({ __label__ _l; _l: &&_l;}) +#include #include #include #include @@ -129,6 +130,6 @@ unsigned long get_wchan(struct task_struct *p); eip; }) #define KSTK_ESP(tsk) ((tsk) == current ? rdusp() : (tsk)->thread.usp) -#define cpu_relax() do { } while (0) +#define cpu_relax() barrier() #endif diff --git a/include/asm-m68knommu/processor.h b/include/asm-m68knommu/processor.h index 0ee158e09ab..9d3a1bf4123 100644 --- a/include/asm-m68knommu/processor.h +++ b/include/asm-m68knommu/processor.h @@ -13,6 +13,7 @@ */ #define current_text_addr() ({ __label__ _l; _l: &&_l;}) +#include #include #include #include @@ -137,6 +138,6 @@ unsigned long get_wchan(struct task_struct *p); eip; }) #define KSTK_ESP(tsk) ((tsk) == current ? rdusp() : (tsk)->thread.usp) -#define cpu_relax() do { } while (0) +#define cpu_relax() barrier() #endif diff --git a/include/asm-sh/processor.h b/include/asm-sh/processor.h index fa5bd2d8803..eeb0f48bb99 100644 --- a/include/asm-sh/processor.h +++ b/include/asm-sh/processor.h @@ -9,6 +9,7 @@ #define __ASM_SH_PROCESSOR_H #ifdef __KERNEL__ +#include #include #include #include @@ -263,7 +264,7 @@ extern unsigned long get_wchan(struct task_struct *p); #define KSTK_ESP(tsk) ((tsk)->thread.sp) #define cpu_sleep() __asm__ __volatile__ ("sleep" : : : "memory") -#define cpu_relax() do { } while (0) +#define cpu_relax() barrier() #endif /* __KERNEL__ */ #endif /* __ASM_SH_PROCESSOR_H */ diff --git a/include/asm-sh64/processor.h b/include/asm-sh64/processor.h index 1bf252dad82..eb2bee4b47b 100644 --- a/include/asm-sh64/processor.h +++ b/include/asm-sh64/processor.h @@ -22,6 +22,7 @@ #include #include #include +#include /* * Default implementation of macro that returns current @@ -279,7 +280,7 @@ extern unsigned long get_wchan(struct task_struct *p); #define KSTK_EIP(tsk) ((tsk)->thread.pc) #define KSTK_ESP(tsk) ((tsk)->thread.sp) -#define cpu_relax() do { } while (0) +#define cpu_relax() barrier() #endif /* __ASSEMBLY__ */ #endif /* __ASM_SH64_PROCESSOR_H */ diff --git a/include/asm-v850/processor.h b/include/asm-v850/processor.h index 6965b66ccae..979e3467f9a 100644 --- a/include/asm-v850/processor.h +++ b/include/asm-v850/processor.h @@ -18,6 +18,7 @@ #include #endif +#include #include #include @@ -106,7 +107,7 @@ unsigned long get_wchan (struct task_struct *p); #define KSTK_ESP(task) task_sp (task) -#define cpu_relax() ((void)0) +#define cpu_relax() barrier() #else /* __ASSEMBLY__ */ diff --git a/include/asm-xtensa/processor.h b/include/asm-xtensa/processor.h index d1d72ad36f0..8b96e77c9d8 100644 --- a/include/asm-xtensa/processor.h +++ b/include/asm-xtensa/processor.h @@ -20,6 +20,7 @@ #include #include +#include #include #include #include @@ -191,7 +192,7 @@ extern unsigned long get_wchan(struct task_struct *p); #define KSTK_EIP(tsk) (task_pt_regs(tsk)->pc) #define KSTK_ESP(tsk) (task_pt_regs(tsk)->areg[1]) -#define cpu_relax() do { } while (0) +#define cpu_relax() barrier() /* Special register access. */ -- cgit v1.2.3 From c2ce920468624d87ec5f91f080ea99681dae6d88 Mon Sep 17 00:00:00 2001 From: Krzysztof Halasa Date: Wed, 12 Jul 2006 13:46:12 -0700 Subject: [WAN]: converting generic HDLC to use netif_dormant*() This patch converts generic HDLC (and WAN drivers using it) from hdlc_set_carrier() to netif_dormant*() interface. WAN hardware drivers should now use netif_carrier_on|off() like other network drivers. Signed-off-by: Krzysztof Halasa Signed-off-by: David S. Miller --- include/linux/hdlc.h | 2 -- 1 file changed, 2 deletions(-) (limited to 'include') diff --git a/include/linux/hdlc.h b/include/linux/hdlc.h index 4513f9e4093..d5ebbb29aea 100644 --- a/include/linux/hdlc.h +++ b/include/linux/hdlc.h @@ -224,8 +224,6 @@ static __inline__ void debug_frame(const struct sk_buff *skb) int hdlc_open(struct net_device *dev); /* Must be called by hardware driver when HDLC device is being closed */ void hdlc_close(struct net_device *dev); -/* Called by hardware driver when DCD line level changes */ -void hdlc_set_carrier(int on, struct net_device *dev); /* May be used by hardware driver to gain control over HDLC device */ static __inline__ void hdlc_proto_detach(hdlc_device *hdlc) -- cgit v1.2.3 From 8ced8eee8537b52ef5d77e28d7676ce81bc62359 Mon Sep 17 00:00:00 2001 From: Jean Delvare Date: Sat, 1 Jul 2006 17:12:53 +0200 Subject: [PATCH] i2c-powermac: Fix master_xfer return value Fix the value returned by the i2c-powermac's master_xfer method. It should return the number of messages processed successfully, but instead returns the number of data bytes in the first (and only) processed message. Also explicitly mention the master_xfer convention so that future implementations get it right directly. Signed-off-by: Jean Delvare Acked-by: Benjamin Herrenschmidt Signed-off-by: Greg Kroah-Hartman --- include/linux/i2c.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'include') diff --git a/include/linux/i2c.h b/include/linux/i2c.h index 526ddc8eecf..eb0628a7ecc 100644 --- a/include/linux/i2c.h +++ b/include/linux/i2c.h @@ -193,6 +193,8 @@ struct i2c_algorithm { to NULL. If an adapter algorithm can do SMBus access, set smbus_xfer. If set to NULL, the SMBus protocol is simulated using common I2C messages */ + /* master_xfer should return the number of messages successfully + processed, or a negative value on error */ int (*master_xfer)(struct i2c_adapter *adap,struct i2c_msg *msgs, int num); int (*smbus_xfer) (struct i2c_adapter *adap, u16 addr, -- cgit v1.2.3 From 7fac9a3348921e0fc626c7856ce3d1a9746b2b39 Mon Sep 17 00:00:00 2001 From: Randy Dunlap Date: Thu, 22 Jun 2006 15:12:41 -0700 Subject: [PATCH] USB: fix usb kernel-doc Warning(/var/linsrc/linux-2617-g4//include/linux/usb.h:66): No description found for parameter 'ep_dev' Signed-off-by: Randy Dunlap Signed-off-by: Greg Kroah-Hartman --- include/linux/usb.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include') diff --git a/include/linux/usb.h b/include/linux/usb.h index 8dead32e7eb..c944e8f06a4 100644 --- a/include/linux/usb.h +++ b/include/linux/usb.h @@ -48,7 +48,7 @@ struct ep_device; * @urb_list: urbs queued to this endpoint; maintained by usbcore * @hcpriv: for use by HCD; typically holds hardware dma queue head (QH) * with one or more transfer descriptors (TDs) per urb - * @kobj: kobject for sysfs info + * @ep_dev: ep_device for sysfs info * @extra: descriptors following this endpoint in the configuration * @extralen: how many bytes of "extra" are valid * -- cgit v1.2.3 From 5b5daf77a6250f2b1983d092d8237cb169488774 Mon Sep 17 00:00:00 2001 From: Inaky Perez-Gonzalez Date: Mon, 19 Jun 2006 18:19:01 -0700 Subject: [PATCH] USB: Add some basic WUSB definitions This patch adds basic Wireless USB 1.0 definitions to usb_ch9.h that fit into the existing set of declarations. Boils down to two new recipients for requests (ports and remote pipes), rpipe reset and abort request codes and wire adapter and remote pipe descriptor types. Wire adapters are the USB <-> Wireless USB adaptors; remote pipes are used by those adapters to pipe the host <-> endpoint traffic. Signed-off-by: Inaky Perez-Gonzalez Signed-off-by: Greg Kroah-Hartman --- include/linux/usb_ch9.h | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'include') diff --git a/include/linux/usb_ch9.h b/include/linux/usb_ch9.h index a2aacfc7af2..c720d107ff2 100644 --- a/include/linux/usb_ch9.h +++ b/include/linux/usb_ch9.h @@ -51,6 +51,9 @@ #define USB_RECIP_INTERFACE 0x01 #define USB_RECIP_ENDPOINT 0x02 #define USB_RECIP_OTHER 0x03 +/* From Wireless USB 1.0 */ +#define USB_RECIP_PORT 0x04 +#define USB_RECIP_RPIPE 0x05 /* * Standard requests, for the bRequest field of a SETUP packet. @@ -73,7 +76,9 @@ #define USB_REQ_SET_ENCRYPTION 0x0D /* Wireless USB */ #define USB_REQ_GET_ENCRYPTION 0x0E +#define USB_REQ_RPIPE_ABORT 0x0E #define USB_REQ_SET_HANDSHAKE 0x0F +#define USB_REQ_RPIPE_RESET 0x0F #define USB_REQ_GET_HANDSHAKE 0x10 #define USB_REQ_SET_CONNECTION 0x11 #define USB_REQ_SET_SECURITY_DATA 0x12 @@ -159,6 +164,8 @@ struct usb_ctrlrequest { #define USB_DT_BOS 0x0f #define USB_DT_DEVICE_CAPABILITY 0x10 #define USB_DT_WIRELESS_ENDPOINT_COMP 0x11 +#define USB_DT_WIRE_ADAPTER 0x21 +#define USB_DT_RPIPE 0x22 /* conventional codes for class-specific descriptors */ #define USB_DT_CS_DEVICE 0x21 -- cgit v1.2.3 From 883d989a7edf7a62e38e9150990b56209420e9e5 Mon Sep 17 00:00:00 2001 From: Phil Dibowitz Date: Sat, 24 Jun 2006 17:27:10 -0700 Subject: [PATCH] USB Storage: US_FL_MAX_SECTORS_64 flag This patch adds a US_FL_MAX_SECTORS_64 and removes the Genesys special-cases for this that were in scsiglue.c. It also adds the flag to other devices reported to need it. Signed-off-by: Phil Dibowitz Signed-off-by: Matthew Dharm Signed-off-by: Greg Kroah-Hartman --- include/linux/usb_usual.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'include') diff --git a/include/linux/usb_usual.h b/include/linux/usb_usual.h index 608487a62c9..f38f43f20fa 100644 --- a/include/linux/usb_usual.h +++ b/include/linux/usb_usual.h @@ -43,6 +43,8 @@ /* Need delay after Command phase */ \ US_FLAG(NO_WP_DETECT, 0x00000200) \ /* Don't check for write-protect */ \ + US_FLAG(MAX_SECTORS_64, 0x00000400) \ + /* Sets max_sectors to 64 */ #define US_FLAG(name, value) US_FL_##name = value , enum { US_DO_ALL_FLAGS }; -- cgit v1.2.3 From a353678d3136306c1d00f0d2319de1dac8a6b1db Mon Sep 17 00:00:00 2001 From: David Brownell Date: Thu, 6 Jul 2006 15:48:53 -0700 Subject: [PATCH] USB: gadget section fixups Recent section changes broke gadget builds on some platforms. This patch is the best fix that's available until better section markings exist: - There's a lot of cleanup code that gets used in both init and exit paths; stop marking it as "__exit". (Best fix for this would be an "__init_or_exit" section marking, putting the cleanup in __init when __exit sections get discarded else in __exit.) - Stop marking the use-once probe routines as "__init" since references to those routines are not allowed from driver structures. They're now marked "__devinit", which in practice is a net lose. (Best fix for this is likely to separate such use-once probe routines from the driver structure ... but in general, all busses that aren't hotpluggable will be forced to waste memory for all probe-only code.) In general these broken section rules waste an average of two to four kBytes per driver of code bloat ... because none of the relevant code can ever be reused after module initialization. Signed-off-by: David Brownell Signed-off-by: Greg Kroah-Hartman --- include/linux/usb_gadget.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'include') diff --git a/include/linux/usb_gadget.h b/include/linux/usb_gadget.h index 1d78870ed8a..e17186dbcdc 100644 --- a/include/linux/usb_gadget.h +++ b/include/linux/usb_gadget.h @@ -872,9 +872,9 @@ int usb_gadget_config_buf(const struct usb_config_descriptor *config, /* utility wrapping a simple endpoint selection policy */ extern struct usb_ep *usb_ep_autoconfig (struct usb_gadget *, - struct usb_endpoint_descriptor *) __init; + struct usb_endpoint_descriptor *) __devinit; -extern void usb_ep_autoconfig_reset (struct usb_gadget *) __init; +extern void usb_ep_autoconfig_reset (struct usb_gadget *) __devinit; #endif /* __KERNEL__ */ -- cgit v1.2.3 From a969888ce91673c7f4b86520d851a6f0d5a5fa7d Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Tue, 11 Jul 2006 21:22:58 -0700 Subject: [PATCH] USB: move usb-serial.h to include/linux/usb/ USB serial outside of the kernel tree can not build properly due to usb-serial.h being buried down in the source tree. This patch moves the location of the file to include/linux/usb and fixes up all of the usb serial drivers to handle the move properly. Cc: Sergei Organov Signed-off-by: Greg Kroah-Hartman --- include/linux/usb/serial.h | 300 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 300 insertions(+) create mode 100644 include/linux/usb/serial.h (limited to 'include') diff --git a/include/linux/usb/serial.h b/include/linux/usb/serial.h new file mode 100644 index 00000000000..91c983eef89 --- /dev/null +++ b/include/linux/usb/serial.h @@ -0,0 +1,300 @@ +/* + * USB Serial Converter stuff + * + * Copyright (C) 1999 - 2005 + * Greg Kroah-Hartman (greg@kroah.com) + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; version 2 of the License. + * + */ + + +#ifndef __LINUX_USB_SERIAL_H +#define __LINUX_USB_SERIAL_H + +#include +#include + +#define SERIAL_TTY_MAJOR 188 /* Nice legal number now */ +#define SERIAL_TTY_MINORS 255 /* loads of devices :) */ + +#define MAX_NUM_PORTS 8 /* The maximum number of ports one device can grab at once */ + +/* parity check flag */ +#define RELEVANT_IFLAG(iflag) (iflag & (IGNBRK|BRKINT|IGNPAR|PARMRK|INPCK)) + +/** + * usb_serial_port: structure for the specific ports of a device. + * @serial: pointer back to the struct usb_serial owner of this port. + * @tty: pointer to the corresponding tty for this port. + * @lock: spinlock to grab when updating portions of this structure. + * @mutex: mutex used to synchronize serial_open() and serial_close() + * access for this port. + * @number: the number of the port (the minor number). + * @interrupt_in_buffer: pointer to the interrupt in buffer for this port. + * @interrupt_in_urb: pointer to the interrupt in struct urb for this port. + * @interrupt_in_endpointAddress: endpoint address for the interrupt in pipe + * for this port. + * @interrupt_out_buffer: pointer to the interrupt out buffer for this port. + * @interrupt_out_size: the size of the interrupt_out_buffer, in bytes. + * @interrupt_out_urb: pointer to the interrupt out struct urb for this port. + * @interrupt_out_endpointAddress: endpoint address for the interrupt out pipe + * for this port. + * @bulk_in_buffer: pointer to the bulk in buffer for this port. + * @read_urb: pointer to the bulk in struct urb for this port. + * @bulk_in_endpointAddress: endpoint address for the bulk in pipe for this + * port. + * @bulk_out_buffer: pointer to the bulk out buffer for this port. + * @bulk_out_size: the size of the bulk_out_buffer, in bytes. + * @write_urb: pointer to the bulk out struct urb for this port. + * @bulk_out_endpointAddress: endpoint address for the bulk out pipe for this + * port. + * @write_wait: a wait_queue_head_t used by the port. + * @work: work queue entry for the line discipline waking up. + * @open_count: number of times this port has been opened. + * + * This structure is used by the usb-serial core and drivers for the specific + * ports of a device. + */ +struct usb_serial_port { + struct usb_serial * serial; + struct tty_struct * tty; + spinlock_t lock; + struct mutex mutex; + unsigned char number; + + unsigned char * interrupt_in_buffer; + struct urb * interrupt_in_urb; + __u8 interrupt_in_endpointAddress; + + unsigned char * interrupt_out_buffer; + int interrupt_out_size; + struct urb * interrupt_out_urb; + __u8 interrupt_out_endpointAddress; + + unsigned char * bulk_in_buffer; + int bulk_in_size; + struct urb * read_urb; + __u8 bulk_in_endpointAddress; + + unsigned char * bulk_out_buffer; + int bulk_out_size; + struct urb * write_urb; + int write_urb_busy; + __u8 bulk_out_endpointAddress; + + wait_queue_head_t write_wait; + struct work_struct work; + int open_count; + struct device dev; +}; +#define to_usb_serial_port(d) container_of(d, struct usb_serial_port, dev) + +/* get and set the port private data pointer helper functions */ +static inline void *usb_get_serial_port_data (struct usb_serial_port *port) +{ + return dev_get_drvdata(&port->dev); +} + +static inline void usb_set_serial_port_data (struct usb_serial_port *port, void *data) +{ + dev_set_drvdata(&port->dev, data); +} + +/** + * usb_serial - structure used by the usb-serial core for a device + * @dev: pointer to the struct usb_device for this device + * @type: pointer to the struct usb_serial_driver for this device + * @interface: pointer to the struct usb_interface for this device + * @minor: the starting minor number for this device + * @num_ports: the number of ports this device has + * @num_interrupt_in: number of interrupt in endpoints we have + * @num_interrupt_out: number of interrupt out endpoints we have + * @num_bulk_in: number of bulk in endpoints we have + * @num_bulk_out: number of bulk out endpoints we have + * @port: array of struct usb_serial_port structures for the different ports. + * @private: place to put any driver specific information that is needed. The + * usb-serial driver is required to manage this data, the usb-serial core + * will not touch this. Use usb_get_serial_data() and + * usb_set_serial_data() to access this. + */ +struct usb_serial { + struct usb_device * dev; + struct usb_serial_driver * type; + struct usb_interface * interface; + unsigned char minor; + unsigned char num_ports; + unsigned char num_port_pointers; + char num_interrupt_in; + char num_interrupt_out; + char num_bulk_in; + char num_bulk_out; + struct usb_serial_port * port[MAX_NUM_PORTS]; + struct kref kref; + void * private; +}; +#define to_usb_serial(d) container_of(d, struct usb_serial, kref) + +#define NUM_DONT_CARE (-1) + +/* get and set the serial private data pointer helper functions */ +static inline void *usb_get_serial_data (struct usb_serial *serial) +{ + return serial->private; +} + +static inline void usb_set_serial_data (struct usb_serial *serial, void *data) +{ + serial->private = data; +} + +/** + * usb_serial_driver - describes a usb serial driver + * @description: pointer to a string that describes this driver. This string used + * in the syslog messages when a device is inserted or removed. + * @id_table: pointer to a list of usb_device_id structures that define all + * of the devices this structure can support. + * @num_interrupt_in: the number of interrupt in endpoints this device will + * have. + * @num_interrupt_out: the number of interrupt out endpoints this device will + * have. + * @num_bulk_in: the number of bulk in endpoints this device will have. + * @num_bulk_out: the number of bulk out endpoints this device will have. + * @num_ports: the number of different ports this device will have. + * @calc_num_ports: pointer to a function to determine how many ports this + * device has dynamically. It will be called after the probe() + * callback is called, but before attach() + * @probe: pointer to the driver's probe function. + * This will be called when the device is inserted into the system, + * but before the device has been fully initialized by the usb_serial + * subsystem. Use this function to download any firmware to the device, + * or any other early initialization that might be needed. + * Return 0 to continue on with the initialization sequence. Anything + * else will abort it. + * @attach: pointer to the driver's attach function. + * This will be called when the struct usb_serial structure is fully set + * set up. Do any local initialization of the device, or any private + * memory structure allocation at this point in time. + * @shutdown: pointer to the driver's shutdown function. This will be + * called when the device is removed from the system. + * + * This structure is defines a USB Serial driver. It provides all of + * the information that the USB serial core code needs. If the function + * pointers are defined, then the USB serial core code will call them when + * the corresponding tty port functions are called. If they are not + * called, the generic serial function will be used instead. + * + * The driver.owner field should be set to the module owner of this driver. + * The driver.name field should be set to the name of this driver (remember + * it will show up in sysfs, so it needs to be short and to the point. + * Useing the module name is a good idea.) + */ +struct usb_serial_driver { + const char *description; + const struct usb_device_id *id_table; + char num_interrupt_in; + char num_interrupt_out; + char num_bulk_in; + char num_bulk_out; + char num_ports; + + struct list_head driver_list; + struct device_driver driver; + + int (*probe) (struct usb_serial *serial, const struct usb_device_id *id); + int (*attach) (struct usb_serial *serial); + int (*calc_num_ports) (struct usb_serial *serial); + + void (*shutdown) (struct usb_serial *serial); + + int (*port_probe) (struct usb_serial_port *port); + int (*port_remove) (struct usb_serial_port *port); + + /* serial function calls */ + int (*open) (struct usb_serial_port *port, struct file * filp); + void (*close) (struct usb_serial_port *port, struct file * filp); + int (*write) (struct usb_serial_port *port, const unsigned char *buf, int count); + int (*write_room) (struct usb_serial_port *port); + int (*ioctl) (struct usb_serial_port *port, struct file * file, unsigned int cmd, unsigned long arg); + void (*set_termios) (struct usb_serial_port *port, struct termios * old); + void (*break_ctl) (struct usb_serial_port *port, int break_state); + int (*chars_in_buffer) (struct usb_serial_port *port); + void (*throttle) (struct usb_serial_port *port); + void (*unthrottle) (struct usb_serial_port *port); + int (*tiocmget) (struct usb_serial_port *port, struct file *file); + int (*tiocmset) (struct usb_serial_port *port, struct file *file, unsigned int set, unsigned int clear); + + void (*read_int_callback)(struct urb *urb, struct pt_regs *regs); + void (*write_int_callback)(struct urb *urb, struct pt_regs *regs); + void (*read_bulk_callback)(struct urb *urb, struct pt_regs *regs); + void (*write_bulk_callback)(struct urb *urb, struct pt_regs *regs); +}; +#define to_usb_serial_driver(d) container_of(d, struct usb_serial_driver, driver) + +extern int usb_serial_register(struct usb_serial_driver *driver); +extern void usb_serial_deregister(struct usb_serial_driver *driver); +extern void usb_serial_port_softint(struct usb_serial_port *port); + +extern int usb_serial_probe(struct usb_interface *iface, const struct usb_device_id *id); +extern void usb_serial_disconnect(struct usb_interface *iface); + +extern int ezusb_writememory (struct usb_serial *serial, int address, unsigned char *data, int length, __u8 bRequest); +extern int ezusb_set_reset (struct usb_serial *serial, unsigned char reset_bit); + +/* USB Serial console functions */ +#ifdef CONFIG_USB_SERIAL_CONSOLE +extern void usb_serial_console_init (int debug, int minor); +extern void usb_serial_console_exit (void); +extern void usb_serial_console_disconnect(struct usb_serial *serial); +#else +static inline void usb_serial_console_init (int debug, int minor) { } +static inline void usb_serial_console_exit (void) { } +static inline void usb_serial_console_disconnect(struct usb_serial *serial) {} +#endif + +/* Functions needed by other parts of the usbserial core */ +extern struct usb_serial *usb_serial_get_by_index (unsigned int minor); +extern void usb_serial_put(struct usb_serial *serial); +extern int usb_serial_generic_open (struct usb_serial_port *port, struct file *filp); +extern int usb_serial_generic_write (struct usb_serial_port *port, const unsigned char *buf, int count); +extern void usb_serial_generic_close (struct usb_serial_port *port, struct file *filp); +extern int usb_serial_generic_write_room (struct usb_serial_port *port); +extern int usb_serial_generic_chars_in_buffer (struct usb_serial_port *port); +extern void usb_serial_generic_read_bulk_callback (struct urb *urb, struct pt_regs *regs); +extern void usb_serial_generic_write_bulk_callback (struct urb *urb, struct pt_regs *regs); +extern void usb_serial_generic_shutdown (struct usb_serial *serial); +extern int usb_serial_generic_register (int debug); +extern void usb_serial_generic_deregister (void); + +extern int usb_serial_bus_register (struct usb_serial_driver *device); +extern void usb_serial_bus_deregister (struct usb_serial_driver *device); + +extern struct usb_serial_driver usb_serial_generic_device; +extern struct bus_type usb_serial_bus_type; +extern struct tty_driver *usb_serial_tty_driver; + +static inline void usb_serial_debug_data(int debug, + struct device *dev, + const char *function, int size, + const unsigned char *data) +{ + int i; + + if (debug) { + dev_printk(KERN_DEBUG, dev, "%s - length = %d, data = ", function, size); + for (i = 0; i < size; ++i) + printk ("%.2x ", data[i]); + printk ("\n"); + } +} + +/* Use our own dbg macro */ +#undef dbg +#define dbg(format, arg...) do { if (debug) printk(KERN_DEBUG "%s: " format "\n" , __FILE__ , ## arg); } while (0) + + + +#endif /* ifdef __LINUX_USB_SERIAL_H */ + -- cgit v1.2.3 From 6f0312fd7e0e6f96fd847b0b2e1e0d2d2e8ef89d Mon Sep 17 00:00:00 2001 From: "Zhang, Yanmin" Date: Wed, 12 Jul 2006 09:41:47 +0800 Subject: [PATCH] PCI: add PCI Express AER register definitions to pci_regs.h Add new defines of PCI-Express AER registers and their bits into file include/linux/pci_regs.h. Signed-off-by: Zhang Yanmin Signed-off-by: Greg Kroah-Hartman --- include/linux/pci_regs.h | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'include') diff --git a/include/linux/pci_regs.h b/include/linux/pci_regs.h index 6bce4a24036..96930cb5927 100644 --- a/include/linux/pci_regs.h +++ b/include/linux/pci_regs.h @@ -422,7 +422,23 @@ #define PCI_ERR_CAP_ECRC_CHKE 0x00000100 /* ECRC Check Enable */ #define PCI_ERR_HEADER_LOG 28 /* Header Log Register (16 bytes) */ #define PCI_ERR_ROOT_COMMAND 44 /* Root Error Command */ +/* Correctable Err Reporting Enable */ +#define PCI_ERR_ROOT_CMD_COR_EN 0x00000001 +/* Non-fatal Err Reporting Enable */ +#define PCI_ERR_ROOT_CMD_NONFATAL_EN 0x00000002 +/* Fatal Err Reporting Enable */ +#define PCI_ERR_ROOT_CMD_FATAL_EN 0x00000004 #define PCI_ERR_ROOT_STATUS 48 +#define PCI_ERR_ROOT_COR_RCV 0x00000001 /* ERR_COR Received */ +/* Multi ERR_COR Received */ +#define PCI_ERR_ROOT_MULTI_COR_RCV 0x00000002 +/* ERR_FATAL/NONFATAL Recevied */ +#define PCI_ERR_ROOT_UNCOR_RCV 0x00000004 +/* Multi ERR_FATAL/NONFATAL Recevied */ +#define PCI_ERR_ROOT_MULTI_UNCOR_RCV 0x00000008 +#define PCI_ERR_ROOT_FIRST_FATAL 0x00000010 /* First Fatal */ +#define PCI_ERR_ROOT_NONFATAL_RCV 0x00000020 /* Non-Fatal Received */ +#define PCI_ERR_ROOT_FATAL_RCV 0x00000040 /* Fatal Received */ #define PCI_ERR_ROOT_COR_SRC 52 #define PCI_ERR_ROOT_SRC 54 -- cgit v1.2.3 From ffadcc2ff42ecedf71ea67d9051ff028927aed08 Mon Sep 17 00:00:00 2001 From: Kristen Carlson Accardi Date: Wed, 12 Jul 2006 08:59:00 -0700 Subject: [PATCH] PCI: PCIE power management quirk When changing power states from D0->DX and then from DX->D0, some Intel PCIE chipsets will cause a device reset to occur. This will cause problems for any D State other than D3, since any state information that the driver will expect to be present coming from a D1 or D2 state will have been cleared. This patch addes a flag to the pci_dev structure to indicate that devices should not use states D1 or D2, and will set that flag for the affected chipsets. This patch also modifies pci_set_power_state() so that when a device driver tries to set the power state on a device that is downstream from an affected chipset, or on one of the affected devices it only allows state changes to or from D0 & D3. In addition, this patch allows the delay time between D3->D0 to be changed via a quirk. These chipsets also need additional time to change states beyond the normal 10ms. Signed-off-by: Kristen Carlson Accardi Signed-off-by: Greg Kroah-Hartman --- include/linux/pci.h | 1 + 1 file changed, 1 insertion(+) (limited to 'include') diff --git a/include/linux/pci.h b/include/linux/pci.h index 983fca251b2..8565b81d7fb 100644 --- a/include/linux/pci.h +++ b/include/linux/pci.h @@ -161,6 +161,7 @@ struct pci_dev { unsigned int is_enabled:1; /* pci_enable_device has been called */ unsigned int is_busmaster:1; /* device is busmaster */ unsigned int no_msi:1; /* device may not use msi */ + unsigned int no_d1d2:1; /* only allow d0 or d3 */ unsigned int block_ucfg_access:1; /* userspace config space access is blocked */ unsigned int broken_parity_status:1; /* Device generates false positive parity */ unsigned int msi_enabled:1; -- cgit v1.2.3 From 26865e9c26d2d336f385b821b531ce2b31008e20 Mon Sep 17 00:00:00 2001 From: Adrian Bunk Date: Fri, 30 Jun 2006 02:15:43 -0700 Subject: [PATCH] remove kernel/power/pm.c:pm_unregister_all() Remove the deprecated and no longer used pm_unregister_all(). Signed-off-by: Adrian Bunk Acked-by: Pavel Machek Signed-off-by: Andrew Morton Signed-off-by: Greg Kroah-Hartman --- include/linux/pm_legacy.h | 7 ------- 1 file changed, 7 deletions(-) (limited to 'include') diff --git a/include/linux/pm_legacy.h b/include/linux/pm_legacy.h index 78027c533b9..514729a4468 100644 --- a/include/linux/pm_legacy.h +++ b/include/linux/pm_legacy.h @@ -14,11 +14,6 @@ extern int pm_active; struct pm_dev __deprecated * pm_register(pm_dev_t type, unsigned long id, pm_callback callback); -/* - * Unregister all devices with matching callback - */ -void __deprecated pm_unregister_all(pm_callback callback); - /* * Send a request to all devices */ @@ -35,8 +30,6 @@ static inline struct pm_dev *pm_register(pm_dev_t type, return NULL; } -static inline void pm_unregister_all(pm_callback callback) {} - static inline int pm_send_all(pm_request_t rqst, void *data) { return 0; -- cgit v1.2.3 From cd6ef2ada54aa4788d5a3dee3cffaad41383a52a Mon Sep 17 00:00:00 2001 From: Adrian Bunk Date: Fri, 30 Jun 2006 02:15:42 -0700 Subject: [PATCH] The scheduled unexport of insert_resource Implement the scheduled unexport of insert_resource. Signed-off-by: Adrian Bunk Signed-off-by: Andrew Morton Signed-off-by: Greg Kroah-Hartman --- include/linux/ioport.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include') diff --git a/include/linux/ioport.h b/include/linux/ioport.h index 5612dfeeae5..d42c8339907 100644 --- a/include/linux/ioport.h +++ b/include/linux/ioport.h @@ -97,7 +97,7 @@ extern struct resource iomem_resource; extern int request_resource(struct resource *root, struct resource *new); extern struct resource * ____request_resource(struct resource *root, struct resource *new); extern int release_resource(struct resource *new); -extern __deprecated_for_modules int insert_resource(struct resource *parent, struct resource *new); +extern int insert_resource(struct resource *parent, struct resource *new); extern int allocate_resource(struct resource *root, struct resource *new, resource_size_t size, resource_size_t min, resource_size_t max, resource_size_t align, -- cgit v1.2.3 From 50f73fe026b2bda49e53cef2dd57a79f84879733 Mon Sep 17 00:00:00 2001 From: David Woodhouse Date: Wed, 12 Jul 2006 13:56:53 -0700 Subject: [SPARC64]: Fix make headers_install A minor typo in the include/asm-sparc64/Kbuild file prevents the make headers_install from building a useful tree of kernel headers for sparc64. Signed-off-by: David Woodhouse Signed-off-by: Tom "spot" Callaway Signed-off-by: David S. Miller --- include/asm-sparc64/Kbuild | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include') diff --git a/include/asm-sparc64/Kbuild b/include/asm-sparc64/Kbuild index c78d44bb195..9284c3cb27e 100644 --- a/include/asm-sparc64/Kbuild +++ b/include/asm-sparc64/Kbuild @@ -4,7 +4,7 @@ ALTARCH := sparc ARCHDEF := defined __sparc__ && defined __arch64__ ALTARCHDEF := defined __sparc__ && !defined __arch64__ -unifdef-y := fbio.h perfctr.h +unifdef-y += fbio.h perfctr.h header-y += apb.h asi.h bbc.h bpp.h display7seg.h envctrl.h floppy.h \ ipc.h kdebug.h mostek.h openprom.h openpromio.h parport.h \ pconf.h psrcompat.h pstate.h reg.h uctx.h utrap.h watchdog.h -- cgit v1.2.3 From b43c7cec6bf9558336fb033d1217fc765d259c47 Mon Sep 17 00:00:00 2001 From: Chuck Ebbert <76306.1226@compuserve.com> Date: Wed, 12 Jul 2006 16:41:15 -0400 Subject: [PATCH] i386: system.h: remove extra semicolons and fix order include/asm-i386/system.h has trailing semicolons in some of the macros that cause legitimate code to fail compilation, so remove them. Also remove extra blank lines within one group of macros. And put stts() and clts() back together; they got separated somehow. Signed-off-by: Chuck Ebbert <76306.1226@compuserve.com> Signed-off-by: Linus Torvalds --- include/asm-i386/system.h | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) (limited to 'include') diff --git a/include/asm-i386/system.h b/include/asm-i386/system.h index db398d88b1d..2db168ef949 100644 --- a/include/asm-i386/system.h +++ b/include/asm-i386/system.h @@ -82,10 +82,6 @@ __asm__ __volatile__ ("movw %%dx,%1\n\t" \ #define savesegment(seg, value) \ asm volatile("mov %%" #seg ",%0":"=rm" (value)) -/* - * Clear and set 'TS' bit respectively - */ -#define clts() __asm__ __volatile__ ("clts") #define read_cr0() ({ \ unsigned int __dummy; \ __asm__ __volatile__( \ @@ -94,7 +90,7 @@ __asm__ __volatile__ ("movw %%dx,%1\n\t" \ __dummy; \ }) #define write_cr0(x) \ - __asm__ __volatile__("movl %0,%%cr0": :"r" (x)); + __asm__ __volatile__("movl %0,%%cr0": :"r" (x)) #define read_cr2() ({ \ unsigned int __dummy; \ @@ -104,7 +100,7 @@ __asm__ __volatile__ ("movw %%dx,%1\n\t" \ __dummy; \ }) #define write_cr2(x) \ - __asm__ __volatile__("movl %0,%%cr2": :"r" (x)); + __asm__ __volatile__("movl %0,%%cr2": :"r" (x)) #define read_cr3() ({ \ unsigned int __dummy; \ @@ -114,7 +110,7 @@ __asm__ __volatile__ ("movw %%dx,%1\n\t" \ __dummy; \ }) #define write_cr3(x) \ - __asm__ __volatile__("movl %0,%%cr3": :"r" (x)); + __asm__ __volatile__("movl %0,%%cr3": :"r" (x)) #define read_cr4() ({ \ unsigned int __dummy; \ @@ -123,7 +119,6 @@ __asm__ __volatile__ ("movw %%dx,%1\n\t" \ :"=r" (__dummy)); \ __dummy; \ }) - #define read_cr4_safe() ({ \ unsigned int __dummy; \ /* This could fault if %cr4 does not exist */ \ @@ -135,15 +130,19 @@ __asm__ __volatile__ ("movw %%dx,%1\n\t" \ : "=r" (__dummy): "0" (0)); \ __dummy; \ }) - #define write_cr4(x) \ - __asm__ __volatile__("movl %0,%%cr4": :"r" (x)); + __asm__ __volatile__("movl %0,%%cr4": :"r" (x)) + +/* + * Clear and set 'TS' bit respectively + */ +#define clts() __asm__ __volatile__ ("clts") #define stts() write_cr0(8 | read_cr0()) #endif /* __KERNEL__ */ #define wbinvd() \ - __asm__ __volatile__ ("wbinvd": : :"memory"); + __asm__ __volatile__ ("wbinvd": : :"memory") static inline unsigned long get_limit(unsigned long segment) { -- cgit v1.2.3 From 1b0f06d0b4860a8a73dc0b48540d82d8897ead71 Mon Sep 17 00:00:00 2001 From: Greg Ungerer Date: Thu, 13 Jul 2006 09:32:41 +1000 Subject: [PATCH] m68knommu: fix result type in get_user() macro Keep the result holder variable the same type as the quantity we are retreiving in the get_user() macro - don't go through a pointer version of the user space address type. Using the address type causes problems if the address type was const (newer versions of gcc quite rightly error out for that condition). Signed-off-by: Greg Ungerer Signed-off-by: Linus Torvalds --- include/asm-m68knommu/uaccess.h | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'include') diff --git a/include/asm-m68knommu/uaccess.h b/include/asm-m68knommu/uaccess.h index 05be9515a2d..62b29b10bc6 100644 --- a/include/asm-m68knommu/uaccess.h +++ b/include/asm-m68knommu/uaccess.h @@ -93,7 +93,7 @@ extern int __put_user_bad(void); #define get_user(x, ptr) \ ({ \ int __gu_err = 0; \ - typeof(*(ptr)) __gu_val = 0; \ + typeof(x) __gu_val = 0; \ switch (sizeof(*(ptr))) { \ case 1: \ __get_user_asm(__gu_err, __gu_val, ptr, b, "=d"); \ @@ -105,23 +105,23 @@ extern int __put_user_bad(void); __get_user_asm(__gu_err, __gu_val, ptr, l, "=r"); \ break; \ case 8: \ - memcpy(&__gu_val, ptr, sizeof (*(ptr))); \ + memcpy((void *) &__gu_val, ptr, sizeof (*(ptr))); \ break; \ default: \ __gu_val = 0; \ __gu_err = __get_user_bad(); \ break; \ } \ - (x) = __gu_val; \ + (x) = (typeof(*(ptr))) __gu_val; \ __gu_err; \ }) #define __get_user(x, ptr) get_user(x, ptr) extern int __get_user_bad(void); -#define __get_user_asm(err,x,ptr,bwl,reg) \ - __asm__ ("move" #bwl " %1,%0" \ - : "=d" (x) \ +#define __get_user_asm(err,x,ptr,bwl,reg) \ + __asm__ ("move" #bwl " %1,%0" \ + : "=d" (x) \ : "m" (*__ptr(ptr))) #define copy_from_user(to, from, n) (memcpy(to, from, n), 0) -- cgit v1.2.3 From 3e705f279a942471b258b1c7a9e54aa8ff36b89f Mon Sep 17 00:00:00 2001 From: Russell King Date: Thu, 13 Jul 2006 20:48:35 +0100 Subject: [PATCH] Fix broken kernel headers preventing ARM build As a result of 894673ee6122a3ce1958e1fe096901ba5356a96b, the ARM architecture is more or less unbuildable - only one defconfig appears to build, with all others erroring out with: CC arch/arm/kernel/setup.o In file included from /home/rmk/git/linux-2.6-rmk/arch/arm/kernel/setup.c:22: /home/rmk/git/linux-2.6-rmk/include/linux/root_dev.h:7: warning: implicit declaration of function `MKDEV' ... Essentially, root_dev.h uses MKDEV and dev_t, but does not include any headers which provide either of these definitions. The reason it worked previously is that linux/tty.h just happened to include the required headers for linux/root_dev.h. Signed-off-by: Russell King Signed-off-by: Linus Torvalds --- include/linux/root_dev.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'include') diff --git a/include/linux/root_dev.h b/include/linux/root_dev.h index ea4bc9d1373..ed241aad7c1 100644 --- a/include/linux/root_dev.h +++ b/include/linux/root_dev.h @@ -2,6 +2,8 @@ #define _ROOT_DEV_H_ #include +#include +#include enum { Root_NFS = MKDEV(UNNAMED_MAJOR, 255), -- cgit v1.2.3 From 2e128dedcd66d2f17f42a45dacc223fa2dcd8acd Mon Sep 17 00:00:00 2001 From: Chris Dearman Date: Fri, 30 Jun 2006 12:32:37 +0100 Subject: [MIPS] Default cpu_has_mipsmt to a runtime check Signed-off-by: Chris Dearman Signed-off-by: Ralf Baechle --- include/asm-mips/cpu-features.h | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) (limited to 'include') diff --git a/include/asm-mips/cpu-features.h b/include/asm-mips/cpu-features.h index 44285a9d552..3c2fc2b647c 100644 --- a/include/asm-mips/cpu-features.h +++ b/include/asm-mips/cpu-features.h @@ -143,12 +143,8 @@ #define cpu_has_dsp (cpu_data[0].ases & MIPS_ASE_DSP) #endif -#ifdef CONFIG_MIPS_MT #ifndef cpu_has_mipsmt -# define cpu_has_mipsmt (cpu_data[0].ases & MIPS_ASE_MIPSMT) -#endif -#else -# define cpu_has_mipsmt 0 +#define cpu_has_mipsmt (cpu_data[0].ases & MIPS_ASE_MIPSMT) #endif #ifdef CONFIG_32BIT -- cgit v1.2.3 From e1e80b4d24eddd1a76cd386e25164cf159661bd6 Mon Sep 17 00:00:00 2001 From: Ralf Baechle Date: Sat, 1 Jul 2006 22:07:23 +0100 Subject: [MIPS] Don't include obsolete . Signed-off-by: Ralf Baechle --- include/asm-mips/apm.h | 1 - include/asm-mips/mach-excite/excite.h | 1 - 2 files changed, 2 deletions(-) (limited to 'include') diff --git a/include/asm-mips/apm.h b/include/asm-mips/apm.h index e8c69208f63..4b99ffc1152 100644 --- a/include/asm-mips/apm.h +++ b/include/asm-mips/apm.h @@ -13,7 +13,6 @@ #ifndef MIPS_ASM_SA1100_APM_H #define MIPS_ASM_SA1100_APM_H -#include #include /* diff --git a/include/asm-mips/mach-excite/excite.h b/include/asm-mips/mach-excite/excite.h index c52610de2b3..130bd4b8edc 100644 --- a/include/asm-mips/mach-excite/excite.h +++ b/include/asm-mips/mach-excite/excite.h @@ -1,7 +1,6 @@ #ifndef __EXCITE_H__ #define __EXCITE_H__ -#include #include #include #include -- cgit v1.2.3 From 722cfd90420b660ad13f933efb135daf1d0e5400 Mon Sep 17 00:00:00 2001 From: Ralf Baechle Date: Sun, 2 Jul 2006 16:31:14 +0100 Subject: [MIPS] Wire up vmsplice(2) and move_pages(2). Signed-off-by: Ralf Baechle --- include/asm-mips/unistd.h | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) (limited to 'include') diff --git a/include/asm-mips/unistd.h b/include/asm-mips/unistd.h index 809f9f55bac..610ccb8a50b 100644 --- a/include/asm-mips/unistd.h +++ b/include/asm-mips/unistd.h @@ -327,16 +327,18 @@ #define __NR_splice (__NR_Linux + 304) #define __NR_sync_file_range (__NR_Linux + 305) #define __NR_tee (__NR_Linux + 306) +#define __NR_vmsplice (__NR_Linux + 307) +#define __NR_move_pages (__NR_Linux + 308) /* * Offset of the last Linux o32 flavoured syscall */ -#define __NR_Linux_syscalls 306 +#define __NR_Linux_syscalls 308 #endif /* _MIPS_SIM == _MIPS_SIM_ABI32 */ #define __NR_O32_Linux 4000 -#define __NR_O32_Linux_syscalls 306 +#define __NR_O32_Linux_syscalls 308 #if _MIPS_SIM == _MIPS_SIM_ABI64 @@ -610,16 +612,18 @@ #define __NR_splice (__NR_Linux + 263) #define __NR_sync_file_range (__NR_Linux + 264) #define __NR_tee (__NR_Linux + 265) +#define __NR_vmsplice (__NR_Linux + 266) +#define __NR_move_pages (__NR_Linux + 267) /* * Offset of the last Linux 64-bit flavoured syscall */ -#define __NR_Linux_syscalls 265 +#define __NR_Linux_syscalls 267 #endif /* _MIPS_SIM == _MIPS_SIM_ABI64 */ #define __NR_64_Linux 5000 -#define __NR_64_Linux_syscalls 265 +#define __NR_64_Linux_syscalls 267 #if _MIPS_SIM == _MIPS_SIM_NABI32 @@ -897,16 +901,18 @@ #define __NR_splice (__NR_Linux + 267) #define __NR_sync_file_range (__NR_Linux + 268) #define __NR_tee (__NR_Linux + 269) +#define __NR_vmsplice (__NR_Linux + 270) +#define __NR_move_pages (__NR_Linux + 271) /* * Offset of the last N32 flavoured syscall */ -#define __NR_Linux_syscalls 269 +#define __NR_Linux_syscalls 271 #endif /* _MIPS_SIM == _MIPS_SIM_NABI32 */ #define __NR_N32_Linux 6000 -#define __NR_N32_Linux_syscalls 269 +#define __NR_N32_Linux_syscalls 271 #ifdef __KERNEL__ -- cgit v1.2.3 From a722df087dc745a213573ed860be57a255e799bb Mon Sep 17 00:00:00 2001 From: Yoichi Yuasa Date: Sun, 2 Jul 2006 23:13:34 +0900 Subject: [MIPS] vr41xx: Removed unused definitions for NEC CMBVR4133. Signed-off-by: Yoichi Yuasa Signed-off-by: Ralf Baechle --- include/asm-mips/vr41xx/cmbvr4133.h | 3 --- 1 file changed, 3 deletions(-) (limited to 'include') diff --git a/include/asm-mips/vr41xx/cmbvr4133.h b/include/asm-mips/vr41xx/cmbvr4133.h index 42af389019e..3fbfde19c80 100644 --- a/include/asm-mips/vr41xx/cmbvr4133.h +++ b/include/asm-mips/vr41xx/cmbvr4133.h @@ -55,7 +55,4 @@ #define IDE_SECONDARY_IRQ I8259_IRQ(15) #define I8259_IRQ_LAST IDE_SECONDARY_IRQ -#define RTC_PORT(x) (0xaf000100 + (x)) -#define RTC_IO_EXTENT 0x140 - #endif /* __NEC_CMBVR4133_H */ -- cgit v1.2.3 From fc5d2d279ff820172a698706d33e733d4578bd6c Mon Sep 17 00:00:00 2001 From: Ralf Baechle Date: Thu, 6 Jul 2006 13:04:01 +0100 Subject: [MIPS] Use the proper technical term for naming some of the cache macros. Signed-off-by: Ralf Baechle --- include/asm-mips/cpu-features.h | 4 ++-- include/asm-mips/cpu.h | 2 +- include/asm-mips/mach-cobalt/cpu-feature-overrides.h | 2 +- include/asm-mips/mach-excite/cpu-feature-overrides.h | 2 +- include/asm-mips/mach-ip27/cpu-feature-overrides.h | 2 +- include/asm-mips/mach-ja/cpu-feature-overrides.h | 2 +- include/asm-mips/mach-mips/cpu-feature-overrides.h | 4 ++-- include/asm-mips/mach-ocelot3/cpu-feature-overrides.h | 2 +- include/asm-mips/mach-sibyte/cpu-feature-overrides.h | 2 +- include/asm-mips/mach-sim/cpu-feature-overrides.h | 4 ++-- include/asm-mips/mach-yosemite/cpu-feature-overrides.h | 2 +- 11 files changed, 14 insertions(+), 14 deletions(-) (limited to 'include') diff --git a/include/asm-mips/cpu-features.h b/include/asm-mips/cpu-features.h index 3c2fc2b647c..eadca266f15 100644 --- a/include/asm-mips/cpu-features.h +++ b/include/asm-mips/cpu-features.h @@ -195,8 +195,8 @@ # define cpu_has_veic 0 #endif -#ifndef cpu_has_subset_pcaches -#define cpu_has_subset_pcaches (cpu_data[0].options & MIPS_CPU_SUBSET_CACHES) +#ifndef cpu_has_inclusive_pcaches +#define cpu_has_inclusive_pcaches (cpu_data[0].options & MIPS_CPU_INCLUSIVE_CACHES) #endif #ifndef cpu_dcache_line_size diff --git a/include/asm-mips/cpu.h b/include/asm-mips/cpu.h index dff2a0a52f8..d38fdbf845b 100644 --- a/include/asm-mips/cpu.h +++ b/include/asm-mips/cpu.h @@ -242,7 +242,7 @@ #define MIPS_CPU_EJTAG 0x00008000 /* EJTAG exception */ #define MIPS_CPU_NOFPUEX 0x00010000 /* no FPU exception */ #define MIPS_CPU_LLSC 0x00020000 /* CPU has ll/sc instructions */ -#define MIPS_CPU_SUBSET_CACHES 0x00040000 /* P-cache subset enforced */ +#define MIPS_CPU_INCLUSIVE_CACHES 0x00040000 /* P-cache subset enforced */ #define MIPS_CPU_PREFETCH 0x00080000 /* CPU has usable prefetch */ #define MIPS_CPU_VINT 0x00100000 /* CPU supports MIPSR2 vectored interrupts */ #define MIPS_CPU_VEIC 0x00200000 /* CPU supports MIPSR2 external interrupt controller mode */ diff --git a/include/asm-mips/mach-cobalt/cpu-feature-overrides.h b/include/asm-mips/mach-cobalt/cpu-feature-overrides.h index e0e08fc5d7f..c6dfa59d198 100644 --- a/include/asm-mips/mach-cobalt/cpu-feature-overrides.h +++ b/include/asm-mips/mach-cobalt/cpu-feature-overrides.h @@ -27,7 +27,7 @@ #define cpu_has_mcheck 0 #define cpu_has_ejtag 0 -#define cpu_has_subset_pcaches 0 +#define cpu_has_inclusive_pcaches 0 #define cpu_dcache_line_size() 32 #define cpu_icache_line_size() 32 #define cpu_scache_line_size() 0 diff --git a/include/asm-mips/mach-excite/cpu-feature-overrides.h b/include/asm-mips/mach-excite/cpu-feature-overrides.h index abb76b2fd86..0d31854222f 100644 --- a/include/asm-mips/mach-excite/cpu-feature-overrides.h +++ b/include/asm-mips/mach-excite/cpu-feature-overrides.h @@ -31,7 +31,7 @@ #define cpu_has_nofpuex 0 #define cpu_has_64bits 1 -#define cpu_has_subset_pcaches 0 +#define cpu_has_inclusive_pcaches 0 #define cpu_dcache_line_size() 32 #define cpu_icache_line_size() 32 diff --git a/include/asm-mips/mach-ip27/cpu-feature-overrides.h b/include/asm-mips/mach-ip27/cpu-feature-overrides.h index 19c2d135985..a071974b67b 100644 --- a/include/asm-mips/mach-ip27/cpu-feature-overrides.h +++ b/include/asm-mips/mach-ip27/cpu-feature-overrides.h @@ -34,7 +34,7 @@ #define cpu_has_4kex 1 #define cpu_has_4k_cache 1 -#define cpu_has_subset_pcaches 1 +#define cpu_has_inclusive_pcaches 1 #define cpu_dcache_line_size() 32 #define cpu_icache_line_size() 64 diff --git a/include/asm-mips/mach-ja/cpu-feature-overrides.h b/include/asm-mips/mach-ja/cpu-feature-overrides.h index 90ff087083b..84b6dead0e8 100644 --- a/include/asm-mips/mach-ja/cpu-feature-overrides.h +++ b/include/asm-mips/mach-ja/cpu-feature-overrides.h @@ -31,7 +31,7 @@ #define cpu_has_nofpuex 0 #define cpu_has_64bits 1 -#define cpu_has_subset_pcaches 0 +#define cpu_has_inclusive_pcaches 0 #define cpu_dcache_line_size() 32 #define cpu_icache_line_size() 32 diff --git a/include/asm-mips/mach-mips/cpu-feature-overrides.h b/include/asm-mips/mach-mips/cpu-feature-overrides.h index e960679f54b..7f3e3f9bd23 100644 --- a/include/asm-mips/mach-mips/cpu-feature-overrides.h +++ b/include/asm-mips/mach-mips/cpu-feature-overrides.h @@ -39,7 +39,7 @@ #define cpu_has_nofpuex 0 /* #define cpu_has_64bits ? */ /* #define cpu_has_64bit_zero_reg ? */ -/* #define cpu_has_subset_pcaches ? */ +/* #define cpu_has_inclusive_pcaches ? */ #define cpu_icache_snoops_remote_store 1 #endif @@ -65,7 +65,7 @@ #define cpu_has_nofpuex 0 /* #define cpu_has_64bits ? */ /* #define cpu_has_64bit_zero_reg ? */ -/* #define cpu_has_subset_pcaches ? */ +/* #define cpu_has_inclusive_pcaches ? */ #define cpu_icache_snoops_remote_store 1 #endif diff --git a/include/asm-mips/mach-ocelot3/cpu-feature-overrides.h b/include/asm-mips/mach-ocelot3/cpu-feature-overrides.h index 782b986241d..57a12ded061 100644 --- a/include/asm-mips/mach-ocelot3/cpu-feature-overrides.h +++ b/include/asm-mips/mach-ocelot3/cpu-feature-overrides.h @@ -34,7 +34,7 @@ #define cpu_has_nofpuex 0 #define cpu_has_64bits 1 -#define cpu_has_subset_pcaches 0 +#define cpu_has_inclusive_pcaches 0 #define cpu_dcache_line_size() 32 #define cpu_icache_line_size() 32 diff --git a/include/asm-mips/mach-sibyte/cpu-feature-overrides.h b/include/asm-mips/mach-sibyte/cpu-feature-overrides.h index 193a666cd13..a25968f277a 100644 --- a/include/asm-mips/mach-sibyte/cpu-feature-overrides.h +++ b/include/asm-mips/mach-sibyte/cpu-feature-overrides.h @@ -31,7 +31,7 @@ #define cpu_has_nofpuex 0 #define cpu_has_64bits 1 -#define cpu_has_subset_pcaches 0 +#define cpu_has_inclusive_pcaches 0 #define cpu_dcache_line_size() 32 #define cpu_icache_line_size() 32 diff --git a/include/asm-mips/mach-sim/cpu-feature-overrides.h b/include/asm-mips/mach-sim/cpu-feature-overrides.h index d736bdadb6d..779b0220573 100644 --- a/include/asm-mips/mach-sim/cpu-feature-overrides.h +++ b/include/asm-mips/mach-sim/cpu-feature-overrides.h @@ -34,7 +34,7 @@ #define cpu_has_nofpuex 0 /* #define cpu_has_64bits ? */ /* #define cpu_has_64bit_zero_reg ? */ -/* #define cpu_has_subset_pcaches ? */ +/* #define cpu_has_inclusive_pcaches ? */ #endif #ifdef CONFIG_CPU_MIPS64 @@ -59,7 +59,7 @@ #define cpu_has_nofpuex 0 /* #define cpu_has_64bits ? */ /* #define cpu_has_64bit_zero_reg ? */ -/* #define cpu_has_subset_pcaches ? */ +/* #define cpu_has_inclusive_pcaches ? */ #endif #endif /* __ASM_MACH_MIPS_CPU_FEATURE_OVERRIDES_H */ diff --git a/include/asm-mips/mach-yosemite/cpu-feature-overrides.h b/include/asm-mips/mach-yosemite/cpu-feature-overrides.h index 3073542c93c..42cebb7ce7a 100644 --- a/include/asm-mips/mach-yosemite/cpu-feature-overrides.h +++ b/include/asm-mips/mach-yosemite/cpu-feature-overrides.h @@ -31,7 +31,7 @@ #define cpu_has_nofpuex 0 #define cpu_has_64bits 1 -#define cpu_has_subset_pcaches 0 +#define cpu_has_inclusive_pcaches 0 #define cpu_dcache_line_size() 32 #define cpu_icache_line_size() 32 -- cgit v1.2.3 From 4e8ab3618273b8c5f87a46f82902fbd4138f97f4 Mon Sep 17 00:00:00 2001 From: Yoichi Yuasa Date: Tue, 4 Jul 2006 22:59:41 +0900 Subject: [MIPS] VR41xx: Set VR41_CONF_BP only for PrId 0x0c80. Signed-off-by: Yoichi Yuasa Signed-off-by: Ralf Baechle --- include/asm-mips/mipsregs.h | 1 + 1 file changed, 1 insertion(+) (limited to 'include') diff --git a/include/asm-mips/mipsregs.h b/include/asm-mips/mipsregs.h index 9192d76c133..b4169f0fb13 100644 --- a/include/asm-mips/mipsregs.h +++ b/include/asm-mips/mipsregs.h @@ -470,6 +470,7 @@ /* Bits specific to the VR41xx. */ #define VR41_CONF_CS (_ULCAST_(1) << 12) +#define VR41_CONF_BP (_ULCAST_(1) << 16) #define VR41_CONF_M16 (_ULCAST_(1) << 20) #define VR41_CONF_AD (_ULCAST_(1) << 23) -- cgit v1.2.3 From 7de58fab9ccb63b4194ce39cf163a7491921d037 Mon Sep 17 00:00:00 2001 From: Atsushi Nemoto Date: Wed, 5 Jul 2006 01:22:44 +0900 Subject: [MIPS] Sparsemem fixes 1. MIPS should select SPARSEMEM_STATIC since allocating bootmem in memory_present() will corrupt bootmap area. 2. pfn_valid() for SPARSEMEM is defined in linux/mmzone.h Signed-off-by: Atsushi Nemoto Signed-off-by: Ralf Baechle --- include/asm-mips/page.h | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) (limited to 'include') diff --git a/include/asm-mips/page.h b/include/asm-mips/page.h index 6b97744f00c..6ed1151a05a 100644 --- a/include/asm-mips/page.h +++ b/include/asm-mips/page.h @@ -138,16 +138,14 @@ typedef struct { unsigned long pgprot; } pgprot_t; #define pfn_to_kaddr(pfn) __va((pfn) << PAGE_SHIFT) -#ifndef CONFIG_SPARSEMEM -#ifndef CONFIG_NEED_MULTIPLE_NODES -#define pfn_valid(pfn) ((pfn) < max_mapnr) -#endif -#endif - #ifdef CONFIG_FLATMEM #define pfn_valid(pfn) ((pfn) < max_mapnr) +#elif defined(CONFIG_SPARSEMEM) + +/* pfn_valid is defined in linux/mmzone.h */ + #elif defined(CONFIG_NEED_MULTIPLE_NODES) #define pfn_valid(pfn) \ @@ -159,8 +157,6 @@ typedef struct { unsigned long pgprot; } pgprot_t; : 0); \ }) -#else -#error Provide a definition of pfn_valid #endif #define virt_to_page(kaddr) pfn_to_page(__pa(kaddr) >> PAGE_SHIFT) -- cgit v1.2.3 From 8d197f3d17d4f43eb7d032491af7fc959cbed4fa Mon Sep 17 00:00:00 2001 From: Atsushi Nemoto Date: Fri, 7 Jul 2006 14:26:41 +0900 Subject: [MIPS] Fix rdhwr_op definition. Signed-off-by: Atsushi Nemoto Signed-off-by: Ralf Baechle --- include/asm-mips/inst.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include') diff --git a/include/asm-mips/inst.h b/include/asm-mips/inst.h index 1ed8d0f6257..6489f00731c 100644 --- a/include/asm-mips/inst.h +++ b/include/asm-mips/inst.h @@ -74,7 +74,7 @@ enum spec3_op { ins_op, dinsm_op, dinsu_op, dins_op, bshfl_op = 0x20, dbshfl_op = 0x24, - rdhwr_op = 0x3f + rdhwr_op = 0x3b }; /* -- cgit v1.2.3 From 192ef366198ce16c0379100565cdc5b7bd68511f Mon Sep 17 00:00:00 2001 From: Ralf Baechle Date: Fri, 7 Jul 2006 14:07:18 +0100 Subject: [MIPS] TRACE_IRQFLAGS_SUPPORT support. Signed-off-by: Ralf Baechle --- include/asm-mips/atomic.h | 2 +- include/asm-mips/bitops.h | 2 +- include/asm-mips/interrupt.h | 221 ------------------------------------------ include/asm-mips/irqflags.h | 225 +++++++++++++++++++++++++++++++++++++++++++ include/asm-mips/mipsregs.h | 2 +- include/asm-mips/system.h | 2 +- 6 files changed, 229 insertions(+), 225 deletions(-) delete mode 100644 include/asm-mips/interrupt.h create mode 100644 include/asm-mips/irqflags.h (limited to 'include') diff --git a/include/asm-mips/atomic.h b/include/asm-mips/atomic.h index 13d44e14025..e64abc0d822 100644 --- a/include/asm-mips/atomic.h +++ b/include/asm-mips/atomic.h @@ -22,8 +22,8 @@ #ifndef _ASM_ATOMIC_H #define _ASM_ATOMIC_H +#include #include -#include #include typedef struct { volatile int counter; } atomic_t; diff --git a/include/asm-mips/bitops.h b/include/asm-mips/bitops.h index 098cec26368..1bb89c5a10e 100644 --- a/include/asm-mips/bitops.h +++ b/include/asm-mips/bitops.h @@ -31,7 +31,7 @@ #ifdef __KERNEL__ -#include +#include #include #include diff --git a/include/asm-mips/interrupt.h b/include/asm-mips/interrupt.h deleted file mode 100644 index a99d6867510..00000000000 --- a/include/asm-mips/interrupt.h +++ /dev/null @@ -1,221 +0,0 @@ -/* - * This file is subject to the terms and conditions of the GNU General Public - * License. See the file "COPYING" in the main directory of this archive - * for more details. - * - * Copyright (C) 1994, 95, 96, 97, 98, 99, 2003 by Ralf Baechle - * Copyright (C) 1996 by Paul M. Antoine - * Copyright (C) 1999 Silicon Graphics - * Copyright (C) 2000 MIPS Technologies, Inc. - */ -#ifndef _ASM_INTERRUPT_H -#define _ASM_INTERRUPT_H - -#include - -__asm__ ( - " .macro local_irq_enable \n" - " .set push \n" - " .set reorder \n" - " .set noat \n" -#ifdef CONFIG_MIPS_MT_SMTC - " mfc0 $1, $2, 1 # SMTC - clear TCStatus.IXMT \n" - " ori $1, 0x400 \n" - " xori $1, 0x400 \n" - " mtc0 $1, $2, 1 \n" -#elif defined(CONFIG_CPU_MIPSR2) - " ei \n" -#else - " mfc0 $1,$12 \n" - " ori $1,0x1f \n" - " xori $1,0x1e \n" - " mtc0 $1,$12 \n" -#endif - " irq_enable_hazard \n" - " .set pop \n" - " .endm"); - -static inline void local_irq_enable(void) -{ - __asm__ __volatile__( - "local_irq_enable" - : /* no outputs */ - : /* no inputs */ - : "memory"); -} - -/* - * For cli() we have to insert nops to make sure that the new value - * has actually arrived in the status register before the end of this - * macro. - * R4000/R4400 need three nops, the R4600 two nops and the R10000 needs - * no nops at all. - */ -/* - * For TX49, operating only IE bit is not enough. - * - * If mfc0 $12 follows store and the mfc0 is last instruction of a - * page and fetching the next instruction causes TLB miss, the result - * of the mfc0 might wrongly contain EXL bit. - * - * ERT-TX49H2-027, ERT-TX49H3-012, ERT-TX49HL3-006, ERT-TX49H4-008 - * - * Workaround: mask EXL bit of the result or place a nop before mfc0. - */ -__asm__ ( - " .macro local_irq_disable\n" - " .set push \n" - " .set noat \n" -#ifdef CONFIG_MIPS_MT_SMTC - " mfc0 $1, $2, 1 \n" - " ori $1, 0x400 \n" - " .set noreorder \n" - " mtc0 $1, $2, 1 \n" -#elif defined(CONFIG_CPU_MIPSR2) - " di \n" -#else - " mfc0 $1,$12 \n" - " ori $1,0x1f \n" - " xori $1,0x1f \n" - " .set noreorder \n" - " mtc0 $1,$12 \n" -#endif - " irq_disable_hazard \n" - " .set pop \n" - " .endm \n"); - -static inline void local_irq_disable(void) -{ - __asm__ __volatile__( - "local_irq_disable" - : /* no outputs */ - : /* no inputs */ - : "memory"); -} - -__asm__ ( - " .macro local_save_flags flags \n" - " .set push \n" - " .set reorder \n" -#ifdef CONFIG_MIPS_MT_SMTC - " mfc0 \\flags, $2, 1 \n" -#else - " mfc0 \\flags, $12 \n" -#endif - " .set pop \n" - " .endm \n"); - -#define local_save_flags(x) \ -__asm__ __volatile__( \ - "local_save_flags %0" \ - : "=r" (x)) - -__asm__ ( - " .macro local_irq_save result \n" - " .set push \n" - " .set reorder \n" - " .set noat \n" -#ifdef CONFIG_MIPS_MT_SMTC - " mfc0 \\result, $2, 1 \n" - " ori $1, \\result, 0x400 \n" - " .set noreorder \n" - " mtc0 $1, $2, 1 \n" - " andi \\result, \\result, 0x400 \n" -#elif defined(CONFIG_CPU_MIPSR2) - " di \\result \n" - " andi \\result, 1 \n" -#else - " mfc0 \\result, $12 \n" - " ori $1, \\result, 0x1f \n" - " xori $1, 0x1f \n" - " .set noreorder \n" - " mtc0 $1, $12 \n" -#endif - " irq_disable_hazard \n" - " .set pop \n" - " .endm \n"); - -#define local_irq_save(x) \ -__asm__ __volatile__( \ - "local_irq_save\t%0" \ - : "=r" (x) \ - : /* no inputs */ \ - : "memory") - -__asm__ ( - " .macro local_irq_restore flags \n" - " .set push \n" - " .set noreorder \n" - " .set noat \n" -#ifdef CONFIG_MIPS_MT_SMTC - "mfc0 $1, $2, 1 \n" - "andi \\flags, 0x400 \n" - "ori $1, 0x400 \n" - "xori $1, 0x400 \n" - "or \\flags, $1 \n" - "mtc0 \\flags, $2, 1 \n" -#elif defined(CONFIG_CPU_MIPSR2) && defined(CONFIG_IRQ_CPU) - /* - * Slow, but doesn't suffer from a relativly unlikely race - * condition we're having since days 1. - */ - " beqz \\flags, 1f \n" - " di \n" - " ei \n" - "1: \n" -#elif defined(CONFIG_CPU_MIPSR2) - /* - * Fast, dangerous. Life is fun, life is good. - */ - " mfc0 $1, $12 \n" - " ins $1, \\flags, 0, 1 \n" - " mtc0 $1, $12 \n" -#else - " mfc0 $1, $12 \n" - " andi \\flags, 1 \n" - " ori $1, 0x1f \n" - " xori $1, 0x1f \n" - " or \\flags, $1 \n" - " mtc0 \\flags, $12 \n" -#endif - " irq_disable_hazard \n" - " .set pop \n" - " .endm \n"); - -#define local_irq_restore(flags) \ -do { \ - unsigned long __tmp1; \ - \ - __asm__ __volatile__( \ - "local_irq_restore\t%0" \ - : "=r" (__tmp1) \ - : "0" (flags) \ - : "memory"); \ -} while(0) - -static inline int irqs_disabled(void) -{ -#ifdef CONFIG_MIPS_MT_SMTC - /* - * SMTC model uses TCStatus.IXMT to disable interrupts for a thread/CPU - */ - unsigned long __result; - - __asm__ __volatile__( - " .set noreorder \n" - " mfc0 %0, $2, 1 \n" - " andi %0, 0x400 \n" - " slt %0, $0, %0 \n" - " .set reorder \n" - : "=r" (__result)); - - return __result; -#else - unsigned long flags; - local_save_flags(flags); - - return !(flags & 1); -#endif -} - -#endif /* _ASM_INTERRUPT_H */ diff --git a/include/asm-mips/irqflags.h b/include/asm-mips/irqflags.h new file mode 100644 index 00000000000..43ca09a3a3d --- /dev/null +++ b/include/asm-mips/irqflags.h @@ -0,0 +1,225 @@ +/* + * This file is subject to the terms and conditions of the GNU General Public + * License. See the file "COPYING" in the main directory of this archive + * for more details. + * + * Copyright (C) 1994, 95, 96, 97, 98, 99, 2003 by Ralf Baechle + * Copyright (C) 1996 by Paul M. Antoine + * Copyright (C) 1999 Silicon Graphics + * Copyright (C) 2000 MIPS Technologies, Inc. + */ +#ifndef _ASM_IRQFLAGS_H +#define _ASM_IRQFLAGS_H + +#ifndef __ASSEMBLY__ + +#include + +__asm__ ( + " .macro raw_local_irq_enable \n" + " .set push \n" + " .set reorder \n" + " .set noat \n" +#ifdef CONFIG_MIPS_MT_SMTC + " mfc0 $1, $2, 1 # SMTC - clear TCStatus.IXMT \n" + " ori $1, 0x400 \n" + " xori $1, 0x400 \n" + " mtc0 $1, $2, 1 \n" +#elif defined(CONFIG_CPU_MIPSR2) + " ei \n" +#else + " mfc0 $1,$12 \n" + " ori $1,0x1f \n" + " xori $1,0x1e \n" + " mtc0 $1,$12 \n" +#endif + " irq_enable_hazard \n" + " .set pop \n" + " .endm"); + +static inline void raw_local_irq_enable(void) +{ + __asm__ __volatile__( + "raw_local_irq_enable" + : /* no outputs */ + : /* no inputs */ + : "memory"); +} + +/* + * For cli() we have to insert nops to make sure that the new value + * has actually arrived in the status register before the end of this + * macro. + * R4000/R4400 need three nops, the R4600 two nops and the R10000 needs + * no nops at all. + */ +/* + * For TX49, operating only IE bit is not enough. + * + * If mfc0 $12 follows store and the mfc0 is last instruction of a + * page and fetching the next instruction causes TLB miss, the result + * of the mfc0 might wrongly contain EXL bit. + * + * ERT-TX49H2-027, ERT-TX49H3-012, ERT-TX49HL3-006, ERT-TX49H4-008 + * + * Workaround: mask EXL bit of the result or place a nop before mfc0. + */ +__asm__ ( + " .macro raw_local_irq_disable\n" + " .set push \n" + " .set noat \n" +#ifdef CONFIG_MIPS_MT_SMTC + " mfc0 $1, $2, 1 \n" + " ori $1, 0x400 \n" + " .set noreorder \n" + " mtc0 $1, $2, 1 \n" +#elif defined(CONFIG_CPU_MIPSR2) + " di \n" +#else + " mfc0 $1,$12 \n" + " ori $1,0x1f \n" + " xori $1,0x1f \n" + " .set noreorder \n" + " mtc0 $1,$12 \n" +#endif + " irq_disable_hazard \n" + " .set pop \n" + " .endm \n"); + +static inline void raw_local_irq_disable(void) +{ + __asm__ __volatile__( + "raw_local_irq_disable" + : /* no outputs */ + : /* no inputs */ + : "memory"); +} + +__asm__ ( + " .macro raw_local_save_flags flags \n" + " .set push \n" + " .set reorder \n" +#ifdef CONFIG_MIPS_MT_SMTC + " mfc0 \\flags, $2, 1 \n" +#else + " mfc0 \\flags, $12 \n" +#endif + " .set pop \n" + " .endm \n"); + +#define raw_local_save_flags(x) \ +__asm__ __volatile__( \ + "raw_local_save_flags %0" \ + : "=r" (x)) + +__asm__ ( + " .macro raw_local_irq_save result \n" + " .set push \n" + " .set reorder \n" + " .set noat \n" +#ifdef CONFIG_MIPS_MT_SMTC + " mfc0 \\result, $2, 1 \n" + " ori $1, \\result, 0x400 \n" + " .set noreorder \n" + " mtc0 $1, $2, 1 \n" + " andi \\result, \\result, 0x400 \n" +#elif defined(CONFIG_CPU_MIPSR2) + " di \\result \n" + " andi \\result, 1 \n" +#else + " mfc0 \\result, $12 \n" + " ori $1, \\result, 0x1f \n" + " xori $1, 0x1f \n" + " .set noreorder \n" + " mtc0 $1, $12 \n" +#endif + " irq_disable_hazard \n" + " .set pop \n" + " .endm \n"); + +#define raw_local_irq_save(x) \ +__asm__ __volatile__( \ + "raw_local_irq_save\t%0" \ + : "=r" (x) \ + : /* no inputs */ \ + : "memory") + +__asm__ ( + " .macro raw_local_irq_restore flags \n" + " .set push \n" + " .set noreorder \n" + " .set noat \n" +#ifdef CONFIG_MIPS_MT_SMTC + "mfc0 $1, $2, 1 \n" + "andi \\flags, 0x400 \n" + "ori $1, 0x400 \n" + "xori $1, 0x400 \n" + "or \\flags, $1 \n" + "mtc0 \\flags, $2, 1 \n" +#elif defined(CONFIG_CPU_MIPSR2) && defined(CONFIG_IRQ_CPU) + /* + * Slow, but doesn't suffer from a relativly unlikely race + * condition we're having since days 1. + */ + " beqz \\flags, 1f \n" + " di \n" + " ei \n" + "1: \n" +#elif defined(CONFIG_CPU_MIPSR2) + /* + * Fast, dangerous. Life is fun, life is good. + */ + " mfc0 $1, $12 \n" + " ins $1, \\flags, 0, 1 \n" + " mtc0 $1, $12 \n" +#else + " mfc0 $1, $12 \n" + " andi \\flags, 1 \n" + " ori $1, 0x1f \n" + " xori $1, 0x1f \n" + " or \\flags, $1 \n" + " mtc0 \\flags, $12 \n" +#endif + " irq_disable_hazard \n" + " .set pop \n" + " .endm \n"); + +#define raw_local_irq_restore(flags) \ +do { \ + unsigned long __tmp1; \ + \ + __asm__ __volatile__( \ + "raw_local_irq_restore\t%0" \ + : "=r" (__tmp1) \ + : "0" (flags) \ + : "memory"); \ +} while(0) + +static inline int raw_irqs_disabled_flags(unsigned long flags) +{ +#ifdef CONFIG_MIPS_MT_SMTC + /* + * SMTC model uses TCStatus.IXMT to disable interrupts for a thread/CPU + */ + return flags & 0x400; +#else + return !(flags & 1); +#endif +} + +#endif + +/* + * Do the CPU's IRQ-state tracing from assembly code. + */ +#ifdef CONFIG_TRACE_IRQFLAGS +# define TRACE_IRQS_ON \ + jal trace_hardirqs_on +# define TRACE_IRQS_OFF \ + jal trace_hardirqs_off +#else +# define TRACE_IRQS_ON +# define TRACE_IRQS_OFF +#endif + +#endif /* _ASM_IRQFLAGS_H */ diff --git a/include/asm-mips/mipsregs.h b/include/asm-mips/mipsregs.h index b4169f0fb13..677668867b9 100644 --- a/include/asm-mips/mipsregs.h +++ b/include/asm-mips/mipsregs.h @@ -1417,7 +1417,7 @@ change_c0_##name(unsigned int change, unsigned int new) \ #else /* SMTC versions that manage MT scheduling */ -#include +#include /* * This is a duplicate of dmt() in mipsmtregs.h to avoid problems with diff --git a/include/asm-mips/system.h b/include/asm-mips/system.h index 130333d7c4e..13c98dde82d 100644 --- a/include/asm-mips/system.h +++ b/include/asm-mips/system.h @@ -13,13 +13,13 @@ #define _ASM_SYSTEM_H #include +#include #include #include #include #include #include -#include /* * read_barrier_depends - Flush all pending reads that subsequents reads -- cgit v1.2.3 From 2874fe55332e2fb4e9c8e672cf2b7361bb168d17 Mon Sep 17 00:00:00 2001 From: Yoichi Yuasa Date: Sat, 8 Jul 2006 00:42:12 +0900 Subject: [MIPS] vr41xx: Replace magic number for P4K bit with symbol. Signed-off-by: Yoichi Yuasa Signed-off-by: Ralf Baechle --- include/asm-mips/mipsregs.h | 1 + 1 file changed, 1 insertion(+) (limited to 'include') diff --git a/include/asm-mips/mipsregs.h b/include/asm-mips/mipsregs.h index 677668867b9..1f318d70799 100644 --- a/include/asm-mips/mipsregs.h +++ b/include/asm-mips/mipsregs.h @@ -470,6 +470,7 @@ /* Bits specific to the VR41xx. */ #define VR41_CONF_CS (_ULCAST_(1) << 12) +#define VR41_CONF_P4K (_ULCAST_(1) << 13) #define VR41_CONF_BP (_ULCAST_(1) << 16) #define VR41_CONF_M16 (_ULCAST_(1) << 20) #define VR41_CONF_AD (_ULCAST_(1) << 23) -- cgit v1.2.3 From 54d0a216f40e060ba4265bb851cc36b3ca55d1a8 Mon Sep 17 00:00:00 2001 From: Ralf Baechle Date: Sun, 9 Jul 2006 21:38:56 +0100 Subject: [MIPS] Replace board_timer_setup function pointer by plat_timer_setup. Signed-off-by: Ralf Baechle --- --- include/asm-mips/time.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'include') diff --git a/include/asm-mips/time.h b/include/asm-mips/time.h index d897c8bb554..2d543735668 100644 --- a/include/asm-mips/time.h +++ b/include/asm-mips/time.h @@ -83,11 +83,11 @@ extern asmlinkage void ll_local_timer_interrupt(int irq, struct pt_regs *regs); /* * board specific routines required by time_init(). * board_time_init is defaulted to NULL and can remain so. - * board_timer_setup must be setup properly in machine setup routine. + * plat_timer_setup must be setup properly in machine setup routine. */ struct irqaction; extern void (*board_time_init)(void); -extern void (*board_timer_setup)(struct irqaction *irq); +extern void plat_timer_setup(struct irqaction *irq); /* * mips_hpt_frequency - must be set if you intend to use an R4k-compatible -- cgit v1.2.3 From 66151bbd20c6c62dbe5b131484c885086e3a8d29 Mon Sep 17 00:00:00 2001 From: Yoichi Yuasa Date: Thu, 13 Jul 2006 17:33:03 +0900 Subject: [MIPS] vr41xx: Move IRQ numbers to asm-mips/vr41xx/irq.h Signed-off-by: Yoichi Yuasa Signed-off-by: Ralf Baechle --- include/asm-mips/vr41xx/capcella.h | 2 +- include/asm-mips/vr41xx/cmbvr4133.h | 3 +- include/asm-mips/vr41xx/irq.h | 101 ++++++++++++++++++++++++++++++++++++ include/asm-mips/vr41xx/mpc30x.h | 2 +- include/asm-mips/vr41xx/tb0219.h | 2 +- include/asm-mips/vr41xx/tb0226.h | 2 +- include/asm-mips/vr41xx/tb0287.h | 2 +- include/asm-mips/vr41xx/vr41xx.h | 53 ------------------- include/asm-mips/vr41xx/vrc4173.h | 20 ------- 9 files changed, 107 insertions(+), 80 deletions(-) create mode 100644 include/asm-mips/vr41xx/irq.h (limited to 'include') diff --git a/include/asm-mips/vr41xx/capcella.h b/include/asm-mips/vr41xx/capcella.h index d10ffda50de..e0ee05a3dfc 100644 --- a/include/asm-mips/vr41xx/capcella.h +++ b/include/asm-mips/vr41xx/capcella.h @@ -20,7 +20,7 @@ #ifndef __ZAO_CAPCELLA_H #define __ZAO_CAPCELLA_H -#include +#include /* * General-Purpose I/O Pin Number diff --git a/include/asm-mips/vr41xx/cmbvr4133.h b/include/asm-mips/vr41xx/cmbvr4133.h index 3fbfde19c80..9490ade58b4 100644 --- a/include/asm-mips/vr41xx/cmbvr4133.h +++ b/include/asm-mips/vr41xx/cmbvr4133.h @@ -15,8 +15,7 @@ #ifndef __NEC_CMBVR4133_H #define __NEC_CMBVR4133_H -#include -#include +#include /* * General-Purpose I/O Pin Number diff --git a/include/asm-mips/vr41xx/irq.h b/include/asm-mips/vr41xx/irq.h new file mode 100644 index 00000000000..d315dfbc08f --- /dev/null +++ b/include/asm-mips/vr41xx/irq.h @@ -0,0 +1,101 @@ +/* + * include/asm-mips/vr41xx/irq.h + * + * Interrupt numbers for NEC VR4100 series. + * + * Copyright (C) 1999 Michael Klar + * Copyright (C) 2001, 2002 Paul Mundt + * Copyright (C) 2002 MontaVista Software, Inc. + * Copyright (C) 2002 TimeSys Corp. + * Copyright (C) 2003-2006 Yoichi Yuasa + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + */ +#ifndef __NEC_VR41XX_IRQ_H +#define __NEC_VR41XX_IRQ_H + +/* + * CPU core Interrupt Numbers + */ +#define MIPS_CPU_IRQ_BASE 0 +#define MIPS_CPU_IRQ(x) (MIPS_CPU_IRQ_BASE + (x)) +#define MIPS_SOFTINT0_IRQ MIPS_CPU_IRQ(0) +#define MIPS_SOFTINT1_IRQ MIPS_CPU_IRQ(1) +#define INT0_IRQ MIPS_CPU_IRQ(2) +#define INT1_IRQ MIPS_CPU_IRQ(3) +#define INT2_IRQ MIPS_CPU_IRQ(4) +#define INT3_IRQ MIPS_CPU_IRQ(5) +#define INT4_IRQ MIPS_CPU_IRQ(6) +#define TIMER_IRQ MIPS_CPU_IRQ(7) + +/* + * SYINT1 Interrupt Numbers + */ +#define SYSINT1_IRQ_BASE 8 +#define SYSINT1_IRQ(x) (SYSINT1_IRQ_BASE + (x)) +#define BATTRY_IRQ SYSINT1_IRQ(0) +#define POWER_IRQ SYSINT1_IRQ(1) +#define RTCLONG1_IRQ SYSINT1_IRQ(2) +#define ELAPSEDTIME_IRQ SYSINT1_IRQ(3) +/* RFU */ +#define PIU_IRQ SYSINT1_IRQ(5) +#define AIU_IRQ SYSINT1_IRQ(6) +#define KIU_IRQ SYSINT1_IRQ(7) +#define GIUINT_IRQ SYSINT1_IRQ(8) +#define SIU_IRQ SYSINT1_IRQ(9) +#define BUSERR_IRQ SYSINT1_IRQ(10) +#define SOFTINT_IRQ SYSINT1_IRQ(11) +#define CLKRUN_IRQ SYSINT1_IRQ(12) +#define DOZEPIU_IRQ SYSINT1_IRQ(13) +#define SYSINT1_IRQ_LAST DOZEPIU_IRQ + +/* + * SYSINT2 Interrupt Numbers + */ +#define SYSINT2_IRQ_BASE 24 +#define SYSINT2_IRQ(x) (SYSINT2_IRQ_BASE + (x)) +#define RTCLONG2_IRQ SYSINT2_IRQ(0) +#define LED_IRQ SYSINT2_IRQ(1) +#define HSP_IRQ SYSINT2_IRQ(2) +#define TCLOCK_IRQ SYSINT2_IRQ(3) +#define FIR_IRQ SYSINT2_IRQ(4) +#define CEU_IRQ SYSINT2_IRQ(4) /* same number as FIR_IRQ */ +#define DSIU_IRQ SYSINT2_IRQ(5) +#define PCI_IRQ SYSINT2_IRQ(6) +#define SCU_IRQ SYSINT2_IRQ(7) +#define CSI_IRQ SYSINT2_IRQ(8) +#define BCU_IRQ SYSINT2_IRQ(9) +#define ETHERNET_IRQ SYSINT2_IRQ(10) +#define SYSINT2_IRQ_LAST ETHERNET_IRQ + +/* + * GIU Interrupt Numbers + */ +#define GIU_IRQ_BASE 40 +#define GIU_IRQ(x) (GIU_IRQ_BASE + (x)) /* IRQ 40-71 */ +#define GIU_IRQ_LAST GIU_IRQ(31) + +/* + * VRC4173 Interrupt Numbers + */ +#define VRC4173_IRQ_BASE 72 +#define VRC4173_IRQ(x) (VRC4173_IRQ_BASE + (x)) +#define VRC4173_USB_IRQ VRC4173_IRQ(0) +#define VRC4173_PCMCIA2_IRQ VRC4173_IRQ(1) +#define VRC4173_PCMCIA1_IRQ VRC4173_IRQ(2) +#define VRC4173_PS2CH2_IRQ VRC4173_IRQ(3) +#define VRC4173_PS2CH1_IRQ VRC4173_IRQ(4) +#define VRC4173_PIU_IRQ VRC4173_IRQ(5) +#define VRC4173_AIU_IRQ VRC4173_IRQ(6) +#define VRC4173_KIU_IRQ VRC4173_IRQ(7) +#define VRC4173_GIU_IRQ VRC4173_IRQ(8) +#define VRC4173_AC97_IRQ VRC4173_IRQ(9) +#define VRC4173_AC97INT1_IRQ VRC4173_IRQ(10) +/* RFU */ +#define VRC4173_DOZEPIU_IRQ VRC4173_IRQ(13) +#define VRC4173_IRQ_LAST VRC4173_DOZEPIU_IRQ + +#endif /* __NEC_VR41XX_IRQ_H */ diff --git a/include/asm-mips/vr41xx/mpc30x.h b/include/asm-mips/vr41xx/mpc30x.h index a6cbe4da666..1d67df843dc 100644 --- a/include/asm-mips/vr41xx/mpc30x.h +++ b/include/asm-mips/vr41xx/mpc30x.h @@ -20,7 +20,7 @@ #ifndef __VICTOR_MPC30X_H #define __VICTOR_MPC30X_H -#include +#include /* * General-Purpose I/O Pin Number diff --git a/include/asm-mips/vr41xx/tb0219.h b/include/asm-mips/vr41xx/tb0219.h index b318b9612a8..dc981b4be0a 100644 --- a/include/asm-mips/vr41xx/tb0219.h +++ b/include/asm-mips/vr41xx/tb0219.h @@ -23,7 +23,7 @@ #ifndef __TANBAC_TB0219_H #define __TANBAC_TB0219_H -#include +#include /* * General-Purpose I/O Pin Number diff --git a/include/asm-mips/vr41xx/tb0226.h b/include/asm-mips/vr41xx/tb0226.h index 2513f450e2d..de527dcfa5f 100644 --- a/include/asm-mips/vr41xx/tb0226.h +++ b/include/asm-mips/vr41xx/tb0226.h @@ -20,7 +20,7 @@ #ifndef __TANBAC_TB0226_H #define __TANBAC_TB0226_H -#include +#include /* * General-Purpose I/O Pin Number diff --git a/include/asm-mips/vr41xx/tb0287.h b/include/asm-mips/vr41xx/tb0287.h index dd9832313af..61bead68abf 100644 --- a/include/asm-mips/vr41xx/tb0287.h +++ b/include/asm-mips/vr41xx/tb0287.h @@ -22,7 +22,7 @@ #ifndef __TANBAC_TB0287_H #define __TANBAC_TB0287_H -#include +#include /* * General-Purpose I/O Pin Number diff --git a/include/asm-mips/vr41xx/vr41xx.h b/include/asm-mips/vr41xx/vr41xx.h index 70828d5fae9..dd3eb3dc588 100644 --- a/include/asm-mips/vr41xx/vr41xx.h +++ b/include/asm-mips/vr41xx/vr41xx.h @@ -74,59 +74,6 @@ extern void vr41xx_mask_clock(vr41xx_clock_t clock); /* * Interrupt Control Unit */ -/* CPU core Interrupt Numbers */ -#define MIPS_CPU_IRQ_BASE 0 -#define MIPS_CPU_IRQ(x) (MIPS_CPU_IRQ_BASE + (x)) -#define MIPS_SOFTINT0_IRQ MIPS_CPU_IRQ(0) -#define MIPS_SOFTINT1_IRQ MIPS_CPU_IRQ(1) -#define INT0_IRQ MIPS_CPU_IRQ(2) -#define INT1_IRQ MIPS_CPU_IRQ(3) -#define INT2_IRQ MIPS_CPU_IRQ(4) -#define INT3_IRQ MIPS_CPU_IRQ(5) -#define INT4_IRQ MIPS_CPU_IRQ(6) -#define TIMER_IRQ MIPS_CPU_IRQ(7) - -/* SYINT1 Interrupt Numbers */ -#define SYSINT1_IRQ_BASE 8 -#define SYSINT1_IRQ(x) (SYSINT1_IRQ_BASE + (x)) -#define BATTRY_IRQ SYSINT1_IRQ(0) -#define POWER_IRQ SYSINT1_IRQ(1) -#define RTCLONG1_IRQ SYSINT1_IRQ(2) -#define ELAPSEDTIME_IRQ SYSINT1_IRQ(3) -/* RFU */ -#define PIU_IRQ SYSINT1_IRQ(5) -#define AIU_IRQ SYSINT1_IRQ(6) -#define KIU_IRQ SYSINT1_IRQ(7) -#define GIUINT_IRQ SYSINT1_IRQ(8) -#define SIU_IRQ SYSINT1_IRQ(9) -#define BUSERR_IRQ SYSINT1_IRQ(10) -#define SOFTINT_IRQ SYSINT1_IRQ(11) -#define CLKRUN_IRQ SYSINT1_IRQ(12) -#define DOZEPIU_IRQ SYSINT1_IRQ(13) -#define SYSINT1_IRQ_LAST DOZEPIU_IRQ - -/* SYSINT2 Interrupt Numbers */ -#define SYSINT2_IRQ_BASE 24 -#define SYSINT2_IRQ(x) (SYSINT2_IRQ_BASE + (x)) -#define RTCLONG2_IRQ SYSINT2_IRQ(0) -#define LED_IRQ SYSINT2_IRQ(1) -#define HSP_IRQ SYSINT2_IRQ(2) -#define TCLOCK_IRQ SYSINT2_IRQ(3) -#define FIR_IRQ SYSINT2_IRQ(4) -#define CEU_IRQ SYSINT2_IRQ(4) /* same number as FIR_IRQ */ -#define DSIU_IRQ SYSINT2_IRQ(5) -#define PCI_IRQ SYSINT2_IRQ(6) -#define SCU_IRQ SYSINT2_IRQ(7) -#define CSI_IRQ SYSINT2_IRQ(8) -#define BCU_IRQ SYSINT2_IRQ(9) -#define ETHERNET_IRQ SYSINT2_IRQ(10) -#define SYSINT2_IRQ_LAST ETHERNET_IRQ - -/* GIU Interrupt Numbers */ -#define GIU_IRQ_BASE 40 -#define GIU_IRQ(x) (GIU_IRQ_BASE + (x)) /* IRQ 40-71 */ -#define GIU_IRQ_LAST GIU_IRQ(31) - extern int vr41xx_set_intassign(unsigned int irq, unsigned char intassign); extern int cascade_irq(unsigned int irq, int (*get_irq)(unsigned int, struct pt_regs *)); diff --git a/include/asm-mips/vr41xx/vrc4173.h b/include/asm-mips/vr41xx/vrc4173.h index 96fdcd54cec..e5e6ad1d2f8 100644 --- a/include/asm-mips/vr41xx/vrc4173.h +++ b/include/asm-mips/vr41xx/vrc4173.h @@ -26,26 +26,6 @@ #include -/* - * Interrupt Number - */ -#define VRC4173_IRQ_BASE 72 -#define VRC4173_IRQ(x) (VRC4173_IRQ_BASE + (x)) -#define VRC4173_USB_IRQ VRC4173_IRQ(0) -#define VRC4173_PCMCIA2_IRQ VRC4173_IRQ(1) -#define VRC4173_PCMCIA1_IRQ VRC4173_IRQ(2) -#define VRC4173_PS2CH2_IRQ VRC4173_IRQ(3) -#define VRC4173_PS2CH1_IRQ VRC4173_IRQ(4) -#define VRC4173_PIU_IRQ VRC4173_IRQ(5) -#define VRC4173_AIU_IRQ VRC4173_IRQ(6) -#define VRC4173_KIU_IRQ VRC4173_IRQ(7) -#define VRC4173_GIU_IRQ VRC4173_IRQ(8) -#define VRC4173_AC97_IRQ VRC4173_IRQ(9) -#define VRC4173_AC97INT1_IRQ VRC4173_IRQ(10) -/* RFU */ -#define VRC4173_DOZEPIU_IRQ VRC4173_IRQ(13) -#define VRC4173_IRQ_LAST VRC4173_DOZEPIU_IRQ - /* * PCI I/O accesses */ -- cgit v1.2.3 From efcb487a8e9a86874cf63c3fbf6c85bbf87e6d87 Mon Sep 17 00:00:00 2001 From: Yoichi Yuasa Date: Thu, 13 Jul 2006 17:33:14 +0900 Subject: [MIPS] vr41xx: Removed old v2.4 VRC4173 driver Signed-off-by: Yoichi Yuasa Signed-off-by: Ralf Baechle --- include/asm-mips/vr41xx/vrc4173.h | 201 -------------------------------------- 1 file changed, 201 deletions(-) delete mode 100644 include/asm-mips/vr41xx/vrc4173.h (limited to 'include') diff --git a/include/asm-mips/vr41xx/vrc4173.h b/include/asm-mips/vr41xx/vrc4173.h deleted file mode 100644 index e5e6ad1d2f8..00000000000 --- a/include/asm-mips/vr41xx/vrc4173.h +++ /dev/null @@ -1,201 +0,0 @@ -/* - * vrc4173.h, Include file for NEC VRC4173. - * - * Copyright (C) 2000 Michael R. McDonald - * Copyright (C) 2001-2003 Montavista Software Inc. - * Author: Yoichi Yuasa - * Copyright (C) 2004 Yoichi Yuasa - * Copyright (C) 2005 Ralf Baechle (ralf@linux-mips.org) - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ -#ifndef __NEC_VRC4173_H -#define __NEC_VRC4173_H - -#include - -/* - * PCI I/O accesses - */ -#ifdef CONFIG_VRC4173 - -extern unsigned long vrc4173_io_offset; - -#define set_vrc4173_io_offset(offset) do { vrc4173_io_offset = (offset); } while (0) - -#define vrc4173_outb(val,port) outb((val), vrc4173_io_offset+(port)) -#define vrc4173_outw(val,port) outw((val), vrc4173_io_offset+(port)) -#define vrc4173_outl(val,port) outl((val), vrc4173_io_offset+(port)) -#define vrc4173_outb_p(val,port) outb_p((val), vrc4173_io_offset+(port)) -#define vrc4173_outw_p(val,port) outw_p((val), vrc4173_io_offset+(port)) -#define vrc4173_outl_p(val,port) outl_p((val), vrc4173_io_offset+(port)) - -#define vrc4173_inb(port) inb(vrc4173_io_offset+(port)) -#define vrc4173_inw(port) inw(vrc4173_io_offset+(port)) -#define vrc4173_inl(port) inl(vrc4173_io_offset+(port)) -#define vrc4173_inb_p(port) inb_p(vrc4173_io_offset+(port)) -#define vrc4173_inw_p(port) inw_p(vrc4173_io_offset+(port)) -#define vrc4173_inl_p(port) inl_p(vrc4173_io_offset+(port)) - -#define vrc4173_outsb(port,addr,count) outsb(vrc4173_io_offset+(port),(addr),(count)) -#define vrc4173_outsw(port,addr,count) outsw(vrc4173_io_offset+(port),(addr),(count)) -#define vrc4173_outsl(port,addr,count) outsl(vrc4173_io_offset+(port),(addr),(count)) - -#define vrc4173_insb(port,addr,count) insb(vrc4173_io_offset+(port),(addr),(count)) -#define vrc4173_insw(port,addr,count) insw(vrc4173_io_offset+(port),(addr),(count)) -#define vrc4173_insl(port,addr,count) insl(vrc4173_io_offset+(port),(addr),(count)) - -#else - -#define set_vrc4173_io_offset(offset) do {} while (0) - -#define vrc4173_outb(val,port) do {} while (0) -#define vrc4173_outw(val,port) do {} while (0) -#define vrc4173_outl(val,port) do {} while (0) -#define vrc4173_outb_p(val,port) do {} while (0) -#define vrc4173_outw_p(val,port) do {} while (0) -#define vrc4173_outl_p(val,port) do {} while (0) - -#define vrc4173_inb(port) 0 -#define vrc4173_inw(port) 0 -#define vrc4173_inl(port) 0 -#define vrc4173_inb_p(port) 0 -#define vrc4173_inw_p(port) 0 -#define vrc4173_inl_p(port) 0 - -#define vrc4173_outsb(port,addr,count) do {} while (0) -#define vrc4173_outsw(port,addr,count) do {} while (0) -#define vrc4173_outsl(port,addr,count) do {} while (0) - -#define vrc4173_insb(port,addr,count) do {} while (0) -#define vrc4173_insw(port,addr,count) do {} while (0) -#define vrc4173_insl(port,addr,count) do {} while (0) - -#endif - -/* - * Clock Mask Unit - */ -typedef enum vrc4173_clock { - VRC4173_PIU_CLOCK, - VRC4173_KIU_CLOCK, - VRC4173_AIU_CLOCK, - VRC4173_PS2_CH1_CLOCK, - VRC4173_PS2_CH2_CLOCK, - VRC4173_USBU_PCI_CLOCK, - VRC4173_CARDU1_PCI_CLOCK, - VRC4173_CARDU2_PCI_CLOCK, - VRC4173_AC97U_PCI_CLOCK, - VRC4173_USBU_48MHz_CLOCK, - VRC4173_EXT_48MHz_CLOCK, - VRC4173_48MHz_CLOCK, -} vrc4173_clock_t; - -#ifdef CONFIG_VRC4173 - -extern void vrc4173_supply_clock(vrc4173_clock_t clock); -extern void vrc4173_mask_clock(vrc4173_clock_t clock); - -#else - -static inline void vrc4173_supply_clock(vrc4173_clock_t clock) {} -static inline void vrc4173_mask_clock(vrc4173_clock_t clock) {} - -#endif - -/* - * Interupt Control Unit - */ - -#define VRC4173_PIUINT_COMMAND 0x0040 -#define VRC4173_PIUINT_DATA 0x0020 -#define VRC4173_PIUINT_PAGE1 0x0010 -#define VRC4173_PIUINT_PAGE0 0x0008 -#define VRC4173_PIUINT_DATALOST 0x0004 -#define VRC4173_PIUINT_STATUSCHANGE 0x0001 - -#ifdef CONFIG_VRC4173 - -extern void vrc4173_enable_piuint(uint16_t mask); -extern void vrc4173_disable_piuint(uint16_t mask); - -#else - -static inline void vrc4173_enable_piuint(uint16_t mask) {} -static inline void vrc4173_disable_piuint(uint16_t mask) {} - -#endif - -#define VRC4173_AIUINT_INPUT_DMAEND 0x0800 -#define VRC4173_AIUINT_INPUT_DMAHALT 0x0400 -#define VRC4173_AIUINT_INPUT_DATALOST 0x0200 -#define VRC4173_AIUINT_INPUT_DATA 0x0100 -#define VRC4173_AIUINT_OUTPUT_DMAEND 0x0008 -#define VRC4173_AIUINT_OUTPUT_DMAHALT 0x0004 -#define VRC4173_AIUINT_OUTPUT_NODATA 0x0002 - -#ifdef CONFIG_VRC4173 - -extern void vrc4173_enable_aiuint(uint16_t mask); -extern void vrc4173_disable_aiuint(uint16_t mask); - -#else - -static inline void vrc4173_enable_aiuint(uint16_t mask) {} -static inline void vrc4173_disable_aiuint(uint16_t mask) {} - -#endif - -#define VRC4173_KIUINT_DATALOST 0x0004 -#define VRC4173_KIUINT_DATAREADY 0x0002 -#define VRC4173_KIUINT_SCAN 0x0001 - -#ifdef CONFIG_VRC4173 - -extern void vrc4173_enable_kiuint(uint16_t mask); -extern void vrc4173_disable_kiuint(uint16_t mask); - -#else - -static inline void vrc4173_enable_kiuint(uint16_t mask) {} -static inline void vrc4173_disable_kiuint(uint16_t mask) {} - -#endif - -/* - * General-Purpose I/O Unit - */ -typedef enum vrc4173_function { - PS2_CHANNEL1, - PS2_CHANNEL2, - TOUCHPANEL, - KEYBOARD_8SCANLINES, - KEYBOARD_10SCANLINES, - KEYBOARD_12SCANLINES, - GPIO_0_15PINS, - GPIO_16_20PINS, -} vrc4173_function_t; - -#ifdef CONFIG_VRC4173 - -extern void vrc4173_select_function(vrc4173_function_t function); - -#else - -static inline void vrc4173_select_function(vrc4173_function_t function) {} - -#endif - -#endif /* __NEC_VRC4173_H */ -- cgit v1.2.3 From f26811e0d89d412a2f5d8e16760e71d3b5c2702c Mon Sep 17 00:00:00 2001 From: Yoichi Yuasa Date: Thu, 13 Jul 2006 17:33:24 +0900 Subject: [MIPS] vr41xx: Update e55 setup function Signed-off-by: Yoichi Yuasa Signed-off-by: Ralf Baechle --- include/asm-mips/vr41xx/e55.h | 43 ------------------------------------------- 1 file changed, 43 deletions(-) delete mode 100644 include/asm-mips/vr41xx/e55.h (limited to 'include') diff --git a/include/asm-mips/vr41xx/e55.h b/include/asm-mips/vr41xx/e55.h deleted file mode 100644 index 558f2269bf3..00000000000 --- a/include/asm-mips/vr41xx/e55.h +++ /dev/null @@ -1,43 +0,0 @@ -/* - * e55.h, Include file for CASIO CASSIOPEIA E-10/15/55/65. - * - * Copyright (C) 2002-2004 Yoichi Yuasa - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ -#ifndef __CASIO_E55_H -#define __CASIO_E55_H - -#include -#include - -/* - * Board specific address mapping - */ -#define VR41XX_ISA_MEM_BASE 0x10000000 -#define VR41XX_ISA_MEM_SIZE 0x04000000 - -/* VR41XX_ISA_IO_BASE includes offset from real base. */ -#define VR41XX_ISA_IO_BASE 0x1400c000 -#define VR41XX_ISA_IO_SIZE 0x03ff4000 - -#define ISA_BUS_IO_BASE 0 -#define ISA_BUS_IO_SIZE VR41XX_ISA_IO_SIZE - -#define IO_PORT_BASE KSEG1ADDR(VR41XX_ISA_IO_BASE) -#define IO_PORT_RESOURCE_START ISA_BUS_IO_BASE -#define IO_PORT_RESOURCE_END (ISA_BUS_IO_BASE + ISA_BUS_IO_SIZE - 1) - -#endif /* __CASIO_E55_H */ -- cgit v1.2.3 From bddc8134db00002a9fd1b33fcb45747bdd3a2777 Mon Sep 17 00:00:00 2001 From: Yoichi Yuasa Date: Thu, 13 Jul 2006 17:33:33 +0900 Subject: [MIPS] vr41xx: Update workpad setup function Signed-off-by: Yoichi Yuasa Signed-off-by: Ralf Baechle --- include/asm-mips/vr41xx/workpad.h | 43 --------------------------------------- 1 file changed, 43 deletions(-) delete mode 100644 include/asm-mips/vr41xx/workpad.h (limited to 'include') diff --git a/include/asm-mips/vr41xx/workpad.h b/include/asm-mips/vr41xx/workpad.h deleted file mode 100644 index 6bfa9c009a9..00000000000 --- a/include/asm-mips/vr41xx/workpad.h +++ /dev/null @@ -1,43 +0,0 @@ -/* - * workpad.h, Include file for IBM WorkPad z50. - * - * Copyright (C) 2002-2004 Yoichi Yuasa - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ -#ifndef __IBM_WORKPAD_H -#define __IBM_WORKPAD_H - -#include -#include - -/* - * Board specific address mapping - */ -#define VR41XX_ISA_MEM_BASE 0x10000000 -#define VR41XX_ISA_MEM_SIZE 0x04000000 - -/* VR41XX_ISA_IO_BASE includes offset from real base. */ -#define VR41XX_ISA_IO_BASE 0x15000000 -#define VR41XX_ISA_IO_SIZE 0x03000000 - -#define ISA_BUS_IO_BASE 0 -#define ISA_BUS_IO_SIZE VR41XX_ISA_IO_SIZE - -#define IO_PORT_BASE KSEG1ADDR(VR41XX_ISA_IO_BASE) -#define IO_PORT_RESOURCE_START ISA_BUS_IO_BASE -#define IO_PORT_RESOURCE_END (ISA_BUS_IO_BASE + ISA_BUS_IO_SIZE - 1) - -#endif /* __IBM_WORKPAD_H */ -- cgit v1.2.3 From 0610d11b53ad15200618e38e4511373e3ed09e8a Mon Sep 17 00:00:00 2001 From: Stephen Hemminger Date: Fri, 14 Jul 2006 16:34:22 -0700 Subject: [VLAN]: __vlan_hwaccel_rx can use the faster ether_compare_addr The inline function compare_ether_addr is faster than memcmp. Also, don't need to drag in proc_fs.h, the only reference to proc_dir_entry is a pointer so the declaration is needed here. Signed-off-by: Stephen Hemminger Acked-by: Ben Greear Signed-off-by: David S. Miller --- include/linux/if_vlan.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'include') diff --git a/include/linux/if_vlan.h b/include/linux/if_vlan.h index eef0876d830..383627ad328 100644 --- a/include/linux/if_vlan.h +++ b/include/linux/if_vlan.h @@ -23,8 +23,8 @@ struct vlan_collection; struct vlan_dev_info; struct hlist_node; -#include /* for proc_dir_entry */ #include +#include #define VLAN_HLEN 4 /* The additional bytes (on top of the Ethernet header) * that VLAN requires. @@ -185,7 +185,8 @@ static inline int __vlan_hwaccel_rx(struct sk_buff *skb, * This allows the VLAN to have a different MAC than the underlying * device, and still route correctly. */ - if (!memcmp(eth_hdr(skb)->h_dest, skb->dev->dev_addr, ETH_ALEN)) + if (!compare_ether_addr(eth_hdr(skb)->h_dest, + skb->dev->dev_addr)) skb->pkt_type = PACKET_HOST; break; }; -- cgit v1.2.3 From f0ee3404cce2c45f8b95b341dd6311cd92e5cee0 Mon Sep 17 00:00:00 2001 From: "Michael S. Tsirkin" Date: Fri, 14 Jul 2006 00:23:52 -0700 Subject: [PATCH] IB/addr: gid structure alignment fix The device address contains unsigned character arrays, which contain raw GID addresses. The GIDs may not be naturally aligned, so do not cast them to structures or unions. Signed-off-by: Sean Hefty Signed-off-by: Michael S. Tsirkin Cc: Roland Dreier Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- include/rdma/ib_addr.h | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'include') diff --git a/include/rdma/ib_addr.h b/include/rdma/ib_addr.h index fcb5ba87dcc..0ff67398928 100644 --- a/include/rdma/ib_addr.h +++ b/include/rdma/ib_addr.h @@ -89,9 +89,10 @@ static inline void ib_addr_set_pkey(struct rdma_dev_addr *dev_addr, u16 pkey) dev_addr->broadcast[9] = (unsigned char) pkey; } -static inline union ib_gid *ib_addr_get_sgid(struct rdma_dev_addr *dev_addr) +static inline void ib_addr_get_sgid(struct rdma_dev_addr *dev_addr, + union ib_gid *gid) { - return (union ib_gid *) (dev_addr->src_dev_addr + 4); + memcpy(gid, dev_addr->src_dev_addr + 4, sizeof *gid); } static inline void ib_addr_set_sgid(struct rdma_dev_addr *dev_addr, @@ -100,9 +101,10 @@ static inline void ib_addr_set_sgid(struct rdma_dev_addr *dev_addr, memcpy(dev_addr->src_dev_addr + 4, gid, sizeof *gid); } -static inline union ib_gid *ib_addr_get_dgid(struct rdma_dev_addr *dev_addr) +static inline void ib_addr_get_dgid(struct rdma_dev_addr *dev_addr, + union ib_gid *gid) { - return (union ib_gid *) (dev_addr->dst_dev_addr + 4); + memcpy(gid, dev_addr->dst_dev_addr + 4, sizeof *gid); } static inline void ib_addr_set_dgid(struct rdma_dev_addr *dev_addr, -- cgit v1.2.3 From adfaa888a292e7f38fb43668d8994f246e371f0f Mon Sep 17 00:00:00 2001 From: "Michael S. Tsirkin" Date: Fri, 14 Jul 2006 00:23:55 -0700 Subject: [PATCH] fmr pool: remove unnecessary pointer dereference ib_fmr_pool_map_phys gets the virtual address by pointer but never writes there, and users (e.g. srp) seem to assume this and ignore the value returned. This patch cleans up the API to get the VA by value, and updates all users. Signed-off-by: Michael S. Tsirkin Acked-by: Roland Dreier Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- include/rdma/ib_fmr_pool.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include') diff --git a/include/rdma/ib_fmr_pool.h b/include/rdma/ib_fmr_pool.h index 4ace54cd0cc..00dadbf94e1 100644 --- a/include/rdma/ib_fmr_pool.h +++ b/include/rdma/ib_fmr_pool.h @@ -88,7 +88,7 @@ int ib_flush_fmr_pool(struct ib_fmr_pool *pool); struct ib_pool_fmr *ib_fmr_pool_map_phys(struct ib_fmr_pool *pool_handle, u64 *page_list, int list_len, - u64 *io_virtual_address); + u64 io_virtual_address); int ib_fmr_pool_unmap(struct ib_pool_fmr *fmr); -- cgit v1.2.3 From 8757d5fa6b75e8ea906baf0309d49b980e7f9bc9 Mon Sep 17 00:00:00 2001 From: Jan Kiszka Date: Fri, 14 Jul 2006 00:23:56 -0700 Subject: [PATCH] mm: fix oom roll-back of __vmalloc_area_node __vunmap must not rely on area->nr_pages when picking the release methode for area->pages. It may be too small when __vmalloc_area_node failed early due to lacking memory. Instead, use a flag in vmstruct to differentiate. Signed-off-by: Jan Kiszka Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- include/linux/vmalloc.h | 1 + 1 file changed, 1 insertion(+) (limited to 'include') diff --git a/include/linux/vmalloc.h b/include/linux/vmalloc.h index f6024ab4eff..71b6363caaa 100644 --- a/include/linux/vmalloc.h +++ b/include/linux/vmalloc.h @@ -11,6 +11,7 @@ struct vm_area_struct; #define VM_ALLOC 0x00000002 /* vmalloc() */ #define VM_MAP 0x00000004 /* vmap()ed pages */ #define VM_USERMAP 0x00000008 /* suitable for remap_vmalloc_range */ +#define VM_VPAGES 0x00000010 /* buffer for pages was vmalloc'ed */ /* bits [20..32] reserved for arch specific ioremap internals */ /* -- cgit v1.2.3 From 098c5eea03de4707019a205140296893252b4130 Mon Sep 17 00:00:00 2001 From: Andreas Gruenbacher Date: Fri, 14 Jul 2006 00:24:04 -0700 Subject: [PATCH] null-terminate over-long /proc/kallsyms symbols Got a customer bug report (https://bugzilla.novell.com/190296) about kernel symbols longer than 127 characters which end up in a string buffer that is not NULL terminated, leading to garbage in /proc/kallsyms. Using strlcpy prevents this from happening, even though such symbols still won't come out right. A better fix would be to not use a fixed-size buffer, but it's probably not worth the trouble. (Modversion'ed symbols even have a length limit of 60.) [bunk@stusta.de: build fix] Signed-off-by: Andreas Gruenbacher Signed-off-by: Adrian Bunk Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- include/linux/module.h | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'include') diff --git a/include/linux/module.h b/include/linux/module.h index d06c74fb8c2..0dfb794c52d 100644 --- a/include/linux/module.h +++ b/include/linux/module.h @@ -362,10 +362,8 @@ int is_module_address(unsigned long addr); /* Returns module and fills in value, defined and namebuf, or NULL if symnum out of range. */ -struct module *module_get_kallsym(unsigned int symnum, - unsigned long *value, - char *type, - char namebuf[128]); +struct module *module_get_kallsym(unsigned int symnum, unsigned long *value, + char *type, char *name, size_t namelen); /* Look for this name: can be of form module:name. */ unsigned long module_kallsyms_lookup_name(const char *name); @@ -535,8 +533,8 @@ static inline const char *module_address_lookup(unsigned long addr, static inline struct module *module_get_kallsym(unsigned int symnum, unsigned long *value, - char *type, - char namebuf[128]) + char *type, char *name, + size_t namelen) { return NULL; } -- cgit v1.2.3 From 52e92e5788139921352213fa6faf6e30ff1f2f5a Mon Sep 17 00:00:00 2001 From: Adrian Bunk Date: Fri, 14 Jul 2006 00:24:05 -0700 Subject: [PATCH] remove kernel/kthread.c:kthread_stop_sem() Remove the now-unneeded kthread_stop_sem(). Signed-off-by: Adrian Bunk Acked-by: Alan Stern Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- include/linux/kthread.h | 1 - 1 file changed, 1 deletion(-) (limited to 'include') diff --git a/include/linux/kthread.h b/include/linux/kthread.h index 7cce5dfa092..1c65e7a9f18 100644 --- a/include/linux/kthread.h +++ b/include/linux/kthread.h @@ -28,7 +28,6 @@ struct task_struct *kthread_create(int (*threadfn)(void *data), void kthread_bind(struct task_struct *k, unsigned int cpu); int kthread_stop(struct task_struct *k); -int kthread_stop_sem(struct task_struct *k, struct semaphore *s); int kthread_should_stop(void); #endif /* _LINUX_KTHREAD_H */ -- cgit v1.2.3 From 998f6fabbf439e6d518dcbaf9191cb533447b57a Mon Sep 17 00:00:00 2001 From: David Woodhouse Date: Fri, 14 Jul 2006 00:24:07 -0700 Subject: [PATCH] hdrinstall: remove asm/irq.h from user visibility Remove asm/irq.h from the exported headers -- there was never any good reason for it to have been listed. Signed-off-by: David Woodhouse Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- include/asm-generic/Kbuild.asm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include') diff --git a/include/asm-generic/Kbuild.asm b/include/asm-generic/Kbuild.asm index d8d0bcecd23..da163c123ed 100644 --- a/include/asm-generic/Kbuild.asm +++ b/include/asm-generic/Kbuild.asm @@ -1,5 +1,5 @@ unifdef-y += a.out.h auxvec.h byteorder.h errno.h fcntl.h ioctl.h \ - ioctls.h ipcbuf.h irq.h mman.h msgbuf.h param.h poll.h \ + ioctls.h ipcbuf.h mman.h msgbuf.h param.h poll.h \ posix_types.h ptrace.h resource.h sembuf.h shmbuf.h shmparam.h \ sigcontext.h siginfo.h signal.h socket.h sockios.h stat.h \ statfs.h termbits.h termios.h timex.h types.h unistd.h user.h -- cgit v1.2.3 From e035cc35e54230eb704ee7feccf476ed2fb2ae29 Mon Sep 17 00:00:00 2001 From: David Woodhouse Date: Fri, 14 Jul 2006 00:24:07 -0700 Subject: [PATCH] hdrinstall: remove asm/atomic.h from user visibility This isn't suitable for userspace to see -- the kernel headers are not a random library of stuff for userspace; they're only there to define the kernel<->user ABI for system libraries and tools. Anything which _was_ abusing asm/atomic.h from userspace was probably broken anyway -- as it often didn't even give atomic operation. Signed-off-by: David Woodhouse Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- include/asm-generic/Kbuild.asm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include') diff --git a/include/asm-generic/Kbuild.asm b/include/asm-generic/Kbuild.asm index da163c123ed..bdb8b089d85 100644 --- a/include/asm-generic/Kbuild.asm +++ b/include/asm-generic/Kbuild.asm @@ -5,7 +5,7 @@ unifdef-y += a.out.h auxvec.h byteorder.h errno.h fcntl.h ioctl.h \ statfs.h termbits.h termios.h timex.h types.h unistd.h user.h # These really shouldn't be exported -unifdef-y += atomic.h io.h +unifdef-y += io.h # These probably shouldn't be exported unifdef-y += elf.h page.h -- cgit v1.2.3 From 52fa259b5aaf310657e5d30be48a300860741447 Mon Sep 17 00:00:00 2001 From: David Woodhouse Date: Fri, 14 Jul 2006 00:24:08 -0700 Subject: [PATCH] hdrinstall: remove asm/io.h from user visibility There's no excuse for userspace abusing this kernel header -- the kernel's headers are not intended to provide a library of helper routines for userspace. Using from userspace is broken on most architectures anyway. Just say 'no'. Signed-off-by: David Woodhouse Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- include/asm-generic/Kbuild.asm | 3 --- 1 file changed, 3 deletions(-) (limited to 'include') diff --git a/include/asm-generic/Kbuild.asm b/include/asm-generic/Kbuild.asm index bdb8b089d85..6b16dda1811 100644 --- a/include/asm-generic/Kbuild.asm +++ b/include/asm-generic/Kbuild.asm @@ -4,8 +4,5 @@ unifdef-y += a.out.h auxvec.h byteorder.h errno.h fcntl.h ioctl.h \ sigcontext.h siginfo.h signal.h socket.h sockios.h stat.h \ statfs.h termbits.h termios.h timex.h types.h unistd.h user.h -# These really shouldn't be exported -unifdef-y += io.h - # These probably shouldn't be exported unifdef-y += elf.h page.h -- cgit v1.2.3 From 7e56a7dcbb974d9725d80e50d70c6eed7f71110b Mon Sep 17 00:00:00 2001 From: Herbert Valerio Riedel Date: Fri, 14 Jul 2006 00:24:11 -0700 Subject: [PATCH] RTC subsystem, Add ISL1208 support Add support for the I2C-attached Intersil ISL1208 RTC chip. [akpm@osdl.org: cleanups, fixlets] Signed-off-by: Herbert Valerio Riedel Cc: Alessandro Zummo Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- include/linux/i2c-id.h | 1 + 1 file changed, 1 insertion(+) (limited to 'include') diff --git a/include/linux/i2c-id.h b/include/linux/i2c-id.h index 21338bb3441..9418519a55d 100644 --- a/include/linux/i2c-id.h +++ b/include/linux/i2c-id.h @@ -115,6 +115,7 @@ #define I2C_DRIVERID_BT866 85 /* Conexant bt866 video encoder */ #define I2C_DRIVERID_KS0127 86 /* Samsung ks0127 video decoder */ #define I2C_DRIVERID_TLV320AIC23B 87 /* TI TLV320AIC23B audio codec */ +#define I2C_DRIVERID_ISL1208 88 /* Intersil ISL1208 RTC */ #define I2C_DRIVERID_I2CDEV 900 #define I2C_DRIVERID_ARP 902 /* SMBus ARP Client */ -- cgit v1.2.3 From 91e260b80d2fec559877f399dfc36b554f207874 Mon Sep 17 00:00:00 2001 From: Jim Cromie Date: Fri, 14 Jul 2006 00:24:25 -0700 Subject: [PATCH] gpio: drop vtable members .gpio_set_high .gpio_set_low gpio_set is enough drops gpio_set_high, gpio_set_low from the nsc_gpio_ops vtable. While we can't drop them from scx200_gpio (or can we?), we dont need them for new users of the exported vtable; gpio_set(1), gpio_set(0) work fine. Signed-off-by: Jim Cromie Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- include/linux/nsc_gpio.h | 2 -- 1 file changed, 2 deletions(-) (limited to 'include') diff --git a/include/linux/nsc_gpio.h b/include/linux/nsc_gpio.h index 135742cfada..7da0cf3702e 100644 --- a/include/linux/nsc_gpio.h +++ b/include/linux/nsc_gpio.h @@ -25,8 +25,6 @@ struct nsc_gpio_ops { void (*gpio_dump) (struct nsc_gpio_ops *amp, unsigned iminor); int (*gpio_get) (unsigned iminor); void (*gpio_set) (unsigned iminor, int state); - void (*gpio_set_high)(unsigned iminor); - void (*gpio_set_low) (unsigned iminor); void (*gpio_change) (unsigned iminor); int (*gpio_current) (unsigned iminor); struct device* dev; /* for dev_dbg() support, set in init */ -- cgit v1.2.3 From 737bebd137561e184f0a8b4332d9bb0238d8b639 Mon Sep 17 00:00:00 2001 From: Al Viro Date: Fri, 14 Jul 2006 00:24:29 -0700 Subject: [PATCH] symlink nesting level change It's way past time to bump it to 8. Everyone had been warned - for months now. RH kernels have had this for more than a year. Signed-off-by: Al Viro Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- include/linux/namei.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include') diff --git a/include/linux/namei.h b/include/linux/namei.h index 58cb3d3d44b..45511a5918d 100644 --- a/include/linux/namei.h +++ b/include/linux/namei.h @@ -11,7 +11,7 @@ struct open_intent { struct file *file; }; -enum { MAX_NESTED_LINKS = 5 }; +enum { MAX_NESTED_LINKS = 8 }; struct nameidata { struct dentry *dentry; -- cgit v1.2.3 From 22caf04297896e515c6d5cdfb8e08a79a523946c Mon Sep 17 00:00:00 2001 From: Mike Rapoport Date: Fri, 14 Jul 2006 00:24:34 -0700 Subject: [PATCH] mbxfb: Add framebuffer driver for the Intel 2700G Add frame buffer driver for the 2700G LCD controller present on CompuLab CM-X270 computer module. [adaplas] - Add more informative help text to Kconfig - Make DEBUG a Kconfig option as FB_MBX_DEBUG - Remove #include mbxdebug.c, this is frowned upon - Remove redundant casts - Arrange #include's alphabetically - Trivial whitespace Signed-off-by: Mike Rapoport Signed-off-by: Antonino Daplas Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- include/video/mbxfb.h | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 include/video/mbxfb.h (limited to 'include') diff --git a/include/video/mbxfb.h b/include/video/mbxfb.h new file mode 100644 index 00000000000..3bde0f5cd55 --- /dev/null +++ b/include/video/mbxfb.h @@ -0,0 +1,28 @@ +#ifndef __MBX_FB_H +#define __MBX_FB_H + +struct mbxfb_val { + unsigned int defval; + unsigned int min; + unsigned int max; +}; + +struct fb_info; + +struct mbxfb_platform_data { + /* Screen info */ + struct mbxfb_val xres; + struct mbxfb_val yres; + struct mbxfb_val bpp; + + /* Memory info */ + unsigned long memsize; /* if 0 use ODFB? */ + unsigned long timings1; + unsigned long timings2; + unsigned long timings3; + + int (*probe)(struct fb_info *fb); + int (*remove)(struct fb_info *fb); +}; + +#endif /* __MBX_FB_H */ -- cgit v1.2.3 From e8f4d97e1b58b50ad6449bb2d35e6632c0236abd Mon Sep 17 00:00:00 2001 From: Shailabh Nagar Date: Fri, 14 Jul 2006 00:24:35 -0700 Subject: [PATCH] list_is_last utility Add another list utility function to check for last element in a list. Signed-off-by: Shailabh Nagar Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- include/linux/list.h | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'include') diff --git a/include/linux/list.h b/include/linux/list.h index 6b74adf5297..65a5b5ceda4 100644 --- a/include/linux/list.h +++ b/include/linux/list.h @@ -264,6 +264,17 @@ static inline void list_move_tail(struct list_head *list, list_add_tail(list, head); } +/** + * list_is_last - tests whether @list is the last entry in list @head + * @list: the entry to test + * @head: the head of the list + */ +static inline int list_is_last(const struct list_head *list, + const struct list_head *head) +{ + return list->next == head; +} + /** * list_empty - tests whether a list is empty * @head: the list to test. -- cgit v1.2.3 From ca74e92b4698276b6696f15a801759f50944f387 Mon Sep 17 00:00:00 2001 From: Shailabh Nagar Date: Fri, 14 Jul 2006 00:24:36 -0700 Subject: [PATCH] per-task-delay-accounting: setup Initialization code related to collection of per-task "delay" statistics which measure how long it had to wait for cpu, sync block io, swapping etc. The collection of statistics and the interface are in other patches. This patch sets up the data structures and allows the statistics collection to be disabled through a kernel boot parameter. Signed-off-by: Shailabh Nagar Signed-off-by: Balbir Singh Cc: Jes Sorensen Cc: Peter Chubb Cc: Erich Focht Cc: Levent Serinol Cc: Jay Lan Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- include/linux/delayacct.h | 69 +++++++++++++++++++++++++++++++++++++++++++++++ include/linux/sched.h | 20 ++++++++++++++ include/linux/time.h | 12 +++++++++ 3 files changed, 101 insertions(+) create mode 100644 include/linux/delayacct.h (limited to 'include') diff --git a/include/linux/delayacct.h b/include/linux/delayacct.h new file mode 100644 index 00000000000..9572cfa1f12 --- /dev/null +++ b/include/linux/delayacct.h @@ -0,0 +1,69 @@ +/* delayacct.h - per-task delay accounting + * + * Copyright (C) Shailabh Nagar, IBM Corp. 2006 + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See + * the GNU General Public License for more details. + * + */ + +#ifndef _LINUX_DELAYACCT_H +#define _LINUX_DELAYACCT_H + +#include + +#ifdef CONFIG_TASK_DELAY_ACCT + +extern int delayacct_on; /* Delay accounting turned on/off */ +extern kmem_cache_t *delayacct_cache; +extern void delayacct_init(void); +extern void __delayacct_tsk_init(struct task_struct *); +extern void __delayacct_tsk_exit(struct task_struct *); + +static inline void delayacct_set_flag(int flag) +{ + if (current->delays) + current->delays->flags |= flag; +} + +static inline void delayacct_clear_flag(int flag) +{ + if (current->delays) + current->delays->flags &= ~flag; +} + +static inline void delayacct_tsk_init(struct task_struct *tsk) +{ + /* reinitialize in case parent's non-null pointer was dup'ed*/ + tsk->delays = NULL; + if (unlikely(delayacct_on)) + __delayacct_tsk_init(tsk); +} + +static inline void delayacct_tsk_exit(struct task_struct *tsk) +{ + if (tsk->delays) + __delayacct_tsk_exit(tsk); +} + +#else +static inline void delayacct_set_flag(int flag) +{} +static inline void delayacct_clear_flag(int flag) +{} +static inline void delayacct_init(void) +{} +static inline void delayacct_tsk_init(struct task_struct *tsk) +{} +static inline void delayacct_tsk_exit(struct task_struct *tsk) +{} +#endif /* CONFIG_TASK_DELAY_ACCT */ + +#endif diff --git a/include/linux/sched.h b/include/linux/sched.h index 1c876e27ff9..7a54e62763c 100644 --- a/include/linux/sched.h +++ b/include/linux/sched.h @@ -552,6 +552,23 @@ struct sched_info { extern struct file_operations proc_schedstat_operations; #endif +#ifdef CONFIG_TASK_DELAY_ACCT +struct task_delay_info { + spinlock_t lock; + unsigned int flags; /* Private per-task flags */ + + /* For each stat XXX, add following, aligned appropriately + * + * struct timespec XXX_start, XXX_end; + * u64 XXX_delay; + * u32 XXX_count; + * + * Atomicity of updates to XXX_delay, XXX_count protected by + * single lock above (split into XXX_lock if contention is an issue). + */ +}; +#endif + enum idle_type { SCHED_IDLE, @@ -945,6 +962,9 @@ struct task_struct { * cache last used pipe for splice */ struct pipe_inode_info *splice_pipe; +#ifdef CONFIG_TASK_DELAY_ACCT + struct task_delay_info *delays; +#endif }; static inline pid_t process_group(struct task_struct *tsk) diff --git a/include/linux/time.h b/include/linux/time.h index c05f8bb9a32..a5b739967b7 100644 --- a/include/linux/time.h +++ b/include/linux/time.h @@ -70,6 +70,18 @@ extern unsigned long mktime(const unsigned int year, const unsigned int mon, extern void set_normalized_timespec(struct timespec *ts, time_t sec, long nsec); +/* + * sub = lhs - rhs, in normalized form + */ +static inline struct timespec timespec_sub(struct timespec lhs, + struct timespec rhs) +{ + struct timespec ts_delta; + set_normalized_timespec(&ts_delta, lhs.tv_sec - rhs.tv_sec, + lhs.tv_nsec - rhs.tv_nsec); + return ts_delta; +} + /* * Returns true if the timespec is norm, false if denorm: */ -- cgit v1.2.3 From 0ff922452df86f3e9a2c6f705c4588ec62d096a7 Mon Sep 17 00:00:00 2001 From: Shailabh Nagar Date: Fri, 14 Jul 2006 00:24:37 -0700 Subject: [PATCH] per-task-delay-accounting: sync block I/O and swapin delay collection Unlike earlier iterations of the delay accounting patches, now delays are only collected for the actual I/O waits rather than try and cover the delays seen in I/O submission paths. Account separately for block I/O delays incurred as a result of swapin page faults whose frequency can be affected by the task/process' rss limit. Hence swapin delays can act as feedback for rss limit changes independent of I/O priority changes. Signed-off-by: Shailabh Nagar Signed-off-by: Balbir Singh Cc: Jes Sorensen Cc: Peter Chubb Cc: Erich Focht Cc: Levent Serinol Cc: Jay Lan Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- include/linux/delayacct.h | 25 +++++++++++++++++++++++++ include/linux/sched.h | 13 +++++++++++++ 2 files changed, 38 insertions(+) (limited to 'include') diff --git a/include/linux/delayacct.h b/include/linux/delayacct.h index 9572cfa1f12..0ecbf9aad8e 100644 --- a/include/linux/delayacct.h +++ b/include/linux/delayacct.h @@ -19,6 +19,13 @@ #include +/* + * Per-task flags relevant to delay accounting + * maintained privately to avoid exhausting similar flags in sched.h:PF_* + * Used to set current->delays->flags + */ +#define DELAYACCT_PF_SWAPIN 0x00000001 /* I am doing a swapin */ + #ifdef CONFIG_TASK_DELAY_ACCT extern int delayacct_on; /* Delay accounting turned on/off */ @@ -26,6 +33,8 @@ extern kmem_cache_t *delayacct_cache; extern void delayacct_init(void); extern void __delayacct_tsk_init(struct task_struct *); extern void __delayacct_tsk_exit(struct task_struct *); +extern void __delayacct_blkio_start(void); +extern void __delayacct_blkio_end(void); static inline void delayacct_set_flag(int flag) { @@ -53,6 +62,18 @@ static inline void delayacct_tsk_exit(struct task_struct *tsk) __delayacct_tsk_exit(tsk); } +static inline void delayacct_blkio_start(void) +{ + if (current->delays) + __delayacct_blkio_start(); +} + +static inline void delayacct_blkio_end(void) +{ + if (current->delays) + __delayacct_blkio_end(); +} + #else static inline void delayacct_set_flag(int flag) {} @@ -64,6 +85,10 @@ static inline void delayacct_tsk_init(struct task_struct *tsk) {} static inline void delayacct_tsk_exit(struct task_struct *tsk) {} +static inline void delayacct_blkio_start(void) +{} +static inline void delayacct_blkio_end(void) +{} #endif /* CONFIG_TASK_DELAY_ACCT */ #endif diff --git a/include/linux/sched.h b/include/linux/sched.h index 7a54e62763c..2f43f1fb7de 100644 --- a/include/linux/sched.h +++ b/include/linux/sched.h @@ -566,6 +566,19 @@ struct task_delay_info { * Atomicity of updates to XXX_delay, XXX_count protected by * single lock above (split into XXX_lock if contention is an issue). */ + + /* + * XXX_count is incremented on every XXX operation, the delay + * associated with the operation is added to XXX_delay. + * XXX_delay contains the accumulated delay time in nanoseconds. + */ + struct timespec blkio_start, blkio_end; /* Shared by blkio, swapin */ + u64 blkio_delay; /* wait for sync block io completion */ + u64 swapin_delay; /* wait for swapin block io completion */ + u32 blkio_count; /* total count of the number of sync block */ + /* io operations performed */ + u32 swapin_count; /* total count of the number of swapin block */ + /* io operations performed */ }; #endif -- cgit v1.2.3 From 52f17b6c2bd443e7806a161e9d10a983650db01d Mon Sep 17 00:00:00 2001 From: Chandra Seetharaman Date: Fri, 14 Jul 2006 00:24:38 -0700 Subject: [PATCH] per-task-delay-accounting: cpu delay collection via schedstats Make the task-related schedstats functions callable by delay accounting even if schedstats collection isn't turned on. This removes the dependency of delay accounting on schedstats. Signed-off-by: Chandra Seetharaman Signed-off-by: Shailabh Nagar Signed-off-by: Balbir Singh Cc: Jes Sorensen Cc: Peter Chubb Cc: Erich Focht Cc: Levent Serinol Cc: Jay Lan Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- include/linux/sched.h | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) (limited to 'include') diff --git a/include/linux/sched.h b/include/linux/sched.h index 2f43f1fb7de..f751062d89a 100644 --- a/include/linux/sched.h +++ b/include/linux/sched.h @@ -537,7 +537,7 @@ extern struct user_struct root_user; struct backing_dev_info; struct reclaim_state; -#ifdef CONFIG_SCHEDSTATS +#if defined(CONFIG_SCHEDSTATS) || defined(CONFIG_TASK_DELAY_ACCT) struct sched_info { /* cumulative counters */ unsigned long cpu_time, /* time spent on the cpu */ @@ -548,9 +548,11 @@ struct sched_info { unsigned long last_arrival, /* when we last ran on a cpu */ last_queued; /* when we were last queued to run */ }; +#endif /* defined(CONFIG_SCHEDSTATS) || defined(CONFIG_TASK_DELAY_ACCT) */ +#ifdef CONFIG_SCHEDSTATS extern struct file_operations proc_schedstat_operations; -#endif +#endif /* CONFIG_SCHEDSTATS */ #ifdef CONFIG_TASK_DELAY_ACCT struct task_delay_info { @@ -580,7 +582,19 @@ struct task_delay_info { u32 swapin_count; /* total count of the number of swapin block */ /* io operations performed */ }; +#endif /* CONFIG_TASK_DELAY_ACCT */ + +static inline int sched_info_on(void) +{ +#ifdef CONFIG_SCHEDSTATS + return 1; +#elif defined(CONFIG_TASK_DELAY_ACCT) + extern int delayacct_on; + return delayacct_on; +#else + return 0; #endif +} enum idle_type { @@ -777,7 +791,7 @@ struct task_struct { cpumask_t cpus_allowed; unsigned int time_slice, first_time_slice; -#ifdef CONFIG_SCHEDSTATS +#if defined(CONFIG_SCHEDSTATS) || defined(CONFIG_TASK_DELAY_ACCT) struct sched_info sched_info; #endif -- cgit v1.2.3 From fb0ba6bd021248b6bdc58a7b1213a55a6776a38a Mon Sep 17 00:00:00 2001 From: Balbir Singh Date: Fri, 14 Jul 2006 00:24:39 -0700 Subject: [PATCH] per-task-delay-accounting: utilities for genetlink usage Two utilities for simplifying usage of NETLINK_GENERIC interface. Signed-off-by: Balbir Singh Signed-off-by: Shailabh Nagar Cc: Jes Sorensen Cc: Peter Chubb Cc: Erich Focht Cc: Levent Serinol Cc: Jay Lan Cc: "David S. Miller" Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- include/net/genetlink.h | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'include') diff --git a/include/net/genetlink.h b/include/net/genetlink.h index 805de50df00..8c228726426 100644 --- a/include/net/genetlink.h +++ b/include/net/genetlink.h @@ -150,4 +150,24 @@ static inline int genlmsg_unicast(struct sk_buff *skb, u32 pid) return nlmsg_unicast(genl_sock, skb, pid); } +/** + * gennlmsg_data - head of message payload + * @gnlh: genetlink messsage header + */ +static inline void *genlmsg_data(const struct genlmsghdr *gnlh) +{ + return ((unsigned char *) gnlh + GENL_HDRLEN); +} + +/** + * genlmsg_len - length of message payload + * @gnlh: genetlink message header + */ +static inline int genlmsg_len(const struct genlmsghdr *gnlh) +{ + struct nlmsghdr *nlh = (struct nlmsghdr *)((unsigned char *)gnlh - + NLMSG_HDRLEN); + return (nlh->nlmsg_len - GENL_HDRLEN - NLMSG_HDRLEN); +} + #endif /* __NET_GENERIC_NETLINK_H */ -- cgit v1.2.3 From c757249af152c59fd74b85e52e8c090acb33d9c0 Mon Sep 17 00:00:00 2001 From: Shailabh Nagar Date: Fri, 14 Jul 2006 00:24:40 -0700 Subject: [PATCH] per-task-delay-accounting: taskstats interface Create a "taskstats" interface based on generic netlink (NETLINK_GENERIC family), for getting statistics of tasks and thread groups during their lifetime and when they exit. The interface is intended for use by multiple accounting packages though it is being created in the context of delay accounting. This patch creates the interface without populating the fields of the data that is sent to the user in response to a command or upon the exit of a task. Each accounting package interested in using taskstats has to provide an additional patch to add its stats to the common structure. [akpm@osdl.org: cleanups, Kconfig fix] Signed-off-by: Shailabh Nagar Signed-off-by: Balbir Singh Cc: Jes Sorensen Cc: Peter Chubb Cc: Erich Focht Cc: Levent Serinol Cc: Jay Lan Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- include/linux/taskstats.h | 84 ++++++++++++++++++++++++++++++++++++++++++ include/linux/taskstats_kern.h | 57 ++++++++++++++++++++++++++++ 2 files changed, 141 insertions(+) create mode 100644 include/linux/taskstats.h create mode 100644 include/linux/taskstats_kern.h (limited to 'include') diff --git a/include/linux/taskstats.h b/include/linux/taskstats.h new file mode 100644 index 00000000000..51f62759bea --- /dev/null +++ b/include/linux/taskstats.h @@ -0,0 +1,84 @@ +/* taskstats.h - exporting per-task statistics + * + * Copyright (C) Shailabh Nagar, IBM Corp. 2006 + * (C) Balbir Singh, IBM Corp. 2006 + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of version 2.1 of the GNU Lesser General Public License + * as published by the Free Software Foundation. + * + * This program is distributed in the hope that it would be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + */ + +#ifndef _LINUX_TASKSTATS_H +#define _LINUX_TASKSTATS_H + +/* Format for per-task data returned to userland when + * - a task exits + * - listener requests stats for a task + * + * The struct is versioned. Newer versions should only add fields to + * the bottom of the struct to maintain backward compatibility. + * + * + * To add new fields + * a) bump up TASKSTATS_VERSION + * b) add comment indicating new version number at end of struct + * c) add new fields after version comment; maintain 64-bit alignment + */ + +#define TASKSTATS_VERSION 1 + +struct taskstats { + + /* Version 1 */ + __u64 version; +}; + + +#define TASKSTATS_LISTEN_GROUP 0x1 + +/* + * Commands sent from userspace + * Not versioned. New commands should only be inserted at the enum's end + * prior to __TASKSTATS_CMD_MAX + */ + +enum { + TASKSTATS_CMD_UNSPEC = 0, /* Reserved */ + TASKSTATS_CMD_GET, /* user->kernel request/get-response */ + TASKSTATS_CMD_NEW, /* kernel->user event */ + __TASKSTATS_CMD_MAX, +}; + +#define TASKSTATS_CMD_MAX (__TASKSTATS_CMD_MAX - 1) + +enum { + TASKSTATS_TYPE_UNSPEC = 0, /* Reserved */ + TASKSTATS_TYPE_PID, /* Process id */ + TASKSTATS_TYPE_TGID, /* Thread group id */ + TASKSTATS_TYPE_STATS, /* taskstats structure */ + TASKSTATS_TYPE_AGGR_PID, /* contains pid + stats */ + TASKSTATS_TYPE_AGGR_TGID, /* contains tgid + stats */ + __TASKSTATS_TYPE_MAX, +}; + +#define TASKSTATS_TYPE_MAX (__TASKSTATS_TYPE_MAX - 1) + +enum { + TASKSTATS_CMD_ATTR_UNSPEC = 0, + TASKSTATS_CMD_ATTR_PID, + TASKSTATS_CMD_ATTR_TGID, + __TASKSTATS_CMD_ATTR_MAX, +}; + +#define TASKSTATS_CMD_ATTR_MAX (__TASKSTATS_CMD_ATTR_MAX - 1) + +/* NETLINK_GENERIC related info */ + +#define TASKSTATS_GENL_NAME "TASKSTATS" +#define TASKSTATS_GENL_VERSION 0x1 + +#endif /* _LINUX_TASKSTATS_H */ diff --git a/include/linux/taskstats_kern.h b/include/linux/taskstats_kern.h new file mode 100644 index 00000000000..bd0ecb969c2 --- /dev/null +++ b/include/linux/taskstats_kern.h @@ -0,0 +1,57 @@ +/* taskstats_kern.h - kernel header for per-task statistics interface + * + * Copyright (C) Shailabh Nagar, IBM Corp. 2006 + * (C) Balbir Singh, IBM Corp. 2006 + */ + +#ifndef _LINUX_TASKSTATS_KERN_H +#define _LINUX_TASKSTATS_KERN_H + +#include +#include + +enum { + TASKSTATS_MSG_UNICAST, /* send data only to requester */ + TASKSTATS_MSG_MULTICAST, /* send data to a group */ +}; + +#ifdef CONFIG_TASKSTATS +extern kmem_cache_t *taskstats_cache; + +static inline void taskstats_exit_alloc(struct taskstats **ptidstats, + struct taskstats **ptgidstats) +{ + *ptidstats = kmem_cache_zalloc(taskstats_cache, SLAB_KERNEL); + *ptgidstats = kmem_cache_zalloc(taskstats_cache, SLAB_KERNEL); +} + +static inline void taskstats_exit_free(struct taskstats *tidstats, + struct taskstats *tgidstats) +{ + if (tidstats) + kmem_cache_free(taskstats_cache, tidstats); + if (tgidstats) + kmem_cache_free(taskstats_cache, tgidstats); +} + +extern void taskstats_exit_send(struct task_struct *, struct taskstats *, + struct taskstats *); +extern void taskstats_init_early(void); + +#else +static inline void taskstats_exit_alloc(struct taskstats **ptidstats, + struct taskstats **ptgidstats) +{} +static inline void taskstats_exit_free(struct taskstats *ptidstats, + struct taskstats *ptgidstats) +{} +static inline void taskstats_exit_send(struct task_struct *tsk, + struct taskstats *tidstats, + struct taskstats *tgidstats) +{} +static inline void taskstats_init_early(void) +{} +#endif /* CONFIG_TASKSTATS */ + +#endif + -- cgit v1.2.3 From 6f44993fe1d7b2b097f6ac60cd5835c6f5ca0874 Mon Sep 17 00:00:00 2001 From: Shailabh Nagar Date: Fri, 14 Jul 2006 00:24:41 -0700 Subject: [PATCH] per-task-delay-accounting: delay accounting usage of taskstats interface Usage of taskstats interface by delay accounting. Signed-off-by: Shailabh Nagar Signed-off-by: Balbir Singh Cc: Jes Sorensen Cc: Peter Chubb Cc: Erich Focht Cc: Levent Serinol Cc: Jay Lan Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- include/linux/delayacct.h | 15 ++++++++++++ include/linux/sched.h | 1 + include/linux/taskstats.h | 55 +++++++++++++++++++++++++++++++++++++++++- include/linux/taskstats_kern.h | 1 + 4 files changed, 71 insertions(+), 1 deletion(-) (limited to 'include') diff --git a/include/linux/delayacct.h b/include/linux/delayacct.h index 0ecbf9aad8e..d955078a144 100644 --- a/include/linux/delayacct.h +++ b/include/linux/delayacct.h @@ -18,6 +18,7 @@ #define _LINUX_DELAYACCT_H #include +#include /* * Per-task flags relevant to delay accounting @@ -35,6 +36,7 @@ extern void __delayacct_tsk_init(struct task_struct *); extern void __delayacct_tsk_exit(struct task_struct *); extern void __delayacct_blkio_start(void); extern void __delayacct_blkio_end(void); +extern int __delayacct_add_tsk(struct taskstats *, struct task_struct *); static inline void delayacct_set_flag(int flag) { @@ -74,6 +76,16 @@ static inline void delayacct_blkio_end(void) __delayacct_blkio_end(); } +static inline int delayacct_add_tsk(struct taskstats *d, + struct task_struct *tsk) +{ + if (likely(!delayacct_on)) + return -EINVAL; + if (!tsk->delays) + return 0; + return __delayacct_add_tsk(d, tsk); +} + #else static inline void delayacct_set_flag(int flag) {} @@ -89,6 +101,9 @@ static inline void delayacct_blkio_start(void) {} static inline void delayacct_blkio_end(void) {} +static inline int delayacct_add_tsk(struct taskstats *d, + struct task_struct *tsk) +{ return 0; } #endif /* CONFIG_TASK_DELAY_ACCT */ #endif diff --git a/include/linux/sched.h b/include/linux/sched.h index f751062d89a..3c5610ca0c9 100644 --- a/include/linux/sched.h +++ b/include/linux/sched.h @@ -990,6 +990,7 @@ struct task_struct { */ struct pipe_inode_info *splice_pipe; #ifdef CONFIG_TASK_DELAY_ACCT + spinlock_t delays_lock; struct task_delay_info *delays; #endif }; diff --git a/include/linux/taskstats.h b/include/linux/taskstats.h index 51f62759bea..c6aeca32348 100644 --- a/include/linux/taskstats.h +++ b/include/linux/taskstats.h @@ -34,7 +34,60 @@ struct taskstats { /* Version 1 */ - __u64 version; + __u16 version; + __u16 padding[3]; /* Userspace should not interpret the padding + * field which can be replaced by useful + * fields if struct taskstats is extended. + */ + + /* Delay accounting fields start + * + * All values, until comment "Delay accounting fields end" are + * available only if delay accounting is enabled, even though the last + * few fields are not delays + * + * xxx_count is the number of delay values recorded + * xxx_delay_total is the corresponding cumulative delay in nanoseconds + * + * xxx_delay_total wraps around to zero on overflow + * xxx_count incremented regardless of overflow + */ + + /* Delay waiting for cpu, while runnable + * count, delay_total NOT updated atomically + */ + __u64 cpu_count; + __u64 cpu_delay_total; + + /* Following four fields atomically updated using task->delays->lock */ + + /* Delay waiting for synchronous block I/O to complete + * does not account for delays in I/O submission + */ + __u64 blkio_count; + __u64 blkio_delay_total; + + /* Delay waiting for page fault I/O (swap in only) */ + __u64 swapin_count; + __u64 swapin_delay_total; + + /* cpu "wall-clock" running time + * On some architectures, value will adjust for cpu time stolen + * from the kernel in involuntary waits due to virtualization. + * Value is cumulative, in nanoseconds, without a corresponding count + * and wraps around to zero silently on overflow + */ + __u64 cpu_run_real_total; + + /* cpu "virtual" running time + * Uses time intervals seen by the kernel i.e. no adjustment + * for kernel's involuntary waits due to virtualization. + * Value is cumulative, in nanoseconds, without a corresponding count + * and wraps around to zero silently on overflow + */ + __u64 cpu_run_virtual_total; + /* Delay accounting fields end */ + /* version 1 ends here */ }; diff --git a/include/linux/taskstats_kern.h b/include/linux/taskstats_kern.h index bd0ecb969c2..fc9da2e2644 100644 --- a/include/linux/taskstats_kern.h +++ b/include/linux/taskstats_kern.h @@ -17,6 +17,7 @@ enum { #ifdef CONFIG_TASKSTATS extern kmem_cache_t *taskstats_cache; +extern struct mutex taskstats_exit_mutex; static inline void taskstats_exit_alloc(struct taskstats **ptidstats, struct taskstats **ptgidstats) -- cgit v1.2.3 From 25890454667b3295f67b3372352be90705f8667c Mon Sep 17 00:00:00 2001 From: Shailabh Nagar Date: Fri, 14 Jul 2006 00:24:43 -0700 Subject: [PATCH] per-task-delay-accounting: /proc export of aggregated block I/O delays Export I/O delays seen by a task through /proc//stats for use in top etc. Note that delays for I/O done for swapping in pages (swapin I/O) is clubbed together with all other I/O here (this is not the case in the netlink interface where the swapin I/O is kept distinct) [akpm@osdl.org: printk warning fix] Signed-off-by: Shailabh Nagar Signed-off-by: Balbir Singh Cc: Jes Sorensen Cc: Peter Chubb Cc: Erich Focht Cc: Levent Serinol Cc: Jay Lan Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- include/linux/delayacct.h | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'include') diff --git a/include/linux/delayacct.h b/include/linux/delayacct.h index d955078a144..7e8b6011b8f 100644 --- a/include/linux/delayacct.h +++ b/include/linux/delayacct.h @@ -37,6 +37,7 @@ extern void __delayacct_tsk_exit(struct task_struct *); extern void __delayacct_blkio_start(void); extern void __delayacct_blkio_end(void); extern int __delayacct_add_tsk(struct taskstats *, struct task_struct *); +extern __u64 __delayacct_blkio_ticks(struct task_struct *); static inline void delayacct_set_flag(int flag) { @@ -86,6 +87,13 @@ static inline int delayacct_add_tsk(struct taskstats *d, return __delayacct_add_tsk(d, tsk); } +static inline __u64 delayacct_blkio_ticks(struct task_struct *tsk) +{ + if (tsk->delays) + return __delayacct_blkio_ticks(tsk); + return 0; +} + #else static inline void delayacct_set_flag(int flag) {} @@ -104,6 +112,8 @@ static inline void delayacct_blkio_end(void) static inline int delayacct_add_tsk(struct taskstats *d, struct task_struct *tsk) { return 0; } +static inline __u64 delayacct_blkio_ticks(struct task_struct *tsk) +{ return 0; } #endif /* CONFIG_TASK_DELAY_ACCT */ #endif -- cgit v1.2.3 From ad4ecbcba72855a2b5319b96e2a3a65ed1ca3bfd Mon Sep 17 00:00:00 2001 From: Shailabh Nagar Date: Fri, 14 Jul 2006 00:24:44 -0700 Subject: [PATCH] delay accounting taskstats interface send tgid once Send per-tgid data only once during exit of a thread group instead of once with each member thread exit. Currently, when a thread exits, besides its per-tid data, the per-tgid data of its thread group is also sent out, if its thread group is non-empty. The per-tgid data sent consists of the sum of per-tid stats for all *remaining* threads of the thread group. This patch modifies this sending in two ways: - the per-tgid data is sent only when the last thread of a thread group exits. This cuts down heavily on the overhead of sending/receiving per-tgid data, especially when other exploiters of the taskstats interface aren't interested in per-tgid stats - the semantics of the per-tgid data sent are changed. Instead of being the sum of per-tid data for remaining threads, the value now sent is the true total accumalated statistics for all threads that are/were part of the thread group. The patch also addresses a minor issue where failure of one accounting subsystem to fill in the taskstats structure was causing the send of taskstats to not be sent at all. The patch has been tested for stability and run cerberus for over 4 hours on an SMP. [akpm@osdl.org: bugfixes] Signed-off-by: Shailabh Nagar Signed-off-by: Balbir Singh Cc: Jay Lan Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- include/linux/sched.h | 4 +++ include/linux/taskstats_kern.h | 71 ++++++++++++++++++++++++++++++++---------- 2 files changed, 59 insertions(+), 16 deletions(-) (limited to 'include') diff --git a/include/linux/sched.h b/include/linux/sched.h index 3c5610ca0c9..6afa72e080c 100644 --- a/include/linux/sched.h +++ b/include/linux/sched.h @@ -463,6 +463,10 @@ struct signal_struct { #ifdef CONFIG_BSD_PROCESS_ACCT struct pacct_struct pacct; /* per-process accounting information */ #endif +#ifdef CONFIG_TASKSTATS + spinlock_t stats_lock; + struct taskstats *stats; +#endif }; /* Context switch must be unlocked if interrupts are to be enabled */ diff --git a/include/linux/taskstats_kern.h b/include/linux/taskstats_kern.h index fc9da2e2644..0ae8f67af1f 100644 --- a/include/linux/taskstats_kern.h +++ b/include/linux/taskstats_kern.h @@ -19,36 +19,75 @@ enum { extern kmem_cache_t *taskstats_cache; extern struct mutex taskstats_exit_mutex; -static inline void taskstats_exit_alloc(struct taskstats **ptidstats, - struct taskstats **ptgidstats) +static inline void taskstats_exit_alloc(struct taskstats **ptidstats) { *ptidstats = kmem_cache_zalloc(taskstats_cache, SLAB_KERNEL); - *ptgidstats = kmem_cache_zalloc(taskstats_cache, SLAB_KERNEL); } -static inline void taskstats_exit_free(struct taskstats *tidstats, - struct taskstats *tgidstats) +static inline void taskstats_exit_free(struct taskstats *tidstats) { if (tidstats) kmem_cache_free(taskstats_cache, tidstats); - if (tgidstats) - kmem_cache_free(taskstats_cache, tgidstats); } -extern void taskstats_exit_send(struct task_struct *, struct taskstats *, - struct taskstats *); -extern void taskstats_init_early(void); +static inline void taskstats_tgid_init(struct signal_struct *sig) +{ + spin_lock_init(&sig->stats_lock); + sig->stats = NULL; +} + +static inline void taskstats_tgid_alloc(struct signal_struct *sig) +{ + struct taskstats *stats; + unsigned long flags; + + stats = kmem_cache_zalloc(taskstats_cache, SLAB_KERNEL); + if (!stats) + return; + + spin_lock_irqsave(&sig->stats_lock, flags); + if (!sig->stats) { + sig->stats = stats; + stats = NULL; + } + spin_unlock_irqrestore(&sig->stats_lock, flags); + + if (stats) + kmem_cache_free(taskstats_cache, stats); +} +static inline void taskstats_tgid_free(struct signal_struct *sig) +{ + struct taskstats *stats = NULL; + unsigned long flags; + + spin_lock_irqsave(&sig->stats_lock, flags); + if (sig->stats) { + stats = sig->stats; + sig->stats = NULL; + } + spin_unlock_irqrestore(&sig->stats_lock, flags); + if (stats) + kmem_cache_free(taskstats_cache, stats); +} + +extern void taskstats_exit_send(struct task_struct *, struct taskstats *, int); +extern void taskstats_init_early(void); +extern void taskstats_tgid_alloc(struct signal_struct *); #else -static inline void taskstats_exit_alloc(struct taskstats **ptidstats, - struct taskstats **ptgidstats) +static inline void taskstats_exit_alloc(struct taskstats **ptidstats) {} -static inline void taskstats_exit_free(struct taskstats *ptidstats, - struct taskstats *ptgidstats) +static inline void taskstats_exit_free(struct taskstats *ptidstats) {} static inline void taskstats_exit_send(struct task_struct *tsk, - struct taskstats *tidstats, - struct taskstats *tgidstats) + struct taskstats *tidstats, + int group_dead) +{} +static inline void taskstats_tgid_init(struct signal_struct *sig) +{} +static inline void taskstats_tgid_alloc(struct signal_struct *sig) +{} +static inline void taskstats_tgid_free(struct signal_struct *sig) {} static inline void taskstats_init_early(void) {} -- cgit v1.2.3 From c8924363da07aec213e5d359f23eeae1fff91951 Mon Sep 17 00:00:00 2001 From: Shailabh Nagar Date: Fri, 14 Jul 2006 00:24:46 -0700 Subject: [PATCH] per-task delay accounting: avoid send without listeners Don't send taskstats (per-pid or per-tgid) on thread exit when no one is listening for such data. Currently the taskstats interface allocates a structure, fills it in and calls netlink to send out per-pid and per-tgid stats regardless of whether a userspace listener for the data exists (netlink layer would check for that and avoid the multicast). As a result of this patch, the check for the no-listener case is performed early, avoiding the redundant allocation and filling up of the taskstats structures. Signed-off-by: Balbir Singh Signed-off-by: Shailabh Nagar Cc: Jay Lan Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- include/linux/taskstats_kern.h | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'include') diff --git a/include/linux/taskstats_kern.h b/include/linux/taskstats_kern.h index 0ae8f67af1f..2b6adec3a2e 100644 --- a/include/linux/taskstats_kern.h +++ b/include/linux/taskstats_kern.h @@ -9,6 +9,7 @@ #include #include +#include enum { TASKSTATS_MSG_UNICAST, /* send data only to requester */ @@ -19,9 +20,19 @@ enum { extern kmem_cache_t *taskstats_cache; extern struct mutex taskstats_exit_mutex; +static inline int taskstats_has_listeners(void) +{ + if (!genl_sock) + return 0; + return netlink_has_listeners(genl_sock, TASKSTATS_LISTEN_GROUP); +} + + static inline void taskstats_exit_alloc(struct taskstats **ptidstats) { - *ptidstats = kmem_cache_zalloc(taskstats_cache, SLAB_KERNEL); + *ptidstats = NULL; + if (taskstats_has_listeners()) + *ptidstats = kmem_cache_zalloc(taskstats_cache, SLAB_KERNEL); } static inline void taskstats_exit_free(struct taskstats *tidstats) -- cgit v1.2.3 From f9fd8914c1acca0d98b69d831b128d5b52f03c51 Mon Sep 17 00:00:00 2001 From: Shailabh Nagar Date: Fri, 14 Jul 2006 00:24:47 -0700 Subject: [PATCH] per-task delay accounting taskstats interface: control exit data through cpumasks On systems with a large number of cpus, with even a modest rate of tasks exiting per cpu, the volume of taskstats data sent on thread exit can overflow a userspace listener's buffers. One approach to avoiding overflow is to allow listeners to get data for a limited and specific set of cpus. By scaling the number of listeners and/or the cpus they monitor, userspace can handle the statistical data overload more gracefully. In this patch, each listener registers to listen to a specific set of cpus by specifying a cpumask. The interest is recorded per-cpu. When a task exits on a cpu, its taskstats data is unicast to each listener interested in that cpu. Thanks to Andrew Morton for pointing out the various scalability and general concerns of previous attempts and for suggesting this design. [akpm@osdl.org: build fix] Signed-off-by: Shailabh Nagar Signed-off-by: Balbir Singh Signed-off-by: Chandra Seetharaman Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- include/linux/taskstats.h | 4 ++-- include/linux/taskstats_kern.h | 27 ++++----------------------- 2 files changed, 6 insertions(+), 25 deletions(-) (limited to 'include') diff --git a/include/linux/taskstats.h b/include/linux/taskstats.h index c6aeca32348..f1cb6cddd19 100644 --- a/include/linux/taskstats.h +++ b/include/linux/taskstats.h @@ -91,8 +91,6 @@ struct taskstats { }; -#define TASKSTATS_LISTEN_GROUP 0x1 - /* * Commands sent from userspace * Not versioned. New commands should only be inserted at the enum's end @@ -124,6 +122,8 @@ enum { TASKSTATS_CMD_ATTR_UNSPEC = 0, TASKSTATS_CMD_ATTR_PID, TASKSTATS_CMD_ATTR_TGID, + TASKSTATS_CMD_ATTR_REGISTER_CPUMASK, + TASKSTATS_CMD_ATTR_DEREGISTER_CPUMASK, __TASKSTATS_CMD_ATTR_MAX, }; diff --git a/include/linux/taskstats_kern.h b/include/linux/taskstats_kern.h index 2b6adec3a2e..16894b7edcc 100644 --- a/include/linux/taskstats_kern.h +++ b/include/linux/taskstats_kern.h @@ -11,30 +11,10 @@ #include #include -enum { - TASKSTATS_MSG_UNICAST, /* send data only to requester */ - TASKSTATS_MSG_MULTICAST, /* send data to a group */ -}; - #ifdef CONFIG_TASKSTATS extern kmem_cache_t *taskstats_cache; extern struct mutex taskstats_exit_mutex; -static inline int taskstats_has_listeners(void) -{ - if (!genl_sock) - return 0; - return netlink_has_listeners(genl_sock, TASKSTATS_LISTEN_GROUP); -} - - -static inline void taskstats_exit_alloc(struct taskstats **ptidstats) -{ - *ptidstats = NULL; - if (taskstats_has_listeners()) - *ptidstats = kmem_cache_zalloc(taskstats_cache, SLAB_KERNEL); -} - static inline void taskstats_exit_free(struct taskstats *tidstats) { if (tidstats) @@ -82,17 +62,18 @@ static inline void taskstats_tgid_free(struct signal_struct *sig) kmem_cache_free(taskstats_cache, stats); } -extern void taskstats_exit_send(struct task_struct *, struct taskstats *, int); +extern void taskstats_exit_alloc(struct taskstats **, unsigned int *); +extern void taskstats_exit_send(struct task_struct *, struct taskstats *, int, unsigned int); extern void taskstats_init_early(void); extern void taskstats_tgid_alloc(struct signal_struct *); #else -static inline void taskstats_exit_alloc(struct taskstats **ptidstats) +static inline void taskstats_exit_alloc(struct taskstats **ptidstats, unsigned int *mycpu) {} static inline void taskstats_exit_free(struct taskstats *ptidstats) {} static inline void taskstats_exit_send(struct task_struct *tsk, struct taskstats *tidstats, - int group_dead) + int group_dead, unsigned int cpu) {} static inline void taskstats_tgid_init(struct signal_struct *sig) {} -- cgit v1.2.3 From 52393ccc0a53c130f31fbbdb8b40b2aadb55ee72 Mon Sep 17 00:00:00 2001 From: Steven Rostedt Date: Fri, 14 Jul 2006 16:05:03 -0400 Subject: [PATCH] remove set_wmb - arch removal set_wmb should not be used in the kernel because it just confuses the code more and has no benefit. Since it is not currently used in the kernel this patch removes it so that new code does not include it. All archs define set_wmb(var, value) to do { var = value; wmb(); } while(0) except ia64 and sparc which use a mb() instead. But this is still moot since it is not used anyway. Hasn't been tested on any archs but x86 and x86_64 (and only compiled tested) Signed-off-by: Steven Rostedt Signed-off-by: Linus Torvalds --- include/asm-alpha/barrier.h | 3 --- include/asm-arm/system.h | 1 - include/asm-arm26/system.h | 1 - include/asm-cris/system.h | 1 - include/asm-frv/system.h | 1 - include/asm-h8300/system.h | 1 - include/asm-i386/system.h | 2 -- include/asm-ia64/system.h | 3 +-- include/asm-m32r/system.h | 1 - include/asm-m68k/system.h | 1 - include/asm-m68knommu/system.h | 1 - include/asm-mips/system.h | 3 --- include/asm-parisc/system.h | 2 -- include/asm-powerpc/system.h | 1 - include/asm-ppc/system.h | 1 - include/asm-s390/system.h | 1 - include/asm-sh/system.h | 1 - include/asm-sh64/system.h | 1 - include/asm-sparc/system.h | 1 - include/asm-sparc64/system.h | 2 -- include/asm-v850/system.h | 1 - include/asm-x86_64/system.h | 1 - include/asm-xtensa/system.h | 1 - 23 files changed, 1 insertion(+), 31 deletions(-) (limited to 'include') diff --git a/include/asm-alpha/barrier.h b/include/asm-alpha/barrier.h index 681ff581afa..384dc08d6f5 100644 --- a/include/asm-alpha/barrier.h +++ b/include/asm-alpha/barrier.h @@ -30,7 +30,4 @@ __asm__ __volatile__("mb": : :"memory") #define set_mb(var, value) \ do { var = value; mb(); } while (0) -#define set_wmb(var, value) \ -do { var = value; wmb(); } while (0) - #endif /* __BARRIER_H */ diff --git a/include/asm-arm/system.h b/include/asm-arm/system.h index 6001febfe63..0947cbf9b69 100644 --- a/include/asm-arm/system.h +++ b/include/asm-arm/system.h @@ -176,7 +176,6 @@ extern unsigned int user_debug; #define wmb() mb() #define read_barrier_depends() do { } while(0) #define set_mb(var, value) do { var = value; mb(); } while (0) -#define set_wmb(var, value) do { var = value; wmb(); } while (0) #define nop() __asm__ __volatile__("mov\tr0,r0\t@ nop\n\t"); /* diff --git a/include/asm-arm26/system.h b/include/asm-arm26/system.h index d1f69d70619..00ae32aa1db 100644 --- a/include/asm-arm26/system.h +++ b/include/asm-arm26/system.h @@ -90,7 +90,6 @@ extern unsigned int user_debug; #define read_barrier_depends() do { } while(0) #define set_mb(var, value) do { var = value; mb(); } while (0) -#define set_wmb(var, value) do { var = value; wmb(); } while (0) /* * We assume knowledge of how diff --git a/include/asm-cris/system.h b/include/asm-cris/system.h index b1c593b6dbf..b869f6161aa 100644 --- a/include/asm-cris/system.h +++ b/include/asm-cris/system.h @@ -17,7 +17,6 @@ extern struct task_struct *resume(struct task_struct *prev, struct task_struct * #define wmb() mb() #define read_barrier_depends() do { } while(0) #define set_mb(var, value) do { var = value; mb(); } while (0) -#define set_wmb(var, value) do { var = value; wmb(); } while (0) #ifdef CONFIG_SMP #define smp_mb() mb() diff --git a/include/asm-frv/system.h b/include/asm-frv/system.h index 351863dfd06..1166899317d 100644 --- a/include/asm-frv/system.h +++ b/include/asm-frv/system.h @@ -179,7 +179,6 @@ do { \ #define rmb() asm volatile ("membar" : : :"memory") #define wmb() asm volatile ("membar" : : :"memory") #define set_mb(var, value) do { var = value; mb(); } while (0) -#define set_wmb(var, value) do { var = value; wmb(); } while (0) #define smp_mb() mb() #define smp_rmb() rmb() diff --git a/include/asm-h8300/system.h b/include/asm-h8300/system.h index 134e0929fce..5084a9d4292 100644 --- a/include/asm-h8300/system.h +++ b/include/asm-h8300/system.h @@ -84,7 +84,6 @@ asmlinkage void resume(void); #define wmb() asm volatile ("" : : :"memory") #define set_rmb(var, value) do { xchg(&var, value); } while (0) #define set_mb(var, value) set_rmb(var, value) -#define set_wmb(var, value) do { var = value; wmb(); } while (0) #ifdef CONFIG_SMP #define smp_mb() mb() diff --git a/include/asm-i386/system.h b/include/asm-i386/system.h index 2db168ef949..49928eb33f8 100644 --- a/include/asm-i386/system.h +++ b/include/asm-i386/system.h @@ -453,8 +453,6 @@ static inline unsigned long long __cmpxchg64(volatile void *ptr, unsigned long l #define set_mb(var, value) do { var = value; barrier(); } while (0) #endif -#define set_wmb(var, value) do { var = value; wmb(); } while (0) - #include /* diff --git a/include/asm-ia64/system.h b/include/asm-ia64/system.h index 65db43ce4de..fc9677bc87e 100644 --- a/include/asm-ia64/system.h +++ b/include/asm-ia64/system.h @@ -98,12 +98,11 @@ extern struct ia64_boot_param { #endif /* - * XXX check on these---I suspect what Linus really wants here is + * XXX check on this ---I suspect what Linus really wants here is * acquire vs release semantics but we can't discuss this stuff with * Linus just yet. Grrr... */ #define set_mb(var, value) do { (var) = (value); mb(); } while (0) -#define set_wmb(var, value) do { (var) = (value); mb(); } while (0) #define safe_halt() ia64_pal_halt_light() /* PAL_HALT_LIGHT */ diff --git a/include/asm-m32r/system.h b/include/asm-m32r/system.h index 311cebf44ef..9e618afec6e 100644 --- a/include/asm-m32r/system.h +++ b/include/asm-m32r/system.h @@ -336,7 +336,6 @@ __cmpxchg(volatile void *ptr, unsigned long old, unsigned long new, int size) #endif #define set_mb(var, value) do { xchg(&var, value); } while (0) -#define set_wmb(var, value) do { var = value; wmb(); } while (0) #define arch_align_stack(x) (x) diff --git a/include/asm-m68k/system.h b/include/asm-m68k/system.h index d6dd8052cd6..131a0cb0f49 100644 --- a/include/asm-m68k/system.h +++ b/include/asm-m68k/system.h @@ -80,7 +80,6 @@ static inline int irqs_disabled(void) #define wmb() barrier() #define read_barrier_depends() do { } while(0) #define set_mb(var, value) do { xchg(&var, value); } while (0) -#define set_wmb(var, value) do { var = value; wmb(); } while (0) #define smp_mb() barrier() #define smp_rmb() barrier() diff --git a/include/asm-m68knommu/system.h b/include/asm-m68knommu/system.h index 2bbe2db00a2..2a814498672 100644 --- a/include/asm-m68knommu/system.h +++ b/include/asm-m68knommu/system.h @@ -106,7 +106,6 @@ asmlinkage void resume(void); #define wmb() asm volatile ("" : : :"memory") #define set_rmb(var, value) do { xchg(&var, value); } while (0) #define set_mb(var, value) set_rmb(var, value) -#define set_wmb(var, value) do { var = value; wmb(); } while (0) #ifdef CONFIG_SMP #define smp_mb() mb() diff --git a/include/asm-mips/system.h b/include/asm-mips/system.h index 13c98dde82d..dcb4701d572 100644 --- a/include/asm-mips/system.h +++ b/include/asm-mips/system.h @@ -143,9 +143,6 @@ #define set_mb(var, value) \ do { var = value; mb(); } while (0) -#define set_wmb(var, value) \ -do { var = value; wmb(); } while (0) - /* * switch_to(n) should switch tasks to task nr n, first * checking that n isn't the current task, in which case it does nothing. diff --git a/include/asm-parisc/system.h b/include/asm-parisc/system.h index 5fe2d2329ab..74f037a39e6 100644 --- a/include/asm-parisc/system.h +++ b/include/asm-parisc/system.h @@ -143,8 +143,6 @@ static inline void set_eiem(unsigned long val) #define read_barrier_depends() do { } while(0) #define set_mb(var, value) do { var = value; mb(); } while (0) -#define set_wmb(var, value) do { var = value; wmb(); } while (0) - #ifndef CONFIG_PA20 /* Because kmalloc only guarantees 8-byte alignment for kmalloc'd data, diff --git a/include/asm-powerpc/system.h b/include/asm-powerpc/system.h index c6569516ba3..7307aa77567 100644 --- a/include/asm-powerpc/system.h +++ b/include/asm-powerpc/system.h @@ -39,7 +39,6 @@ #define read_barrier_depends() do { } while(0) #define set_mb(var, value) do { var = value; mb(); } while (0) -#define set_wmb(var, value) do { var = value; wmb(); } while (0) #ifdef __KERNEL__ #ifdef CONFIG_SMP diff --git a/include/asm-ppc/system.h b/include/asm-ppc/system.h index fb49c0c49ea..738943584c0 100644 --- a/include/asm-ppc/system.h +++ b/include/asm-ppc/system.h @@ -33,7 +33,6 @@ #define read_barrier_depends() do { } while(0) #define set_mb(var, value) do { var = value; mb(); } while (0) -#define set_wmb(var, value) do { var = value; wmb(); } while (0) #ifdef CONFIG_SMP #define smp_mb() mb() diff --git a/include/asm-s390/system.h b/include/asm-s390/system.h index 9ab186ffde2..36a3a85d611 100644 --- a/include/asm-s390/system.h +++ b/include/asm-s390/system.h @@ -299,7 +299,6 @@ __cmpxchg(volatile void *ptr, unsigned long old, unsigned long new, int size) #define set_mb(var, value) do { var = value; mb(); } while (0) -#define set_wmb(var, value) do { var = value; wmb(); } while (0) #ifdef __s390x__ diff --git a/include/asm-sh/system.h b/include/asm-sh/system.h index ce2e60664a8..ad35ad4958f 100644 --- a/include/asm-sh/system.h +++ b/include/asm-sh/system.h @@ -101,7 +101,6 @@ extern void __xchg_called_with_bad_pointer(void); #endif #define set_mb(var, value) do { xchg(&var, value); } while (0) -#define set_wmb(var, value) do { var = value; wmb(); } while (0) /* Interrupt Control */ static __inline__ void local_irq_enable(void) diff --git a/include/asm-sh64/system.h b/include/asm-sh64/system.h index 7606f6e1f01..87ef6f1ad5a 100644 --- a/include/asm-sh64/system.h +++ b/include/asm-sh64/system.h @@ -66,7 +66,6 @@ extern void __xchg_called_with_bad_pointer(void); #define set_rmb(var, value) do { xchg(&var, value); } while (0) #define set_mb(var, value) set_rmb(var, value) -#define set_wmb(var, value) do { var = value; wmb(); } while (0) /* Interrupt Control */ #ifndef HARD_CLI diff --git a/include/asm-sparc/system.h b/include/asm-sparc/system.h index cb7dda1e5e9..100c3eaf3c1 100644 --- a/include/asm-sparc/system.h +++ b/include/asm-sparc/system.h @@ -199,7 +199,6 @@ static inline unsigned long getipl(void) #define wmb() mb() #define read_barrier_depends() do { } while(0) #define set_mb(__var, __value) do { __var = __value; mb(); } while(0) -#define set_wmb(__var, __value) set_mb(__var, __value) #define smp_mb() __asm__ __volatile__("":::"memory") #define smp_rmb() __asm__ __volatile__("":::"memory") #define smp_wmb() __asm__ __volatile__("":::"memory") diff --git a/include/asm-sparc64/system.h b/include/asm-sparc64/system.h index 4ca68600c67..a8b7432c9a7 100644 --- a/include/asm-sparc64/system.h +++ b/include/asm-sparc64/system.h @@ -123,8 +123,6 @@ do { __asm__ __volatile__("ba,pt %%xcc, 1f\n\t" \ #define read_barrier_depends() do { } while(0) #define set_mb(__var, __value) \ do { __var = __value; membar_storeload_storestore(); } while(0) -#define set_wmb(__var, __value) \ - do { __var = __value; wmb(); } while(0) #ifdef CONFIG_SMP #define smp_mb() mb() diff --git a/include/asm-v850/system.h b/include/asm-v850/system.h index 7091af4b786..da39916f10b 100644 --- a/include/asm-v850/system.h +++ b/include/asm-v850/system.h @@ -68,7 +68,6 @@ static inline int irqs_disabled (void) #define read_barrier_depends() ((void)0) #define set_rmb(var, value) do { xchg (&var, value); } while (0) #define set_mb(var, value) set_rmb (var, value) -#define set_wmb(var, value) do { var = value; wmb (); } while (0) #define smp_mb() mb () #define smp_rmb() rmb () diff --git a/include/asm-x86_64/system.h b/include/asm-x86_64/system.h index f67f2873a92..6bf170bceae 100644 --- a/include/asm-x86_64/system.h +++ b/include/asm-x86_64/system.h @@ -240,7 +240,6 @@ static inline unsigned long __cmpxchg(volatile void *ptr, unsigned long old, #endif #define read_barrier_depends() do {} while(0) #define set_mb(var, value) do { (void) xchg(&var, value); } while (0) -#define set_wmb(var, value) do { var = value; wmb(); } while (0) #define warn_if_not_ulong(x) do { unsigned long foo; (void) (&(x) == &foo); } while (0) diff --git a/include/asm-xtensa/system.h b/include/asm-xtensa/system.h index f986170bd2a..932bda92a21 100644 --- a/include/asm-xtensa/system.h +++ b/include/asm-xtensa/system.h @@ -99,7 +99,6 @@ static inline void disable_coprocessor(int i) #endif #define set_mb(var, value) do { var = value; mb(); } while (0) -#define set_wmb(var, value) do { var = value; wmb(); } while (0) #if !defined (__ASSEMBLY__) -- cgit v1.2.3 From 5a651c93d3a823af63b1b15bb94fdc951670fb2f Mon Sep 17 00:00:00 2001 From: Heiko Carstens Date: Mon, 17 Jul 2006 16:09:18 +0200 Subject: [S390] Fix gcc warning about unused return values. Signed-off-by: Heiko Carstens Signed-off-by: Martin Schwidefsky --- include/asm-s390/system.h | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'include') diff --git a/include/asm-s390/system.h b/include/asm-s390/system.h index 36a3a85d611..16040048cd1 100644 --- a/include/asm-s390/system.h +++ b/include/asm-s390/system.h @@ -128,8 +128,13 @@ extern void account_system_vtime(struct task_struct *); #define nop() __asm__ __volatile__ ("nop") -#define xchg(ptr,x) \ - ((__typeof__(*(ptr)))__xchg((unsigned long)(x),(void *)(ptr),sizeof(*(ptr)))) +#define xchg(ptr,x) \ +({ \ + __typeof__(*(ptr)) __ret; \ + __ret = (__typeof__(*(ptr))) \ + __xchg((unsigned long)(x), (void *)(ptr),sizeof(*(ptr))); \ + __ret; \ +}) static inline unsigned long __xchg(unsigned long x, void * ptr, int size) { -- cgit v1.2.3 From 53ba5e09fe37518683ff8b3f28410ce0b9ed2f74 Mon Sep 17 00:00:00 2001 From: Andreas Krebbel Date: Mon, 17 Jul 2006 16:09:42 +0200 Subject: [S390] get_clock inline assembly. Add missing volatile to the get_clock / get_cycles inline assemblies to avoid that consecutive calls get optimized away. Signed-off-by: Andreas Krebbel Signed-off-by: Martin Schwidefsky --- include/asm-s390/timex.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'include') diff --git a/include/asm-s390/timex.h b/include/asm-s390/timex.h index 4848057dafe..5d0332a4c2b 100644 --- a/include/asm-s390/timex.h +++ b/include/asm-s390/timex.h @@ -19,7 +19,7 @@ static inline cycles_t get_cycles(void) { cycles_t cycles; - __asm__("stck 0(%1)" : "=m" (cycles) : "a" (&cycles) : "cc"); + __asm__ __volatile__ ("stck 0(%1)" : "=m" (cycles) : "a" (&cycles) : "cc"); return cycles >> 2; } @@ -27,7 +27,7 @@ static inline unsigned long long get_clock (void) { unsigned long long clk; - __asm__("stck 0(%1)" : "=m" (clk) : "a" (&clk) : "cc"); + __asm__ __volatile__ ("stck 0(%1)" : "=m" (clk) : "a" (&clk) : "cc"); return clk; } -- cgit v1.2.3 From 13abf50df209008b5d44075bafeeab42ace56aa6 Mon Sep 17 00:00:00 2001 From: Tejun Heo Date: Mon, 10 Jul 2006 23:18:46 +0900 Subject: [PATCH] libata: improve EH action and EHI flag handling Update ata_eh_about_to_do() and ata_eh_done() to improve EH action and EHI flag handling. * There are two types of EHI flags - one which expires on successful EH and the other which expires on a successful reset. Make this distinction clear. * Unlike other EH actions, reset actions are represented by two EH action masks and a EHI modifier. Implement correct about_to_do/done semantics for resets. That is, prior to reset, related EH info is sucked in from ehi and cleared, and after reset is complete, related EH info in ehc is cleared. These changes improve consistency and remove unnecessary EH actions caused by stale EH action masks and EHI flags. Signed-off-by: Tejun Heo Signed-off-by: Jeff Garzik --- include/linux/libata.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'include') diff --git a/include/linux/libata.h b/include/linux/libata.h index 6cc497a2b6d..66c3100c2b9 100644 --- a/include/linux/libata.h +++ b/include/linux/libata.h @@ -265,12 +265,14 @@ enum { /* ata_eh_info->flags */ ATA_EHI_HOTPLUGGED = (1 << 0), /* could have been hotplugged */ - ATA_EHI_RESUME_LINK = (1 << 1), /* need to resume link */ + ATA_EHI_RESUME_LINK = (1 << 1), /* resume link (reset modifier) */ ATA_EHI_NO_AUTOPSY = (1 << 2), /* no autopsy */ ATA_EHI_QUIET = (1 << 3), /* be quiet */ ATA_EHI_DID_RESET = (1 << 16), /* already reset this port */ + ATA_EHI_RESET_MODIFIER_MASK = ATA_EHI_RESUME_LINK, + /* max repeat if error condition is still set after ->error_handler */ ATA_EH_MAX_REPEAT = 5, -- cgit v1.2.3 From 46ba6d7d8b0486e9d565729880ddfb2b84d3af31 Mon Sep 17 00:00:00 2001 From: "David S. Miller" Date: Sun, 16 Jul 2006 22:10:44 -0700 Subject: [SPARC64]: Fix more of_device layer IRQ bugs, and correct PROMREG_MAX. Sabre and Psycho PCI controllers can have partial interrupt-map properties, meaning that on-board devices don't match up to any entries. Instead, they are fully specified from the beginning and we should pass them directly to the IRQ translator as-is. Also, fill in the necessary translator slots for the "graphics" and "expansion UPA" interrupts on Sabre, Psycho, and SYSIO SBUS. Increase PROMREG_MAX to 24, as seen on SUNW,ffb devices. Finally, prevent accidentally writing past the end of the of_device struct resource[] and irqs[] arrays. Spit out a log message when we ignore some entries because there are too many of them. Signed-off-by: David S. Miller --- include/asm-sparc64/openprom.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include') diff --git a/include/asm-sparc64/openprom.h b/include/asm-sparc64/openprom.h index b4959d2b0d9..e01b80559c9 100644 --- a/include/asm-sparc64/openprom.h +++ b/include/asm-sparc64/openprom.h @@ -175,7 +175,7 @@ struct linux_nodeops { }; /* More fun PROM structures for device probing. */ -#define PROMREG_MAX 16 +#define PROMREG_MAX 24 #define PROMVADDR_MAX 16 #define PROMINTR_MAX 15 -- cgit v1.2.3 From 06ffd7956e4790d824b4b5575b56def8448ec6d4 Mon Sep 17 00:00:00 2001 From: "David S. Miller" Date: Sun, 16 Jul 2006 22:19:40 -0700 Subject: [SPARC]: Kill prom_getname, unused and not implemented properly. The m68k port's sun3 asm/oplib.h had a stray reference too, so I killed that off as well. Signed-off-by: David S. Miller --- include/asm-m68k/oplib.h | 5 ----- include/asm-sparc/oplib.h | 5 ----- include/asm-sparc64/oplib.h | 5 ----- 3 files changed, 15 deletions(-) (limited to 'include') diff --git a/include/asm-m68k/oplib.h b/include/asm-m68k/oplib.h index c3594f473ef..06caa2d0845 100644 --- a/include/asm-m68k/oplib.h +++ b/include/asm-m68k/oplib.h @@ -244,11 +244,6 @@ extern void prom_getstring(int node, char *prop, char *buf, int bufsize); /* Does the passed node have the given "name"? YES=1 NO=0 */ extern int prom_nodematch(int thisnode, char *name); -/* Puts in buffer a prom name in the form name@x,y or name (x for which_io - * and y for first regs phys address - */ -extern int prom_getname(int node, char *buf, int buflen); - /* Search all siblings starting at the passed node for "name" matching * the given string. Returns the node on success, zero on failure. */ diff --git a/include/asm-sparc/oplib.h b/include/asm-sparc/oplib.h index f283f8aaf6a..91691e52c05 100644 --- a/include/asm-sparc/oplib.h +++ b/include/asm-sparc/oplib.h @@ -267,11 +267,6 @@ extern void prom_getstring(int node, char *prop, char *buf, int bufsize); /* Does the passed node have the given "name"? YES=1 NO=0 */ extern int prom_nodematch(int thisnode, char *name); -/* Puts in buffer a prom name in the form name@x,y or name (x for which_io - * and y for first regs phys address - */ -extern int prom_getname(int node, char *buf, int buflen); - /* Search all siblings starting at the passed node for "name" matching * the given string. Returns the node on success, zero on failure. */ diff --git a/include/asm-sparc64/oplib.h b/include/asm-sparc64/oplib.h index a68b0bb0595..6a0da3b1695 100644 --- a/include/asm-sparc64/oplib.h +++ b/include/asm-sparc64/oplib.h @@ -287,11 +287,6 @@ extern void prom_getstring(int node, const char *prop, char *buf, int bufsize); /* Does the passed node have the given "name"? YES=1 NO=0 */ extern int prom_nodematch(int thisnode, const char *name); -/* Puts in buffer a prom name in the form name@x,y or name (x for which_io - * and y for first regs phys address - */ -extern int prom_getname(int node, char *buf, int buflen); - /* Search all siblings starting at the passed node for "name" matching * the given string. Returns the node on success, zero on failure. */ -- cgit v1.2.3 From ad8fec1720e000ba2384de6408076a60fc92a981 Mon Sep 17 00:00:00 2001 From: Sridhar Samudrala Date: Fri, 21 Jul 2006 14:48:50 -0700 Subject: [SCTP]: Verify all the paths to a peer via heartbeat before using them. This patch implements Path Initialization procedure as described in Sec 2.36 of RFC4460. Signed-off-by: Sridhar Samudrala Signed-off-by: David S. Miller --- include/net/sctp/structs.h | 4 ++++ include/net/sctp/user.h | 9 +++++++++ 2 files changed, 13 insertions(+) (limited to 'include') diff --git a/include/net/sctp/structs.h b/include/net/sctp/structs.h index 5f69158c100..268f2e19ccb 100644 --- a/include/net/sctp/structs.h +++ b/include/net/sctp/structs.h @@ -445,6 +445,7 @@ typedef struct sctp_sender_hb_info { struct sctp_paramhdr param_hdr; union sctp_addr daddr; unsigned long sent_at; + __u64 hb_nonce; } __attribute__((packed)) sctp_sender_hb_info_t; /* @@ -984,6 +985,9 @@ struct sctp_transport { */ char cacc_saw_newack; } cacc; + + /* 64-bit random number sent with heartbeat. */ + __u64 hb_nonce; }; struct sctp_transport *sctp_transport_new(const union sctp_addr *, diff --git a/include/net/sctp/user.h b/include/net/sctp/user.h index 8a6bef6f91e..1b7aae6cdd8 100644 --- a/include/net/sctp/user.h +++ b/include/net/sctp/user.h @@ -560,9 +560,18 @@ struct sctp_paddrinfo { } __attribute__((packed, aligned(4))); /* Peer addresses's state. */ +/* UNKNOWN: Peer address passed by the upper layer in sendmsg or connect[x] + * calls. + * UNCONFIRMED: Peer address received in INIT/INIT-ACK address parameters. + * Not yet confirmed by a heartbeat and not available for data + * transfers. + * ACTIVE : Peer address confirmed, active and available for data transfers. + * INACTIVE: Peer address inactive and not available for data transfers. + */ enum sctp_spinfo_state { SCTP_INACTIVE, SCTP_ACTIVE, + SCTP_UNCONFIRMED, SCTP_UNKNOWN = 0xffff /* Value used for transport state unknown */ }; -- cgit v1.2.3 From dc022a9874d026c7d1635ae66d1afafc5f053731 Mon Sep 17 00:00:00 2001 From: Sridhar Samudrala Date: Fri, 21 Jul 2006 14:49:25 -0700 Subject: [SCTP]: ADDIP: Don't use an address as source until it is ASCONF-ACKed This implements Rules D1 and D4 of Sec 4.3 in the ADDIP draft. Signed-off-by: Sridhar Samudrala Signed-off-by: David S. Miller --- include/net/sctp/structs.h | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) (limited to 'include') diff --git a/include/net/sctp/structs.h b/include/net/sctp/structs.h index 268f2e19ccb..e5aa7ff1f5b 100644 --- a/include/net/sctp/structs.h +++ b/include/net/sctp/structs.h @@ -731,13 +731,10 @@ void sctp_init_addrs(struct sctp_chunk *, union sctp_addr *, const union sctp_addr *sctp_source(const struct sctp_chunk *chunk); /* This is a structure for holding either an IPv6 or an IPv4 address. */ -/* sin_family -- AF_INET or AF_INET6 - * sin_port -- ordinary port number - * sin_addr -- cast to either (struct in_addr) or (struct in6_addr) - */ struct sctp_sockaddr_entry { struct list_head list; union sctp_addr a; + __u8 use_as_src; }; typedef struct sctp_chunk *(sctp_packet_phandler_t)(struct sctp_association *); @@ -1142,7 +1139,7 @@ int sctp_bind_addr_copy(struct sctp_bind_addr *dest, sctp_scope_t scope, gfp_t gfp, int flags); int sctp_add_bind_addr(struct sctp_bind_addr *, union sctp_addr *, - gfp_t gfp); + __u8 use_as_src, gfp_t gfp); int sctp_del_bind_addr(struct sctp_bind_addr *, union sctp_addr *); int sctp_bind_addr_match(struct sctp_bind_addr *, const union sctp_addr *, struct sctp_sock *); -- cgit v1.2.3 From 64d2f0855e50a7185546ee1fbc03c2badc31330f Mon Sep 17 00:00:00 2001 From: Adrian Bunk Date: Fri, 21 Jul 2006 14:49:49 -0700 Subject: [I/OAT]: net/core/user_dma.c should #include Every file should #include the headers containing the prototypes for its global functions. Especially in cases like this one where gcc can tell us through a compile error that the prototype was wrong... Signed-off-by: Adrian Bunk Signed-off-by: David S. Miller --- include/net/netdma.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include') diff --git a/include/net/netdma.h b/include/net/netdma.h index 19760eb131a..ceae5ee85c0 100644 --- a/include/net/netdma.h +++ b/include/net/netdma.h @@ -37,7 +37,7 @@ static inline struct dma_chan *get_softnet_dma(void) } int dma_skb_copy_datagram_iovec(struct dma_chan* chan, - const struct sk_buff *skb, int offset, struct iovec *to, + struct sk_buff *skb, int offset, struct iovec *to, size_t len, struct dma_pinned_list *pinned_list); #endif /* CONFIG_NET_DMA */ -- cgit v1.2.3 From 53c4b2cc7a05c034fd21d104d2ab43ea8cc0e075 Mon Sep 17 00:00:00 2001 From: Herbert Xu Date: Fri, 21 Jul 2006 14:55:38 -0700 Subject: [NET]: Fix reversed error test in netif_tx_trylock A non-zero return value indicates success from spin_trylock, not error. Signed-off-by: Herbert Xu Signed-off-by: David S. Miller --- include/linux/netdevice.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'include') diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h index 76cc099c858..75f02d8c6ed 100644 --- a/include/linux/netdevice.h +++ b/include/linux/netdevice.h @@ -924,10 +924,10 @@ static inline void netif_tx_lock_bh(struct net_device *dev) static inline int netif_tx_trylock(struct net_device *dev) { - int err = spin_trylock(&dev->_xmit_lock); - if (!err) + int ok = spin_trylock(&dev->_xmit_lock); + if (likely(ok)) dev->xmit_lock_owner = smp_processor_id(); - return err; + return ok; } static inline void netif_tx_unlock(struct net_device *dev) -- cgit v1.2.3 From aa95387774039096c11803c04011f1aa42d85758 Mon Sep 17 00:00:00 2001 From: Linus Torvalds Date: Sun, 23 Jul 2006 12:12:16 -0700 Subject: cpu hotplug: simplify and hopefully fix locking The CPU hotplug locking was quite messy, with a recursive lock to handle the fact that both the actual up/down sequence wanted to protect itself from being re-entered, but the callbacks that it called also tended to want to protect themselves from CPU events. This splits the lock into two (one to serialize the whole hotplug sequence, the other to protect against the CPU present bitmaps changing). The latter still allows recursive usage because some subsystems (ondemand policy for cpufreq at least) had already gotten too used to the lax locking, but the locking mistakes are hopefully now less fundamental, and we now warn about recursive lock usage when we see it, in the hope that it can be fixed. Signed-off-by: Linus Torvalds --- include/linux/cpu.h | 6 ------ 1 file changed, 6 deletions(-) (limited to 'include') diff --git a/include/linux/cpu.h b/include/linux/cpu.h index 44a11f1ccaf..8fb344a9abd 100644 --- a/include/linux/cpu.h +++ b/include/linux/cpu.h @@ -48,7 +48,6 @@ static inline void unregister_cpu_notifier(struct notifier_block *nb) { } #endif -extern int current_in_cpu_hotplug(void); int cpu_up(unsigned int cpu); @@ -61,10 +60,6 @@ static inline int register_cpu_notifier(struct notifier_block *nb) static inline void unregister_cpu_notifier(struct notifier_block *nb) { } -static inline int current_in_cpu_hotplug(void) -{ - return 0; -} #endif /* CONFIG_SMP */ extern struct sysdev_class cpu_sysdev_class; @@ -73,7 +68,6 @@ extern struct sysdev_class cpu_sysdev_class; /* Stop CPUs going up and down. */ extern void lock_cpu_hotplug(void); extern void unlock_cpu_hotplug(void); -extern int lock_cpu_hotplug_interruptible(void); #define hotcpu_notifier(fn, pri) { \ static struct notifier_block fn##_nb = \ { .notifier_call = fn, .priority = pri }; \ -- cgit v1.2.3 From 2527e681fd4fd4231c2e04f09d7b04d3cab8eefe Mon Sep 17 00:00:00 2001 From: Sean Hefty Date: Thu, 20 Jul 2006 11:25:50 +0300 Subject: IB/mad: Validate MADs for spec compliance Validate MADs sent by userspace clients for spec compliance with C13-18.1.1 (prevent duplicate requests and responses sent on the same port). Without this, RMPP transactions get aborted because of duplicate packets. This patch is similar to that provided by Jack Morgenstein. Signed-off-by: Sean Hefty Signed-off-by: Michael S. Tsirkin Signed-off-by: Jack Morgenstein Signed-off-by: Roland Dreier --- include/rdma/ib_mad.h | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'include') diff --git a/include/rdma/ib_mad.h b/include/rdma/ib_mad.h index 5ff77558013..585d28e960d 100644 --- a/include/rdma/ib_mad.h +++ b/include/rdma/ib_mad.h @@ -75,6 +75,7 @@ #define IB_MGMT_METHOD_TRAP_REPRESS 0x07 #define IB_MGMT_METHOD_RESP 0x80 +#define IB_BM_ATTR_MOD_RESP cpu_to_be32(1) #define IB_MGMT_MAX_METHODS 128 @@ -246,6 +247,12 @@ struct ib_mad_send_buf { int retries; }; +/** + * ib_response_mad - Returns if the specified MAD has been generated in + * response to a sent request or trap. + */ +int ib_response_mad(struct ib_mad *mad); + /** * ib_get_rmpp_resptime - Returns the RMPP response time. * @rmpp_hdr: An RMPP header. -- cgit v1.2.3 From 2266d8886f64c66e0a4e61e3e1c19dbc27ed00d4 Mon Sep 17 00:00:00 2001 From: Guillaume Chazarain Date: Sun, 23 Jul 2006 23:37:24 -0700 Subject: [PKT_SCHED]: Fix regression in PSCHED_TADD{,2}. In PSCHED_TADD and PSCHED_TADD2, if delta is less than tv.tv_usec (so, less than USEC_PER_SEC too) then tv_res will be smaller than tv. The affectation "(tv_res).tv_usec = __delta;" is wrong. The fix is to revert to the original code before 4ee303dfeac6451b402e3d8512723d3a0f861857 and change the 'if' in 'while'. [Shuya MAEDA: "while (__delta >= USEC_PER_SEC){ ... }" instead of "while (__delta > USEC_PER_SEC){ ... }"] Signed-off-by: Guillaume Chazarain Signed-off-by: David S. Miller --- include/net/pkt_sched.h | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) (limited to 'include') diff --git a/include/net/pkt_sched.h b/include/net/pkt_sched.h index 1925c65e617..f6afee73235 100644 --- a/include/net/pkt_sched.h +++ b/include/net/pkt_sched.h @@ -169,23 +169,17 @@ psched_tod_diff(int delta_sec, int bound) #define PSCHED_TADD2(tv, delta, tv_res) \ ({ \ - int __delta = (delta); \ - (tv_res) = (tv); \ - while(__delta >= USEC_PER_SEC){ \ - (tv_res).tv_sec++; \ - __delta -= USEC_PER_SEC; \ - } \ + int __delta = (tv).tv_usec + (delta); \ + (tv_res).tv_sec = (tv).tv_sec; \ + while (__delta >= USEC_PER_SEC) { (tv_res).tv_sec++; __delta -= USEC_PER_SEC; } \ (tv_res).tv_usec = __delta; \ }) #define PSCHED_TADD(tv, delta) \ ({ \ - int __delta = (delta); \ - while(__delta >= USEC_PER_SEC){ \ - (tv).tv_sec++; \ - __delta -= USEC_PER_SEC; \ - } \ - (tv).tv_usec = __delta; \ + (tv).tv_usec += (delta); \ + while ((tv).tv_usec >= USEC_PER_SEC) { (tv).tv_sec++; \ + (tv).tv_usec -= USEC_PER_SEC; } \ }) /* Set/check that time is in the "past perfect"; -- cgit v1.2.3 From d8ca3d11c6611685ea7783b4acb623bf08496f94 Mon Sep 17 00:00:00 2001 From: Martin Michlmayr Date: Mon, 24 Jul 2006 21:30:01 +0100 Subject: [ARM] 3731/1: Allow IRQ definitions of IQ80331 and IQ80332 to co-exist Patch from Martin Michlmayr ARCH_IQ80331 and MACH_IQ80332 can be enabled at the same time but a header file makes certain IRQ definitions conditional, leading to the following compilation error when both platforms are enabled: arch/arm/mach-iop3xx/iq80332-pci.c: In function 'iq80332_map_irq': arch/arm/mach-iop3xx/iq80332-pci.c:54: error: 'IRQ_IQ80332_INTA' undeclared (first use in this function) arch/arm/mach-iop3xx/iq80332-pci.c:54: error: (Each undeclared identifier is reported only once arch/arm/mach-iop3xx/iq80332-pci.c:54: error: for each function it appears in.) arch/arm/mach-iop3xx/iq80332-pci.c:54: error: 'IRQ_IQ80332_INTB' undeclared (first use in this function) arch/arm/mach-iop3xx/iq80332-pci.c:54: error: 'IRQ_IQ80332_INTC' undeclared (first use in this function) arch/arm/mach-iop3xx/iq80332-pci.c:54: error: 'IRQ_IQ80332_INTD' undeclared (first use in this function) Signed-off-by: Martin Michlmayr Signed-off-by: Russell King --- include/asm-arm/arch-iop3xx/iop331-irqs.h | 4 ---- 1 file changed, 4 deletions(-) (limited to 'include') diff --git a/include/asm-arm/arch-iop3xx/iop331-irqs.h b/include/asm-arm/arch-iop3xx/iop331-irqs.h index 8ff73d48722..7135ad7e335 100644 --- a/include/asm-arm/arch-iop3xx/iop331-irqs.h +++ b/include/asm-arm/arch-iop3xx/iop331-irqs.h @@ -91,7 +91,6 @@ #define NR_IRQS NR_IOP331_IRQS -#if defined(CONFIG_ARCH_IQ80331) /* * Interrupts available on the IQ80331 board */ @@ -111,7 +110,6 @@ #define IRQ_IQ80331_INTC IRQ_IOP331_XINT2 #define IRQ_IQ80331_INTD IRQ_IOP331_XINT3 -#elif defined(CONFIG_MACH_IQ80332) /* * Interrupts available on the IQ80332 board */ @@ -131,6 +129,4 @@ #define IRQ_IQ80332_INTC IRQ_IOP331_XINT2 #define IRQ_IQ80332_INTD IRQ_IOP331_XINT3 -#endif - #endif // _IOP331_IRQ_H_ -- cgit v1.2.3 From 37182d1bd3264cf9c0dce3408bee48af0755de7e Mon Sep 17 00:00:00 2001 From: Christoph Hellwig Date: Mon, 24 Jul 2006 15:30:28 -0700 Subject: [NET]: Remove CONFIG_HAVE_ARCH_DEV_ALLOC_SKB skbuff.h has an #ifndef CONFIG_HAVE_ARCH_DEV_ALLOC_SKB to allow architectures to reimplement __dev_alloc_skb. It's not set on any architecture and now that we have an architecture-overrideable NET_SKB_PAD there is not point at all to have one either. Signed-off-by: Christoph Hellwig Signed-off-by: David S. Miller --- include/linux/skbuff.h | 4 ---- 1 file changed, 4 deletions(-) (limited to 'include') diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h index 0bf31b83578..f9875797664 100644 --- a/include/linux/skbuff.h +++ b/include/linux/skbuff.h @@ -1066,7 +1066,6 @@ static inline void __skb_queue_purge(struct sk_buff_head *list) kfree_skb(skb); } -#ifndef CONFIG_HAVE_ARCH_DEV_ALLOC_SKB /** * __dev_alloc_skb - allocate an skbuff for sending * @length: length to allocate @@ -1087,9 +1086,6 @@ static inline struct sk_buff *__dev_alloc_skb(unsigned int length, skb_reserve(skb, NET_SKB_PAD); return skb; } -#else -extern struct sk_buff *__dev_alloc_skb(unsigned int length, int gfp_mask); -#endif /** * dev_alloc_skb - allocate an skbuff for sending -- cgit v1.2.3 From b4e54de8d34afe7fcf08bfe91070d9dfeae6ed27 Mon Sep 17 00:00:00 2001 From: Christoph Hellwig Date: Mon, 24 Jul 2006 15:31:14 -0700 Subject: [NET]: Correct dev_alloc_skb kerneldoc dev_alloc_skb is designated for RX descriptors, not TX. (Some drivers use it for the latter anyway, but that's a different story) Signed-off-by: Christoph Hellwig Signed-off-by: David S. Miller --- include/linux/skbuff.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'include') diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h index f9875797664..4307e764ef0 100644 --- a/include/linux/skbuff.h +++ b/include/linux/skbuff.h @@ -1067,7 +1067,7 @@ static inline void __skb_queue_purge(struct sk_buff_head *list) } /** - * __dev_alloc_skb - allocate an skbuff for sending + * __dev_alloc_skb - allocate an skbuff for receiving * @length: length to allocate * @gfp_mask: get_free_pages mask, passed to alloc_skb * @@ -1088,7 +1088,7 @@ static inline struct sk_buff *__dev_alloc_skb(unsigned int length, } /** - * dev_alloc_skb - allocate an skbuff for sending + * dev_alloc_skb - allocate an skbuff for receiving * @length: length to allocate * * Allocate a new &sk_buff and assign it a usage count of one. The -- cgit v1.2.3 From 29ed46015dd61f99d203ec7ab307ccf92d2d0cf2 Mon Sep 17 00:00:00 2001 From: "David S. Miller" Date: Sat, 22 Jul 2006 02:05:07 -0700 Subject: [SPARC]: Fix SA_STATIC_ALLOC value. It alises IRQF_SHARED which causes all kinds of problems. Signed-off-by: David S. Miller --- include/asm-sparc/signal.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include') diff --git a/include/asm-sparc/signal.h b/include/asm-sparc/signal.h index 0ae5084c427..d03a21c97ab 100644 --- a/include/asm-sparc/signal.h +++ b/include/asm-sparc/signal.h @@ -168,7 +168,7 @@ struct sigstack { * statically allocated data.. which is NOT GOOD. * */ -#define SA_STATIC_ALLOC 0x80 +#define SA_STATIC_ALLOC 0x8000 #endif #include -- cgit v1.2.3 From 10ea6ac895418bd0d23900e3330daa6ba0836d26 Mon Sep 17 00:00:00 2001 From: Patrick McHardy Date: Mon, 24 Jul 2006 22:54:55 -0700 Subject: [NETFILTER]: bridge netfilter: add deferred output hooks to feature-removal-schedule Add bridge netfilter deferred output hooks to feature-removal-schedule and disable them by default. Until their removal they will be activated by the physdev match when needed. Signed-off-by: Patrick McHardy Signed-off-by: David S. Miller --- include/linux/netfilter_bridge.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'include') diff --git a/include/linux/netfilter_bridge.h b/include/linux/netfilter_bridge.h index 87764022cc6..31f02ba036c 100644 --- a/include/linux/netfilter_bridge.h +++ b/include/linux/netfilter_bridge.h @@ -79,6 +79,8 @@ struct bridge_skb_cb { __u32 ipv4; } daddr; }; + +extern int brnf_deferred_hooks; #endif /* CONFIG_BRIDGE_NETFILTER */ #endif /* __KERNEL__ */ -- cgit v1.2.3 From 153d7f3fcae7ed4e19328549aa9467acdfbced10 Mon Sep 17 00:00:00 2001 From: Arjan van de Ven Date: Wed, 26 Jul 2006 15:40:07 +0200 Subject: [PATCH] Reorganize the cpufreq cpu hotplug locking to not be totally bizare The patch below moves the cpu hotplugging higher up in the cpufreq layering; this is needed to avoid recursive taking of the cpu hotplug lock and to otherwise detangle the mess. The new rules are: 1. you must do lock_cpu_hotplug() around the following functions: __cpufreq_driver_target __cpufreq_governor (for CPUFREQ_GOV_LIMITS operation only) __cpufreq_set_policy 2. governer methods (.governer) must NOT take the lock_cpu_hotplug() lock in any way; they are called with the lock taken already 3. if your governer spawns a thread that does things, like calling __cpufreq_driver_target, your thread must honor rule #1. 4. the policy lock and other cpufreq internal locks nest within the lock_cpu_hotplug() lock. I'm not entirely happy about how the __cpufreq_governor rule ended up (conditional locking rule depending on the argument) but basically all callers pass this as a constant so it's not too horrible. The patch also removes the cpufreq_governor() function since during the locking audit it turned out to be entirely unused (so no need to fix it) The patch works on my testbox, but it could use more testing (otoh... it can't be much worse than the current code) Signed-off-by: Arjan van de Ven Signed-off-by: Linus Torvalds --- include/linux/cpufreq.h | 3 --- 1 file changed, 3 deletions(-) (limited to 'include') diff --git a/include/linux/cpufreq.h b/include/linux/cpufreq.h index 35e137636b0..4ea39fee99c 100644 --- a/include/linux/cpufreq.h +++ b/include/linux/cpufreq.h @@ -172,9 +172,6 @@ extern int __cpufreq_driver_target(struct cpufreq_policy *policy, unsigned int relation); -/* pass an event to the cpufreq governor */ -int cpufreq_governor(unsigned int cpu, unsigned int event); - int cpufreq_register_governor(struct cpufreq_governor *governor); void cpufreq_unregister_governor(struct cpufreq_governor *governor); -- cgit v1.2.3 From 92f282988b4ce3967ee8399f7d1184ebfa04e48b Mon Sep 17 00:00:00 2001 From: "David S. Miller" Date: Thu, 27 Jul 2006 16:49:21 -0700 Subject: [SPARC64]: Fix quad-float multiply emulation. Something is wrong with the 3-multiply (vs. 4-multiply) optimized version of _FP_MUL_MEAT_2_*(), so just use the slower version which actually computes correct values. Noticed by Rene Rebe Signed-off-by: David S. Miller --- include/asm-sparc64/sfp-machine.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include') diff --git a/include/asm-sparc64/sfp-machine.h b/include/asm-sparc64/sfp-machine.h index 5015bb8d6c3..89d42431efb 100644 --- a/include/asm-sparc64/sfp-machine.h +++ b/include/asm-sparc64/sfp-machine.h @@ -34,7 +34,7 @@ #define _FP_MUL_MEAT_D(R,X,Y) \ _FP_MUL_MEAT_1_wide(_FP_WFRACBITS_D,R,X,Y,umul_ppmm) #define _FP_MUL_MEAT_Q(R,X,Y) \ - _FP_MUL_MEAT_2_wide_3mul(_FP_WFRACBITS_Q,R,X,Y,umul_ppmm) + _FP_MUL_MEAT_2_wide(_FP_WFRACBITS_Q,R,X,Y,umul_ppmm) #define _FP_DIV_MEAT_S(R,X,Y) _FP_DIV_MEAT_1_imm(S,R,X,Y,_FP_DIV_HELP_imm) #define _FP_DIV_MEAT_D(R,X,Y) _FP_DIV_MEAT_1_udiv_norm(D,R,X,Y) -- cgit v1.2.3 From b8cfac4c2f3d12d0f4cbe6f992d945f2fdfc098d Mon Sep 17 00:00:00 2001 From: "David S. Miller" Date: Thu, 27 Jul 2006 17:57:32 -0700 Subject: [SPARC64]: Fix typo in pgprot_noncached(). The sun4v code sequence was or'ing in the sun4u pte bits by mistake. Signed-off-by: David S. Miller --- include/asm-sparc64/pgtable.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include') diff --git a/include/asm-sparc64/pgtable.h b/include/asm-sparc64/pgtable.h index 03f5bc9b6be..1ba19eb34ce 100644 --- a/include/asm-sparc64/pgtable.h +++ b/include/asm-sparc64/pgtable.h @@ -339,7 +339,7 @@ static inline pgprot_t pgprot_noncached(pgprot_t prot) " .section .sun4v_2insn_patch, \"ax\"\n" " .word 661b\n" " andn %0, %4, %0\n" - " or %0, %3, %0\n" + " or %0, %5, %0\n" " .previous\n" : "=r" (val) : "0" (val), "i" (_PAGE_CP_4U | _PAGE_CV_4U), "i" (_PAGE_E_4U), -- cgit v1.2.3 From 361934849e9c0418950bedf667732f36337d88b9 Mon Sep 17 00:00:00 2001 From: Jens Axboe Date: Fri, 28 Jul 2006 08:54:59 +0200 Subject: [PATCH] ide: option to disable cache flushes for buggy drives Some drives claim they support cache flushing, but get seriously confused if you try. Add this option to be able to boot with barriers enabled by default. Signed-off-by: Jens Axboe --- include/linux/ide.h | 1 + 1 file changed, 1 insertion(+) (limited to 'include') diff --git a/include/linux/ide.h b/include/linux/ide.h index dc7abef1096..99620451d95 100644 --- a/include/linux/ide.h +++ b/include/linux/ide.h @@ -571,6 +571,7 @@ typedef struct ide_drive_s { u8 waiting_for_dma; /* dma currently in progress */ u8 unmask; /* okay to unmask other irqs */ u8 bswap; /* byte swap data */ + u8 noflush; /* don't attempt flushes */ u8 dsc_overlap; /* DSC overlap */ u8 nice1; /* give potential excess bandwidth */ -- cgit v1.2.3 From a4045dff782a8692637c24a0222120082c887caa Mon Sep 17 00:00:00 2001 From: bibo mao Date: Fri, 28 Jul 2006 14:44:48 +0200 Subject: [PATCH] x86_64: Enlarge debug stack for nested kprobes In x86_64 platform, INT1 and INT3 trap stack is IST stack called DEBUG_STACK, when INT1/INT3 trap happens, system will switch to DEBUG_STACK by hardware. Current DEBUG_STACK size is 4K, when int1/int3 trap happens, kernel will minus current DEBUG_STACK IST value by 4k. But if int3/int1 trap is nested, it will destroy other vector's IST stack. This patch modifies this, it sets DEBUG_STACK size as 8K and allows two level of nested int1/int3 trap. Kprobe DEBUG_STACK may be nested, because kprobe handler may be probed by other kprobes. Thanks jbeulich for pointing out error in the first patch. [AK: nested kprobes are pretty dubious. Hopefully one nest will be enough. This will cost 8K per CPU (4K more than before)] Signed-off-by: bibo, mao Signed-off-by: Andi Kleen Signed-off-by: Linus Torvalds --- include/asm-x86_64/page.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include') diff --git a/include/asm-x86_64/page.h b/include/asm-x86_64/page.h index f7bf875aae4..10f346165ca 100644 --- a/include/asm-x86_64/page.h +++ b/include/asm-x86_64/page.h @@ -19,7 +19,7 @@ #define EXCEPTION_STACK_ORDER 0 #define EXCEPTION_STKSZ (PAGE_SIZE << EXCEPTION_STACK_ORDER) -#define DEBUG_STACK_ORDER EXCEPTION_STACK_ORDER +#define DEBUG_STACK_ORDER (EXCEPTION_STACK_ORDER + 1) #define DEBUG_STKSZ (PAGE_SIZE << DEBUG_STACK_ORDER) #define IRQSTACK_ORDER 2 -- cgit v1.2.3 From e3f2ddeac718c768fdac4b7fe69d465172f788a8 Mon Sep 17 00:00:00 2001 From: Ingo Molnar Date: Sat, 29 Jul 2006 05:17:57 +0200 Subject: [PATCH] pi-futex: robust-futex exit Fix robust PI-futexes to be properly unlocked on unexpected exit. For this to work the kernel has to know whether a futex is a PI or a non-PI one, because the semantics are different. Since the space in relevant glibc data structures is extremely scarce, the best solution is to encode the 'PI' information in bit 0 of the robust list pointer. Existing (non-PI) glibc robust futexes have this bit always zero, so the ABI is kept. New glibc with PI-robust-futexes will set this bit. Further fixes from Thomas Gleixner Signed-off-by: Ingo Molnar Signed-off-by: Ulrich Drepper Signed-off-by: Thomas Gleixner Signed-off-by: Linus Torvalds --- include/linux/futex.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'include') diff --git a/include/linux/futex.h b/include/linux/futex.h index 34c3a215f2c..d097b5b72bc 100644 --- a/include/linux/futex.h +++ b/include/linux/futex.h @@ -96,7 +96,8 @@ struct robust_list_head { long do_futex(u32 __user *uaddr, int op, u32 val, unsigned long timeout, u32 __user *uaddr2, u32 val2, u32 val3); -extern int handle_futex_death(u32 __user *uaddr, struct task_struct *curr); +extern int +handle_futex_death(u32 __user *uaddr, struct task_struct *curr, int pi); #ifdef CONFIG_FUTEX extern void exit_robust_list(struct task_struct *curr); -- cgit v1.2.3 From d2105b10fe0f460c388fe4e09226313f519d8c00 Mon Sep 17 00:00:00 2001 From: Jon Mason Date: Sat, 29 Jul 2006 21:42:43 +0200 Subject: [PATCH] x86_64: Calgary IOMMU - Multi-Node NULL pointer dereference fix Calgary hits a NULL pointer dereference when booting in a multi-chassis NUMA system. See Redhat bugzilla number 198498, found by Konrad Rzeszutek (konradr@redhat.com). There are many issues that had to be resolved to fix this problem. Firstly when I originally wrote the code to handle NUMA systems, I had a large misunderstanding that was not corrected until now. That was that I thought the "number of nodes online" referred to number of physical systems connected. So that if NUMA was disabled, there would only be 1 node and it would only show that node's PCI bus. In reality if NUMA is disabled, the system displays all of the connected chassis as one node but is only ignorant of the delays in accessing main memory. Therefore, references to num_online_nodes() and MAX_NUMNODES are incorrect and need to be set to the maximum number of nodes that can be accessed (which are 8). I created a variable, MAX_NUM_CHASSIS, and set it to 8 to fix this. Secondly, when walking the PCI in detect_calgary, the code only checked the first "slot" when looking to see if a device is present. This will work for most cases, but unfortunately it isn't always the case. In the NUMA MXE drawers, there are USB devices present on the 3rd slot (with slot 1 being empty). So, to work around this, all slots (up to 8) are scanned to see if there are any devices present. Lastly, the bus is being enumerated on large systems in a different way the we originally thought. This throws the ugly logic we had out the window. To more elegantly handle this, I reorganized the kva array to be sparse (which removed the need to have any bus number to kva slot logic in tce.c) and created a secondary space array to contain the bus number to phb mapping. With these changes Calgary boots on an x460 with 4 nodes with and without NUMA enabled. Signed-off-by: Jon Mason Signed-off-by: Muli Ben-Yehuda Signed-off-by: Andi Kleen Signed-off-by: Linus Torvalds --- include/asm-x86_64/calgary.h | 5 ----- 1 file changed, 5 deletions(-) (limited to 'include') diff --git a/include/asm-x86_64/calgary.h b/include/asm-x86_64/calgary.h index fbfb50136ed..4e391952424 100644 --- a/include/asm-x86_64/calgary.h +++ b/include/asm-x86_64/calgary.h @@ -60,9 +60,4 @@ static inline int calgary_iommu_init(void) { return 1; } static inline void detect_calgary(void) { return; } #endif -static inline unsigned int bus_to_phb(unsigned char busno) -{ - return ((busno % 15 == 0) ? 0 : busno / 2 + 1); -} - #endif /* _ASM_X86_64_CALGARY_H */ -- cgit v1.2.3 From 65f87d8a8a6e1b560c61951d0a68ed80f7c8ff19 Mon Sep 17 00:00:00 2001 From: Andi Kleen Date: Sat, 29 Jul 2006 21:42:49 +0200 Subject: [PATCH] x86_64: Fix swiotlb=force It was broken before. But having it is important as possible hardware bug workaround. And previously there was no way to force swiotlb if there is another IOMMU. Side effect is that iommu=force won't force swiotlb anymore even if there isn't another IOMMU. Signed-off-by: Andi Kleen Signed-off-by: Linus Torvalds --- include/asm-x86_64/swiotlb.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'include') diff --git a/include/asm-x86_64/swiotlb.h b/include/asm-x86_64/swiotlb.h index 5f9a0180582..ba94ab3d267 100644 --- a/include/asm-x86_64/swiotlb.h +++ b/include/asm-x86_64/swiotlb.h @@ -42,6 +42,8 @@ extern void swiotlb_free_coherent (struct device *hwdev, size_t size, extern int swiotlb_dma_supported(struct device *hwdev, u64 mask); extern void swiotlb_init(void); +extern int swiotlb_force; + #ifdef CONFIG_SWIOTLB extern int swiotlb; #else -- cgit v1.2.3 From 2ccb48ebb4de139eef4fcefd5f2bb823cb0d81b9 Mon Sep 17 00:00:00 2001 From: Neil Brown Date: Sun, 30 Jul 2006 03:03:01 -0700 Subject: [PATCH] ext3: avoid triggering ext3_error on bad NFS file handle The inode number out of an NFS file handle gets passed eventually to ext3_get_inode_block() without any checking. If ext3_get_inode_block() allows it to trigger an error, then bad filehandles can have unpleasant effect - ext3_error() will usually cause a forced read-only remount, or a panic if `errors=panic' was used. So remove the call to ext3_error there and put a matching check in ext3/namei.c where inode numbers are read off storage. [akpm@osdl.org: fix off-by-one error] Signed-off-by: Neil Brown Signed-off-by: Jan Kara Cc: Marcel Holtmann Cc: Cc: "Stephen C. Tweedie" Cc: Eric Sandeen Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- include/linux/ext3_fs.h | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'include') diff --git a/include/linux/ext3_fs.h b/include/linux/ext3_fs.h index 5607e6457a6..9f9cce7bd86 100644 --- a/include/linux/ext3_fs.h +++ b/include/linux/ext3_fs.h @@ -492,6 +492,15 @@ static inline struct ext3_inode_info *EXT3_I(struct inode *inode) { return container_of(inode, struct ext3_inode_info, vfs_inode); } + +static inline int ext3_valid_inum(struct super_block *sb, unsigned long ino) +{ + return ino == EXT3_ROOT_INO || + ino == EXT3_JOURNAL_INO || + ino == EXT3_RESIZE_INO || + (ino >= EXT3_FIRST_INO(sb) && + ino <= le32_to_cpu(EXT3_SB(sb)->s_es->s_inodes_count)); +} #else /* Assume that user mode programs are passing in an ext3fs superblock, not * a kernel struct super_block. This will allow us to call the feature-test -- cgit v1.2.3 From 822cfbff2ef49a08d1b9618d50f81b475d4f936c Mon Sep 17 00:00:00 2001 From: Chandra Seetharaman Date: Sun, 30 Jul 2006 03:03:04 -0700 Subject: [PATCH] Process Events: Fix biarch compatibility issue. use __u64 timestamp Events sent by Process Events Connector from a 64-bit kernel are not binary compatible with a 32-bit userspace program because the "timestamp" field (struct timespec) is not arch independent. This affects the fields that follow "timestamp" as they will be be off by 8 bytes. This is a problem for 32-bit userspace programs running with 64-bit kernels on ppc64, s390, x86-64.. any "biarch" system. Matt had submitted a different solution to lkml as an RFC earlier. We have since switched to a solution recommended by Evgeniy Polyakov. This patch fixes the problem by changing the timestamp to be a __u64, which stores the number of nanoseconds. Tested on a x86_64 system with both 32 bit application and 64 bit application and on a i386 system. Signed-off-by: Chandra Seetharaman Signed-off-by: Matt Helsley Cc: Evgeniy Polyakov Cc: Guillaume Thouvenin Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- include/linux/cn_proc.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'include') diff --git a/include/linux/cn_proc.h b/include/linux/cn_proc.h index dbb7769009b..1c86d65bc4b 100644 --- a/include/linux/cn_proc.h +++ b/include/linux/cn_proc.h @@ -57,7 +57,8 @@ struct proc_event { PROC_EVENT_EXIT = 0x80000000 } what; __u32 cpu; - struct timespec timestamp; + __u64 __attribute__((aligned(8))) timestamp_ns; + /* Number of nano seconds since system boot */ union { /* must be last field of proc_event struct */ struct { __u32 err; -- cgit v1.2.3 From 15a647eba94c3da27ccc666bea72e7cca06b2d19 Mon Sep 17 00:00:00 2001 From: David Brownell Date: Sun, 30 Jul 2006 03:03:08 -0700 Subject: [PATCH] genirq: {en,dis}able_irq_wake() need refcounting too IRQs need refcounting and a state flag to track whether the the IRQ should be enabled or disabled as a "normal IRQ" source after a series of calls to {en,dis}able_irq(). For shared IRQs, the IRQ must be enabled so long as at least one driver needs it active. Likewise, IRQs need the same support to track whether the IRQ should be enabled or disabled as a "wakeup event" source after a series of calls to {en,dis}able_irq_wake(). For shared IRQs, the IRQ must be enabled as a wakeup source during sleep so long as at least one driver needs it. But right now they _don't have_ that refcounting ... which means sharing a wakeup-capable IRQ can't work correctly in some configurations. This patch adds the refcount and flag mechanisms to set_irq_wake() -- which is what {en,dis}able_irq_wake() call -- and minimal documentation of what the irq wake mechanism does. Drivers relying on the older (broken) "toggle" semantics will trigger a warning; that'll be a handful of drivers on ARM systems. Signed-off-by: David Brownell Acked-by: Ingo Molnar Acked-by: Thomas Gleixner Cc: Russell King Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- include/linux/irq.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'include') diff --git a/include/linux/irq.h b/include/linux/irq.h index b48eae32dc6..6e59ac05ef2 100644 --- a/include/linux/irq.h +++ b/include/linux/irq.h @@ -58,6 +58,7 @@ #define IRQ_NOREQUEST 0x04000000 /* IRQ cannot be requested */ #define IRQ_NOAUTOEN 0x08000000 /* IRQ will not be enabled on request irq */ #define IRQ_DELAYED_DISABLE 0x10000000 /* IRQ disable (masking) happens delayed. */ +#define IRQ_WAKEUP 0x20000000 /* IRQ triggers system wakeup */ struct proc_dir_entry; @@ -124,6 +125,7 @@ struct irq_chip { * @action: the irq action chain * @status: status information * @depth: disable-depth, for nested irq_disable() calls + * @wake_depth: enable depth, for multiple set_irq_wake() callers * @irq_count: stats field to detect stalled irqs * @irqs_unhandled: stats field for spurious unhandled interrupts * @lock: locking for SMP @@ -147,6 +149,7 @@ struct irq_desc { unsigned int status; /* IRQ status */ unsigned int depth; /* nested irq disables */ + unsigned int wake_depth; /* nested wake enables */ unsigned int irq_count; /* For detecting broken IRQs */ unsigned int irqs_unhandled; spinlock_t lock; -- cgit v1.2.3 From 7d94dddd438bcba97db44f120da39bb001b5249f Mon Sep 17 00:00:00 2001 From: Shailabh Nagar Date: Sun, 30 Jul 2006 03:03:10 -0700 Subject: [PATCH] make taskstats sending completely independent of delay accounting on/off status Complete the separation of delay accounting and taskstats by ignoring the return value of delay accounting functions that fill in parts of taskstats before it is sent out (either in response to a command or as part of a task exit). Also make delayacct_add_tsk return silently when delay accounting is turned off rather than treat it as an error. Signed-off-by: Shailabh Nagar Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- include/linux/delayacct.h | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'include') diff --git a/include/linux/delayacct.h b/include/linux/delayacct.h index 7e8b6011b8f..8a284cc6fd5 100644 --- a/include/linux/delayacct.h +++ b/include/linux/delayacct.h @@ -80,9 +80,7 @@ static inline void delayacct_blkio_end(void) static inline int delayacct_add_tsk(struct taskstats *d, struct task_struct *tsk) { - if (likely(!delayacct_on)) - return -EINVAL; - if (!tsk->delays) + if (likely(!delayacct_on) || !tsk->delays) return 0; return __delayacct_add_tsk(d, tsk); } -- cgit v1.2.3 From 163ecdff060f2fa9e8f5238882fd0137493556a6 Mon Sep 17 00:00:00 2001 From: Shailabh Nagar Date: Sun, 30 Jul 2006 03:03:11 -0700 Subject: [PATCH] delay accounting: temporarily enable by default Enable delay accounting by default so that feature gets coverage testing without requiring special measures. Earlier, it was off by default and had to be enabled via a boot time param. This patch reverses the default behaviour to improve coverage testing. It can be removed late in the kernel development cycle if its believed users shouldn't have to incur any cost if they don't want delay accounting. Or it can be retained forever if the utility of the stats is deemed common enough to warrant keeping the feature on. Signed-off-by: Shailabh Nagar Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- include/linux/delayacct.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'include') diff --git a/include/linux/delayacct.h b/include/linux/delayacct.h index 8a284cc6fd5..11487b6e712 100644 --- a/include/linux/delayacct.h +++ b/include/linux/delayacct.h @@ -55,7 +55,7 @@ static inline void delayacct_tsk_init(struct task_struct *tsk) { /* reinitialize in case parent's non-null pointer was dup'ed*/ tsk->delays = NULL; - if (unlikely(delayacct_on)) + if (delayacct_on) __delayacct_tsk_init(tsk); } @@ -80,7 +80,7 @@ static inline void delayacct_blkio_end(void) static inline int delayacct_add_tsk(struct taskstats *d, struct task_struct *tsk) { - if (likely(!delayacct_on) || !tsk->delays) + if (!delayacct_on || !tsk->delays) return 0; return __delayacct_add_tsk(d, tsk); } -- cgit v1.2.3 From a9ad965ea9a6d719daf333847a2ceb0e363994bd Mon Sep 17 00:00:00 2001 From: "bibo, mao" Date: Sun, 30 Jul 2006 03:03:26 -0700 Subject: [PATCH] IA64: kprobe invalidate icache of jump buffer Kprobe inserts breakpoint instruction in probepoint and then jumps to instruction slot when breakpoint is hit, the instruction slot icache must be consistent with dcache. Here is the patch which invalidates instruction slot icache area. Without this patch, in some machines there will be fault when executing instruction slot where icache content is inconsistent with dcache. Signed-off-by: bibo,mao Acked-by: "Luck, Tony" Acked-by: Keshavamurthy Anil S Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- include/asm-i386/kprobes.h | 1 + include/asm-ia64/kprobes.h | 1 + include/asm-powerpc/kprobes.h | 1 + include/asm-sparc64/kprobes.h | 1 + include/asm-x86_64/kprobes.h | 1 + 5 files changed, 5 insertions(+) (limited to 'include') diff --git a/include/asm-i386/kprobes.h b/include/asm-i386/kprobes.h index 0730a20f6db..8774d06689d 100644 --- a/include/asm-i386/kprobes.h +++ b/include/asm-i386/kprobes.h @@ -45,6 +45,7 @@ typedef u8 kprobe_opcode_t; #define JPROBE_ENTRY(pentry) (kprobe_opcode_t *)pentry #define ARCH_SUPPORTS_KRETPROBES #define ARCH_INACTIVE_KPROBE_COUNT 0 +#define flush_insn_slot(p) do { } while (0) void arch_remove_kprobe(struct kprobe *p); void kretprobe_trampoline(void); diff --git a/include/asm-ia64/kprobes.h b/include/asm-ia64/kprobes.h index 2418a787c40..93890491011 100644 --- a/include/asm-ia64/kprobes.h +++ b/include/asm-ia64/kprobes.h @@ -125,5 +125,6 @@ static inline void jprobe_return(void) } extern void invalidate_stacked_regs(void); extern void flush_register_stack(void); +extern void flush_insn_slot(struct kprobe *p); #endif /* _ASM_KPROBES_H */ diff --git a/include/asm-powerpc/kprobes.h b/include/asm-powerpc/kprobes.h index 2d0af52c823..34e1f89a5fa 100644 --- a/include/asm-powerpc/kprobes.h +++ b/include/asm-powerpc/kprobes.h @@ -51,6 +51,7 @@ typedef unsigned int kprobe_opcode_t; #define ARCH_SUPPORTS_KRETPROBES #define ARCH_INACTIVE_KPROBE_COUNT 1 +#define flush_insn_slot(p) do { } while (0) void kretprobe_trampoline(void); extern void arch_remove_kprobe(struct kprobe *p); diff --git a/include/asm-sparc64/kprobes.h b/include/asm-sparc64/kprobes.h index 15065af566c..c9f5c34d318 100644 --- a/include/asm-sparc64/kprobes.h +++ b/include/asm-sparc64/kprobes.h @@ -13,6 +13,7 @@ typedef u32 kprobe_opcode_t; #define JPROBE_ENTRY(pentry) (kprobe_opcode_t *)pentry #define arch_remove_kprobe(p) do {} while (0) #define ARCH_INACTIVE_KPROBE_COUNT 0 +#define flush_insn_slot(p) do { } while (0) /* Architecture specific copy of original instruction*/ struct arch_specific_insn { diff --git a/include/asm-x86_64/kprobes.h b/include/asm-x86_64/kprobes.h index d36febd9bb1..cf5317898fb 100644 --- a/include/asm-x86_64/kprobes.h +++ b/include/asm-x86_64/kprobes.h @@ -47,6 +47,7 @@ typedef u8 kprobe_opcode_t; void kretprobe_trampoline(void); extern void arch_remove_kprobe(struct kprobe *p); +#define flush_insn_slot(p) do { } while (0) /* Architecture specific copy of original instruction*/ struct arch_specific_insn { -- cgit v1.2.3 From b8bdb460b7ecf08a4fed6e8b5b6b3fe874587aaa Mon Sep 17 00:00:00 2001 From: Yoichi Yuasa Date: Sun, 30 Jul 2006 03:03:33 -0700 Subject: [PATCH] always define IRQ_PER_CPU Reduce the likelihood of someone accidentally introducing namespace collisions. Signed-off-by: Yoichi Yuasa Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- include/linux/irq.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include') diff --git a/include/linux/irq.h b/include/linux/irq.h index 6e59ac05ef2..fbf6d901e9c 100644 --- a/include/linux/irq.h +++ b/include/linux/irq.h @@ -47,8 +47,8 @@ #define IRQ_WAITING 0x00200000 /* IRQ not yet seen - for autodetection */ #define IRQ_LEVEL 0x00400000 /* IRQ level triggered */ #define IRQ_MASKED 0x00800000 /* IRQ masked - shouldn't be seen again */ +#define IRQ_PER_CPU 0x01000000 /* IRQ is per CPU */ #ifdef CONFIG_IRQ_PER_CPU -# define IRQ_PER_CPU 0x01000000 /* IRQ is per CPU */ # define CHECK_IRQ_PER_CPU(var) ((var) & IRQ_PER_CPU) #else # define CHECK_IRQ_PER_CPU(var) 0 -- cgit v1.2.3 From 0d94df56963251d896e87c6197f6df132593232b Mon Sep 17 00:00:00 2001 From: Uwe Zeisberger Date: Sun, 30 Jul 2006 03:04:02 -0700 Subject: [PATCH] Add parentheses around arguments in the SH_DIV macro. There is currently no affected user in the tree, but usage is less surprising that way. Signed-off-by: Uwe Zeisberger Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- include/linux/jiffies.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'include') diff --git a/include/linux/jiffies.h b/include/linux/jiffies.h index 043376920f5..329ebcffa10 100644 --- a/include/linux/jiffies.h +++ b/include/linux/jiffies.h @@ -47,8 +47,8 @@ * - (NOM / DEN) fits in (32 - LSH) bits. * - (NOM % DEN) fits in (32 - LSH) bits. */ -#define SH_DIV(NOM,DEN,LSH) ( ((NOM / DEN) << LSH) \ - + (((NOM % DEN) << LSH) + DEN / 2) / DEN) +#define SH_DIV(NOM,DEN,LSH) ( (((NOM) / (DEN)) << (LSH)) \ + + ((((NOM) % (DEN)) << (LSH)) + (DEN) / 2) / (DEN)) /* HZ is the requested value. ACTHZ is actual HZ ("<< 8" is for accuracy) */ #define ACTHZ (SH_DIV (CLOCK_TICK_RATE, LATCH, 8)) -- cgit v1.2.3 From 256154fbc31c25a8df4d398232acfa9d4892224c Mon Sep 17 00:00:00 2001 From: "Antonino A. Daplas" Date: Sun, 30 Jul 2006 03:04:17 -0700 Subject: [PATCH] fbdev: statically link the framebuffer notification functions The backlight and lcd subsystems can be notified by the framebuffer layer of blanking events. However, these subsystems, as a whole, can function independently from the framebuffer layer. But in order to enable to the lcd and backlight subsystems, the framebuffer has to be compiled also, effectively sucking in a huge amount of unneeded code. To prevent dependency problems, separate out the framebuffer notification mechanism from the framebuffer layer and permanently link it to the kernel. Signed-off-by: Antonino Daplas Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- include/linux/fb.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include') diff --git a/include/linux/fb.h b/include/linux/fb.h index 405f44e44e5..4ad0673b199 100644 --- a/include/linux/fb.h +++ b/include/linux/fb.h @@ -524,7 +524,7 @@ struct fb_event { extern int fb_register_client(struct notifier_block *nb); extern int fb_unregister_client(struct notifier_block *nb); - +extern int fb_notifier_call_chain(unsigned long val, void *v); /* * Pixmap structure definition * -- cgit v1.2.3 From 4b755999d6e0c1d988fb448289abb6c226cd8c36 Mon Sep 17 00:00:00 2001 From: Michael Hanselmann Date: Sun, 30 Jul 2006 03:04:19 -0700 Subject: [PATCH] powermac: More powermac backlight fixes This patch fixes several problems: - The legacy backlight value might be set at interrupt time. Introduced a worker to prevent it from directly calling the backlight code. - via-pmu allows the backlight to be grabbed, in which case we need to prevent other kernel code from changing the brightness. - Don't send PMU requests in via-pmu-backlight when the machine is about to sleep or waking up. - More Kconfig fixes. Signed-off-by: Michael Hanselmann Cc: Benjamin Herrenschmidt Cc: "Antonino A. Daplas" Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- include/asm-powerpc/backlight.h | 4 ++++ include/linux/pmu.h | 3 +-- 2 files changed, 5 insertions(+), 2 deletions(-) (limited to 'include') diff --git a/include/asm-powerpc/backlight.h b/include/asm-powerpc/backlight.h index 58d4b6f8d82..8cf5c37c381 100644 --- a/include/asm-powerpc/backlight.h +++ b/include/asm-powerpc/backlight.h @@ -30,8 +30,12 @@ static inline void pmac_backlight_key_down(void) pmac_backlight_key(1); } +extern void pmac_backlight_set_legacy_brightness_pmu(int brightness); extern int pmac_backlight_set_legacy_brightness(int brightness); extern int pmac_backlight_get_legacy_brightness(void); +extern void pmac_backlight_enable(void); +extern void pmac_backlight_disable(void); + #endif /* __KERNEL__ */ #endif diff --git a/include/linux/pmu.h b/include/linux/pmu.h index 2ed807ddc08..783177387ac 100644 --- a/include/linux/pmu.h +++ b/include/linux/pmu.h @@ -231,7 +231,6 @@ extern struct pmu_battery_info pmu_batteries[PMU_MAX_BATTERIES]; extern unsigned int pmu_power_flags; /* Backlight */ -extern int disable_kernel_backlight; -extern void pmu_backlight_init(struct device_node*); +extern void pmu_backlight_init(void); #endif /* __KERNEL__ */ -- cgit v1.2.3