Skip to content

Commit

Permalink
Merge master.kernel.org:/home/rmk/linux-2.6-arm
Browse files Browse the repository at this point in the history
  • Loading branch information
Linus Torvalds committed Nov 8, 2005
2 parents 329f7db + 72274c9 commit 9f04012
Show file tree
Hide file tree
Showing 24 changed files with 629 additions and 173 deletions.
10 changes: 10 additions & 0 deletions arch/arm/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -356,6 +356,16 @@ config HOTPLUG_CPU
Say Y here to experiment with turning CPUs off and on. CPUs
can be controlled through /sys/devices/system/cpu.

config LOCAL_TIMERS
bool "Use local timer interrupts"
depends on SMP && n
default y
help
Enable support for local timers on SMP platforms, rather then the
legacy IPI broadcast method. Local timers allows the system
accounting to be spread across the timer interval, preventing a
"thundering herd" at every timer tick.

config PREEMPT
bool "Preemptible Kernel (EXPERIMENTAL)"
depends on EXPERIMENTAL
Expand Down
6 changes: 6 additions & 0 deletions arch/arm/boot/compressed/misc.c
Original file line number Diff line number Diff line change
Expand Up @@ -283,8 +283,14 @@ void flush_window(void)
putstr(".");
}

#ifndef arch_error
#define arch_error(x)
#endif

static void error(char *x)
{
arch_error(x);

putstr("\n\n");
putstr(x);
putstr("\n\n -- System halted");
Expand Down
6 changes: 0 additions & 6 deletions arch/arm/common/scoop.c
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,6 @@

#define SCOOP_REG(d,adr) (*(volatile unsigned short*)(d +(adr)))

/* PCMCIA to Scoop linkage structures for pxa2xx_sharpsl.c
There is no easy way to link multiple scoop devices into one
single entity for the pxa2xx_pcmcia device */
int scoop_num;
struct scoop_pcmcia_dev *scoop_devs;

struct scoop_dev {
void *base;
spinlock_t scoop_lock;
Expand Down
4 changes: 4 additions & 0 deletions arch/arm/kernel/armksyms.c
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
*/
#include <linux/module.h>
#include <linux/string.h>
#include <linux/cryptohash.h>
#include <linux/delay.h>
#include <linux/in6.h>
#include <linux/syscalls.h>
Expand Down Expand Up @@ -126,6 +127,9 @@ EXPORT_SYMBOL(__put_user_2);
EXPORT_SYMBOL(__put_user_4);
EXPORT_SYMBOL(__put_user_8);

/* crypto hash */
EXPORT_SYMBOL(sha_transform);

/* gcc lib functions */
EXPORT_SYMBOL(__ashldi3);
EXPORT_SYMBOL(__ashrdi3);
Expand Down
7 changes: 7 additions & 0 deletions arch/arm/kernel/entry-armv.S
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,13 @@
movne r0, sp
adrne lr, 1b
bne do_IPI

#ifdef CONFIG_LOCAL_TIMERS
test_for_ltirq r0, r6, r5, lr
movne r0, sp
adrne lr, 1b
bne do_local_timer
#endif
#endif

.endm
Expand Down
3 changes: 2 additions & 1 deletion arch/arm/kernel/irq.c
Original file line number Diff line number Diff line change
Expand Up @@ -264,6 +264,7 @@ int show_interrupts(struct seq_file *p, void *v)
#endif
#ifdef CONFIG_SMP
show_ipi_list(p);
show_local_irqs(p);
#endif
seq_printf(p, "Err: %10lu\n", irq_err_count);
}
Expand Down Expand Up @@ -995,7 +996,7 @@ void __init init_irq_proc(void)
struct proc_dir_entry *dir;
int irq;

dir = proc_mkdir("irq", 0);
dir = proc_mkdir("irq", NULL);
if (!dir)
return;

Expand Down
42 changes: 38 additions & 4 deletions arch/arm/kernel/smp.c
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ int __cpuinit __cpu_up(unsigned int cpu)
ret = -EIO;
}

secondary_data.stack = 0;
secondary_data.stack = NULL;
secondary_data.pgdir = 0;

