Commit 44e7ed39 authored by Linus Torvalds's avatar Linus Torvalds

Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/sparc-2.6

* git://git.kernel.org/pub/scm/linux/kernel/git/davem/sparc-2.6:
  sparc64: setup_valid_addr_bitmap_from_pavail() should be __init
  sparc: Fix resource flags for PCI children in OF device tree.
  sparc32: Implement smp_call_function_single().
parents 011fec74 dbb8c35d
...@@ -50,27 +50,24 @@ struct seq_file; ...@@ -50,27 +50,24 @@ struct seq_file;
void smp_bogo(struct seq_file *); void smp_bogo(struct seq_file *);
void smp_info(struct seq_file *); void smp_info(struct seq_file *);
BTFIXUPDEF_CALL(void, smp_cross_call, smpfunc_t, unsigned long, unsigned long, unsigned long, unsigned long, unsigned long) BTFIXUPDEF_CALL(void, smp_cross_call, smpfunc_t, cpumask_t, unsigned long, unsigned long, unsigned long, unsigned long)
BTFIXUPDEF_CALL(int, __hard_smp_processor_id, void) BTFIXUPDEF_CALL(int, __hard_smp_processor_id, void)
BTFIXUPDEF_BLACKBOX(hard_smp_processor_id) BTFIXUPDEF_BLACKBOX(hard_smp_processor_id)
BTFIXUPDEF_BLACKBOX(load_current) BTFIXUPDEF_BLACKBOX(load_current)
#define smp_cross_call(func,arg1,arg2,arg3,arg4,arg5) BTFIXUP_CALL(smp_cross_call)(func,arg1,arg2,arg3,arg4,arg5) #define smp_cross_call(func,mask,arg1,arg2,arg3,arg4) BTFIXUP_CALL(smp_cross_call)(func,mask,arg1,arg2,arg3,arg4)
static inline void xc0(smpfunc_t func) { smp_cross_call(func, 0, 0, 0, 0, 0); } static inline void xc0(smpfunc_t func) { smp_cross_call(func, cpu_online_map, 0, 0, 0, 0); }
static inline void xc1(smpfunc_t func, unsigned long arg1) static inline void xc1(smpfunc_t func, unsigned long arg1)
{ smp_cross_call(func, arg1, 0, 0, 0, 0); } { smp_cross_call(func, cpu_online_map, arg1, 0, 0, 0); }
static inline void xc2(smpfunc_t func, unsigned long arg1, unsigned long arg2) static inline void xc2(smpfunc_t func, unsigned long arg1, unsigned long arg2)
{ smp_cross_call(func, arg1, arg2, 0, 0, 0); } { smp_cross_call(func, cpu_online_map, arg1, arg2, 0, 0); }
static inline void xc3(smpfunc_t func, unsigned long arg1, unsigned long arg2, static inline void xc3(smpfunc_t func, unsigned long arg1, unsigned long arg2,
unsigned long arg3) unsigned long arg3)
{ smp_cross_call(func, arg1, arg2, arg3, 0, 0); } { smp_cross_call(func, cpu_online_map, arg1, arg2, arg3, 0); }
static inline void xc4(smpfunc_t func, unsigned long arg1, unsigned long arg2, static inline void xc4(smpfunc_t func, unsigned long arg1, unsigned long arg2,
unsigned long arg3, unsigned long arg4) unsigned long arg3, unsigned long arg4)
{ smp_cross_call(func, arg1, arg2, arg3, arg4, 0); } { smp_cross_call(func, cpu_online_map, arg1, arg2, arg3, arg4); }
static inline void xc5(smpfunc_t func, unsigned long arg1, unsigned long arg2,
unsigned long arg3, unsigned long arg4, unsigned long arg5)
{ smp_cross_call(func, arg1, arg2, arg3, arg4, arg5); }
static inline int smp_call_function(void (*func)(void *info), void *info, int wait) static inline int smp_call_function(void (*func)(void *info), void *info, int wait)
{ {
...@@ -78,6 +75,14 @@ static inline int smp_call_function(void (*func)(void *info), void *info, int wa ...@@ -78,6 +75,14 @@ static inline int smp_call_function(void (*func)(void *info), void *info, int wa
return 0; return 0;
} }
static inline int smp_call_function_single(int cpuid, void (*func) (void *info),
void *info, int wait)
{
smp_cross_call((smpfunc_t)func, cpumask_of_cpu(cpuid),
(unsigned long) info, 0, 0, 0);
return 0;
}
static inline int cpu_logical_map(int cpu) static inline int cpu_logical_map(int cpu)
{ {
return cpu; return cpu;
......
...@@ -70,7 +70,7 @@ struct of_bus { ...@@ -70,7 +70,7 @@ struct of_bus {
int *addrc, int *sizec); int *addrc, int *sizec);
int (*map)(u32 *addr, const u32 *range, int (*map)(u32 *addr, const u32 *range,
int na, int ns, int pna); int na, int ns, int pna);
unsigned int (*get_flags)(const u32 *addr); unsigned long (*get_flags)(const u32 *addr, unsigned long);
}; };
/* /*
...@@ -130,8 +130,10 @@ static int of_bus_default_map(u32 *addr, const u32 *range, ...@@ -130,8 +130,10 @@ static int of_bus_default_map(u32 *addr, const u32 *range,
return 0; return 0;
} }
static unsigned int of_bus_default_get_flags(const u32 *addr) static unsigned long of_bus_default_get_flags(const u32 *addr, unsigned long flags)
{ {
if (flags)
return flags;
return IORESOURCE_MEM; return IORESOURCE_MEM;
} }
...@@ -194,17 +196,21 @@ static int of_bus_pci_map(u32 *addr, const u32 *range, ...@@ -194,17 +196,21 @@ static int of_bus_pci_map(u32 *addr, const u32 *range,
return 0; return 0;
} }
static unsigned int of_bus_pci_get_flags(const u32 *addr) static unsigned long of_bus_pci_get_flags(const u32 *addr, unsigned long flags)
{ {
unsigned int flags = 0;
u32 w = addr[0]; u32 w = addr[0];
/* For PCI, we override whatever child busses may have used. */
flags = 0;
switch((w >> 24) & 0x03) { switch((w >> 24) & 0x03) {
case 0x01: case 0x01:
flags |= IORESOURCE_IO; flags |= IORESOURCE_IO;
break;
case 0x02: /* 32 bits */ case 0x02: /* 32 bits */
case 0x03: /* 64 bits */ case 0x03: /* 64 bits */
flags |= IORESOURCE_MEM; flags |= IORESOURCE_MEM;
break;
} }
if (w & 0x40000000) if (w & 0x40000000)
flags |= IORESOURCE_PREFETCH; flags |= IORESOURCE_PREFETCH;
...@@ -362,10 +368,11 @@ static void __init build_device_resources(struct of_device *op, ...@@ -362,10 +368,11 @@ static void __init build_device_resources(struct of_device *op,
int pna, pns; int pna, pns;
size = of_read_addr(reg + na, ns); size = of_read_addr(reg + na, ns);
flags = bus->get_flags(reg);
memcpy(addr, reg, na * 4); memcpy(addr, reg, na * 4);
flags = bus->get_flags(reg, 0);
/* If the immediate parent has no ranges property to apply, /* If the immediate parent has no ranges property to apply,
* just use a 1<->1 mapping. * just use a 1<->1 mapping.
*/ */
...@@ -393,6 +400,8 @@ static void __init build_device_resources(struct of_device *op, ...@@ -393,6 +400,8 @@ static void __init build_device_resources(struct of_device *op,
dna, dns, pna)) dna, dns, pna))
break; break;
flags = pbus->get_flags(addr, flags);
dna = pna; dna = pna;
dns = pns; dns = pns;
dbus = pbus; dbus = pbus;
......
...@@ -262,8 +262,9 @@ static struct smp_funcall { ...@@ -262,8 +262,9 @@ static struct smp_funcall {
static DEFINE_SPINLOCK(cross_call_lock); static DEFINE_SPINLOCK(cross_call_lock);
/* Cross calls must be serialized, at least currently. */ /* Cross calls must be serialized, at least currently. */
void smp4d_cross_call(smpfunc_t func, unsigned long arg1, unsigned long arg2, static void smp4d_cross_call(smpfunc_t func, cpumask_t mask, unsigned long arg1,
unsigned long arg3, unsigned long arg4, unsigned long arg5) unsigned long arg2, unsigned long arg3,
unsigned long arg4)
{ {
if(smp_processors_ready) { if(smp_processors_ready) {
register int high = smp_highest_cpu; register int high = smp_highest_cpu;
...@@ -278,7 +279,7 @@ void smp4d_cross_call(smpfunc_t func, unsigned long arg1, unsigned long arg2, ...@@ -278,7 +279,7 @@ void smp4d_cross_call(smpfunc_t func, unsigned long arg1, unsigned long arg2,
register unsigned long a2 asm("i2") = arg2; register unsigned long a2 asm("i2") = arg2;
register unsigned long a3 asm("i3") = arg3; register unsigned long a3 asm("i3") = arg3;
register unsigned long a4 asm("i4") = arg4; register unsigned long a4 asm("i4") = arg4;
register unsigned long a5 asm("i5") = arg5; register unsigned long a5 asm("i5") = 0;
__asm__ __volatile__( __asm__ __volatile__(
"std %0, [%6]\n\t" "std %0, [%6]\n\t"
...@@ -290,11 +291,10 @@ void smp4d_cross_call(smpfunc_t func, unsigned long arg1, unsigned long arg2, ...@@ -290,11 +291,10 @@ void smp4d_cross_call(smpfunc_t func, unsigned long arg1, unsigned long arg2,
/* Init receive/complete mapping, plus fire the IPI's off. */ /* Init receive/complete mapping, plus fire the IPI's off. */
{ {
cpumask_t mask;
register int i; register int i;
mask = cpumask_of_cpu(hard_smp4d_processor_id()); cpu_clear(smp_processor_id(), mask);
cpus_andnot(mask, cpu_online_map, mask); cpus_and(mask, cpu_online_map, mask);
for(i = 0; i <= high; i++) { for(i = 0; i <= high; i++) {
if (cpu_isset(i, mask)) { if (cpu_isset(i, mask)) {
ccall_info.processors_in[i] = 0; ccall_info.processors_in[i] = 0;
...@@ -309,12 +309,16 @@ void smp4d_cross_call(smpfunc_t func, unsigned long arg1, unsigned long arg2, ...@@ -309,12 +309,16 @@ void smp4d_cross_call(smpfunc_t func, unsigned long arg1, unsigned long arg2,
i = 0; i = 0;
do { do {
if (!cpu_isset(i, mask))
continue;
while(!ccall_info.processors_in[i]) while(!ccall_info.processors_in[i])
barrier(); barrier();
} while(++i <= high); } while(++i <= high);
i = 0; i = 0;
do { do {
if (!cpu_isset(i, mask))
continue;
while(!ccall_info.processors_out[i]) while(!ccall_info.processors_out[i])
barrier(); barrier();
} while(++i <= high); } while(++i <= high);
......
...@@ -244,9 +244,9 @@ static struct smp_funcall { ...@@ -244,9 +244,9 @@ static struct smp_funcall {
static DEFINE_SPINLOCK(cross_call_lock); static DEFINE_SPINLOCK(cross_call_lock);
/* Cross calls must be serialized, at least currently. */ /* Cross calls must be serialized, at least currently. */
static void smp4m_cross_call(smpfunc_t func, unsigned long arg1, static void smp4m_cross_call(smpfunc_t func, cpumask_t mask, unsigned long arg1,
unsigned long arg2, unsigned long arg3, unsigned long arg2, unsigned long arg3,
unsigned long arg4, unsigned long arg5) unsigned long arg4)
{ {
register int ncpus = SUN4M_NCPUS; register int ncpus = SUN4M_NCPUS;
unsigned long flags; unsigned long flags;
...@@ -259,14 +259,14 @@ static void smp4m_cross_call(smpfunc_t func, unsigned long arg1, ...@@ -259,14 +259,14 @@ static void smp4m_cross_call(smpfunc_t func, unsigned long arg1,
ccall_info.arg2 = arg2; ccall_info.arg2 = arg2;
ccall_info.arg3 = arg3; ccall_info.arg3 = arg3;
ccall_info.arg4 = arg4; ccall_info.arg4 = arg4;
ccall_info.arg5 = arg5; ccall_info.arg5 = 0;
/* Init receive/complete mapping, plus fire the IPI's off. */ /* Init receive/complete mapping, plus fire the IPI's off. */
{ {
cpumask_t mask = cpu_online_map;
register int i; register int i;
cpu_clear(smp_processor_id(), mask); cpu_clear(smp_processor_id(), mask);
cpus_and(mask, cpu_online_map, mask);
for(i = 0; i < ncpus; i++) { for(i = 0; i < ncpus; i++) {
if (cpu_isset(i, mask)) { if (cpu_isset(i, mask)) {
ccall_info.processors_in[i] = 0; ccall_info.processors_in[i] = 0;
...@@ -284,12 +284,16 @@ static void smp4m_cross_call(smpfunc_t func, unsigned long arg1, ...@@ -284,12 +284,16 @@ static void smp4m_cross_call(smpfunc_t func, unsigned long arg1,
i = 0; i = 0;
do { do {
if (!cpu_isset(i, mask))
continue;
while(!ccall_info.processors_in[i]) while(!ccall_info.processors_in[i])
barrier(); barrier();
} while(++i < ncpus); } while(++i < ncpus);
i = 0; i = 0;
do { do {
if (!cpu_isset(i, mask))
continue;
while(!ccall_info.processors_out[i]) while(!ccall_info.processors_out[i])
barrier(); barrier();
} while(++i < ncpus); } while(++i < ncpus);
......
...@@ -96,7 +96,7 @@ struct of_bus { ...@@ -96,7 +96,7 @@ struct of_bus {
int *addrc, int *sizec); int *addrc, int *sizec);
int (*map)(u32 *addr, const u32 *range, int (*map)(u32 *addr, const u32 *range,
int na, int ns, int pna); int na, int ns, int pna);
unsigned int (*get_flags)(const u32 *addr); unsigned long (*get_flags)(const u32 *addr, unsigned long);
}; };
/* /*
...@@ -156,8 +156,10 @@ static int of_bus_default_map(u32 *addr, const u32 *range, ...@@ -156,8 +156,10 @@ static int of_bus_default_map(u32 *addr, const u32 *range,
return 0; return 0;
} }
static unsigned int of_bus_default_get_flags(const u32 *addr) static unsigned long of_bus_default_get_flags(const u32 *addr, unsigned long flags)
{ {
if (flags)
return flags;
return IORESOURCE_MEM; return IORESOURCE_MEM;
} }
...@@ -249,17 +251,21 @@ static int of_bus_pci_map(u32 *addr, const u32 *range, ...@@ -249,17 +251,21 @@ static int of_bus_pci_map(u32 *addr, const u32 *range,
return 0; return 0;
} }
static unsigned int of_bus_pci_get_flags(const u32 *addr) static unsigned long of_bus_pci_get_flags(const u32 *addr, unsigned long flags)
{ {
unsigned int flags = 0;
u32 w = addr[0]; u32 w = addr[0];
/* For PCI, we override whatever child busses may have used. */
flags = 0;
switch((w >> 24) & 0x03) { switch((w >> 24) & 0x03) {
case 0x01: case 0x01:
flags |= IORESOURCE_IO; flags |= IORESOURCE_IO;
break;
case 0x02: /* 32 bits */ case 0x02: /* 32 bits */
case 0x03: /* 64 bits */ case 0x03: /* 64 bits */
flags |= IORESOURCE_MEM; flags |= IORESOURCE_MEM;
break;
} }
if (w & 0x40000000) if (w & 0x40000000)
flags |= IORESOURCE_PREFETCH; flags |= IORESOURCE_PREFETCH;
...@@ -478,10 +484,10 @@ static void __init build_device_resources(struct of_device *op, ...@@ -478,10 +484,10 @@ static void __init build_device_resources(struct of_device *op,
int pna, pns; int pna, pns;
size = of_read_addr(reg + na, ns); size = of_read_addr(reg + na, ns);
flags = bus->get_flags(reg);
memcpy(addr, reg, na * 4); memcpy(addr, reg, na * 4);
flags = bus->get_flags(addr, 0);
if (use_1to1_mapping(pp)) { if (use_1to1_mapping(pp)) {
result = of_read_addr(addr, na); result = of_read_addr(addr, na);
goto build_res; goto build_res;
...@@ -506,6 +512,8 @@ static void __init build_device_resources(struct of_device *op, ...@@ -506,6 +512,8 @@ static void __init build_device_resources(struct of_device *op,
dna, dns, pna)) dna, dns, pna))
break; break;
flags = pbus->get_flags(addr, flags);
dna = pna; dna = pna;
dns = pns; dns = pns;
dbus = pbus; dbus = pbus;
......
...@@ -1843,7 +1843,7 @@ static int pavail_rescan_ents __initdata; ...@@ -1843,7 +1843,7 @@ static int pavail_rescan_ents __initdata;
* memory list again, and make sure it provides at least as much * memory list again, and make sure it provides at least as much
* memory as 'pavail' does. * memory as 'pavail' does.
*/ */
static void setup_valid_addr_bitmap_from_pavail(void) static void __init setup_valid_addr_bitmap_from_pavail(void)
{ {
int i; int i;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment