From 2d0ebb36038c0626cde662a3b06da9787cfb68c3 Mon Sep 17 00:00:00 2001 From: Linus Torvalds Date: Wed, 23 Nov 2005 08:44:05 -0800 Subject: Revert "[NET]: Shut up warnings in net/core/flow.c" This reverts commit af2b4079ab154bd12e8c12b02db5f31b31babe63 Changing the #define to an inline function breaks on non-SMP builds, since wuite a few places in the kernel do not implement the ipi handler when compiling for UP. Signed-off-by: Linus Torvalds --- include/linux/smp.h | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) (limited to 'include') diff --git a/include/linux/smp.h b/include/linux/smp.h index b6069c8e1f0..9dfa3ee769a 100644 --- a/include/linux/smp.h +++ b/include/linux/smp.h @@ -94,13 +94,7 @@ void smp_prepare_boot_cpu(void); */ #define raw_smp_processor_id() 0 #define hard_smp_processor_id() 0 - -static inline int smp_call_function(void (*func) (void *info), void *info, - int retry, int wait) -{ - return 0; -} - +#define smp_call_function(func,info,retry,wait) ({ 0; }) #define on_each_cpu(func,info,retry,wait) ({ func(info); 0; }) static inline void smp_send_reschedule(int cpu) { } #define num_booting_cpus() 1 -- cgit v1.2.3 From 3238c448c6e26d7c26d2e9b070ef149d066cb6c2 Mon Sep 17 00:00:00 2001 From: Adam Brooks Date: Wed, 23 Nov 2005 22:45:27 +0000 Subject: [ARM] 3173/1: Fix to allow 2.6.15-rc2 to compile for IOP3xx boards Patch from Adam Brooks Fixes an issue in 2.6.15-rc2 that prevented compilation of kernels for IOP3xx boards. Signed-off-by: Adam Brooks Signed-off-by: Russell King --- include/asm-arm/arch-iop3xx/timex.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include') diff --git a/include/asm-arm/arch-iop3xx/timex.h b/include/asm-arm/arch-iop3xx/timex.h index d4187fe9a85..472badb451c 100644 --- a/include/asm-arm/arch-iop3xx/timex.h +++ b/include/asm-arm/arch-iop3xx/timex.h @@ -4,7 +4,7 @@ * IOP3xx architecture timex specifications */ #include - +#include #if defined(CONFIG_ARCH_IQ80321) || defined(CONFIG_ARCH_IQ31244) -- cgit v1.2.3 From 7c72aaf29621d29ed19fd68c44edb45321645049 Mon Sep 17 00:00:00 2001 From: Hugh Dickins Date: Wed, 23 Nov 2005 13:37:40 -0800 Subject: [PATCH] mm: fill arch atomic64 gaps alpha, sparc64, x86_64 are each missing some primitives from their atomic64 support: fill in the gaps I've noticed by extrapolating asm, follow the groupings in each file. But powerpc and parisc still lack atomic64. Signed-off-by: Hugh Dickins Cc: Richard Henderson Cc: Ivan Kokshaysky Cc: "David S. Miller" Cc: Andi Kleen Cc: Nick Piggin Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- include/asm-alpha/atomic.h | 7 ++++-- include/asm-sparc64/atomic.h | 1 + include/asm-x86_64/atomic.h | 51 +++++++++++++++++++++++++++++++++----------- 3 files changed, 44 insertions(+), 15 deletions(-) (limited to 'include') diff --git a/include/asm-alpha/atomic.h b/include/asm-alpha/atomic.h index 36505bb4e8c..6183eab006d 100644 --- a/include/asm-alpha/atomic.h +++ b/include/asm-alpha/atomic.h @@ -118,8 +118,6 @@ static __inline__ long atomic_add_return(int i, atomic_t * v) return result; } -#define atomic_add_negative(a, v) (atomic_add_return((a), (v)) < 0) - static __inline__ long atomic64_add_return(long i, atomic64_t * v) { long temp, result; @@ -189,6 +187,9 @@ static __inline__ long atomic64_sub_return(long i, atomic64_t * v) }) #define atomic_inc_not_zero(v) atomic_add_unless((v), 1, 0) +#define atomic_add_negative(a, v) (atomic_add_return((a), (v)) < 0) +#define atomic64_add_negative(a, v) (atomic64_add_return((a), (v)) < 0) + #define atomic_dec_return(v) atomic_sub_return(1,(v)) #define atomic64_dec_return(v) atomic64_sub_return(1,(v)) @@ -199,6 +200,8 @@ static __inline__ long atomic64_sub_return(long i, atomic64_t * v) #define atomic64_sub_and_test(i,v) (atomic64_sub_return((i), (v)) == 0) #define atomic_inc_and_test(v) (atomic_add_return(1, (v)) == 0) +#define atomic64_inc_and_test(v) (atomic64_add_return(1, (v)) == 0) + #define atomic_dec_and_test(v) (atomic_sub_return(1, (v)) == 0) #define atomic64_dec_and_test(v) (atomic64_sub_return(1, (v)) == 0) diff --git a/include/asm-sparc64/atomic.h b/include/asm-sparc64/atomic.h index 8198c3d0d00..3789fe31599 100644 --- a/include/asm-sparc64/atomic.h +++ b/include/asm-sparc64/atomic.h @@ -54,6 +54,7 @@ extern int atomic64_sub_ret(int, atomic64_t *); * other cases. */ #define atomic_inc_and_test(v) (atomic_inc_return(v) == 0) +#define atomic64_inc_and_test(v) (atomic64_inc_return(v) == 0) #define atomic_sub_and_test(i, v) (atomic_sub_ret(i, v) == 0) #define atomic64_sub_and_test(i, v) (atomic64_sub_ret(i, v) == 0) diff --git a/include/asm-x86_64/atomic.h b/include/asm-x86_64/atomic.h index 0866ef67f19..50db9f39274 100644 --- a/include/asm-x86_64/atomic.h +++ b/include/asm-x86_64/atomic.h @@ -160,8 +160,8 @@ static __inline__ int atomic_inc_and_test(atomic_t *v) /** * atomic_add_negative - add and test if negative - * @v: pointer of type atomic_t * @i: integer value to add + * @v: pointer of type atomic_t * * Atomically adds @i to @v and returns true * if the result is negative, or false when @@ -178,6 +178,31 @@ static __inline__ int atomic_add_negative(int i, atomic_t *v) return c; } +/** + * atomic_add_return - add and return + * @i: integer value to add + * @v: pointer of type atomic_t + * + * Atomically adds @i to @v and returns @i + @v + */ +static __inline__ int atomic_add_return(int i, atomic_t *v) +{ + int __i = i; + __asm__ __volatile__( + LOCK "xaddl %0, %1;" + :"=r"(i) + :"m"(v->counter), "0"(i)); + return i + __i; +} + +static __inline__ int atomic_sub_return(int i, atomic_t *v) +{ + return atomic_add_return(-i,v); +} + +#define atomic_inc_return(v) (atomic_add_return(1,v)) +#define atomic_dec_return(v) (atomic_sub_return(1,v)) + /* An 64bit atomic type */ typedef struct { volatile long counter; } atomic64_t; @@ -320,14 +345,14 @@ static __inline__ int atomic64_inc_and_test(atomic64_t *v) /** * atomic64_add_negative - add and test if negative - * @v: pointer to atomic64_t * @i: integer value to add + * @v: pointer to type atomic64_t * * Atomically adds @i to @v and returns true * if the result is negative, or false when * result is greater than or equal to zero. */ -static __inline__ long atomic64_add_negative(long i, atomic64_t *v) +static __inline__ int atomic64_add_negative(long i, atomic64_t *v) { unsigned char c; @@ -339,27 +364,30 @@ static __inline__ long atomic64_add_negative(long i, atomic64_t *v) } /** - * atomic_add_return - add and return - * @v: pointer of type atomic_t + * atomic64_add_return - add and return * @i: integer value to add + * @v: pointer to type atomic64_t * * Atomically adds @i to @v and returns @i + @v */ -static __inline__ int atomic_add_return(int i, atomic_t *v) +static __inline__ long atomic64_add_return(long i, atomic64_t *v) { - int __i = i; + long __i = i; __asm__ __volatile__( - LOCK "xaddl %0, %1;" + LOCK "xaddq %0, %1;" :"=r"(i) :"m"(v->counter), "0"(i)); return i + __i; } -static __inline__ int atomic_sub_return(int i, atomic_t *v) +static __inline__ long atomic64_sub_return(long i, atomic64_t *v) { - return atomic_add_return(-i,v); + return atomic64_add_return(-i,v); } +#define atomic64_inc_return(v) (atomic64_add_return(1,v)) +#define atomic64_dec_return(v) (atomic64_sub_return(1,v)) + #define atomic_cmpxchg(v, old, new) ((int)cmpxchg(&((v)->counter), old, new)) /** @@ -381,9 +409,6 @@ static __inline__ int atomic_sub_return(int i, atomic_t *v) }) #define atomic_inc_not_zero(v) atomic_add_unless((v), 1, 0) -#define atomic_inc_return(v) (atomic_add_return(1,v)) -#define atomic_dec_return(v) (atomic_sub_return(1,v)) - /* These are x86-specific, used by some header files */ #define atomic_clear_mask(mask, addr) \ __asm__ __volatile__(LOCK "andl %0,%1" \ -- cgit v1.2.3 From 5e391dc9e3fec68922137ae317bf680a74656c1b Mon Sep 17 00:00:00 2001 From: David Gibson Date: Wed, 23 Nov 2005 13:37:45 -0800 Subject: [PATCH] powerpc: fix for hugepage areas straddling 4GB boundary Commit 7d24f0b8a53261709938ffabe3e00f88f6498df9 fixed bugs in the ppc64 SLB miss handler with respect to hugepage handling, and in the process tweaked the semantics of the hugepage address masks in mm_context_t. Unfortunately, it left out a couple of necessary changes to go with that change. First, the in_hugepage_area() macro was not updated to match, second prepare_hugepage_range() was not updated to correctly handle hugepages regions which straddled the 4GB point. The latter appears only to cause process-hangs when attempting to map such a region, but the former can cause oopses if a get_user_pages() is triggered at the wrong point. This patch addresses both bugs. Signed-off-by: David Gibson Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- arch/powerpc/mm/hugetlbpage.c | 6 +++--- include/asm-powerpc/page_64.h | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) (limited to 'include') diff --git a/arch/powerpc/mm/hugetlbpage.c b/arch/powerpc/mm/hugetlbpage.c index 9250f14be8e..f867bba893c 100644 --- a/arch/powerpc/mm/hugetlbpage.c +++ b/arch/powerpc/mm/hugetlbpage.c @@ -287,15 +287,15 @@ static int open_high_hpage_areas(struct mm_struct *mm, u16 newareas) int prepare_hugepage_range(unsigned long addr, unsigned long len) { - int err; + int err = 0; if ( (addr+len) < addr ) return -EINVAL; - if ((addr + len) < 0x100000000UL) + if (addr < 0x100000000UL) err = open_low_hpage_areas(current->mm, LOW_ESID_MASK(addr, len)); - else + if ((addr + len) >= 0x100000000UL) err = open_high_hpage_areas(current->mm, HTLB_AREA_MASK(addr, len)); if (err) { diff --git a/include/asm-powerpc/page_64.h b/include/asm-powerpc/page_64.h index 1e6e7846824..58a3dd9a79e 100644 --- a/include/asm-powerpc/page_64.h +++ b/include/asm-powerpc/page_64.h @@ -135,9 +135,9 @@ extern unsigned int HPAGE_SHIFT; #define in_hugepage_area(context, addr) \ (cpu_has_feature(CPU_FTR_16M_PAGE) && \ - ( ((1 << GET_HTLB_AREA(addr)) & (context).high_htlb_areas) || \ - ( ((addr) < 0x100000000L) && \ - ((1 << GET_ESID(addr)) & (context).low_htlb_areas) ) ) ) + ( ( (addr) >= 0x100000000UL) \ + ? ((1 << GET_HTLB_AREA(addr)) & (context).high_htlb_areas) \ + : ((1 << GET_ESID(addr)) & (context).low_htlb_areas) ) ) #else /* !CONFIG_HUGETLB_PAGE */ -- cgit v1.2.3 From 8dd396ec7bf706fe85d8c6792b478ee6f09e8de6 Mon Sep 17 00:00:00 2001 From: Randy Dunlap Date: Wed, 23 Nov 2005 15:45:53 -0800 Subject: [PATCH] USB: kernel-doc for linux/usb.h Fix kernel-doc warning in linux/usb.h. Signed-off-by: Randy Dunlap Signed-off-by: Greg Kroah-Hartman Signed-off-by: Linus Torvalds --- include/linux/usb.h | 1 + 1 file changed, 1 insertion(+) (limited to 'include') diff --git a/include/linux/usb.h b/include/linux/usb.h index 856d232c756..d81b050e595 100644 --- a/include/linux/usb.h +++ b/include/linux/usb.h @@ -47,6 +47,7 @@ struct usb_driver; * @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 * @extra: descriptors following this endpoint in the configuration * @extralen: how many bytes of "extra" are valid * -- cgit v1.2.3