*pmd_offset(pgd, PHYS_OFFSET) = __pmd(0);
Expand Down Expand Up @@ -184,6 +184,11 @@ int __cpuexit __cpu_disable(void)
*/
migrate_irqs();

/*
* Stop the local timer for this CPU.
*/
local_timer_stop(cpu);

/*
* Flush user cache and TLB mappings, and then remove this CPU
* from the vm mask set of all processes.
Expand Down Expand Up @@ -289,6 +294,11 @@ asmlinkage void __cpuinit secondary_start_kernel(void)
*/
cpu_set(cpu, cpu_online_map);

/*
* Setup local timer for this CPU.
*/
local_timer_setup(cpu);

/*
* OK, it's off to the idle thread for us
*/
Expand Down Expand Up @@ -359,8 +369,8 @@ static void send_ipi_message(cpumask_t callmap, enum ipi_msg_type msg)
* You must not call this function with disabled interrupts, from a
* hardware interrupt handler, nor from a bottom half handler.
*/
int smp_call_function_on_cpu(void (*func)(void *info), void *info, int retry,
int wait, cpumask_t callmap)
static int smp_call_function_on_cpu(void (*func)(void *info), void *info,
int retry, int wait, cpumask_t callmap)
{
struct smp_call_struct data;
unsigned long timeout;
Expand Down Expand Up @@ -454,6 +464,18 @@ void show_ipi_list(struct seq_file *p)
seq_putc(p, '\n');
}

void show_local_irqs(struct seq_file *p)
{
unsigned int cpu;

seq_printf(p, "LOC: ");

for_each_present_cpu(cpu)
seq_printf(p, "%10u ", irq_stat[cpu].local_timer_irqs);

seq_putc(p, '\n');
}

static void ipi_timer(struct pt_regs *regs)
{
int user = user_mode(regs);
Expand All @@ -464,6 +486,18 @@ static void ipi_timer(struct pt_regs *regs)
irq_exit();
}

#ifdef CONFIG_LOCAL_TIMERS
asmlinkage void do_local_timer(struct pt_regs *regs)
{
int cpu = smp_processor_id();

if (local_timer_ack()) {
irq_stat[cpu].local_timer_irqs++;
ipi_timer(regs);
}
}
#endif

