aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/kernel
diff options
context:
space:
mode:
Diffstat (limited to 'arch/arm/kernel')
-rw-r--r--arch/arm/kernel/ecard.c31
-rw-r--r--arch/arm/kernel/ecard.h56
-rw-r--r--arch/arm/kernel/process.c3
-rw-r--r--arch/arm/kernel/time.c4
4 files changed, 79 insertions, 15 deletions
diff --git a/arch/arm/kernel/ecard.c b/arch/arm/kernel/ecard.c
index f1c0fb974177..bdbd7da99286 100644
--- a/arch/arm/kernel/ecard.c
+++ b/arch/arm/kernel/ecard.c
@@ -40,6 +40,7 @@
40#include <linux/device.h> 40#include <linux/device.h>
41#include <linux/init.h> 41#include <linux/init.h>
42#include <linux/mutex.h> 42#include <linux/mutex.h>
43#include <linux/kthread.h>
43 44
44#include <asm/dma.h> 45#include <asm/dma.h>
45#include <asm/ecard.h> 46#include <asm/ecard.h>
@@ -50,6 +51,8 @@
50#include <asm/mach/irq.h> 51#include <asm/mach/irq.h>
51#include <asm/tlbflush.h> 52#include <asm/tlbflush.h>
52 53
54#include "ecard.h"
55
53#ifndef CONFIG_ARCH_RPC 56#ifndef CONFIG_ARCH_RPC
54#define HAVE_EXPMASK 57#define HAVE_EXPMASK
55#endif 58#endif
@@ -123,7 +126,7 @@ static void ecard_task_reset(struct ecard_request *req)
123 126
124 res = ec->slot_no == 8 127 res = ec->slot_no == 8
125 ? &ec->resource[ECARD_RES_MEMC] 128 ? &ec->resource[ECARD_RES_MEMC]
126 : ec->type == ECARD_EASI 129 : ec->easi
127 ? &ec->resource[ECARD_RES_EASI] 130 ? &ec->resource[ECARD_RES_EASI]
128 : &ec->resource[ECARD_RES_IOCSYNC]; 131 : &ec->resource[ECARD_RES_IOCSYNC];
129 132
@@ -178,7 +181,7 @@ static void ecard_task_readbytes(struct ecard_request *req)
178 index += 1; 181 index += 1;
179 } 182 }
180 } else { 183 } else {
181 unsigned long base = (ec->type == ECARD_EASI 184 unsigned long base = (ec->easi
182 ? &ec->resource[ECARD_RES_EASI] 185 ? &ec->resource[ECARD_RES_EASI]
183 : &ec->resource[ECARD_RES_IOCSYNC])->start; 186 : &ec->resource[ECARD_RES_IOCSYNC])->start;
184 void __iomem *pbase = (void __iomem *)base; 187 void __iomem *pbase = (void __iomem *)base;
@@ -263,8 +266,6 @@ static int ecard_init_mm(void)
263static int 266static int
264ecard_task(void * unused) 267ecard_task(void * unused)
265{ 268{
266 daemonize("kecardd");
267
268 /* 269 /*
269 * Allocate a mm. We're not a lazy-TLB kernel task since we need 270 * Allocate a mm. We're not a lazy-TLB kernel task since we need
270 * to set page table entries where the user space would be. Note 271 * to set page table entries where the user space would be. Note
@@ -727,7 +728,7 @@ static int ecard_prints(char *buffer, ecard_t *ec)
727 char *start = buffer; 728 char *start = buffer;
728 729
729 buffer += sprintf(buffer, " %d: %s ", ec->slot_no, 730 buffer += sprintf(buffer, " %d: %s ", ec->slot_no,
730 ec->type == ECARD_EASI ? "EASI" : " "); 731 ec->easi ? "EASI" : " ");
731 732
732 if (ec->cid.id == 0) { 733 if (ec->cid.id == 0) {
733 struct in_chunk_dir incd; 734 struct in_chunk_dir incd;
@@ -814,7 +815,7 @@ static struct expansion_card *__init ecard_alloc_card(int type, int slot)
814 } 815 }
815 816
816 ec->slot_no = slot; 817 ec->slot_no = slot;
817 ec->type = type; 818 ec->easi = type == ECARD_EASI;
818 ec->irq = NO_IRQ; 819 ec->irq = NO_IRQ;
819 ec->fiq = NO_IRQ; 820 ec->fiq = NO_IRQ;
820 ec->dma = NO_DMA; 821 ec->dma = NO_DMA;
@@ -825,6 +826,7 @@ static struct expansion_card *__init ecard_alloc_card(int type, int slot)
825 ec->dev.bus = &ecard_bus_type; 826 ec->dev.bus = &ecard_bus_type;
826 ec->dev.dma_mask = &ec->dma_mask; 827 ec->dev.dma_mask = &ec->dma_mask;
827 ec->dma_mask = (u64)0xffffffff; 828 ec->dma_mask = (u64)0xffffffff;
829 ec->dev.coherent_dma_mask = ec->dma_mask;
828 830
829 if (slot < 4) { 831 if (slot < 4) {
830 ec_set_resource(ec, ECARD_RES_MEMC, 832 ec_set_resource(ec, ECARD_RES_MEMC,
@@ -907,7 +909,7 @@ static ssize_t ecard_show_device(struct device *dev, struct device_attribute *at
907static ssize_t ecard_show_type(struct device *dev, struct device_attribute *attr, char *buf) 909static ssize_t ecard_show_type(struct device *dev, struct device_attribute *attr, char *buf)
908{ 910{
909 struct expansion_card *ec = ECARD_DEV(dev); 911 struct expansion_card *ec = ECARD_DEV(dev);
910 return sprintf(buf, "%s\n", ec->type == ECARD_EASI ? "EASI" : "IOC"); 912 return sprintf(buf, "%s\n", ec->easi ? "EASI" : "IOC");
911} 913}
912 914
913static struct device_attribute ecard_dev_attrs[] = { 915static struct device_attribute ecard_dev_attrs[] = {
@@ -1058,13 +1060,14 @@ ecard_probe(int slot, card_type_t type)
1058 */ 1060 */
1059static int __init ecard_init(void) 1061static int __init ecard_init(void)
1060{ 1062{
1061 int slot, irqhw, ret; 1063 struct task_struct *task;
1062 1064 int slot, irqhw;
1063 ret = kernel_thread(ecard_task, NULL, CLONE_KERNEL); 1065
1064 if (ret < 0) { 1066 task = kthread_run(ecard_task, NULL, "kecardd");
1065 printk(KERN_ERR "Ecard: unable to create kernel thread: %d\n", 1067 if (IS_ERR(task)) {
1066 ret); 1068 printk(KERN_ERR "Ecard: unable to create kernel thread: %ld\n",
1067 return ret; 1069 PTR_ERR(task));
1070 return PTR_ERR(task);
1068 } 1071 }
1069 1072
1070 printk("Probing expansion cards\n"); 1073 printk("Probing expansion cards\n");
diff --git a/arch/arm/kernel/ecard.h b/arch/arm/kernel/ecard.h
new file mode 100644
index 000000000000..d7c2dacf935d
--- /dev/null
+++ b/arch/arm/kernel/ecard.h
@@ -0,0 +1,56 @@
1/*
2 * ecard.h
3 *
4 * Copyright 2007 Russell King
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation.
9 */
10
11/* Definitions internal to ecard.c - for it's use only!!
12 *
13 * External expansion card header as read from the card
14 */
15struct ex_ecid {
16 unsigned char r_irq:1;
17 unsigned char r_zero:1;
18 unsigned char r_fiq:1;
19 unsigned char r_id:4;
20 unsigned char r_a:1;
21
22 unsigned char r_cd:1;
23 unsigned char r_is:1;
24 unsigned char r_w:2;
25 unsigned char r_r1:4;
26
27 unsigned char r_r2:8;
28
29 unsigned char r_prod[2];
30
31 unsigned char r_manu[2];
32
33 unsigned char r_country;
34
35 unsigned char r_fiqmask;
36 unsigned char r_fiqoff[3];
37
38 unsigned char r_irqmask;
39 unsigned char r_irqoff[3];
40};
41
42/*
43 * Chunk directory entry as read from the card
44 */
45struct ex_chunk_dir {
46 unsigned char r_id;
47 unsigned char r_len[3];
48 unsigned long r_start;
49 union {
50 char string[256];
51 char data[1];
52 } d;
53#define c_id(x) ((x)->r_id)
54#define c_len(x) ((x)->r_len[0]|((x)->r_len[1]<<8)|((x)->r_len[2]<<16))
55#define c_start(x) ((x)->r_start)
56};
diff --git a/arch/arm/kernel/process.c b/arch/arm/kernel/process.c
index 8afd83d0cbdd..5d6e6523598b 100644
--- a/arch/arm/kernel/process.c
+++ b/arch/arm/kernel/process.c
@@ -27,6 +27,7 @@
27#include <linux/cpu.h> 27#include <linux/cpu.h>
28#include <linux/elfcore.h> 28#include <linux/elfcore.h>
29#include <linux/pm.h> 29#include <linux/pm.h>
30#include <linux/tick.h>
30 31
31#include <asm/leds.h> 32#include <asm/leds.h>
32#include <asm/processor.h> 33#include <asm/processor.h>
@@ -159,9 +160,11 @@ void cpu_idle(void)
159 if (!idle) 160 if (!idle)
160 idle = default_idle; 161 idle = default_idle;
161 leds_event(led_idle_start); 162 leds_event(led_idle_start);
163 tick_nohz_stop_sched_tick();
162 while (!need_resched()) 164 while (!need_resched())
163 idle(); 165 idle();
164 leds_event(led_idle_end); 166 leds_event(led_idle_end);
167 tick_nohz_restart_sched_tick();
165 preempt_enable_no_resched(); 168 preempt_enable_no_resched();
166 schedule(); 169 schedule();
167 preempt_disable(); 170 preempt_disable();
diff --git a/arch/arm/kernel/time.c b/arch/arm/kernel/time.c
index f61decb89ba2..d0540e4eaf5b 100644
--- a/arch/arm/kernel/time.c
+++ b/arch/arm/kernel/time.c
@@ -327,6 +327,7 @@ void restore_time_delta(struct timespec *delta, struct timespec *rtc)
327} 327}
328EXPORT_SYMBOL(restore_time_delta); 328EXPORT_SYMBOL(restore_time_delta);
329 329
330#ifndef CONFIG_GENERIC_CLOCKEVENTS
330/* 331/*
331 * Kernel system timer support. 332 * Kernel system timer support.
332 */ 333 */
@@ -340,8 +341,9 @@ void timer_tick(void)
340 update_process_times(user_mode(get_irq_regs())); 341 update_process_times(user_mode(get_irq_regs()));
341#endif 342#endif
342} 343}
344#endif
343 345
344#ifdef CONFIG_PM 346#if defined(CONFIG_PM) && !defined(CONFIG_GENERIC_CLOCKEVENTS)
345static int timer_suspend(struct sys_device *dev, pm_message_t state) 347static int timer_suspend(struct sys_device *dev, pm_message_t state)
346{ 348{
347 struct sys_timer *timer = container_of(dev, struct sys_timer, dev); 349 struct sys_timer *timer = container_of(dev, struct sys_timer, dev);