diff options
Diffstat (limited to 'drivers/char')
-rw-r--r-- | drivers/char/Kconfig | 2 | ||||
-rw-r--r-- | drivers/char/agp/ali-agp.c | 4 | ||||
-rw-r--r-- | drivers/char/agp/amd-k7-agp.c | 2 | ||||
-rw-r--r-- | drivers/char/agp/amd64-agp.c | 2 | ||||
-rw-r--r-- | drivers/char/agp/ati-agp.c | 2 | ||||
-rw-r--r-- | drivers/char/agp/backend.c | 4 | ||||
-rw-r--r-- | drivers/char/agp/efficeon-agp.c | 2 | ||||
-rw-r--r-- | drivers/char/agp/frontend.c | 6 | ||||
-rw-r--r-- | drivers/char/agp/nvidia-agp.c | 2 | ||||
-rw-r--r-- | drivers/char/agp/sis-agp.c | 2 | ||||
-rw-r--r-- | drivers/char/agp/sworks-agp.c | 2 | ||||
-rw-r--r-- | drivers/char/agp/via-agp.c | 4 | ||||
-rw-r--r-- | drivers/char/dtlk.c | 2 | ||||
-rw-r--r-- | drivers/char/hangcheck-timer.c | 104 | ||||
-rw-r--r-- | drivers/char/ipmi/ipmi_bt_sm.c | 1 | ||||
-rw-r--r-- | drivers/char/ipmi/ipmi_msghandler.c | 36 | ||||
-rw-r--r-- | drivers/char/ipmi/ipmi_si_intf.c | 65 | ||||
-rw-r--r-- | drivers/char/ipmi/ipmi_watchdog.c | 2 | ||||
-rw-r--r-- | drivers/char/rio/rio_linux.c | 2 | ||||
-rw-r--r-- | drivers/char/s3c2410-rtc.c | 8 | ||||
-rw-r--r-- | drivers/char/specialix.c | 11 | ||||
-rw-r--r-- | drivers/char/stallion.c | 4 | ||||
-rw-r--r-- | drivers/char/vt_ioctl.c | 3 |
23 files changed, 205 insertions, 67 deletions
diff --git a/drivers/char/Kconfig b/drivers/char/Kconfig index 97ac4edf4655..e162dab64ffd 100644 --- a/drivers/char/Kconfig +++ b/drivers/char/Kconfig | |||
@@ -982,7 +982,7 @@ config MAX_RAW_DEVS | |||
982 | 982 | ||
983 | config HANGCHECK_TIMER | 983 | config HANGCHECK_TIMER |
984 | tristate "Hangcheck timer" | 984 | tristate "Hangcheck timer" |
985 | depends on X86_64 || X86 | 985 | depends on X86_64 || X86 || IA64 || PPC64 || ARCH_S390 |
986 | help | 986 | help |
987 | The hangcheck-timer module detects when the system has gone | 987 | The hangcheck-timer module detects when the system has gone |
988 | out to lunch past a certain margin. It can reboot the system | 988 | out to lunch past a certain margin. It can reboot the system |
diff --git a/drivers/char/agp/ali-agp.c b/drivers/char/agp/ali-agp.c index c86a22c5499b..0212febda654 100644 --- a/drivers/char/agp/ali-agp.c +++ b/drivers/char/agp/ali-agp.c | |||
@@ -192,7 +192,7 @@ static struct aper_size_info_32 ali_generic_sizes[7] = | |||
192 | {4, 1024, 0, 3} | 192 | {4, 1024, 0, 3} |
193 | }; | 193 | }; |
194 | 194 | ||
195 | struct agp_bridge_driver ali_generic_bridge = { | 195 | static struct agp_bridge_driver ali_generic_bridge = { |
196 | .owner = THIS_MODULE, | 196 | .owner = THIS_MODULE, |
197 | .aperture_sizes = ali_generic_sizes, | 197 | .aperture_sizes = ali_generic_sizes, |
198 | .size_type = U32_APER_SIZE, | 198 | .size_type = U32_APER_SIZE, |
@@ -215,7 +215,7 @@ struct agp_bridge_driver ali_generic_bridge = { | |||
215 | .agp_destroy_page = ali_destroy_page, | 215 | .agp_destroy_page = ali_destroy_page, |
216 | }; | 216 | }; |
217 | 217 | ||
218 | struct agp_bridge_driver ali_m1541_bridge = { | 218 | static struct agp_bridge_driver ali_m1541_bridge = { |
219 | .owner = THIS_MODULE, | 219 | .owner = THIS_MODULE, |
220 | .aperture_sizes = ali_generic_sizes, | 220 | .aperture_sizes = ali_generic_sizes, |
221 | .size_type = U32_APER_SIZE, | 221 | .size_type = U32_APER_SIZE, |
diff --git a/drivers/char/agp/amd-k7-agp.c b/drivers/char/agp/amd-k7-agp.c index f1ea87ea6b65..e62a3c2c44a9 100644 --- a/drivers/char/agp/amd-k7-agp.c +++ b/drivers/char/agp/amd-k7-agp.c | |||
@@ -358,7 +358,7 @@ static struct gatt_mask amd_irongate_masks[] = | |||
358 | {.mask = 1, .type = 0} | 358 | {.mask = 1, .type = 0} |
359 | }; | 359 | }; |
360 | 360 | ||
361 | struct agp_bridge_driver amd_irongate_driver = { | 361 | static struct agp_bridge_driver amd_irongate_driver = { |
362 | .owner = THIS_MODULE, | 362 | .owner = THIS_MODULE, |
363 | .aperture_sizes = amd_irongate_sizes, | 363 | .aperture_sizes = amd_irongate_sizes, |
364 | .size_type = LVL2_APER_SIZE, | 364 | .size_type = LVL2_APER_SIZE, |
diff --git a/drivers/char/agp/amd64-agp.c b/drivers/char/agp/amd64-agp.c index 905f0629c44f..399c042f68f0 100644 --- a/drivers/char/agp/amd64-agp.c +++ b/drivers/char/agp/amd64-agp.c | |||
@@ -243,7 +243,7 @@ static void amd64_cleanup(void) | |||
243 | } | 243 | } |
244 | 244 | ||
245 | 245 | ||
246 | struct agp_bridge_driver amd_8151_driver = { | 246 | static struct agp_bridge_driver amd_8151_driver = { |
247 | .owner = THIS_MODULE, | 247 | .owner = THIS_MODULE, |
248 | .aperture_sizes = amd_8151_sizes, | 248 | .aperture_sizes = amd_8151_sizes, |
249 | .size_type = U32_APER_SIZE, | 249 | .size_type = U32_APER_SIZE, |
diff --git a/drivers/char/agp/ati-agp.c b/drivers/char/agp/ati-agp.c index 757dde006fc9..a65f8827c283 100644 --- a/drivers/char/agp/ati-agp.c +++ b/drivers/char/agp/ati-agp.c | |||
@@ -393,7 +393,7 @@ static int ati_free_gatt_table(struct agp_bridge_data *bridge) | |||
393 | return 0; | 393 | return 0; |
394 | } | 394 | } |
395 | 395 | ||
396 | struct agp_bridge_driver ati_generic_bridge = { | 396 | static struct agp_bridge_driver ati_generic_bridge = { |
397 | .owner = THIS_MODULE, | 397 | .owner = THIS_MODULE, |
398 | .aperture_sizes = ati_generic_sizes, | 398 | .aperture_sizes = ati_generic_sizes, |
399 | .size_type = LVL2_APER_SIZE, | 399 | .size_type = LVL2_APER_SIZE, |
diff --git a/drivers/char/agp/backend.c b/drivers/char/agp/backend.c index c3442f3c6480..2f3dfb63bdc6 100644 --- a/drivers/char/agp/backend.c +++ b/drivers/char/agp/backend.c | |||
@@ -97,7 +97,7 @@ void agp_backend_release(struct agp_bridge_data *bridge) | |||
97 | EXPORT_SYMBOL(agp_backend_release); | 97 | EXPORT_SYMBOL(agp_backend_release); |
98 | 98 | ||
99 | 99 | ||
100 | struct { int mem, agp; } maxes_table[] = { | 100 | static struct { int mem, agp; } maxes_table[] = { |
101 | {0, 0}, | 101 | {0, 0}, |
102 | {32, 4}, | 102 | {32, 4}, |
103 | {64, 28}, | 103 | {64, 28}, |
@@ -322,7 +322,7 @@ static int __init agp_init(void) | |||
322 | return 0; | 322 | return 0; |
323 | } | 323 | } |
324 | 324 | ||
325 | void __exit agp_exit(void) | 325 | static void __exit agp_exit(void) |
326 | { | 326 | { |
327 | } | 327 | } |
328 | 328 | ||
diff --git a/drivers/char/agp/efficeon-agp.c b/drivers/char/agp/efficeon-agp.c index 2a87cecdc912..1383c3165ea1 100644 --- a/drivers/char/agp/efficeon-agp.c +++ b/drivers/char/agp/efficeon-agp.c | |||
@@ -303,7 +303,7 @@ static int efficeon_remove_memory(struct agp_memory * mem, off_t pg_start, int t | |||
303 | } | 303 | } |
304 | 304 | ||
305 | 305 | ||
306 | struct agp_bridge_driver efficeon_driver = { | 306 | static struct agp_bridge_driver efficeon_driver = { |
307 | .owner = THIS_MODULE, | 307 | .owner = THIS_MODULE, |
308 | .aperture_sizes = efficeon_generic_sizes, | 308 | .aperture_sizes = efficeon_generic_sizes, |
309 | .size_type = LVL2_APER_SIZE, | 309 | .size_type = LVL2_APER_SIZE, |
diff --git a/drivers/char/agp/frontend.c b/drivers/char/agp/frontend.c index f633623ac802..3dfb6648547b 100644 --- a/drivers/char/agp/frontend.c +++ b/drivers/char/agp/frontend.c | |||
@@ -235,7 +235,7 @@ static void agp_insert_into_pool(struct agp_memory * temp) | |||
235 | 235 | ||
236 | /* File private list routines */ | 236 | /* File private list routines */ |
237 | 237 | ||
238 | struct agp_file_private *agp_find_private(pid_t pid) | 238 | static struct agp_file_private *agp_find_private(pid_t pid) |
239 | { | 239 | { |
240 | struct agp_file_private *curr; | 240 | struct agp_file_private *curr; |
241 | 241 | ||
@@ -250,7 +250,7 @@ struct agp_file_private *agp_find_private(pid_t pid) | |||
250 | return NULL; | 250 | return NULL; |
251 | } | 251 | } |
252 | 252 | ||
253 | void agp_insert_file_private(struct agp_file_private * priv) | 253 | static void agp_insert_file_private(struct agp_file_private * priv) |
254 | { | 254 | { |
255 | struct agp_file_private *prev; | 255 | struct agp_file_private *prev; |
256 | 256 | ||
@@ -262,7 +262,7 @@ void agp_insert_file_private(struct agp_file_private * priv) | |||
262 | agp_fe.file_priv_list = priv; | 262 | agp_fe.file_priv_list = priv; |
263 | } | 263 | } |
264 | 264 | ||
265 | void agp_remove_file_private(struct agp_file_private * priv) | 265 | static void agp_remove_file_private(struct agp_file_private * priv) |
266 | { | 266 | { |
267 | struct agp_file_private *next; | 267 | struct agp_file_private *next; |
268 | struct agp_file_private *prev; | 268 | struct agp_file_private *prev; |
diff --git a/drivers/char/agp/nvidia-agp.c b/drivers/char/agp/nvidia-agp.c index 4f7a3e8bc919..80dafa3030bd 100644 --- a/drivers/char/agp/nvidia-agp.c +++ b/drivers/char/agp/nvidia-agp.c | |||
@@ -288,7 +288,7 @@ static struct gatt_mask nvidia_generic_masks[] = | |||
288 | }; | 288 | }; |
289 | 289 | ||
290 | 290 | ||
291 | struct agp_bridge_driver nvidia_driver = { | 291 | static struct agp_bridge_driver nvidia_driver = { |
292 | .owner = THIS_MODULE, | 292 | .owner = THIS_MODULE, |
293 | .aperture_sizes = nvidia_generic_sizes, | 293 | .aperture_sizes = nvidia_generic_sizes, |
294 | .size_type = U8_APER_SIZE, | 294 | .size_type = U8_APER_SIZE, |
diff --git a/drivers/char/agp/sis-agp.c b/drivers/char/agp/sis-agp.c index cfccacb2a647..ebc05554045c 100644 --- a/drivers/char/agp/sis-agp.c +++ b/drivers/char/agp/sis-agp.c | |||
@@ -119,7 +119,7 @@ static struct aper_size_info_8 sis_generic_sizes[7] = | |||
119 | {4, 1024, 0, 3} | 119 | {4, 1024, 0, 3} |
120 | }; | 120 | }; |
121 | 121 | ||
122 | struct agp_bridge_driver sis_driver = { | 122 | static struct agp_bridge_driver sis_driver = { |
123 | .owner = THIS_MODULE, | 123 | .owner = THIS_MODULE, |
124 | .aperture_sizes = sis_generic_sizes, | 124 | .aperture_sizes = sis_generic_sizes, |
125 | .size_type = U8_APER_SIZE, | 125 | .size_type = U8_APER_SIZE, |
diff --git a/drivers/char/agp/sworks-agp.c b/drivers/char/agp/sworks-agp.c index bb338d9134e0..10c23302dd84 100644 --- a/drivers/char/agp/sworks-agp.c +++ b/drivers/char/agp/sworks-agp.c | |||
@@ -409,7 +409,7 @@ static void serverworks_agp_enable(struct agp_bridge_data *bridge, u32 mode) | |||
409 | agp_device_command(command, 0); | 409 | agp_device_command(command, 0); |
410 | } | 410 | } |
411 | 411 | ||
412 | struct agp_bridge_driver sworks_driver = { | 412 | static struct agp_bridge_driver sworks_driver = { |
413 | .owner = THIS_MODULE, | 413 | .owner = THIS_MODULE, |
414 | .aperture_sizes = serverworks_sizes, | 414 | .aperture_sizes = serverworks_sizes, |
415 | .size_type = LVL2_APER_SIZE, | 415 | .size_type = LVL2_APER_SIZE, |
diff --git a/drivers/char/agp/via-agp.c b/drivers/char/agp/via-agp.c index e1451dd9b6a7..c847df575cf5 100644 --- a/drivers/char/agp/via-agp.c +++ b/drivers/char/agp/via-agp.c | |||
@@ -170,7 +170,7 @@ static void via_tlbflush_agp3(struct agp_memory *mem) | |||
170 | } | 170 | } |
171 | 171 | ||
172 | 172 | ||
173 | struct agp_bridge_driver via_agp3_driver = { | 173 | static struct agp_bridge_driver via_agp3_driver = { |
174 | .owner = THIS_MODULE, | 174 | .owner = THIS_MODULE, |
175 | .aperture_sizes = agp3_generic_sizes, | 175 | .aperture_sizes = agp3_generic_sizes, |
176 | .size_type = U8_APER_SIZE, | 176 | .size_type = U8_APER_SIZE, |
@@ -193,7 +193,7 @@ struct agp_bridge_driver via_agp3_driver = { | |||
193 | .agp_destroy_page = agp_generic_destroy_page, | 193 | .agp_destroy_page = agp_generic_destroy_page, |
194 | }; | 194 | }; |
195 | 195 | ||
196 | struct agp_bridge_driver via_driver = { | 196 | static struct agp_bridge_driver via_driver = { |
197 | .owner = THIS_MODULE, | 197 | .owner = THIS_MODULE, |
198 | .aperture_sizes = via_generic_sizes, | 198 | .aperture_sizes = via_generic_sizes, |
199 | .size_type = U8_APER_SIZE, | 199 | .size_type = U8_APER_SIZE, |
diff --git a/drivers/char/dtlk.c b/drivers/char/dtlk.c index 903e4c3cc209..a229915ce1b2 100644 --- a/drivers/char/dtlk.c +++ b/drivers/char/dtlk.c | |||
@@ -52,7 +52,7 @@ | |||
52 | #define KERNEL | 52 | #define KERNEL |
53 | #include <linux/types.h> | 53 | #include <linux/types.h> |
54 | #include <linux/fs.h> | 54 | #include <linux/fs.h> |
55 | #include <linux/mm.h> /* for verify_area */ | 55 | #include <linux/mm.h> |
56 | #include <linux/errno.h> /* for -EBUSY */ | 56 | #include <linux/errno.h> /* for -EBUSY */ |
57 | #include <linux/ioport.h> /* for request_region */ | 57 | #include <linux/ioport.h> /* for request_region */ |
58 | #include <linux/delay.h> /* for loops_per_jiffy */ | 58 | #include <linux/delay.h> /* for loops_per_jiffy */ |
diff --git a/drivers/char/hangcheck-timer.c b/drivers/char/hangcheck-timer.c index 83d6b37b36cd..78e650fc5b41 100644 --- a/drivers/char/hangcheck-timer.c +++ b/drivers/char/hangcheck-timer.c | |||
@@ -3,7 +3,7 @@ | |||
3 | * | 3 | * |
4 | * Driver for a little io fencing timer. | 4 | * Driver for a little io fencing timer. |
5 | * | 5 | * |
6 | * Copyright (C) 2002 Oracle Corporation. All rights reserved. | 6 | * Copyright (C) 2002, 2003 Oracle. All rights reserved. |
7 | * | 7 | * |
8 | * Author: Joel Becker <joel.becker@oracle.com> | 8 | * Author: Joel Becker <joel.becker@oracle.com> |
9 | * | 9 | * |
@@ -44,11 +44,14 @@ | |||
44 | #include <linux/fs.h> | 44 | #include <linux/fs.h> |
45 | #include <linux/mm.h> | 45 | #include <linux/mm.h> |
46 | #include <linux/reboot.h> | 46 | #include <linux/reboot.h> |
47 | #include <linux/smp_lock.h> | ||
47 | #include <linux/init.h> | 48 | #include <linux/init.h> |
49 | #include <linux/delay.h> | ||
48 | #include <asm/uaccess.h> | 50 | #include <asm/uaccess.h> |
51 | #include <linux/sysrq.h> | ||
49 | 52 | ||
50 | 53 | ||
51 | #define VERSION_STR "0.5.0" | 54 | #define VERSION_STR "0.9.0" |
52 | 55 | ||
53 | #define DEFAULT_IOFENCE_MARGIN 60 /* Default fudge factor, in seconds */ | 56 | #define DEFAULT_IOFENCE_MARGIN 60 /* Default fudge factor, in seconds */ |
54 | #define DEFAULT_IOFENCE_TICK 180 /* Default timer timeout, in seconds */ | 57 | #define DEFAULT_IOFENCE_TICK 180 /* Default timer timeout, in seconds */ |
@@ -56,18 +59,89 @@ | |||
56 | static int hangcheck_tick = DEFAULT_IOFENCE_TICK; | 59 | static int hangcheck_tick = DEFAULT_IOFENCE_TICK; |
57 | static int hangcheck_margin = DEFAULT_IOFENCE_MARGIN; | 60 | static int hangcheck_margin = DEFAULT_IOFENCE_MARGIN; |
58 | static int hangcheck_reboot; /* Defaults to not reboot */ | 61 | static int hangcheck_reboot; /* Defaults to not reboot */ |
62 | static int hangcheck_dump_tasks; /* Defaults to not dumping SysRQ T */ | ||
59 | 63 | ||
60 | /* Driver options */ | 64 | /* options - modular */ |
61 | module_param(hangcheck_tick, int, 0); | 65 | module_param(hangcheck_tick, int, 0); |
62 | MODULE_PARM_DESC(hangcheck_tick, "Timer delay."); | 66 | MODULE_PARM_DESC(hangcheck_tick, "Timer delay."); |
63 | module_param(hangcheck_margin, int, 0); | 67 | module_param(hangcheck_margin, int, 0); |
64 | MODULE_PARM_DESC(hangcheck_margin, "If the hangcheck timer has been delayed more than hangcheck_margin seconds, the driver will fire."); | 68 | MODULE_PARM_DESC(hangcheck_margin, "If the hangcheck timer has been delayed more than hangcheck_margin seconds, the driver will fire."); |
65 | module_param(hangcheck_reboot, int, 0); | 69 | module_param(hangcheck_reboot, int, 0); |
66 | MODULE_PARM_DESC(hangcheck_reboot, "If nonzero, the machine will reboot when the timer margin is exceeded."); | 70 | MODULE_PARM_DESC(hangcheck_reboot, "If nonzero, the machine will reboot when the timer margin is exceeded."); |
71 | module_param(hangcheck_dump_tasks, int, 0); | ||
72 | MODULE_PARM_DESC(hangcheck_dump_tasks, "If nonzero, the machine will dump the system task state when the timer margin is exceeded."); | ||
67 | 73 | ||
68 | MODULE_AUTHOR("Joel Becker"); | 74 | MODULE_AUTHOR("Oracle"); |
69 | MODULE_DESCRIPTION("Hangcheck-timer detects when the system has gone out to lunch past a certain margin."); | 75 | MODULE_DESCRIPTION("Hangcheck-timer detects when the system has gone out to lunch past a certain margin."); |
70 | MODULE_LICENSE("GPL"); | 76 | MODULE_LICENSE("GPL"); |
77 | MODULE_VERSION(VERSION_STR); | ||
78 | |||
79 | /* options - nonmodular */ | ||
80 | #ifndef MODULE | ||
81 | |||
82 | static int __init hangcheck_parse_tick(char *str) | ||
83 | { | ||
84 | int par; | ||
85 | if (get_option(&str,&par)) | ||
86 | hangcheck_tick = par; | ||
87 | return 1; | ||
88 | } | ||
89 | |||
90 | static int __init hangcheck_parse_margin(char *str) | ||
91 | { | ||
92 | int par; | ||
93 | if (get_option(&str,&par)) | ||
94 | hangcheck_margin = par; | ||
95 | return 1; | ||
96 | } | ||
97 | |||
98 | static int __init hangcheck_parse_reboot(char *str) | ||
99 | { | ||
100 | int par; | ||
101 | if (get_option(&str,&par)) | ||
102 | hangcheck_reboot = par; | ||
103 | return 1; | ||
104 | } | ||
105 | |||
106 | static int __init hangcheck_parse_dump_tasks(char *str) | ||
107 | { | ||
108 | int par; | ||
109 | if (get_option(&str,&par)) | ||
110 | hangcheck_dump_tasks = par; | ||
111 | return 1; | ||
112 | } | ||
113 | |||
114 | __setup("hcheck_tick", hangcheck_parse_tick); | ||
115 | __setup("hcheck_margin", hangcheck_parse_margin); | ||
116 | __setup("hcheck_reboot", hangcheck_parse_reboot); | ||
117 | __setup("hcheck_dump_tasks", hangcheck_parse_dump_tasks); | ||
118 | #endif /* not MODULE */ | ||
119 | |||
120 | #if defined(CONFIG_X86) || defined(CONFIG_X86_64) | ||
121 | # define HAVE_MONOTONIC | ||
122 | # define TIMER_FREQ 1000000000ULL | ||
123 | #elif defined(CONFIG_ARCH_S390) | ||
124 | /* FA240000 is 1 Second in the IBM time universe (Page 4-38 Principles of Op for zSeries */ | ||
125 | # define TIMER_FREQ 0xFA240000ULL | ||
126 | #elif defined(CONFIG_IA64) | ||
127 | # define TIMER_FREQ ((unsigned long long)local_cpu_data->itc_freq) | ||
128 | #elif defined(CONFIG_PPC64) | ||
129 | # define TIMER_FREQ (HZ*loops_per_jiffy) | ||
130 | #endif | ||
131 | |||
132 | #ifdef HAVE_MONOTONIC | ||
133 | extern unsigned long long monotonic_clock(void); | ||
134 | #else | ||
135 | static inline unsigned long long monotonic_clock(void) | ||
136 | { | ||
137 | # ifdef __s390__ | ||
138 | /* returns the TOD. see 4-38 Principles of Op of zSeries */ | ||
139 | return get_clock(); | ||
140 | # else | ||
141 | return get_cycles(); | ||
142 | # endif /* __s390__ */ | ||
143 | } | ||
144 | #endif /* HAVE_MONOTONIC */ | ||
71 | 145 | ||
72 | 146 | ||
73 | /* Last time scheduled */ | 147 | /* Last time scheduled */ |
@@ -78,7 +152,6 @@ static void hangcheck_fire(unsigned long); | |||
78 | static struct timer_list hangcheck_ticktock = | 152 | static struct timer_list hangcheck_ticktock = |
79 | TIMER_INITIALIZER(hangcheck_fire, 0, 0); | 153 | TIMER_INITIALIZER(hangcheck_fire, 0, 0); |
80 | 154 | ||
81 | extern unsigned long long monotonic_clock(void); | ||
82 | 155 | ||
83 | static void hangcheck_fire(unsigned long data) | 156 | static void hangcheck_fire(unsigned long data) |
84 | { | 157 | { |
@@ -92,6 +165,12 @@ static void hangcheck_fire(unsigned long data) | |||
92 | tsc_diff = (cur_tsc + (~0ULL - hangcheck_tsc)); /* or something */ | 165 | tsc_diff = (cur_tsc + (~0ULL - hangcheck_tsc)); /* or something */ |
93 | 166 | ||
94 | if (tsc_diff > hangcheck_tsc_margin) { | 167 | if (tsc_diff > hangcheck_tsc_margin) { |
168 | if (hangcheck_dump_tasks) { | ||
169 | printk(KERN_CRIT "Hangcheck: Task state:\n"); | ||
170 | #ifdef CONFIG_MAGIC_SYSRQ | ||
171 | handle_sysrq('t', NULL, NULL); | ||
172 | #endif /* CONFIG_MAGIC_SYSRQ */ | ||
173 | } | ||
95 | if (hangcheck_reboot) { | 174 | if (hangcheck_reboot) { |
96 | printk(KERN_CRIT "Hangcheck: hangcheck is restarting the machine.\n"); | 175 | printk(KERN_CRIT "Hangcheck: hangcheck is restarting the machine.\n"); |
97 | machine_restart(NULL); | 176 | machine_restart(NULL); |
@@ -108,10 +187,16 @@ static int __init hangcheck_init(void) | |||
108 | { | 187 | { |
109 | printk("Hangcheck: starting hangcheck timer %s (tick is %d seconds, margin is %d seconds).\n", | 188 | printk("Hangcheck: starting hangcheck timer %s (tick is %d seconds, margin is %d seconds).\n", |
110 | VERSION_STR, hangcheck_tick, hangcheck_margin); | 189 | VERSION_STR, hangcheck_tick, hangcheck_margin); |
111 | 190 | #if defined (HAVE_MONOTONIC) | |
112 | hangcheck_tsc_margin = hangcheck_margin + hangcheck_tick; | 191 | printk("Hangcheck: Using monotonic_clock().\n"); |
113 | hangcheck_tsc_margin *= 1000000000; | 192 | #elif defined(__s390__) |
114 | 193 | printk("Hangcheck: Using TOD.\n"); | |
194 | #else | ||
195 | printk("Hangcheck: Using get_cycles().\n"); | ||
196 | #endif /* HAVE_MONOTONIC */ | ||
197 | hangcheck_tsc_margin = | ||
198 | (unsigned long long)(hangcheck_margin + hangcheck_tick); | ||
199 | hangcheck_tsc_margin *= (unsigned long long)TIMER_FREQ; | ||
115 | 200 | ||
116 | hangcheck_tsc = monotonic_clock(); | 201 | hangcheck_tsc = monotonic_clock(); |
117 | mod_timer(&hangcheck_ticktock, jiffies + (hangcheck_tick*HZ)); | 202 | mod_timer(&hangcheck_ticktock, jiffies + (hangcheck_tick*HZ)); |
@@ -123,6 +208,7 @@ static int __init hangcheck_init(void) | |||
123 | static void __exit hangcheck_exit(void) | 208 | static void __exit hangcheck_exit(void) |
124 | { | 209 | { |
125 | del_timer_sync(&hangcheck_ticktock); | 210 | del_timer_sync(&hangcheck_ticktock); |
211 | printk("Hangcheck: Stopped hangcheck timer.\n"); | ||
126 | } | 212 | } |
127 | 213 | ||
128 | module_init(hangcheck_init); | 214 | module_init(hangcheck_init); |
diff --git a/drivers/char/ipmi/ipmi_bt_sm.c b/drivers/char/ipmi/ipmi_bt_sm.c index 225b330115bb..5ce9c6269033 100644 --- a/drivers/char/ipmi/ipmi_bt_sm.c +++ b/drivers/char/ipmi/ipmi_bt_sm.c | |||
@@ -235,7 +235,6 @@ static void reset_flags(struct si_sm_data *bt) | |||
235 | if (BT_STATUS & BT_B_BUSY) BT_CONTROL(BT_B_BUSY); | 235 | if (BT_STATUS & BT_B_BUSY) BT_CONTROL(BT_B_BUSY); |
236 | BT_CONTROL(BT_CLR_WR_PTR); | 236 | BT_CONTROL(BT_CLR_WR_PTR); |
237 | BT_CONTROL(BT_SMS_ATN); | 237 | BT_CONTROL(BT_SMS_ATN); |
238 | BT_INTMASK_W(BT_BMC_HWRST); | ||
239 | #ifdef DEVELOPMENT_ONLY_NOT_FOR_PRODUCTION | 238 | #ifdef DEVELOPMENT_ONLY_NOT_FOR_PRODUCTION |
240 | if (BT_STATUS & BT_B2H_ATN) { | 239 | if (BT_STATUS & BT_B2H_ATN) { |
241 | int i; | 240 | int i; |
diff --git a/drivers/char/ipmi/ipmi_msghandler.c b/drivers/char/ipmi/ipmi_msghandler.c index a6606a1aced7..d7fb452af7f9 100644 --- a/drivers/char/ipmi/ipmi_msghandler.c +++ b/drivers/char/ipmi/ipmi_msghandler.c | |||
@@ -2588,28 +2588,20 @@ handle_msg_timeout(struct ipmi_recv_msg *msg) | |||
2588 | deliver_response(msg); | 2588 | deliver_response(msg); |
2589 | } | 2589 | } |
2590 | 2590 | ||
2591 | static void | 2591 | static struct ipmi_smi_msg * |
2592 | send_from_recv_msg(ipmi_smi_t intf, struct ipmi_recv_msg *recv_msg, | 2592 | smi_from_recv_msg(ipmi_smi_t intf, struct ipmi_recv_msg *recv_msg, |
2593 | struct ipmi_smi_msg *smi_msg, | 2593 | unsigned char seq, long seqid) |
2594 | unsigned char seq, long seqid) | ||
2595 | { | 2594 | { |
2596 | if (!smi_msg) | 2595 | struct ipmi_smi_msg *smi_msg = ipmi_alloc_smi_msg(); |
2597 | smi_msg = ipmi_alloc_smi_msg(); | ||
2598 | if (!smi_msg) | 2596 | if (!smi_msg) |
2599 | /* If we can't allocate the message, then just return, we | 2597 | /* If we can't allocate the message, then just return, we |
2600 | get 4 retries, so this should be ok. */ | 2598 | get 4 retries, so this should be ok. */ |
2601 | return; | 2599 | return NULL; |
2602 | 2600 | ||
2603 | memcpy(smi_msg->data, recv_msg->msg.data, recv_msg->msg.data_len); | 2601 | memcpy(smi_msg->data, recv_msg->msg.data, recv_msg->msg.data_len); |
2604 | smi_msg->data_size = recv_msg->msg.data_len; | 2602 | smi_msg->data_size = recv_msg->msg.data_len; |
2605 | smi_msg->msgid = STORE_SEQ_IN_MSGID(seq, seqid); | 2603 | smi_msg->msgid = STORE_SEQ_IN_MSGID(seq, seqid); |
2606 | 2604 | ||
2607 | /* Send the new message. We send with a zero priority. It | ||
2608 | timed out, I doubt time is that critical now, and high | ||
2609 | priority messages are really only for messages to the local | ||
2610 | MC, which don't get resent. */ | ||
2611 | intf->handlers->sender(intf->send_info, smi_msg, 0); | ||
2612 | |||
2613 | #ifdef DEBUG_MSGING | 2605 | #ifdef DEBUG_MSGING |
2614 | { | 2606 | { |
2615 | int m; | 2607 | int m; |
@@ -2619,6 +2611,7 @@ send_from_recv_msg(ipmi_smi_t intf, struct ipmi_recv_msg *recv_msg, | |||
2619 | printk("\n"); | 2611 | printk("\n"); |
2620 | } | 2612 | } |
2621 | #endif | 2613 | #endif |
2614 | return smi_msg; | ||
2622 | } | 2615 | } |
2623 | 2616 | ||
2624 | static void | 2617 | static void |
@@ -2683,14 +2676,13 @@ ipmi_timeout_handler(long timeout_period) | |||
2683 | intf->timed_out_ipmb_commands++; | 2676 | intf->timed_out_ipmb_commands++; |
2684 | spin_unlock(&intf->counter_lock); | 2677 | spin_unlock(&intf->counter_lock); |
2685 | } else { | 2678 | } else { |
2679 | struct ipmi_smi_msg *smi_msg; | ||
2686 | /* More retries, send again. */ | 2680 | /* More retries, send again. */ |
2687 | 2681 | ||
2688 | /* Start with the max timer, set to normal | 2682 | /* Start with the max timer, set to normal |
2689 | timer after the message is sent. */ | 2683 | timer after the message is sent. */ |
2690 | ent->timeout = MAX_MSG_TIMEOUT; | 2684 | ent->timeout = MAX_MSG_TIMEOUT; |
2691 | ent->retries_left--; | 2685 | ent->retries_left--; |
2692 | send_from_recv_msg(intf, ent->recv_msg, NULL, | ||
2693 | j, ent->seqid); | ||
2694 | spin_lock(&intf->counter_lock); | 2686 | spin_lock(&intf->counter_lock); |
2695 | if (ent->recv_msg->addr.addr_type | 2687 | if (ent->recv_msg->addr.addr_type |
2696 | == IPMI_LAN_ADDR_TYPE) | 2688 | == IPMI_LAN_ADDR_TYPE) |
@@ -2698,6 +2690,20 @@ ipmi_timeout_handler(long timeout_period) | |||
2698 | else | 2690 | else |
2699 | intf->retransmitted_ipmb_commands++; | 2691 | intf->retransmitted_ipmb_commands++; |
2700 | spin_unlock(&intf->counter_lock); | 2692 | spin_unlock(&intf->counter_lock); |
2693 | smi_msg = smi_from_recv_msg(intf, | ||
2694 | ent->recv_msg, j, ent->seqid); | ||
2695 | if(!smi_msg) | ||
2696 | continue; | ||
2697 | |||
2698 | spin_unlock_irqrestore(&(intf->seq_lock),flags); | ||
2699 | /* Send the new message. We send with a zero | ||
2700 | * priority. It timed out, I doubt time is | ||
2701 | * that critical now, and high priority | ||
2702 | * messages are really only for messages to the | ||
2703 | * local MC, which don't get resent. */ | ||
2704 | intf->handlers->sender(intf->send_info, | ||
2705 | smi_msg, 0); | ||
2706 | spin_lock_irqsave(&(intf->seq_lock), flags); | ||
2701 | } | 2707 | } |
2702 | } | 2708 | } |
2703 | spin_unlock_irqrestore(&(intf->seq_lock), flags); | 2709 | spin_unlock_irqrestore(&(intf->seq_lock), flags); |
diff --git a/drivers/char/ipmi/ipmi_si_intf.c b/drivers/char/ipmi/ipmi_si_intf.c index 29de259a981e..5419440087fd 100644 --- a/drivers/char/ipmi/ipmi_si_intf.c +++ b/drivers/char/ipmi/ipmi_si_intf.c | |||
@@ -100,6 +100,11 @@ enum si_intf_state { | |||
100 | /* FIXME - add watchdog stuff. */ | 100 | /* FIXME - add watchdog stuff. */ |
101 | }; | 101 | }; |
102 | 102 | ||
103 | /* Some BT-specific defines we need here. */ | ||
104 | #define IPMI_BT_INTMASK_REG 2 | ||
105 | #define IPMI_BT_INTMASK_CLEAR_IRQ_BIT 2 | ||
106 | #define IPMI_BT_INTMASK_ENABLE_IRQ_BIT 1 | ||
107 | |||
103 | enum si_type { | 108 | enum si_type { |
104 | SI_KCS, SI_SMIC, SI_BT | 109 | SI_KCS, SI_SMIC, SI_BT |
105 | }; | 110 | }; |
@@ -875,6 +880,17 @@ static irqreturn_t si_irq_handler(int irq, void *data, struct pt_regs *regs) | |||
875 | return IRQ_HANDLED; | 880 | return IRQ_HANDLED; |
876 | } | 881 | } |
877 | 882 | ||
883 | static irqreturn_t si_bt_irq_handler(int irq, void *data, struct pt_regs *regs) | ||
884 | { | ||
885 | struct smi_info *smi_info = data; | ||
886 | /* We need to clear the IRQ flag for the BT interface. */ | ||
887 | smi_info->io.outputb(&smi_info->io, IPMI_BT_INTMASK_REG, | ||
888 | IPMI_BT_INTMASK_CLEAR_IRQ_BIT | ||
889 | | IPMI_BT_INTMASK_ENABLE_IRQ_BIT); | ||
890 | return si_irq_handler(irq, data, regs); | ||
891 | } | ||
892 | |||
893 | |||
878 | static struct ipmi_smi_handlers handlers = | 894 | static struct ipmi_smi_handlers handlers = |
879 | { | 895 | { |
880 | .owner = THIS_MODULE, | 896 | .owner = THIS_MODULE, |
@@ -1001,11 +1017,22 @@ static int std_irq_setup(struct smi_info *info) | |||
1001 | if (!info->irq) | 1017 | if (!info->irq) |
1002 | return 0; | 1018 | return 0; |
1003 | 1019 | ||
1004 | rv = request_irq(info->irq, | 1020 | if (info->si_type == SI_BT) { |
1005 | si_irq_handler, | 1021 | rv = request_irq(info->irq, |
1006 | SA_INTERRUPT, | 1022 | si_bt_irq_handler, |
1007 | DEVICE_NAME, | 1023 | SA_INTERRUPT, |
1008 | info); | 1024 | DEVICE_NAME, |
1025 | info); | ||
1026 | if (!rv) | ||
1027 | /* Enable the interrupt in the BT interface. */ | ||
1028 | info->io.outputb(&info->io, IPMI_BT_INTMASK_REG, | ||
1029 | IPMI_BT_INTMASK_ENABLE_IRQ_BIT); | ||
1030 | } else | ||
1031 | rv = request_irq(info->irq, | ||
1032 | si_irq_handler, | ||
1033 | SA_INTERRUPT, | ||
1034 | DEVICE_NAME, | ||
1035 | info); | ||
1009 | if (rv) { | 1036 | if (rv) { |
1010 | printk(KERN_WARNING | 1037 | printk(KERN_WARNING |
1011 | "ipmi_si: %s unable to claim interrupt %d," | 1038 | "ipmi_si: %s unable to claim interrupt %d," |
@@ -1024,6 +1051,9 @@ static void std_irq_cleanup(struct smi_info *info) | |||
1024 | if (!info->irq) | 1051 | if (!info->irq) |
1025 | return; | 1052 | return; |
1026 | 1053 | ||
1054 | if (info->si_type == SI_BT) | ||
1055 | /* Disable the interrupt in the BT interface. */ | ||
1056 | info->io.outputb(&info->io, IPMI_BT_INTMASK_REG, 0); | ||
1027 | free_irq(info->irq, info); | 1057 | free_irq(info->irq, info); |
1028 | } | 1058 | } |
1029 | 1059 | ||
@@ -1526,8 +1556,17 @@ static int try_init_acpi(int intf_num, struct smi_info **new_info) | |||
1526 | info->irq_setup = NULL; | 1556 | info->irq_setup = NULL; |
1527 | } | 1557 | } |
1528 | 1558 | ||
1529 | regspacings[intf_num] = spmi->addr.register_bit_width / 8; | 1559 | if (spmi->addr.register_bit_width) { |
1530 | info->io.regspacing = spmi->addr.register_bit_width / 8; | 1560 | /* A (hopefully) properly formed register bit width. */ |
1561 | regspacings[intf_num] = spmi->addr.register_bit_width / 8; | ||
1562 | info->io.regspacing = spmi->addr.register_bit_width / 8; | ||
1563 | } else { | ||
1564 | /* Some broken systems get this wrong and set the value | ||
1565 | * to zero. Assume it is the default spacing. If that | ||
1566 | * is wrong, too bad, the vendor should fix the tables. */ | ||
1567 | regspacings[intf_num] = DEFAULT_REGSPACING; | ||
1568 | info->io.regspacing = DEFAULT_REGSPACING; | ||
1569 | } | ||
1531 | regsizes[intf_num] = regspacings[intf_num]; | 1570 | regsizes[intf_num] = regspacings[intf_num]; |
1532 | info->io.regsize = regsizes[intf_num]; | 1571 | info->io.regsize = regsizes[intf_num]; |
1533 | regshifts[intf_num] = spmi->addr.register_bit_offset; | 1572 | regshifts[intf_num] = spmi->addr.register_bit_offset; |
@@ -1623,7 +1662,13 @@ static int decode_dmi(dmi_header_t *dm, int intf_num) | |||
1623 | } | 1662 | } |
1624 | } else { | 1663 | } else { |
1625 | /* Old DMI spec. */ | 1664 | /* Old DMI spec. */ |
1626 | ipmi_data->base_addr = base_addr; | 1665 | /* Note that technically, the lower bit of the base |
1666 | * address should be 1 if the address is I/O and 0 if | ||
1667 | * the address is in memory. So many systems get that | ||
1668 | * wrong (and all that I have seen are I/O) so we just | ||
1669 | * ignore that bit and assume I/O. Systems that use | ||
1670 | * memory should use the newer spec, anyway. */ | ||
1671 | ipmi_data->base_addr = base_addr & 0xfffe; | ||
1627 | ipmi_data->addr_space = IPMI_IO_ADDR_SPACE; | 1672 | ipmi_data->addr_space = IPMI_IO_ADDR_SPACE; |
1628 | ipmi_data->offset = 1; | 1673 | ipmi_data->offset = 1; |
1629 | } | 1674 | } |
@@ -2199,7 +2244,7 @@ static int init_one_smi(int intf_num, struct smi_info **smi) | |||
2199 | /* Wait until we know that we are out of any interrupt | 2244 | /* Wait until we know that we are out of any interrupt |
2200 | handlers might have been running before we freed the | 2245 | handlers might have been running before we freed the |
2201 | interrupt. */ | 2246 | interrupt. */ |
2202 | synchronize_kernel(); | 2247 | synchronize_sched(); |
2203 | 2248 | ||
2204 | if (new_smi->si_sm) { | 2249 | if (new_smi->si_sm) { |
2205 | if (new_smi->handlers) | 2250 | if (new_smi->handlers) |
@@ -2312,7 +2357,7 @@ static void __exit cleanup_one_si(struct smi_info *to_clean) | |||
2312 | /* Wait until we know that we are out of any interrupt | 2357 | /* Wait until we know that we are out of any interrupt |
2313 | handlers might have been running before we freed the | 2358 | handlers might have been running before we freed the |
2314 | interrupt. */ | 2359 | interrupt. */ |
2315 | synchronize_kernel(); | 2360 | synchronize_sched(); |
2316 | 2361 | ||
2317 | /* Wait for the timer to stop. This avoids problems with race | 2362 | /* Wait for the timer to stop. This avoids problems with race |
2318 | conditions removing the timer here. */ | 2363 | conditions removing the timer here. */ |
diff --git a/drivers/char/ipmi/ipmi_watchdog.c b/drivers/char/ipmi/ipmi_watchdog.c index fd7093879c66..fcd1c02a32cb 100644 --- a/drivers/char/ipmi/ipmi_watchdog.c +++ b/drivers/char/ipmi/ipmi_watchdog.c | |||
@@ -709,11 +709,11 @@ static int ipmi_close(struct inode *ino, struct file *filep) | |||
709 | if (expect_close == 42) { | 709 | if (expect_close == 42) { |
710 | ipmi_watchdog_state = WDOG_TIMEOUT_NONE; | 710 | ipmi_watchdog_state = WDOG_TIMEOUT_NONE; |
711 | ipmi_set_timeout(IPMI_SET_TIMEOUT_NO_HB); | 711 | ipmi_set_timeout(IPMI_SET_TIMEOUT_NO_HB); |
712 | clear_bit(0, &ipmi_wdog_open); | ||
713 | } else { | 712 | } else { |
714 | printk(KERN_CRIT PFX "Unexpected close, not stopping watchdog!\n"); | 713 | printk(KERN_CRIT PFX "Unexpected close, not stopping watchdog!\n"); |
715 | ipmi_heartbeat(); | 714 | ipmi_heartbeat(); |
716 | } | 715 | } |
716 | clear_bit(0, &ipmi_wdog_open); | ||
717 | } | 717 | } |
718 | 718 | ||
719 | ipmi_fasync (-1, filep, 0); | 719 | ipmi_fasync (-1, filep, 0); |
diff --git a/drivers/char/rio/rio_linux.c b/drivers/char/rio/rio_linux.c index a91ae271cf0a..763893e289b3 100644 --- a/drivers/char/rio/rio_linux.c +++ b/drivers/char/rio/rio_linux.c | |||
@@ -221,7 +221,7 @@ static int rio_probe_addrs[]= {0xc0000, 0xd0000, 0xe0000}; | |||
221 | /* Set the mask to all-ones. This alas, only supports 32 interrupts. | 221 | /* Set the mask to all-ones. This alas, only supports 32 interrupts. |
222 | Some architectures may need more. -- Changed to LONG to | 222 | Some architectures may need more. -- Changed to LONG to |
223 | support up to 64 bits on 64bit architectures. -- REW 20/06/99 */ | 223 | support up to 64 bits on 64bit architectures. -- REW 20/06/99 */ |
224 | long rio_irqmask = -1; | 224 | static long rio_irqmask = -1; |
225 | 225 | ||
226 | MODULE_AUTHOR("Rogier Wolff <R.E.Wolff@bitwizard.nl>, Patrick van de Lageweg <patrick@bitwizard.nl>"); | 226 | MODULE_AUTHOR("Rogier Wolff <R.E.Wolff@bitwizard.nl>, Patrick van de Lageweg <patrick@bitwizard.nl>"); |
227 | MODULE_DESCRIPTION("RIO driver"); | 227 | MODULE_DESCRIPTION("RIO driver"); |
diff --git a/drivers/char/s3c2410-rtc.c b/drivers/char/s3c2410-rtc.c index 8e61be34a1d3..ed867db550a9 100644 --- a/drivers/char/s3c2410-rtc.c +++ b/drivers/char/s3c2410-rtc.c | |||
@@ -116,7 +116,7 @@ static void s3c2410_rtc_setfreq(int freq) | |||
116 | 116 | ||
117 | /* Time read/write */ | 117 | /* Time read/write */ |
118 | 118 | ||
119 | static void s3c2410_rtc_gettime(struct rtc_time *rtc_tm) | 119 | static int s3c2410_rtc_gettime(struct rtc_time *rtc_tm) |
120 | { | 120 | { |
121 | unsigned int have_retried = 0; | 121 | unsigned int have_retried = 0; |
122 | 122 | ||
@@ -151,6 +151,8 @@ static void s3c2410_rtc_gettime(struct rtc_time *rtc_tm) | |||
151 | 151 | ||
152 | rtc_tm->tm_year += 100; | 152 | rtc_tm->tm_year += 100; |
153 | rtc_tm->tm_mon -= 1; | 153 | rtc_tm->tm_mon -= 1; |
154 | |||
155 | return 0; | ||
154 | } | 156 | } |
155 | 157 | ||
156 | 158 | ||
@@ -171,7 +173,7 @@ static int s3c2410_rtc_settime(struct rtc_time *tm) | |||
171 | return 0; | 173 | return 0; |
172 | } | 174 | } |
173 | 175 | ||
174 | static void s3c2410_rtc_getalarm(struct rtc_wkalrm *alrm) | 176 | static int s3c2410_rtc_getalarm(struct rtc_wkalrm *alrm) |
175 | { | 177 | { |
176 | struct rtc_time *alm_tm = &alrm->time; | 178 | struct rtc_time *alm_tm = &alrm->time; |
177 | unsigned int alm_en; | 179 | unsigned int alm_en; |
@@ -231,6 +233,8 @@ static void s3c2410_rtc_getalarm(struct rtc_wkalrm *alrm) | |||
231 | } | 233 | } |
232 | 234 | ||
233 | /* todo - set alrm->enabled ? */ | 235 | /* todo - set alrm->enabled ? */ |
236 | |||
237 | return 0; | ||
234 | } | 238 | } |
235 | 239 | ||
236 | static int s3c2410_rtc_setalarm(struct rtc_wkalrm *alrm) | 240 | static int s3c2410_rtc_setalarm(struct rtc_wkalrm *alrm) |
diff --git a/drivers/char/specialix.c b/drivers/char/specialix.c index c789d5ceac76..50e0b612a8a2 100644 --- a/drivers/char/specialix.c +++ b/drivers/char/specialix.c | |||
@@ -1987,10 +1987,9 @@ static inline int sx_set_serial_info(struct specialix_port * port, | |||
1987 | 1987 | ||
1988 | func_enter(); | 1988 | func_enter(); |
1989 | /* | 1989 | /* |
1990 | error = verify_area(VERIFY_READ, (void *) newinfo, sizeof(tmp)); | 1990 | if (!access_ok(VERIFY_READ, (void *) newinfo, sizeof(tmp))) { |
1991 | if (error) { | ||
1992 | func_exit(); | 1991 | func_exit(); |
1993 | return error; | 1992 | return -EFAULT; |
1994 | } | 1993 | } |
1995 | */ | 1994 | */ |
1996 | if (copy_from_user(&tmp, newinfo, sizeof(tmp))) { | 1995 | if (copy_from_user(&tmp, newinfo, sizeof(tmp))) { |
@@ -2046,14 +2045,12 @@ static inline int sx_get_serial_info(struct specialix_port * port, | |||
2046 | { | 2045 | { |
2047 | struct serial_struct tmp; | 2046 | struct serial_struct tmp; |
2048 | struct specialix_board *bp = port_Board(port); | 2047 | struct specialix_board *bp = port_Board(port); |
2049 | // int error; | ||
2050 | 2048 | ||
2051 | func_enter(); | 2049 | func_enter(); |
2052 | 2050 | ||
2053 | /* | 2051 | /* |
2054 | error = verify_area(VERIFY_WRITE, (void *) retinfo, sizeof(tmp)); | 2052 | if (!access_ok(VERIFY_WRITE, (void *) retinfo, sizeof(tmp))) |
2055 | if (error) | 2053 | return -EFAULT; |
2056 | return error; | ||
2057 | */ | 2054 | */ |
2058 | 2055 | ||
2059 | memset(&tmp, 0, sizeof(tmp)); | 2056 | memset(&tmp, 0, sizeof(tmp)); |
diff --git a/drivers/char/stallion.c b/drivers/char/stallion.c index de166608c59e..b8899f560b5e 100644 --- a/drivers/char/stallion.c +++ b/drivers/char/stallion.c | |||
@@ -466,7 +466,7 @@ static int stl_parsebrd(stlconf_t *confp, char **argp); | |||
466 | 466 | ||
467 | static unsigned long stl_atol(char *str); | 467 | static unsigned long stl_atol(char *str); |
468 | 468 | ||
469 | int stl_init(void); | 469 | static int stl_init(void); |
470 | static int stl_open(struct tty_struct *tty, struct file *filp); | 470 | static int stl_open(struct tty_struct *tty, struct file *filp); |
471 | static void stl_close(struct tty_struct *tty, struct file *filp); | 471 | static void stl_close(struct tty_struct *tty, struct file *filp); |
472 | static int stl_write(struct tty_struct *tty, const unsigned char *buf, int count); | 472 | static int stl_write(struct tty_struct *tty, const unsigned char *buf, int count); |
@@ -3063,7 +3063,7 @@ static struct tty_operations stl_ops = { | |||
3063 | 3063 | ||
3064 | /*****************************************************************************/ | 3064 | /*****************************************************************************/ |
3065 | 3065 | ||
3066 | int __init stl_init(void) | 3066 | static int __init stl_init(void) |
3067 | { | 3067 | { |
3068 | int i; | 3068 | int i; |
3069 | printk(KERN_INFO "%s: version %s\n", stl_drvtitle, stl_drvversion); | 3069 | printk(KERN_INFO "%s: version %s\n", stl_drvtitle, stl_drvversion); |
diff --git a/drivers/char/vt_ioctl.c b/drivers/char/vt_ioctl.c index 5d386f4bea49..8971484b956b 100644 --- a/drivers/char/vt_ioctl.c +++ b/drivers/char/vt_ioctl.c | |||
@@ -24,6 +24,7 @@ | |||
24 | #include <linux/major.h> | 24 | #include <linux/major.h> |
25 | #include <linux/fs.h> | 25 | #include <linux/fs.h> |
26 | #include <linux/console.h> | 26 | #include <linux/console.h> |
27 | #include <linux/signal.h> | ||
27 | 28 | ||
28 | #include <asm/io.h> | 29 | #include <asm/io.h> |
29 | #include <asm/uaccess.h> | 30 | #include <asm/uaccess.h> |
@@ -641,7 +642,7 @@ int vt_ioctl(struct tty_struct *tty, struct file * file, | |||
641 | extern int spawnpid, spawnsig; | 642 | extern int spawnpid, spawnsig; |
642 | if (!perm || !capable(CAP_KILL)) | 643 | if (!perm || !capable(CAP_KILL)) |
643 | return -EPERM; | 644 | return -EPERM; |
644 | if (arg < 1 || arg > _NSIG || arg == SIGKILL) | 645 | if (!valid_signal(arg) || arg < 1 || arg == SIGKILL) |
645 | return -EINVAL; | 646 | return -EINVAL; |
646 | spawnpid = current->pid; | 647 | spawnpid = current->pid; |
647 | spawnsig = arg; | 648 | spawnsig = arg; |