diff options
author | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-02-12 12:57:44 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-02-12 12:57:44 -0500 |
commit | ebaf0c6032f525ddb0158fb59848d41899dce8cd (patch) | |
tree | c6c19d30f3621725f61941d1de967c4351fb22f7 | |
parent | ee9b6d61a2a43c5952eb43283f8db284a4e70b8a (diff) | |
parent | 022ae414daadb718130679e4eacc105521f11ec7 (diff) |
Merge branch 'for-linus' of git://git390.osdl.marist.edu/pub/scm/linux-2.6
* 'for-linus' of git://git390.osdl.marist.edu/pub/scm/linux-2.6:
[S390] remove __io_virt and mmiowb.
[S390] cio: use ARRAY_SIZE in device_id.c
[S390] cio: Fixup interface for setting options on ccw devices.
[S390] smp_call_function/smp_call_function_on locking.
-rw-r--r-- | arch/s390/kernel/smp.c | 15 | ||||
-rw-r--r-- | drivers/s390/cio/device_id.c | 3 | ||||
-rw-r--r-- | drivers/s390/cio/device_ops.c | 32 | ||||
-rw-r--r-- | drivers/s390/cio/qdio.c | 2 | ||||
-rw-r--r-- | include/asm-s390/ccwdev.h | 2 | ||||
-rw-r--r-- | include/asm-s390/io.h | 6 |
6 files changed, 45 insertions, 15 deletions
diff --git a/arch/s390/kernel/smp.c b/arch/s390/kernel/smp.c index 65b52320d145..83a4ea6e3d60 100644 --- a/arch/s390/kernel/smp.c +++ b/arch/s390/kernel/smp.c | |||
@@ -57,7 +57,7 @@ static void smp_ext_bitcall(int, ec_bit_sig); | |||
57 | static void smp_ext_bitcall_others(ec_bit_sig); | 57 | static void smp_ext_bitcall_others(ec_bit_sig); |
58 | 58 | ||
59 | /* | 59 | /* |
60 | 5B * Structure and data for smp_call_function(). This is designed to minimise | 60 | * Structure and data for smp_call_function(). This is designed to minimise |
61 | * static memory requirements. It also looks cleaner. | 61 | * static memory requirements. It also looks cleaner. |
62 | */ | 62 | */ |
63 | static DEFINE_SPINLOCK(call_lock); | 63 | static DEFINE_SPINLOCK(call_lock); |
@@ -104,7 +104,7 @@ int smp_call_function (void (*func) (void *info), void *info, int nonatomic, | |||
104 | * remote CPUs are nearly ready to execute <<func>> or are or have executed. | 104 | * remote CPUs are nearly ready to execute <<func>> or are or have executed. |
105 | * | 105 | * |
106 | * You must not call this function with disabled interrupts or from a | 106 | * You must not call this function with disabled interrupts or from a |
107 | * hardware interrupt handler or from a bottom half handler. | 107 | * hardware interrupt handler. |
108 | */ | 108 | */ |
109 | { | 109 | { |
110 | struct call_data_struct data; | 110 | struct call_data_struct data; |
@@ -113,8 +113,8 @@ int smp_call_function (void (*func) (void *info), void *info, int nonatomic, | |||
113 | if (cpus <= 0) | 113 | if (cpus <= 0) |
114 | return 0; | 114 | return 0; |
115 | 115 | ||
116 | /* Can deadlock when called with interrupts disabled */ | 116 | /* Can deadlock when interrupts are disabled or if in wrong context */ |
117 | WARN_ON(irqs_disabled()); | 117 | WARN_ON(irqs_disabled() || in_irq()); |
118 | 118 | ||
119 | data.func = func; | 119 | data.func = func; |
120 | data.info = info; | 120 | data.info = info; |
@@ -123,7 +123,7 @@ int smp_call_function (void (*func) (void *info), void *info, int nonatomic, | |||
123 | if (wait) | 123 | if (wait) |
124 | atomic_set(&data.finished, 0); | 124 | atomic_set(&data.finished, 0); |
125 | 125 | ||
126 | spin_lock(&call_lock); | 126 | spin_lock_bh(&call_lock); |
127 | call_data = &data; | 127 | call_data = &data; |
128 | /* Send a message to all other CPUs and wait for them to respond */ | 128 | /* Send a message to all other CPUs and wait for them to respond */ |
129 | smp_ext_bitcall_others(ec_call_function); | 129 | smp_ext_bitcall_others(ec_call_function); |
@@ -135,7 +135,7 @@ int smp_call_function (void (*func) (void *info), void *info, int nonatomic, | |||
135 | if (wait) | 135 | if (wait) |
136 | while (atomic_read(&data.finished) != cpus) | 136 | while (atomic_read(&data.finished) != cpus) |
137 | cpu_relax(); | 137 | cpu_relax(); |
138 | spin_unlock(&call_lock); | 138 | spin_unlock_bh(&call_lock); |
139 | 139 | ||
140 | return 0; | 140 | return 0; |
141 | } | 141 | } |
@@ -159,6 +159,9 @@ int smp_call_function_on(void (*func) (void *info), void *info, | |||
159 | if (!cpu_online(cpu)) | 159 | if (!cpu_online(cpu)) |
160 | return -EINVAL; | 160 | return -EINVAL; |
161 | 161 | ||
162 | /* Can deadlock when interrupts are disabled or if in wrong context */ | ||
163 | WARN_ON(irqs_disabled() || in_irq()); | ||
164 | |||
162 | /* disable preemption for local function call */ | 165 | /* disable preemption for local function call */ |
163 | curr_cpu = get_cpu(); | 166 | curr_cpu = get_cpu(); |
164 | 167 | ||
diff --git a/drivers/s390/cio/device_id.c b/drivers/s390/cio/device_id.c index f17275917fe5..997f46874537 100644 --- a/drivers/s390/cio/device_id.c +++ b/drivers/s390/cio/device_id.c | |||
@@ -11,6 +11,7 @@ | |||
11 | 11 | ||
12 | #include <linux/module.h> | 12 | #include <linux/module.h> |
13 | #include <linux/init.h> | 13 | #include <linux/init.h> |
14 | #include <linux/kernel.h> | ||
14 | 15 | ||
15 | #include <asm/ccwdev.h> | 16 | #include <asm/ccwdev.h> |
16 | #include <asm/delay.h> | 17 | #include <asm/delay.h> |
@@ -138,7 +139,7 @@ VM_virtual_device_info (__u16 devno, struct senseid *ps) | |||
138 | ps->cu_model = 0x60; | 139 | ps->cu_model = 0x60; |
139 | return; | 140 | return; |
140 | } | 141 | } |
141 | for (i = 0; i < sizeof(vm_devices) / sizeof(vm_devices[0]); i++) | 142 | for (i = 0; i < ARRAY_SIZE(vm_devices); i++) |
142 | if (diag_data.vrdcvcla == vm_devices[i].vrdcvcla && | 143 | if (diag_data.vrdcvcla == vm_devices[i].vrdcvcla && |
143 | diag_data.vrdcvtyp == vm_devices[i].vrdcvtyp) { | 144 | diag_data.vrdcvtyp == vm_devices[i].vrdcvtyp) { |
144 | ps->cu_type = vm_devices[i].cu_type; | 145 | ps->cu_type = vm_devices[i].cu_type; |
diff --git a/drivers/s390/cio/device_ops.c b/drivers/s390/cio/device_ops.c index d7b25b8f71d2..7c7775aae38a 100644 --- a/drivers/s390/cio/device_ops.c +++ b/drivers/s390/cio/device_ops.c | |||
@@ -23,8 +23,7 @@ | |||
23 | #include "chsc.h" | 23 | #include "chsc.h" |
24 | #include "device.h" | 24 | #include "device.h" |
25 | 25 | ||
26 | int | 26 | int ccw_device_set_options_mask(struct ccw_device *cdev, unsigned long flags) |
27 | ccw_device_set_options(struct ccw_device *cdev, unsigned long flags) | ||
28 | { | 27 | { |
29 | /* | 28 | /* |
30 | * The flag usage is mutal exclusive ... | 29 | * The flag usage is mutal exclusive ... |
@@ -39,6 +38,33 @@ ccw_device_set_options(struct ccw_device *cdev, unsigned long flags) | |||
39 | return 0; | 38 | return 0; |
40 | } | 39 | } |
41 | 40 | ||
41 | int ccw_device_set_options(struct ccw_device *cdev, unsigned long flags) | ||
42 | { | ||
43 | /* | ||
44 | * The flag usage is mutal exclusive ... | ||
45 | */ | ||
46 | if (((flags & CCWDEV_EARLY_NOTIFICATION) && | ||
47 | (flags & CCWDEV_REPORT_ALL)) || | ||
48 | ((flags & CCWDEV_EARLY_NOTIFICATION) && | ||
49 | cdev->private->options.repall) || | ||
50 | ((flags & CCWDEV_REPORT_ALL) && | ||
51 | cdev->private->options.fast)) | ||
52 | return -EINVAL; | ||
53 | cdev->private->options.fast |= (flags & CCWDEV_EARLY_NOTIFICATION) != 0; | ||
54 | cdev->private->options.repall |= (flags & CCWDEV_REPORT_ALL) != 0; | ||
55 | cdev->private->options.pgroup |= (flags & CCWDEV_DO_PATHGROUP) != 0; | ||
56 | cdev->private->options.force |= (flags & CCWDEV_ALLOW_FORCE) != 0; | ||
57 | return 0; | ||
58 | } | ||
59 | |||
60 | void ccw_device_clear_options(struct ccw_device *cdev, unsigned long flags) | ||
61 | { | ||
62 | cdev->private->options.fast &= (flags & CCWDEV_EARLY_NOTIFICATION) == 0; | ||
63 | cdev->private->options.repall &= (flags & CCWDEV_REPORT_ALL) == 0; | ||
64 | cdev->private->options.pgroup &= (flags & CCWDEV_DO_PATHGROUP) == 0; | ||
65 | cdev->private->options.force &= (flags & CCWDEV_ALLOW_FORCE) == 0; | ||
66 | } | ||
67 | |||
42 | int | 68 | int |
43 | ccw_device_clear(struct ccw_device *cdev, unsigned long intparm) | 69 | ccw_device_clear(struct ccw_device *cdev, unsigned long intparm) |
44 | { | 70 | { |
@@ -601,7 +627,9 @@ _ccw_device_get_device_number(struct ccw_device *cdev) | |||
601 | 627 | ||
602 | 628 | ||
603 | MODULE_LICENSE("GPL"); | 629 | MODULE_LICENSE("GPL"); |
630 | EXPORT_SYMBOL(ccw_device_set_options_mask); | ||
604 | EXPORT_SYMBOL(ccw_device_set_options); | 631 | EXPORT_SYMBOL(ccw_device_set_options); |
632 | EXPORT_SYMBOL(ccw_device_clear_options); | ||
605 | EXPORT_SYMBOL(ccw_device_clear); | 633 | EXPORT_SYMBOL(ccw_device_clear); |
606 | EXPORT_SYMBOL(ccw_device_halt); | 634 | EXPORT_SYMBOL(ccw_device_halt); |
607 | EXPORT_SYMBOL(ccw_device_resume); | 635 | EXPORT_SYMBOL(ccw_device_resume); |
diff --git a/drivers/s390/cio/qdio.c b/drivers/s390/cio/qdio.c index d726cd5777de..5b1e3ff26c0b 100644 --- a/drivers/s390/cio/qdio.c +++ b/drivers/s390/cio/qdio.c | |||
@@ -3194,7 +3194,7 @@ qdio_establish(struct qdio_initialize *init_data) | |||
3194 | 3194 | ||
3195 | spin_lock_irqsave(get_ccwdev_lock(cdev),saveflags); | 3195 | spin_lock_irqsave(get_ccwdev_lock(cdev),saveflags); |
3196 | 3196 | ||
3197 | ccw_device_set_options(cdev, 0); | 3197 | ccw_device_set_options_mask(cdev, 0); |
3198 | result=ccw_device_start_timeout(cdev,&irq_ptr->ccw, | 3198 | result=ccw_device_start_timeout(cdev,&irq_ptr->ccw, |
3199 | QDIO_DOING_ESTABLISH,0, 0, | 3199 | QDIO_DOING_ESTABLISH,0, 0, |
3200 | QDIO_ESTABLISH_TIMEOUT); | 3200 | QDIO_ESTABLISH_TIMEOUT); |
diff --git a/include/asm-s390/ccwdev.h b/include/asm-s390/ccwdev.h index 58c70acffc73..cfc81533b9ba 100644 --- a/include/asm-s390/ccwdev.h +++ b/include/asm-s390/ccwdev.h | |||
@@ -110,7 +110,9 @@ extern void ccw_driver_unregister (struct ccw_driver *driver); | |||
110 | 110 | ||
111 | struct ccw1; | 111 | struct ccw1; |
112 | 112 | ||
113 | extern int ccw_device_set_options_mask(struct ccw_device *, unsigned long); | ||
113 | extern int ccw_device_set_options(struct ccw_device *, unsigned long); | 114 | extern int ccw_device_set_options(struct ccw_device *, unsigned long); |
115 | extern void ccw_device_clear_options(struct ccw_device *, unsigned long); | ||
114 | 116 | ||
115 | /* Allow for i/o completion notification after primary interrupt status. */ | 117 | /* Allow for i/o completion notification after primary interrupt status. */ |
116 | #define CCWDEV_EARLY_NOTIFICATION 0x0001 | 118 | #define CCWDEV_EARLY_NOTIFICATION 0x0001 |
diff --git a/include/asm-s390/io.h b/include/asm-s390/io.h index dca6a6cc103f..b7ff6afc3caa 100644 --- a/include/asm-s390/io.h +++ b/include/asm-s390/io.h | |||
@@ -17,8 +17,6 @@ | |||
17 | 17 | ||
18 | #define IO_SPACE_LIMIT 0xffffffff | 18 | #define IO_SPACE_LIMIT 0xffffffff |
19 | 19 | ||
20 | #define __io_virt(x) ((void *)(PAGE_OFFSET | (unsigned long)(x))) | ||
21 | |||
22 | /* | 20 | /* |
23 | * Change virtual addresses to physical addresses and vv. | 21 | * Change virtual addresses to physical addresses and vv. |
24 | * These are pretty trivial | 22 | * These are pretty trivial |
@@ -37,11 +35,9 @@ static inline unsigned long virt_to_phys(volatile void * address) | |||
37 | 35 | ||
38 | static inline void * phys_to_virt(unsigned long address) | 36 | static inline void * phys_to_virt(unsigned long address) |
39 | { | 37 | { |
40 | return __io_virt(address); | 38 | return (void *) address; |
41 | } | 39 | } |
42 | 40 | ||
43 | #define mmiowb() do { } while (0) | ||
44 | |||
45 | /* | 41 | /* |
46 | * Convert a physical pointer to a virtual kernel pointer for /dev/mem | 42 | * Convert a physical pointer to a virtual kernel pointer for /dev/mem |
47 | * access | 43 | * access |