/*
* ipi_call_function - handle IPI from smp_call_function()
*
Expand Down Expand Up @@ -515,7 +549,7 @@ static void ipi_cpu_stop(unsigned int cpu)
*
* Bit 0 - Inter-processor function call
*/
void do_IPI(struct pt_regs *regs)
asmlinkage void do_IPI(struct pt_regs *regs)
{
unsigned int cpu = smp_processor_id();
struct ipi_data *ipi = &per_cpu(ipi_data, cpu);
Expand Down
48 changes: 38 additions & 10 deletions arch/arm/mach-pxa/corgi.c
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,37 @@ static struct scoop_config corgi_scoop_setup = {
.io_out = CORGI_SCOOP_IO_OUT,
};

struct platform_device corgiscoop_device = {
.name = "sharp-scoop",
.id = -1,
.dev = {
.platform_data = &corgi_scoop_setup,
},
.num_resources = ARRAY_SIZE(corgi_scoop_resources),
.resource = corgi_scoop_resources,
};

static void corgi_pcmcia_init(void)
{
/* Setup default state of GPIO outputs
before we enable them as outputs. */
GPSR(GPIO48_nPOE) = GPIO_bit(GPIO48_nPOE) |
GPIO_bit(GPIO49_nPWE) | GPIO_bit(GPIO50_nPIOR) |
GPIO_bit(GPIO51_nPIOW) | GPIO_bit(GPIO52_nPCE_1) |
GPIO_bit(GPIO53_nPCE_2);

pxa_gpio_mode(GPIO48_nPOE_MD);
pxa_gpio_mode(GPIO49_nPWE_MD);
pxa_gpio_mode(GPIO50_nPIOR_MD);
pxa_gpio_mode(GPIO51_nPIOW_MD);
pxa_gpio_mode(GPIO55_nPREG_MD);
pxa_gpio_mode(GPIO56_nPWAIT_MD);
pxa_gpio_mode(GPIO57_nIOIS16_MD);
pxa_gpio_mode(GPIO52_nPCE_1_MD);
pxa_gpio_mode(GPIO53_nPCE_2_MD);
pxa_gpio_mode(GPIO54_pSKTSEL_MD);
}

static struct scoop_pcmcia_dev corgi_pcmcia_scoop[] = {
{
.dev = &corgiscoop_device.dev,
Expand All @@ -71,16 +102,14 @@ static struct scoop_pcmcia_dev corgi_pcmcia_scoop[] = {
},
};

struct platform_device corgiscoop_device = {
.name = "sharp-scoop",
.id = -1,
.dev = {
.platform_data = &corgi_scoop_setup,
},
.num_resources = ARRAY_SIZE(corgi_scoop_resources),
.resource = corgi_scoop_resources,
static struct scoop_pcmcia_config corgi_pcmcia_config = {
.devs = &corgi_pcmcia_scoop[0],
.num_devs = 1,
.pcmcia_init = corgi_pcmcia_init,
};

EXPORT_SYMBOL(corgiscoop_device);


/*
* Corgi SSP Device
Expand Down Expand Up @@ -294,8 +323,7 @@ static void __init corgi_init(void)
pxa_set_mci_info(&corgi_mci_platform_data);
pxa_set_ficp_info(&corgi_ficp_platform_data);

scoop_num = 1;
scoop_devs = &corgi_pcmcia_scoop[0];
platform_scoop_config = &corgi_pcmcia_config;

platform_add_devices(devices, ARRAY_SIZE(devices));
}
Expand Down
32 changes: 30 additions & 2 deletions arch/arm/mach-pxa/poodle.c
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,27 @@ struct platform_device poodle_scoop_device = {
.resource = poodle_scoop_resources,
};

static void poodle_pcmcia_init(void)
{
/* Setup default state of GPIO outputs
before we enable them as outputs. */
GPSR(GPIO48_nPOE) = GPIO_bit(GPIO48_nPOE) |
GPIO_bit(GPIO49_nPWE) | GPIO_bit(GPIO50_nPIOR) |
GPIO_bit(GPIO51_nPIOW) | GPIO_bit(GPIO52_nPCE_1) |
GPIO_bit(GPIO53_nPCE_2);

pxa_gpio_mode(GPIO48_nPOE_MD);
pxa_gpio_mode(GPIO49_nPWE_MD);
pxa_gpio_mode(GPIO50_nPIOR_MD);
pxa_gpio_mode(GPIO51_nPIOW_MD);
pxa_gpio_mode(GPIO55_nPREG_MD);
pxa_gpio_mode(GPIO56_nPWAIT_MD);
pxa_gpio_mode(GPIO57_nIOIS16_MD);
pxa_gpio_mode(GPIO52_nPCE_1_MD);
pxa_gpio_mode(GPIO53_nPCE_2_MD);
pxa_gpio_mode(GPIO54_pSKTSEL_MD);
}

static struct scoop_pcmcia_dev poodle_pcmcia_scoop[] = {
{
.dev = &poodle_scoop_device.dev,
Expand All @@ -74,6 +95,14 @@ static struct scoop_pcmcia_dev poodle_pcmcia_scoop[] = {
},
};

static struct scoop_pcmcia_config poodle_pcmcia_config = {
.devs = &poodle_pcmcia_scoop[0],
.num_devs = 1,
.pcmcia_init = poodle_pcmcia_init,
};

EXPORT_SYMBOL(poodle_scoop_device);


/* LoCoMo device */
static struct resource locomo_resources[] = {
Expand Down Expand Up @@ -268,8 +297,7 @@ static void __init poodle_init(void)
pxa_set_mci_info(&poodle_mci_platform_data);
pxa_set_ficp_info(&poodle_ficp_platform_data);

scoop_num = 1;
scoop_devs = &poodle_pcmcia_scoop[0];
platform_scoop_config = &poodle_pcmcia_config;

ret = platform_add_devices(devices, ARRAY_SIZE(devices));
if (ret) {
Expand Down
Loading

0 comments on commit 9f04012

Please sign in to comment.