aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/char
diff options
context:
space:
mode:
authorJens Axboe <jens.axboe@oracle.com>2010-03-19 03:05:10 -0400
committerJens Axboe <jens.axboe@oracle.com>2010-03-19 03:05:10 -0400
commitb4b7a4ef097f288f724420b473dbf92a89c0ab7e (patch)
tree23ad8101e3e77c32a8d1e1b95a9c1cd7f7a475b7 /drivers/char
parente9ce335df51ff782035a15c261a3c0c9892a1767 (diff)
parenta3d3203e4bb40f253b1541e310dc0f9305be7c84 (diff)
Merge branch 'master' into for-linus
Conflicts: block/Kconfig Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
Diffstat (limited to 'drivers/char')
-rw-r--r--drivers/char/ChangeLog775
-rw-r--r--drivers/char/agp/Kconfig2
-rw-r--r--drivers/char/agp/intel-agp.c2
-rw-r--r--drivers/char/applicom.c2
-rw-r--r--drivers/char/hvc_iseries.c2
-rw-r--r--drivers/char/hvc_iucv.c6
-rw-r--r--drivers/char/hw_random/n2-drv.c2
-rw-r--r--drivers/char/ip2/i2hw.h2
-rw-r--r--drivers/char/ipmi/ipmi_si_intf.c71
-rw-r--r--drivers/char/mem.c195
-rw-r--r--drivers/char/mmtimer.c2
-rw-r--r--drivers/char/n_tty.c17
-rw-r--r--drivers/char/pty.c2
-rw-r--r--drivers/char/random.c2
-rw-r--r--drivers/char/serial167.c2
-rw-r--r--drivers/char/tty_audit.c1
-rw-r--r--drivers/char/tty_io.c2
-rw-r--r--drivers/char/vt.c6
18 files changed, 201 insertions, 892 deletions
diff --git a/drivers/char/ChangeLog b/drivers/char/ChangeLog
deleted file mode 100644
index 56b8a2e76ab1..000000000000
--- a/drivers/char/ChangeLog
+++ /dev/null
@@ -1,775 +0,0 @@
12001-08-11 Tim Waugh <twaugh@redhat.com>
2
3 * serial.c (get_pci_port): Deal with awkward Titan cards.
4
51998-08-26 Theodore Ts'o <tytso@rsts-11.mit.edu>
6
7 * serial.c (rs_open): Correctly decrement the module in-use count
8 on errors.
9
10Thu Feb 19 14:24:08 1998 Theodore Ts'o <tytso@rsts-11.mit.edu>
11
12 * tty_io.c (tty_name): Remove the non-reentrant (and non-SMP safe)
13 version of tty_name, and rename the reentrant _tty_name
14 function to be tty_name.
15 (tty_open): Add a warning message stating callout devices
16 are deprecated.
17
18Mon Dec 1 08:24:15 1997 Theodore Ts'o <tytso@rsts-11.mit.edu>
19
20 * tty_io.c (tty_get_baud_rate): Print a warning syslog if the
21 tty->alt_speed kludge is used; this means the system is
22 using the deprecated SPD_HI ioctls.
23
24Mon Nov 24 10:37:49 1997 Theodore Ts'o <tytso@rsts-11.mit.edu>
25
26 * serial.c, esp.c, rocket.c: Change drivers to take advantage of
27 tty_get_baud_rate().
28
29 * tty_io.c (tty_get_baud_rate): New function which computes the
30 correct baud rate for the tty. More factoring out of
31 common code out of the serial driver to the high-level tty
32 functions....
33
34Sat Nov 22 07:53:36 1997 Theodore Ts'o <tytso@rsts-11.mit.edu>
35
36 * serial.c, esp.c, rocket.c: Add tty->driver.break() routine, and
37 allow high-level tty code to handle the break and soft
38 carrier ioctls.
39
40 * tty_ioctl.c (n_tty_ioctl): Support TIOCGSOFTCAR and
41 TIOCSSOFTCAR, so that device drivers don't have to support
42 it.
43
44 * serial.c (autoconfig): Change 16750 test to hopefully eliminate
45 false results by people with strange 16550As being
46 detected as 16750s. Hopefully 16750s will still be
47 detected as 16750, and other weird UARTs won't get poorly
48 autodetected. If this doesn't work, I'll have to disable
49 the auto identification for the 16750.
50
51 * tty_io.c (tty_hangup): Now actually do the tty hangup
52 processing during the timer processing, and disable
53 interrupts while doing the hangup processing. This avoids
54 several nasty race conditions which happened when the
55 hangup processing was done asynchronously.
56 (tty_ioctl): Do break handling in the tty driver if
57 driver's break function is supported.
58 (tty_flip_buffer_push): New exported function which should
59 be used by drivers to push characters in the flip buffer
60 to the tty handler. This may either be done using a task
61 queue function for better CPU efficiency, or directly for
62 low latency operation.
63
64 * serial.c (rs_set_termios): Fix bug rs_set_termios when
65 transitioning away from B0, submitted by Stanislav
66 Voronyi.
67
68Thu Jun 19 20:05:58 1997 Theodore Ts'o <tytso@rsts-11.mit.edu>
69
70 * serial.c (begin_break, end_break, rs_ioctl): Applied patch
71 to support BSD ioctls to set and clear the break
72 condition explicitly.
73
74 * console.c (scrup, scrdown, insert_line, delete_line): Applied
75 fix suggested by Aaron Tiensivu to speed up block scrolls
76 up and down.
77
78 * n_tty.c (opost_block, write_chan): Added a modified "fast
79 console" patch which processes a block of text via
80 "cooking" efficiently.
81
82Wed Jun 18 15:25:50 1997 Theodore Ts'o <tytso@rsts-11.mit.edu>
83
84 * tty_io.c (init_dev, release_dev): Applied fix suggested by Bill
85 Hawes to prevent race conditions in the tty code.
86
87 * n_tty.c (n_tty_chars_in_buffer): Applied fix suggested by Bill
88 Hawes so that n_tty_chars_in_buffer returns the correct
89 value in the case when the tty is in cannonical mode. (To
90 avoid a pty deadlock with telnetd.)
91
92Thu Feb 27 01:53:08 1997 Theodore Ts'o <tytso@rsts-11.mit.edu>
93
94 * serial.c (change_speed): Add support for the termios flag
95 CMSPAR, which allows the user to select stick parity.
96 (i.e, if PARODD is set, the parity bit is always 1; if
97 PARRODD is not set, then the parity bit is always 0).
98
99Wed Feb 26 19:03:10 1997 Theodore Ts'o <tytso@rsts-11.mit.edu>
100
101 * serial.c (cleanup_module): Fix memory leak when using the serial
102 driver as a module; make sure tmp_buf gets freed!
103
104Tue Feb 25 11:01:59 1997 Theodore Ts'o <tytso@rsts-11.mit.edu>
105
106 * serial.c (set_modem_info): Add support for setting and clearing
107 the OUT1 and OUT2 bits. (For special case UART's, usually
108 for half-duplex.)
109 (autoconfig, change_speed): Fix TI 16750 support.
110
111Sun Feb 16 00:14:43 1997 Theodore Ts'o <tytso@rsts-11.mit.edu>
112
113 * tty_io.c (release_dev): Add sanity check to make sure there are
114 no waiters on tty->read_wait or tty->write_wait.
115
116 * serial.c (rs_init): Don't autoconfig a device if the I/O region
117 is already reserved.
118
119 * serial.c (serial_proc_info): Add support for /proc/serial.
120
121Thu Feb 13 00:49:10 1997 Theodore Ts'o <tytso@rsts-11.mit.edu>
122
123 * serial.c (receive_chars): When the UART repotrs an overrun
124 condition, it does so with a valid character. Changed to
125 not throw away the valid character, but instead report the
126 overrun after the valid character.
127
128 * serial.c: Added new #ifdef's for some of the advanced serial
129 driver features. A minimal driver that only supports COM
130 1/2/3/4 without sharing serial interrupts only takes 17k;
131 the full driver takes 32k.
132
133Wed Feb 12 14:50:44 1997 Theodore Ts'o <tytso@rsts-11.mit.edu>
134
135 * vt.c:
136 * pty.c:
137 * tty_ioctl.c:
138 * serial.c: Update routines to use the new 2.1 memory access
139 routines.
140
141Wed Dec 4 07:51:52 1996 Theodore Ts'o <tytso@localhost.mit.edu>
142
143 * serial.c (change_speed): Use save_flags(); cli() and
144 restore_flags() in order to ensure we don't accidentally
145 turn on interrupts when starting up the port.
146 (startup): Move the insertion of serial structure into the
147 IRQ chain earlier into the startup processing. Interrupts
148 should be off this whole time, but we eventually will want
149 to reduce this window.
150
151Thu Nov 21 10:05:22 1996 Theodore Ts'o <tytso@localhost.mit.edu>
152
153 * tty_ioctl.c (tty_wait_until_sent): Always check the driver
154 wait_until_ready routine, even if there are no characters
155 in the xmit buffer. (There may be charactes in the device
156 FIFO.)
157 (n_tty_ioctl): Add new flag tty->flow_stopped which
158 indicates whether the tty is stopped due to a request by
159 the TCXONC ioctl (used by tcflow). If so, don't let an
160 incoming XOFF character restart the tty. The tty can only
161 be restarted by another TCXONC request.
162
163 * tty_io.c (start_tty): Don't allow the tty to be restarted if
164 tty->flow_stopped is true.
165
166 * n_tty.c (n_tty_receive_char): If tty->flow_stopped is true, and
167 IXANY is set, don't eat a character trying to restart the
168 tty.
169
170 * serial.c (startup): Remove need for MCR_noint from the
171 async_struct structure. Only turn on DTR and RTS if the
172 baud rate is not zero.
173 (change_speed): More accurately calculate the timeout
174 value based on the word size. Move responsibility of
175 hangup when speed becomes B0 to rs_set_termios()
176 (set_serial_info): When changing the UART type set the
177 current xmit_fifo_size as well as the permanent
178 xmit_fifo_size.
179 (rs_ioctl): Fix TCSBRK (used by tcdrain) and TCSBRKP
180 ioctls to return EINTR if interrupted by a signal.
181 (rs_set_termios): If the baud rate changes to or from B0,
182 this function is now responsible for setting or clearing
183 DTR and RTS. DTR and RTS are only be changed on the
184 transition to or from the B0 state.
185 (rs_close): Wait for the characters to drain based on
186 info->timeout. At low baud rates (50 bps), it may take a
187 long time for the FIFO to completely drain out!
188 (rs_wait_until_sent): Fixed timeout handling. Now
189 releases control to the scheduler, but checks frequently
190 enough so that the function is sensitive enough to pass
191 the timing requirements of the NIST-PCTS.
192 (block_til_ready): When opening the device, don't turn on
193 DTR and RTS if the baud rate is B0.
194
195Thu Nov 14 00:06:09 1996 Theodore Ts'o <tytso@rsts-11.mit.edu>
196
197 * serial.c (autoconfig): Fix autoconfiguration problems;
198 info->flags wasn't getting initialized from the state
199 structure. Put in more paranoid test for the 16750.
200
201Fri Nov 8 20:19:50 1996 Theodore Ts'o <tytso@rsts-11.mit.edu>
202
203 * n_tty.c (n_tty_flush_buffer): Only call driver->unthrottle() if
204 the tty was previous throttled.
205 (n_tty_set_termios, write_chan): Add changes suggested by
206 Simon P. Allen to allow hardware cooking.
207
208 * tty_ioctl.c (set_termios): If we get a signal while waiting for
209 the tty to drain, return -EINTR.
210
211 * serial.c (change_speed): Add support for CREAD, as required by
212 POSIX.
213
214Sat Nov 2 20:43:10 1996 Theodore Ts'o <tytso@rsts-11.mit.edu>
215
216 * serial.c: Wholesale changes. Added support for the Startech
217 16650 and 16650V2 chips. (WARNING: the new startech
218 16650A may or may not work!) Added support for the
219 TI16750 (not yet tested). Split async_struct into a
220 transient part (async_struct) and a permanent part
221 (serial_state) which contains the configuration
222 information for the ports. Added new driver routines
223 wait_until_sent() and send_xchar() to help with POSIX
224 compliance. Added support for radio clocks which waggle
225 the carrier detect line (CONFIG_HARD_PPS).
226
227 * tty_ioctl.c (tty_wait_until_sent): Added call to new driver
228 function tty->driver.wait_until_sent(), which returns when
229 the tty's device xmit buffers are drained. Needed for
230 full POSIX compliance.
231
232 (send_prio_char): New function, called by the ioctl's
233 TCIOFF and TCION; uses the new driver call send_xchar(),
234 which will send the XON or XOFF character at high priority
235 (and even if tty output is stopped).
236
237Wed Jun 5 18:52:04 1996 Theodore Ts'o <tytso@rsts-11.mit.edu>
238
239 * pty.c (pty_close): When closing a pty, make sure packet mode is
240 cleared.
241
242Sun May 26 09:33:52 1996 Theodore Ts'o <tytso@rsts-11.mit.edu>
243
244 * vesa_blank.c (set_vesa_blanking): Add missing verify_area() call.
245
246 * selection.c (set_selection): Add missing verify_area() call.
247
248 * tty_io.c (tty_ioctl): Add missing verify_area() calls.
249
250 * serial.c (rs_ioctl): Add missing verify_area() calls.
251 (rs_init): Allow initialization of serial driver
252 configuration from a module.
253
254 * random.c (extract_entropy): Add missing verify_area call.
255 Don't limit number of characters returned to
256 32,768. Extract entropy is now no longer a inlined
257 function.
258
259 (random_read): Check return value in case extract_entropy
260 returns an error.
261
262 (secure_tcp_sequence_number): New function which returns a
263 secure TCP sequence number. This is needed to prevent some
264 nasty TCP hijacking attacks.
265
266 (init_std_data): Initialize using gettimeofday() instead of
267 struct timeval xtime.
268
269 (fast_add_entropy_word, add_entropy_word): Rename the
270 inline function add_entropy_word() to
271 fast_add_entropy_word(). Make add_entropy_word() be the
272 non-inlined function which is used in non-timing critical
273 places, in order to save space.
274
275 (initialize_benchmark, begin_benchmark, end_benchmark): New
276 functions defined when RANDOM_BENCHMARK is defined. They
277 allow us to benchmark the speed of the
278 add_timer_randomness() call.
279
280 (int_ln, rotate_left): Add two new inline functions with
281 i386 optimized asm instructions. This speeds up the
282 critical add_entropy_word() and add_timer_randomness()
283 functions, which are called from interrupt handlers.
284
285Tue May 7 22:51:11 1996 <tytso@rsts-11.mit.edu>
286
287 * random.c (add_timer_randomness): Limit the amount randomness
288 that we estimate to 12 bits. (An arbitrary amount).
289
290 (extract_entropy): To make it harder to analyze the hash
291 function, fold the hash function in half using XOR, and
292 use the folded result as the value to emit to the user.
293 Also, add timer randomness each pass through the
294 exact_entropy call, to increase the amount of unknown
295 values during the extraction process.
296
297 (random_ioctl): Use IOR/IOW definitions to define the
298 ioctl values used by the /dev/random driver. Allow the
299 old ioctl values to be used for backwards compatibility
300 (for a limited amount of time).
301
302Wed Apr 24 14:02:04 1996 Theodore Ts'o <tytso@rsts-11.mit.edu>
303
304 * random.c (add_timer_randomness): Use 2nd derivative as well to
305 better estimate entropy.
306
307 (rand_initialize): Explicitly initialize all the pointers
308 to NULL. (Clearing pointers using memset isn't portable.)
309 Initialize the random pool with OS-dependent data.
310
311 (random_write): Add sanity checking to the arguments to
312 random_write(), so that bad arguments won't cause a kernel
313 SEGV.
314
315 (random_read): Update the access time of the device inode
316 when you return data to the user.
317
318 (random_ioctl): Wake up the random_wait channel when there
319 are only WAIT_INPUT_BITS available. Add more paranoia
320 checks to make sure entropy_count doesn't go beyond the
321 bounds of (0, POOLSIZE). Add a few missing verify_area
322 checks. Add support for the RNDCLEARPOOL ioctl, which
323 zaps the random pool.
324
325 (add_timer_randomness): Wake up the random_wait
326 channel only when there are WAIT_INPUT_BITS available.
327
328 (random_select): Allow a random refresh daemon process to
329 select on /dev/random for writing; wake up the daemon when
330 there are less than WAIT_OUTPUT_BITS bits of randomness
331 available.
332
333Tue Apr 23 22:56:07 1996 <tytso@rsts-11.mit.edu>
334
335 * tty_io.c (init_dev): Change return code when user attempts to
336 open master pty which is already open from EAGAIN to EIO,
337 to match with BSD expectations. EIO is more correct
338 anyway, since EAGAIN implies that retrying will be
339 successful --- which it might be.... Eventually!!
340
341 * pty.c (pty_open, pty_close): Fix wait loop so that we don't
342 busy loop while waiting for the master side to open.
343 Fix tty opening/closing logic. TTY_SLAVE_CLOSED was
344 renamed to TTY_OTHER_CLOSED, so that the name is more
345 descriptive. Also fixed code so that the tty flag
346 actually works correctly now....
347
348Mon Apr 1 10:22:01 1996 <tytso@rsts-11.mit.edu>
349
350 * serial.c (rs_close): Cleaned up modularization changes.
351 Remove code which forced line discipline back to N_TTY
352 this is done in the tty upper layers, and there's no
353 reason to do it here. (Making this change also
354 removed the requirement that the serial module access
355 the internal kernel symbol "ldiscs".)
356
357 * tty_io.c (tty_init): Formally register a tty_driver entry for
358 /dev/tty (device 4, 0) and /dev/console (device 5, 0).
359 This guarantees that major device numbers 4 and 5 will be
360 reserved for the tty subsystem (as they have to be because
361 of /dev/tty and /dev/console). Removed tty_regdev, as
362 this interface is no longer necessary.
363
364Sun Mar 17 20:42:47 GMT 1996 <ah@doc.ic.ac.uk>
365
366 * serial.c : modularisation (changes in linux/fs/device.c allow
367 kerneld to automatically load the serial module).
368
369 * Makefile, Config.in : serial modularisation adds.
370
371 * tty_io.c : tty_init_ctty used by to register "cua" driver just
372 for the /dev/tty device (5,0). Added tty_regdev.
373
374 * serial.c (shutdown, rs_ioctl) : when port shuts down wakeup processes
375 waiting on delta_msr_wait. The TIOCMIWAIT ioctl returns EIO
376 if no change was done since the time of call.
377
378Sat Mar 16 14:33:13 1996 <aeb@cwi.nl>
379
380 * tty_io.c (disassociate_ctty): If disassociate_ctty is called by
381 exit, do not perform an implicit vhangup on a pty.
382
383Fri Feb 9 14:15:47 1996 <tytso@rsts-11.mit.edu>
384
385 * serial.c (block_til_ready): Fixed another race condition which
386 happens if a hangup happens during the open.
387
388Wed Jan 10 10:08:00 1996 <tytso@rsts-11.mit.edu>
389
390 * serial.c (block_til_ready): Remove race condition which happened
391 if a hangup condition happened during the setup of the
392 UART, before rs_open() called block_til_ready(). This
393 caused the info->count counter to be erroneously
394 decremented.
395
396 * serial.c (startup, rs_open): Remove race condition that could
397 cause a memory leak of one page. (Fortunately, both race
398 conditions were relatively rare in practice.)
399
400Tue Dec 5 13:21:27 1995 <tytso@rsts-11.mit.edu>
401
402 * serial.c (check_modem_status, rs_ioctl): Support the new
403 ioctl()'s TIOCGICOUNT, TIOCMIWAIT. These allow an
404 application program to wait on a modem serial register
405 status bit change, and to find out how many changes have
406 taken place for the MSR bits.
407
408 (rs_write): Eliminate a race condition which is introduced
409 if it is necessary to wait for the semaphore.
410
411Sat Nov 4 17:14:45 1995 <tytso@rsts-11.mit.edu>
412
413 * tty_io.c (tty_init): Move registration of TTY_MAJOR and
414 TTY_AUX_MAJOR to the end, so that /proc/devices looks
415 prettier.
416
417 * pty.c (pty_init): Use new major numbers for PTY master and slave
418 devices. This allow us to have more than 64 pty's. We
419 register the old pty devices for backwards compatibility.
420 Note that a system should either be using the old pty
421 devices or the new pty devices --- in general, it should
422 try to use both, since they map into the same pty table.
423 The old pty devices are strictly for backwards compatibility.
424
425Wed Oct 11 12:45:24 1995 <tytso@rsts-11.mit.edu>
426
427 * tty_io.c (disassociate_ctty): If disassociate_ctty is called by
428 exit, perform an implicit vhangup on the tty.
429
430 * pty.c (pty_close): When the master pty is closed, send a hangup
431 to the slave pty.
432 (pty_open): Use the flag TTY_SLAVE_CLOSED to test to see
433 if there are any open slave ptys, instead of using
434 tty->link->count. The old method got confused if there
435 were processes that had hung-up file descriptors on the
436 slave tty.
437
438Tue May 2 00:53:25 1995 <tytso@rsx-11.mit.edu>
439
440 * tty_io.c (tty_set_ldisc): Wait until the output buffer is
441 drained before closing the old line discipline --- needed
442 in only one case: XON/XOFF processing.
443
444 * n_tty.c (n_tty_close): Don't bother waiting until the output
445 driver is closed; in general, the line discipline
446 shouldn't care if the hardware is finished
447 transmitting before the line discipline terminates.
448
449 * tty_io.c (release_dev): Shutdown the line discipline after
450 decrementing the tty count variable; but set the
451 TTY_CLOSING flag so that we know that this tty structure
452 isn't long for this world.
453
454 * tty_io.c (init_dev): Add sanity code to check to see if
455 TTY_CLOSING is set on a tty structure; if so, something
456 bad has happened (probably a line discipline close blocked
457 when it shouldn't have; so do a kernel printk and then
458 return an error).
459
460Wed Apr 26 10:23:44 1995 Theodore Y. Ts'o <tytso@localhost>
461
462 * tty_io.c (release_dev): Try to shutdown the line discipline
463 *before* decrementing the tty count variable; this removes
464 a potential race condition which occurs when the line
465 discipline close blocks, and another process then tries
466 open the same serial port.
467
468 * serial.c (rs_hangup): When hanging up, flush the output buffer
469 before shutting down the UART. Otherwise the line
470 discipline close blocks waiting for the characters to get
471 flushed, which never happens until the serial port gets reused.
472
473Wed Apr 12 08:06:16 1995 Theodore Y. Ts'o <tytso@localhost>
474
475 * serial.c (do_serial_hangup, do_softint, check_modem_status,
476 rs_init): Hangups are now scheduled via a separate tqueue
477 structure in the async_struct structure, tqueue_hangup.
478 This task is pushed on to the tq_schedule queue, so that
479 it is processed synchronously by the scheduler.
480
481Sat Feb 18 12:13:51 1995 Theodore Y. Ts'o (tytso@rt-11)
482
483 * tty_io.c (disassociate_ctty, tty_open, tty_ioctl): Clear
484 current->tty_old_pgrp field when a session leader
485 acquires a controlling tty, and after a session leader
486 has disassociated from a controlling tty.
487
488Fri Feb 17 09:34:09 1995 Theodore Y. Ts'o (tytso@rt-11)
489
490 * serial.c (rs_interrupt_single, rs_interrupt, rs_interrupt_multi):
491 Change the number of passes made from 64 to be 256,
492 configurable with the #define RS_ISR_PASS_LIMIT.
493
494 * serial.c (rs_init, set_serial_info, get_serial_info, rs_close):
495 Remove support for closing_wait2. Instead, set
496 tty->closing and rely on the line discipline to prevent
497 echo wars.
498
499 * n_tty.c (n_tty_receive_char): IEXTEN does not need to be
500 enabled in order for IXANY to be active.
501
502 If tty->closing is set, then only process XON and XOFF
503 characters.
504
505Sun Feb 12 23:57:48 1995 Theodore Y. Ts'o (tytso@rt-11)
506
507 * serial.c (rs_timer): Change the interrupt poll time from 60
508 seconds to 10 seconds, configurable with the #define
509 RS_STROBE_TIME.
510
511 * serial.c (rs_interrupt_multi, startup, shutdown, rs_ioctl,
512 set_multiport_struct, get_multiport_struct): Add
513 provisions for a new type of interrupt service routine,
514 which better supports multiple serial ports on a single
515 IRQ.
516
517Sun Feb 5 19:35:11 1995 Theodore Y. Ts'o (tytso@rt-11)
518
519 * tty_ioctl.c (n_tty_ioctl, set_termios, tty_wait_until_sent):
520 * serial.c (rs_ioctl, rs_close):
521 * cyclades.c (cy_ioctl, cy_close):
522 * n_tty.c (n_tty_close): Rename wait_until_sent to
523 tty_wait_until_sent, so that it's a better name to export
524 in ksyms.c.
525
526Sat Feb 4 23:36:20 1995 Theodore Y. Ts'o (tytso@rt-11)
527
528 * serial.c (rs_close): Added missing check for closing_wait2 being
529 ASYNC_CLOSING_WAIT_NONE.
530
531Thu Jan 26 09:02:49 1995 Theodore Y. Ts'o (tytso@rt-11)
532
533 * serial.c (rs_init, set_serial_info, get_serial_info,
534 rs_close): Support close_wait in the serial driver.
535 This is helpful for slow devices (like serial
536 plotters) so that their outputs don't get flushed upon
537 device close. This has to be configurable because
538 normally we don't want ports to be hung up for long
539 periods of time during a close when they are not
540 connected to a device, or the device is powered off.
541
542 The default is to wait 30 seconds; in the case of a
543 very slow device, the close_wait timeout should be
544 lengthened. If it is set to 0, the kernel will wait
545 forever for all of the data to be transmitted.
546
547Thu Jan 17 01:17:20 1995 Theodore Y. Ts'o (tytso@rt-11)
548
549 * serial.c (startup, change_speed, rs_init): Add support to detect
550 the StarTech 16650 chip. Treat it as a 16450 for now,
551 because of its FIFO bugs.
552
553Thu Jan 5 21:21:57 1995 <dahinds@users.sourceforge.net>
554
555 * serial.c: (receive_char): Added counter to prevent infinite loop
556 when a PCMCIA serial device is ejected.
557
558Thu Dec 29 17:53:48 1994 <tytso@rsx-11.mit.edu>
559
560 * tty_io.c (check_tty_count): New procedure which checks
561 tty->count to make sure that it matches with the number of
562 open file descriptors which point at the structure. If
563 the number doesn't match, it prints a warning message.
564
565Wed Dec 28 15:41:51 1994 <tytso@rsx-11.mit.edu>
566
567 * tty_io.c (do_tty_hangup, disassociate_ctty): At hangup time,
568 save the tty's current foreground process group in the
569 session leader's task structure. When the session leader
570 terminates, send a SIGHUP, SIGCONT to that process group.
571 This is not required by POSIX, but it's not prohibited
572 either, and it appears to be the least intrusive way
573 to fix a problem that dialup servers have with
574 orphaned process groups caused by modem hangups.
575
576Thu Dec 8 14:52:11 1994 <tytso@rsx-11.mit.edu>
577
578 * serial.c (rs_ioctl): Don't allow most ioctl's if the serial port
579 isn't initialized.
580
581 * serial.c (rs_close): Don't clear the IER if the serial port
582 isn't initialized.
583
584 * serial.c (block_til_ready): Don't try to block on the dialin
585 port if the serial port isn't initialized.
586
587Wed Dec 7 10:48:30 1994 Si Park (si@wimpol.demon.co.uk)
588 * tty_io.c (tty_register_driver): Fix bug when linking onto
589 the tty_drivers list. We now test that there are elements
590 already on the list before setting the back link from the
591 first element to the new driver.
592
593 * tty_io.c (tty_unregister_driver): Fix bug in unlinking the
594 specified driver from the tty_drivers list. We were not
595 setting the back link correctly. This used to result in
596 a dangling back link pointer and cause panics on the next
597 call to get_tty_driver().
598
599Tue Nov 29 10:21:09 1994 Theodore Y. Ts'o (tytso@rt-11)
600
601 * tty_io.c (tty_unregister_driver): Fix bug in
602 tty_unregister_driver where the pointer to the refcount is
603 tested, instead of the refcount itself. This caused
604 tty_unregister_driver to always return EBUSY.
605
606Sat Nov 26 11:59:24 1994 Theodore Y. Ts'o (tytso@rt-11)
607
608 * tty_io.c (tty_ioctl): Add support for the new ioctl
609 TIOCTTYGSTRUCT, which allow a kernel debugging program
610 direct read access to the tty and tty_driver structures.
611
612Fri Nov 25 17:26:22 1994 Theodore Y. Ts'o (tytso@rt-11)
613
614 * serial.c (rs_set_termios): Don't wake up processes blocked in
615 open when the CLOCAL flag changes, since a blocking
616 open only samples the CLOCAL flag once when it blocks,
617 and doesn't check it again. (n.b. FreeBSD has a
618 different behavior for blocking opens; it's not clear
619 whether Linux or FreeBSD's interpretation is correct.
620 POSIX doesn't give clear guidance on this issue, so
621 this may change in the future....)
622
623 * serial.c (block_til_ready): Use the correct termios structure to
624 check the CLOCAL flag. If the cuaXX device is active,
625 then check the saved termios for the ttySXX device.
626 Otherwise, use the currently active termios structure.
627
628Sun Nov 6 21:05:44 1994 Theodore Y. Ts'o (tytso@rt-11)
629
630 * serial.c (change_speed): Add support for direct access of
631 57,600 and 115,200 bps.
632
633Wed Nov 2 10:32:36 1994 Theodore Y. Ts'o (tytso@rt-11)
634
635 * n_tty.c (n_tty_receive_room): Only allow excess characters
636 through if we are in ICANON mode *and* there are other no
637 pending lines in the buffer. Otherwise cut and paste over
638 4k breaks.
639
640Sat Oct 29 18:17:34 1994 Theodore Y. Ts'o (tytso@rt-11)
641
642 * serial.c (rs_ioctl, get_lsr_info): Added patch suggested by Arne
643 Riiber so that user mode programs can tell when the
644 transmitter shift register is empty.
645
646Thu Oct 27 23:14:29 1994 Theodore Y. Ts'o (tytso@rt-11)
647
648 * tty_ioctl.c (wait_until_sent): Added debugging printk statements
649 (under the #ifdef TTY_DEBUG_WAIT_UNTIL_SENT)
650
651 * serial.c (rs_interrupt, rs_interrupt_single, receive_chars,
652 change_speed, rs_close): rs_close now disables receiver
653 interrupts when closing the serial port. This allows the
654 serial port to close quickly when Linux and a modem (or a
655 mouse) are engaged in an echo war; when closing the serial
656 port, we now first stop listening to incoming characters,
657 and *then* wait for the transmit buffer to drain.
658
659 In order to make this change, the info->read_status_mask
660 is now used to control what bits of the line status
661 register are looked at in the interrupt routine in all
662 cases; previously it was only used in receive_chars to
663 select a few of the status bits.
664
665Mon Oct 24 23:36:21 1994 Theodore Y. Ts'o (tytso@rt-11)
666
667 * serial.c (rs_close): Add a timeout to the transmitter flush
668 loop; this is just a sanity check in case we have flaky
669 (or non-existent-but-configured-by-the-user) hardware.
670
671Fri Oct 21 09:37:23 1994 Theodore Y. Ts'o (tytso@rt-11)
672
673 * tty_io.c (tty_fasync): When asynchronous I/O is enabled, if the
674 process or process group has not be specified yet, set it
675 to be the tty's process group, or if that is not yet set,
676 to the current process's pid.
677
678Thu Oct 20 23:17:28 1994 Theodore Y. Ts'o (tytso@rt-11)
679
680 * n_tty.c (n_tty_receive_room): If we are doing input
681 canonicalization, let as many characters through as
682 possible, so that the excess characters can be "beeped".
683
684Tue Oct 18 10:02:43 1994 Theodore Y. Ts'o (tytso@rt-11)
685
686 * serial.c (rs_start): Removed an incorrect '!' that was
687 preventing transmit interrupts from being re-enabled in
688 rs_start(). Fortunately in most cases it would be
689 re-enabled elsewhere, but this still should be fixed
690 correctly.
691
692Sun Oct 9 23:46:03 1994 Theodore Y. Ts'o (tytso@rt-11)
693
694 * tty_io.c (do_tty_hangup): If the tty driver flags
695 TTY_DRIVER_RESET_TERMIOS is set, then reset the termios
696 settings back to the driver's initial configuration. This
697 allows the termios settings to be reset even if a process
698 has hung up file descriptors keeping a pty's termios from
699 being freed and reset.
700
701 * tty_io.c (release_dev): Fix memory leak. The pty's other
702 termios structure should also be freed.
703
704 * serial.c (rs_close, shutdown): Change how we wait for the
705 transmitter to completely drain before shutting down the
706 serial port. We now do it by scheduling in another
707 process instead of busy looping with the interrupts turned
708 on. This may eliminate some race condition problems that
709 some people seem to be reporting.
710
711Sun Sep 25 14:18:14 1994 Theodore Y. Ts'o (tytso@rt-11)
712
713 * tty_io.c (release_dev): When freeing a tty make sure that both
714 the tty and the o_tty (if present) aren't a process's
715 controlling tty. (Previously, we only checked the tty.)
716
717 * serial.c (change_speed): Only enable the Modem Status
718 Interrupt for a port if CLOCAL is not set or CRTSCTS
719 is set. If we're not checking the carrier detect and
720 CTS line, there's no point in enabling the modem
721 status interrupt. This will save spurious interrupts
722 from slowing down systems who have terminals that
723 don't support either line. (Of course, if you want
724 only one of CD and CTS support, you will need a
725 properly wired serial cable.)
726
727Thu Sep 22 08:32:48 1994 Theodore Y. Ts'o (tytso@rt-11)
728
729 * tty_io.c (do_SAK): Return if tty is null.
730
731 * tty_io.c (_tty_name): Return "NULL tty" if the passed in tty is
732 NULL.
733
734Sat Sep 17 13:19:25 1994 Theodore Y. Ts'o (tytso@rt-11)
735
736 * tty_ioctl.c (n_tty_ioctl): Fix TIOCGLCKTRMIOS and
737 TIOCSLCKTRMIOS, which were totally broken. Remove
738 extra indirection from argument; it should be a struct
739 termios *, not a struct termios **.
740 &real_tty->termios_locked should have been
741 real_tty->termios_locked. This caused us to be
742 reading and writing the termios_locked structure to
743 random places in kernel memory.
744
745 * tty_io.c (release_dev): Oops! Forgot to delete a critical kfree
746 of the locked_termios. This leaves the locked_termios
747 structure pointed at a freed object.
748
749Fri Sep 16 08:13:25 1994 Theodore Y. Ts'o (tytso@rt-11)
750
751 * tty_io.c (tty_open): Don't check for an exclusive open until
752 after the device specific open routine has been called.
753 Otherwise, the serial device ref counting will be screwed
754 up.
755
756 * serial.c (rs_open, block_til_ready): Don't set termios structure
757 until after block_til_ready has returned successfully.
758 Modify block_til_ready to check the normal_termios
759 structure directly, so it doesn't rely on termios being
760 set before it's called.
761
762Thu Sep 15 23:34:01 1994 Theodore Y. Ts'o (tytso@rt-11)
763
764 * serial.c (rs_close): Turn off interrupts during rs_close() to
765 prevent a race condition with the hangup code (which
766 runs during a software interrupt).
767
768 * tty_io.c (release_dev): Don't free the locked_termios structure;
769 its state must be retained across device opens.
770
771
772 * tty_io.c (tty_unregister_driver): Added function to unregister a
773 tty driver. (For loadable device drivers.)
774
775
diff --git a/drivers/char/agp/Kconfig b/drivers/char/agp/Kconfig
index 2fb3a480f6b0..4b66c69eaf57 100644
--- a/drivers/char/agp/Kconfig
+++ b/drivers/char/agp/Kconfig
@@ -57,7 +57,7 @@ config AGP_AMD
57 57
58config AGP_AMD64 58config AGP_AMD64
59 tristate "AMD Opteron/Athlon64 on-CPU GART support" 59 tristate "AMD Opteron/Athlon64 on-CPU GART support"
60 depends on AGP && X86 60 depends on AGP && X86 && K8_NB
61 help 61 help
62 This option gives you AGP support for the GLX component of 62 This option gives you AGP support for the GLX component of
63 X using the on-CPU northbridge of the AMD Athlon64/Opteron CPUs. 63 X using the on-CPU northbridge of the AMD Athlon64/Opteron CPUs.
diff --git a/drivers/char/agp/intel-agp.c b/drivers/char/agp/intel-agp.c
index 919a28558d36..a3e10dc7cc25 100644
--- a/drivers/char/agp/intel-agp.c
+++ b/drivers/char/agp/intel-agp.c
@@ -298,7 +298,7 @@ static void intel_agp_insert_sg_entries(struct agp_memory *mem,
298 j++; 298 j++;
299 } 299 }
300 } else { 300 } else {
301 /* sg may merge pages, but we have to seperate 301 /* sg may merge pages, but we have to separate
302 * per-page addr for GTT */ 302 * per-page addr for GTT */
303 unsigned int len, m; 303 unsigned int len, m;
304 304
diff --git a/drivers/char/applicom.c b/drivers/char/applicom.c
index fe2cb2f5db17..a7424bf7eacf 100644
--- a/drivers/char/applicom.c
+++ b/drivers/char/applicom.c
@@ -14,7 +14,7 @@
14/* et passe en argument a acinit, mais est scrute sur le bus pour s'adapter */ 14/* et passe en argument a acinit, mais est scrute sur le bus pour s'adapter */
15/* au nombre de cartes presentes sur le bus. IOCL code 6 affichait V2.4.3 */ 15/* au nombre de cartes presentes sur le bus. IOCL code 6 affichait V2.4.3 */
16/* F.LAFORSE 28/11/95 creation de fichiers acXX.o avec les differentes */ 16/* F.LAFORSE 28/11/95 creation de fichiers acXX.o avec les differentes */
17/* adresses de base des cartes, IOCTL 6 plus complet */ 17/* addresses de base des cartes, IOCTL 6 plus complet */
18/* J.PAGET le 19/08/96 copie de la version V2.6 en V2.8.0 sans modification */ 18/* J.PAGET le 19/08/96 copie de la version V2.6 en V2.8.0 sans modification */
19/* de code autre que le texte V2.6.1 en V2.8.0 */ 19/* de code autre que le texte V2.6.1 en V2.8.0 */
20/*****************************************************************************/ 20/*****************************************************************************/
diff --git a/drivers/char/hvc_iseries.c b/drivers/char/hvc_iseries.c
index fd0242676a2a..21c54955084e 100644
--- a/drivers/char/hvc_iseries.c
+++ b/drivers/char/hvc_iseries.c
@@ -353,7 +353,7 @@ static void hvc_close_event(struct HvLpEvent *event)
353 353
354 if (!hvlpevent_is_int(event)) { 354 if (!hvlpevent_is_int(event)) {
355 printk(KERN_WARNING 355 printk(KERN_WARNING
356 "hvc: got unexpected close acknowlegement\n"); 356 "hvc: got unexpected close acknowledgement\n");
357 return; 357 return;
358 } 358 }
359 359
diff --git a/drivers/char/hvc_iucv.c b/drivers/char/hvc_iucv.c
index 21681a81cc35..37b0542a4eeb 100644
--- a/drivers/char/hvc_iucv.c
+++ b/drivers/char/hvc_iucv.c
@@ -139,6 +139,8 @@ struct hvc_iucv_private *hvc_iucv_get_private(uint32_t num)
139 * 139 *
140 * This function allocates a new struct iucv_tty_buffer element and, optionally, 140 * This function allocates a new struct iucv_tty_buffer element and, optionally,
141 * allocates an internal data buffer with the specified size @size. 141 * allocates an internal data buffer with the specified size @size.
142 * The internal data buffer is always allocated with GFP_DMA which is
143 * required for receiving and sending data with IUCV.
142 * Note: The total message size arises from the internal buffer size and the 144 * Note: The total message size arises from the internal buffer size and the
143 * members of the iucv_tty_msg structure. 145 * members of the iucv_tty_msg structure.
144 * The function returns NULL if memory allocation has failed. 146 * The function returns NULL if memory allocation has failed.
@@ -154,7 +156,7 @@ static struct iucv_tty_buffer *alloc_tty_buffer(size_t size, gfp_t flags)
154 156
155 if (size > 0) { 157 if (size > 0) {
156 bufp->msg.length = MSG_SIZE(size); 158 bufp->msg.length = MSG_SIZE(size);
157 bufp->mbuf = kmalloc(bufp->msg.length, flags); 159 bufp->mbuf = kmalloc(bufp->msg.length, flags | GFP_DMA);
158 if (!bufp->mbuf) { 160 if (!bufp->mbuf) {
159 mempool_free(bufp, hvc_iucv_mempool); 161 mempool_free(bufp, hvc_iucv_mempool);
160 return NULL; 162 return NULL;
@@ -237,7 +239,7 @@ static int hvc_iucv_write(struct hvc_iucv_private *priv,
237 if (!rb->mbuf) { /* message not yet received ... */ 239 if (!rb->mbuf) { /* message not yet received ... */
238 /* allocate mem to store msg data; if no memory is available 240 /* allocate mem to store msg data; if no memory is available
239 * then leave the buffer on the list and re-try later */ 241 * then leave the buffer on the list and re-try later */
240 rb->mbuf = kmalloc(rb->msg.length, GFP_ATOMIC); 242 rb->mbuf = kmalloc(rb->msg.length, GFP_ATOMIC | GFP_DMA);
241 if (!rb->mbuf) 243 if (!rb->mbuf)
242 return -ENOMEM; 244 return -ENOMEM;
243 245
diff --git a/drivers/char/hw_random/n2-drv.c b/drivers/char/hw_random/n2-drv.c
index 9b3e09cd41f9..10f868eefaa6 100644
--- a/drivers/char/hw_random/n2-drv.c
+++ b/drivers/char/hw_random/n2-drv.c
@@ -71,7 +71,7 @@ MODULE_VERSION(DRV_MODULE_VERSION);
71 * x22 + x21 + x17 + x15 + x13 + x12 + x11 + x7 + x5 + x + 1 71 * x22 + x21 + x17 + x15 + x13 + x12 + x11 + x7 + x5 + x + 1
72 * 72 *
73 * The RNG_CTL_VCO value of each noise cell must be programmed 73 * The RNG_CTL_VCO value of each noise cell must be programmed
74 * seperately. This is why 4 control register values must be provided 74 * separately. This is why 4 control register values must be provided
75 * to the hypervisor. During a write, the hypervisor writes them all, 75 * to the hypervisor. During a write, the hypervisor writes them all,
76 * one at a time, to the actual RNG_CTL register. The first three 76 * one at a time, to the actual RNG_CTL register. The first three
77 * values are used to setup the desired RNG_CTL_VCO for each entropy 77 * values are used to setup the desired RNG_CTL_VCO for each entropy
diff --git a/drivers/char/ip2/i2hw.h b/drivers/char/ip2/i2hw.h
index 8aa6e7ab8d5b..c0ba6c05f0cd 100644
--- a/drivers/char/ip2/i2hw.h
+++ b/drivers/char/ip2/i2hw.h
@@ -559,7 +559,7 @@ Loadware may be sent to the board in two ways:
559 559
5602) It may be hard-coded into your source by including a .h file (typically 5602) It may be hard-coded into your source by including a .h file (typically
561 supplied by Computone), which declares a data array and initializes every 561 supplied by Computone), which declares a data array and initializes every
562 element. This acheives the same result as if an entire loadware file had 562 element. This achieves the same result as if an entire loadware file had
563 been read into the array. 563 been read into the array.
564 564
565 This requires more data space in your program, but access to the file system 565 This requires more data space in your program, but access to the file system
diff --git a/drivers/char/ipmi/ipmi_si_intf.c b/drivers/char/ipmi/ipmi_si_intf.c
index 176f1751237f..4462b113ba3f 100644
--- a/drivers/char/ipmi/ipmi_si_intf.c
+++ b/drivers/char/ipmi/ipmi_si_intf.c
@@ -295,6 +295,9 @@ struct smi_info {
295static int force_kipmid[SI_MAX_PARMS]; 295static int force_kipmid[SI_MAX_PARMS];
296static int num_force_kipmid; 296static int num_force_kipmid;
297 297
298static unsigned int kipmid_max_busy_us[SI_MAX_PARMS];
299static int num_max_busy_us;
300
298static int unload_when_empty = 1; 301static int unload_when_empty = 1;
299 302
300static int try_smi_init(struct smi_info *smi); 303static int try_smi_init(struct smi_info *smi);
@@ -925,23 +928,77 @@ static void set_run_to_completion(void *send_info, int i_run_to_completion)
925 } 928 }
926} 929}
927 930
931/*
932 * Use -1 in the nsec value of the busy waiting timespec to tell that
933 * we are spinning in kipmid looking for something and not delaying
934 * between checks
935 */
936static inline void ipmi_si_set_not_busy(struct timespec *ts)
937{
938 ts->tv_nsec = -1;
939}
940static inline int ipmi_si_is_busy(struct timespec *ts)
941{
942 return ts->tv_nsec != -1;
943}
944
945static int ipmi_thread_busy_wait(enum si_sm_result smi_result,
946 const struct smi_info *smi_info,
947 struct timespec *busy_until)
948{
949 unsigned int max_busy_us = 0;
950
951 if (smi_info->intf_num < num_max_busy_us)
952 max_busy_us = kipmid_max_busy_us[smi_info->intf_num];
953 if (max_busy_us == 0 || smi_result != SI_SM_CALL_WITH_DELAY)
954 ipmi_si_set_not_busy(busy_until);
955 else if (!ipmi_si_is_busy(busy_until)) {
956 getnstimeofday(busy_until);
957 timespec_add_ns(busy_until, max_busy_us*NSEC_PER_USEC);
958 } else {
959 struct timespec now;
960 getnstimeofday(&now);
961 if (unlikely(timespec_compare(&now, busy_until) > 0)) {
962 ipmi_si_set_not_busy(busy_until);
963 return 0;
964 }
965 }
966 return 1;
967}
968
969
970/*
971 * A busy-waiting loop for speeding up IPMI operation.
972 *
973 * Lousy hardware makes this hard. This is only enabled for systems
974 * that are not BT and do not have interrupts. It starts spinning
975 * when an operation is complete or until max_busy tells it to stop
976 * (if that is enabled). See the paragraph on kimid_max_busy_us in
977 * Documentation/IPMI.txt for details.
978 */
928static int ipmi_thread(void *data) 979static int ipmi_thread(void *data)
929{ 980{
930 struct smi_info *smi_info = data; 981 struct smi_info *smi_info = data;
931 unsigned long flags; 982 unsigned long flags;
932 enum si_sm_result smi_result; 983 enum si_sm_result smi_result;
984 struct timespec busy_until;
933 985
986 ipmi_si_set_not_busy(&busy_until);
934 set_user_nice(current, 19); 987 set_user_nice(current, 19);
935 while (!kthread_should_stop()) { 988 while (!kthread_should_stop()) {
989 int busy_wait;
990
936 spin_lock_irqsave(&(smi_info->si_lock), flags); 991 spin_lock_irqsave(&(smi_info->si_lock), flags);
937 smi_result = smi_event_handler(smi_info, 0); 992 smi_result = smi_event_handler(smi_info, 0);
938 spin_unlock_irqrestore(&(smi_info->si_lock), flags); 993 spin_unlock_irqrestore(&(smi_info->si_lock), flags);
994 busy_wait = ipmi_thread_busy_wait(smi_result, smi_info,
995 &busy_until);
939 if (smi_result == SI_SM_CALL_WITHOUT_DELAY) 996 if (smi_result == SI_SM_CALL_WITHOUT_DELAY)
940 ; /* do nothing */ 997 ; /* do nothing */
941 else if (smi_result == SI_SM_CALL_WITH_DELAY) 998 else if (smi_result == SI_SM_CALL_WITH_DELAY && busy_wait)
942 schedule(); 999 schedule();
943 else 1000 else
944 schedule_timeout_interruptible(1); 1001 schedule_timeout_interruptible(0);
945 } 1002 }
946 return 0; 1003 return 0;
947} 1004}
@@ -1144,7 +1201,7 @@ static int regsizes[SI_MAX_PARMS];
1144static unsigned int num_regsizes; 1201static unsigned int num_regsizes;
1145static int regshifts[SI_MAX_PARMS]; 1202static int regshifts[SI_MAX_PARMS];
1146static unsigned int num_regshifts; 1203static unsigned int num_regshifts;
1147static int slave_addrs[SI_MAX_PARMS]; 1204static int slave_addrs[SI_MAX_PARMS]; /* Leaving 0 chooses the default value */
1148static unsigned int num_slave_addrs; 1205static unsigned int num_slave_addrs;
1149 1206
1150#define IPMI_IO_ADDR_SPACE 0 1207#define IPMI_IO_ADDR_SPACE 0
@@ -1212,6 +1269,11 @@ module_param(unload_when_empty, int, 0);
1212MODULE_PARM_DESC(unload_when_empty, "Unload the module if no interfaces are" 1269MODULE_PARM_DESC(unload_when_empty, "Unload the module if no interfaces are"
1213 " specified or found, default is 1. Setting to 0" 1270 " specified or found, default is 1. Setting to 0"
1214 " is useful for hot add of devices using hotmod."); 1271 " is useful for hot add of devices using hotmod.");
1272module_param_array(kipmid_max_busy_us, uint, &num_max_busy_us, 0644);
1273MODULE_PARM_DESC(kipmid_max_busy_us,
1274 "Max time (in microseconds) to busy-wait for IPMI data before"
1275 " sleeping. 0 (default) means to wait forever. Set to 100-500"
1276 " if kipmid is using up a lot of CPU time.");
1215 1277
1216 1278
1217static void std_irq_cleanup(struct smi_info *info) 1279static void std_irq_cleanup(struct smi_info *info)
@@ -1607,7 +1669,7 @@ static int hotmod_handler(const char *val, struct kernel_param *kp)
1607 regsize = 1; 1669 regsize = 1;
1608 regshift = 0; 1670 regshift = 0;
1609 irq = 0; 1671 irq = 0;
1610 ipmb = 0x20; 1672 ipmb = 0; /* Choose the default if not specified */
1611 1673
1612 next = strchr(curr, ':'); 1674 next = strchr(curr, ':');
1613 if (next) { 1675 if (next) {
@@ -1799,6 +1861,7 @@ static __devinit void hardcode_find_bmc(void)
1799 info->irq = irqs[i]; 1861 info->irq = irqs[i];
1800 if (info->irq) 1862 if (info->irq)
1801 info->irq_setup = std_irq_setup; 1863 info->irq_setup = std_irq_setup;
1864 info->slave_addr = slave_addrs[i];
1802 1865
1803 try_smi_init(info); 1866 try_smi_init(info);
1804 } 1867 }
diff --git a/drivers/char/mem.c b/drivers/char/mem.c
index 48788db4e280..1f3215ac085b 100644
--- a/drivers/char/mem.c
+++ b/drivers/char/mem.c
@@ -3,7 +3,7 @@
3 * 3 *
4 * Copyright (C) 1991, 1992 Linus Torvalds 4 * Copyright (C) 1991, 1992 Linus Torvalds
5 * 5 *
6 * Added devfs support. 6 * Added devfs support.
7 * Jan-11-1998, C. Scott Ananian <cananian@alumni.princeton.edu> 7 * Jan-11-1998, C. Scott Ananian <cananian@alumni.princeton.edu>
8 * Shared /dev/zero mmapping support, Feb 2000, Kanoj Sarcar <kanoj@sgi.com> 8 * Shared /dev/zero mmapping support, Feb 2000, Kanoj Sarcar <kanoj@sgi.com>
9 */ 9 */
@@ -44,36 +44,6 @@ static inline unsigned long size_inside_page(unsigned long start,
44 return min(sz, size); 44 return min(sz, size);
45} 45}
46 46
47/*
48 * Architectures vary in how they handle caching for addresses
49 * outside of main memory.
50 *
51 */
52static inline int uncached_access(struct file *file, unsigned long addr)
53{
54#if defined(CONFIG_IA64)
55 /*
56 * On ia64, we ignore O_DSYNC because we cannot tolerate memory attribute aliases.
57 */
58 return !(efi_mem_attributes(addr) & EFI_MEMORY_WB);
59#elif defined(CONFIG_MIPS)
60 {
61 extern int __uncached_access(struct file *file,
62 unsigned long addr);
63
64 return __uncached_access(file, addr);
65 }
66#else
67 /*
68 * Accessing memory above the top the kernel knows about or through a file pointer
69 * that was marked O_DSYNC will be done non-cached.
70 */
71 if (file->f_flags & O_DSYNC)
72 return 1;
73 return addr >= __pa(high_memory);
74#endif
75}
76
77#ifndef ARCH_HAS_VALID_PHYS_ADDR_RANGE 47#ifndef ARCH_HAS_VALID_PHYS_ADDR_RANGE
78static inline int valid_phys_addr_range(unsigned long addr, size_t count) 48static inline int valid_phys_addr_range(unsigned long addr, size_t count)
79{ 49{
@@ -115,15 +85,15 @@ static inline int range_is_allowed(unsigned long pfn, unsigned long size)
115} 85}
116#endif 86#endif
117 87
118void __attribute__((weak)) unxlate_dev_mem_ptr(unsigned long phys, void *addr) 88void __weak unxlate_dev_mem_ptr(unsigned long phys, void *addr)
119{ 89{
120} 90}
121 91
122/* 92/*
123 * This funcion reads the *physical* memory. The f_pos points directly to the 93 * This funcion reads the *physical* memory. The f_pos points directly to the
124 * memory location. 94 * memory location.
125 */ 95 */
126static ssize_t read_mem(struct file * file, char __user * buf, 96static ssize_t read_mem(struct file *file, char __user *buf,
127 size_t count, loff_t *ppos) 97 size_t count, loff_t *ppos)
128{ 98{
129 unsigned long p = *ppos; 99 unsigned long p = *ppos;
@@ -140,10 +110,10 @@ static ssize_t read_mem(struct file * file, char __user * buf,
140 if (sz > 0) { 110 if (sz > 0) {
141 if (clear_user(buf, sz)) 111 if (clear_user(buf, sz))
142 return -EFAULT; 112 return -EFAULT;
143 buf += sz; 113 buf += sz;
144 p += sz; 114 p += sz;
145 count -= sz; 115 count -= sz;
146 read += sz; 116 read += sz;
147 } 117 }
148 } 118 }
149#endif 119#endif
@@ -157,9 +127,9 @@ static ssize_t read_mem(struct file * file, char __user * buf,
157 return -EPERM; 127 return -EPERM;
158 128
159 /* 129 /*
160 * On ia64 if a page has been mapped somewhere as 130 * On ia64 if a page has been mapped somewhere as uncached, then
161 * uncached, then it must also be accessed uncached 131 * it must also be accessed uncached by the kernel or data
162 * by the kernel or data corruption may occur 132 * corruption may occur.
163 */ 133 */
164 ptr = xlate_dev_mem_ptr(p); 134 ptr = xlate_dev_mem_ptr(p);
165 if (!ptr) 135 if (!ptr)
@@ -180,7 +150,7 @@ static ssize_t read_mem(struct file * file, char __user * buf,
180 return read; 150 return read;
181} 151}
182 152
183static ssize_t write_mem(struct file * file, const char __user * buf, 153static ssize_t write_mem(struct file *file, const char __user *buf,
184 size_t count, loff_t *ppos) 154 size_t count, loff_t *ppos)
185{ 155{
186 unsigned long p = *ppos; 156 unsigned long p = *ppos;
@@ -212,9 +182,9 @@ static ssize_t write_mem(struct file * file, const char __user * buf,
212 return -EPERM; 182 return -EPERM;
213 183
214 /* 184 /*
215 * On ia64 if a page has been mapped somewhere as 185 * On ia64 if a page has been mapped somewhere as uncached, then
216 * uncached, then it must also be accessed uncached 186 * it must also be accessed uncached by the kernel or data
217 * by the kernel or data corruption may occur 187 * corruption may occur.
218 */ 188 */
219 ptr = xlate_dev_mem_ptr(p); 189 ptr = xlate_dev_mem_ptr(p);
220 if (!ptr) { 190 if (!ptr) {
@@ -242,13 +212,46 @@ static ssize_t write_mem(struct file * file, const char __user * buf,
242 return written; 212 return written;
243} 213}
244 214
245int __attribute__((weak)) phys_mem_access_prot_allowed(struct file *file, 215int __weak phys_mem_access_prot_allowed(struct file *file,
246 unsigned long pfn, unsigned long size, pgprot_t *vma_prot) 216 unsigned long pfn, unsigned long size, pgprot_t *vma_prot)
247{ 217{
248 return 1; 218 return 1;
249} 219}
250 220
251#ifndef __HAVE_PHYS_MEM_ACCESS_PROT 221#ifndef __HAVE_PHYS_MEM_ACCESS_PROT
222
223/*
224 * Architectures vary in how they handle caching for addresses
225 * outside of main memory.
226 *
227 */
228static int uncached_access(struct file *file, unsigned long addr)
229{
230#if defined(CONFIG_IA64)
231 /*
232 * On ia64, we ignore O_DSYNC because we cannot tolerate memory
233 * attribute aliases.
234 */
235 return !(efi_mem_attributes(addr) & EFI_MEMORY_WB);
236#elif defined(CONFIG_MIPS)
237 {
238 extern int __uncached_access(struct file *file,
239 unsigned long addr);
240
241 return __uncached_access(file, addr);
242 }
243#else
244 /*
245 * Accessing memory above the top the kernel knows about or through a
246 * file pointer
247 * that was marked O_DSYNC will be done non-cached.
248 */
249 if (file->f_flags & O_DSYNC)
250 return 1;
251 return addr >= __pa(high_memory);
252#endif
253}
254
252static pgprot_t phys_mem_access_prot(struct file *file, unsigned long pfn, 255static pgprot_t phys_mem_access_prot(struct file *file, unsigned long pfn,
253 unsigned long size, pgprot_t vma_prot) 256 unsigned long size, pgprot_t vma_prot)
254{ 257{
@@ -294,7 +297,7 @@ static const struct vm_operations_struct mmap_mem_ops = {
294#endif 297#endif
295}; 298};
296 299
297static int mmap_mem(struct file * file, struct vm_area_struct * vma) 300static int mmap_mem(struct file *file, struct vm_area_struct *vma)
298{ 301{
299 size_t size = vma->vm_end - vma->vm_start; 302 size_t size = vma->vm_end - vma->vm_start;
300 303
@@ -329,7 +332,7 @@ static int mmap_mem(struct file * file, struct vm_area_struct * vma)
329} 332}
330 333
331#ifdef CONFIG_DEVKMEM 334#ifdef CONFIG_DEVKMEM
332static int mmap_kmem(struct file * file, struct vm_area_struct * vma) 335static int mmap_kmem(struct file *file, struct vm_area_struct *vma)
333{ 336{
334 unsigned long pfn; 337 unsigned long pfn;
335 338
@@ -337,9 +340,9 @@ static int mmap_kmem(struct file * file, struct vm_area_struct * vma)
337 pfn = __pa((u64)vma->vm_pgoff << PAGE_SHIFT) >> PAGE_SHIFT; 340 pfn = __pa((u64)vma->vm_pgoff << PAGE_SHIFT) >> PAGE_SHIFT;
338 341
339 /* 342 /*
340 * RED-PEN: on some architectures there is more mapped memory 343 * RED-PEN: on some architectures there is more mapped memory than
341 * than available in mem_map which pfn_valid checks 344 * available in mem_map which pfn_valid checks for. Perhaps should add a
342 * for. Perhaps should add a new macro here. 345 * new macro here.
343 * 346 *
344 * RED-PEN: vmalloc is not supported right now. 347 * RED-PEN: vmalloc is not supported right now.
345 */ 348 */
@@ -389,7 +392,7 @@ static ssize_t read_oldmem(struct file *file, char __user *buf,
389/* 392/*
390 * This function reads the *virtual* memory as seen by the kernel. 393 * This function reads the *virtual* memory as seen by the kernel.
391 */ 394 */
392static ssize_t read_kmem(struct file *file, char __user *buf, 395static ssize_t read_kmem(struct file *file, char __user *buf,
393 size_t count, loff_t *ppos) 396 size_t count, loff_t *ppos)
394{ 397{
395 unsigned long p = *ppos; 398 unsigned long p = *ppos;
@@ -400,8 +403,8 @@ static ssize_t read_kmem(struct file *file, char __user *buf,
400 read = 0; 403 read = 0;
401 if (p < (unsigned long) high_memory) { 404 if (p < (unsigned long) high_memory) {
402 low_count = count; 405 low_count = count;
403 if (count > (unsigned long) high_memory - p) 406 if (count > (unsigned long)high_memory - p)
404 low_count = (unsigned long) high_memory - p; 407 low_count = (unsigned long)high_memory - p;
405 408
406#ifdef __ARCH_HAS_NO_PAGE_ZERO_MAPPED 409#ifdef __ARCH_HAS_NO_PAGE_ZERO_MAPPED
407 /* we don't have page 0 mapped on sparc and m68k.. */ 410 /* we don't have page 0 mapped on sparc and m68k.. */
@@ -465,9 +468,8 @@ static ssize_t read_kmem(struct file *file, char __user *buf,
465} 468}
466 469
467 470
468static inline ssize_t 471static ssize_t do_write_kmem(unsigned long p, const char __user *buf,
469do_write_kmem(unsigned long p, const char __user *buf, 472 size_t count, loff_t *ppos)
470 size_t count, loff_t *ppos)
471{ 473{
472 ssize_t written, sz; 474 ssize_t written, sz;
473 unsigned long copied; 475 unsigned long copied;
@@ -491,9 +493,9 @@ do_write_kmem(unsigned long p, const char __user *buf,
491 sz = size_inside_page(p, count); 493 sz = size_inside_page(p, count);
492 494
493 /* 495 /*
494 * On ia64 if a page has been mapped somewhere as 496 * On ia64 if a page has been mapped somewhere as uncached, then
495 * uncached, then it must also be accessed uncached 497 * it must also be accessed uncached by the kernel or data
496 * by the kernel or data corruption may occur 498 * corruption may occur.
497 */ 499 */
498 ptr = xlate_dev_kmem_ptr((char *)p); 500 ptr = xlate_dev_kmem_ptr((char *)p);
499 501
@@ -514,11 +516,10 @@ do_write_kmem(unsigned long p, const char __user *buf,
514 return written; 516 return written;
515} 517}
516 518
517
518/* 519/*
519 * This function writes to the *virtual* memory as seen by the kernel. 520 * This function writes to the *virtual* memory as seen by the kernel.
520 */ 521 */
521static ssize_t write_kmem(struct file * file, const char __user * buf, 522static ssize_t write_kmem(struct file *file, const char __user *buf,
522 size_t count, loff_t *ppos) 523 size_t count, loff_t *ppos)
523{ 524{
524 unsigned long p = *ppos; 525 unsigned long p = *ppos;
@@ -570,17 +571,17 @@ static ssize_t write_kmem(struct file * file, const char __user * buf,
570#endif 571#endif
571 572
572#ifdef CONFIG_DEVPORT 573#ifdef CONFIG_DEVPORT
573static ssize_t read_port(struct file * file, char __user * buf, 574static ssize_t read_port(struct file *file, char __user *buf,
574 size_t count, loff_t *ppos) 575 size_t count, loff_t *ppos)
575{ 576{
576 unsigned long i = *ppos; 577 unsigned long i = *ppos;
577 char __user *tmp = buf; 578 char __user *tmp = buf;
578 579
579 if (!access_ok(VERIFY_WRITE, buf, count)) 580 if (!access_ok(VERIFY_WRITE, buf, count))
580 return -EFAULT; 581 return -EFAULT;
581 while (count-- > 0 && i < 65536) { 582 while (count-- > 0 && i < 65536) {
582 if (__put_user(inb(i),tmp) < 0) 583 if (__put_user(inb(i), tmp) < 0)
583 return -EFAULT; 584 return -EFAULT;
584 i++; 585 i++;
585 tmp++; 586 tmp++;
586 } 587 }
@@ -588,22 +589,22 @@ static ssize_t read_port(struct file * file, char __user * buf,
588 return tmp-buf; 589 return tmp-buf;
589} 590}
590 591
591static ssize_t write_port(struct file * file, const char __user * buf, 592static ssize_t write_port(struct file *file, const char __user *buf,
592 size_t count, loff_t *ppos) 593 size_t count, loff_t *ppos)
593{ 594{
594 unsigned long i = *ppos; 595 unsigned long i = *ppos;
595 const char __user * tmp = buf; 596 const char __user * tmp = buf;
596 597
597 if (!access_ok(VERIFY_READ,buf,count)) 598 if (!access_ok(VERIFY_READ, buf, count))
598 return -EFAULT; 599 return -EFAULT;
599 while (count-- > 0 && i < 65536) { 600 while (count-- > 0 && i < 65536) {
600 char c; 601 char c;
601 if (__get_user(c, tmp)) { 602 if (__get_user(c, tmp)) {
602 if (tmp > buf) 603 if (tmp > buf)
603 break; 604 break;
604 return -EFAULT; 605 return -EFAULT;
605 } 606 }
606 outb(c,i); 607 outb(c, i);
607 i++; 608 i++;
608 tmp++; 609 tmp++;
609 } 610 }
@@ -612,13 +613,13 @@ static ssize_t write_port(struct file * file, const char __user * buf,
612} 613}
613#endif 614#endif
614 615
615static ssize_t read_null(struct file * file, char __user * buf, 616static ssize_t read_null(struct file *file, char __user *buf,
616 size_t count, loff_t *ppos) 617 size_t count, loff_t *ppos)
617{ 618{
618 return 0; 619 return 0;
619} 620}
620 621
621static ssize_t write_null(struct file * file, const char __user * buf, 622static ssize_t write_null(struct file *file, const char __user *buf,
622 size_t count, loff_t *ppos) 623 size_t count, loff_t *ppos)
623{ 624{
624 return count; 625 return count;
@@ -630,13 +631,13 @@ static int pipe_to_null(struct pipe_inode_info *info, struct pipe_buffer *buf,
630 return sd->len; 631 return sd->len;
631} 632}
632 633
633static ssize_t splice_write_null(struct pipe_inode_info *pipe,struct file *out, 634static ssize_t splice_write_null(struct pipe_inode_info *pipe, struct file *out,
634 loff_t *ppos, size_t len, unsigned int flags) 635 loff_t *ppos, size_t len, unsigned int flags)
635{ 636{
636 return splice_from_pipe(pipe, out, ppos, len, flags, pipe_to_null); 637 return splice_from_pipe(pipe, out, ppos, len, flags, pipe_to_null);
637} 638}
638 639
639static ssize_t read_zero(struct file * file, char __user * buf, 640static ssize_t read_zero(struct file *file, char __user *buf,
640 size_t count, loff_t *ppos) 641 size_t count, loff_t *ppos)
641{ 642{
642 size_t written; 643 size_t written;
@@ -667,7 +668,7 @@ static ssize_t read_zero(struct file * file, char __user * buf,
667 return written ? written : -EFAULT; 668 return written ? written : -EFAULT;
668} 669}
669 670
670static int mmap_zero(struct file * file, struct vm_area_struct * vma) 671static int mmap_zero(struct file *file, struct vm_area_struct *vma)
671{ 672{
672#ifndef CONFIG_MMU 673#ifndef CONFIG_MMU
673 return -ENOSYS; 674 return -ENOSYS;
@@ -677,7 +678,7 @@ static int mmap_zero(struct file * file, struct vm_area_struct * vma)
677 return 0; 678 return 0;
678} 679}
679 680
680static ssize_t write_full(struct file * file, const char __user * buf, 681static ssize_t write_full(struct file *file, const char __user *buf,
681 size_t count, loff_t *ppos) 682 size_t count, loff_t *ppos)
682{ 683{
683 return -ENOSPC; 684 return -ENOSPC;
@@ -688,8 +689,7 @@ static ssize_t write_full(struct file * file, const char __user * buf,
688 * can fopen() both devices with "a" now. This was previously impossible. 689 * can fopen() both devices with "a" now. This was previously impossible.
689 * -- SRB. 690 * -- SRB.
690 */ 691 */
691 692static loff_t null_lseek(struct file *file, loff_t offset, int orig)
692static loff_t null_lseek(struct file * file, loff_t offset, int orig)
693{ 693{
694 return file->f_pos = 0; 694 return file->f_pos = 0;
695} 695}
@@ -702,24 +702,31 @@ static loff_t null_lseek(struct file * file, loff_t offset, int orig)
702 * also note that seeking relative to the "end of file" isn't supported: 702 * also note that seeking relative to the "end of file" isn't supported:
703 * it has no meaning, so it returns -EINVAL. 703 * it has no meaning, so it returns -EINVAL.
704 */ 704 */
705static loff_t memory_lseek(struct file * file, loff_t offset, int orig) 705static loff_t memory_lseek(struct file *file, loff_t offset, int orig)
706{ 706{
707 loff_t ret; 707 loff_t ret;
708 708
709 mutex_lock(&file->f_path.dentry->d_inode->i_mutex); 709 mutex_lock(&file->f_path.dentry->d_inode->i_mutex);
710 switch (orig) { 710 switch (orig) {
711 case 0: 711 case SEEK_CUR:
712 file->f_pos = offset; 712 offset += file->f_pos;
713 ret = file->f_pos; 713 if ((unsigned long long)offset <
714 force_successful_syscall_return(); 714 (unsigned long long)file->f_pos) {
715 ret = -EOVERFLOW;
715 break; 716 break;
716 case 1: 717 }
717 file->f_pos += offset; 718 case SEEK_SET:
718 ret = file->f_pos; 719 /* to avoid userland mistaking f_pos=-9 as -EBADF=-9 */
719 force_successful_syscall_return(); 720 if ((unsigned long long)offset >= ~0xFFFULL) {
721 ret = -EOVERFLOW;
720 break; 722 break;
721 default: 723 }
722 ret = -EINVAL; 724 file->f_pos = offset;
725 ret = file->f_pos;
726 force_successful_syscall_return();
727 break;
728 default:
729 ret = -EINVAL;
723 } 730 }
724 mutex_unlock(&file->f_path.dentry->d_inode->i_mutex); 731 mutex_unlock(&file->f_path.dentry->d_inode->i_mutex);
725 return ret; 732 return ret;
@@ -803,7 +810,7 @@ static const struct file_operations oldmem_fops = {
803}; 810};
804#endif 811#endif
805 812
806static ssize_t kmsg_write(struct file * file, const char __user * buf, 813static ssize_t kmsg_write(struct file *file, const char __user *buf,
807 size_t count, loff_t *ppos) 814 size_t count, loff_t *ppos)
808{ 815{
809 char *tmp; 816 char *tmp;
@@ -825,7 +832,7 @@ static ssize_t kmsg_write(struct file * file, const char __user * buf,
825} 832}
826 833
827static const struct file_operations kmsg_fops = { 834static const struct file_operations kmsg_fops = {
828 .write = kmsg_write, 835 .write = kmsg_write,
829}; 836};
830 837
831static const struct memdev { 838static const struct memdev {
@@ -876,7 +883,7 @@ static int memory_open(struct inode *inode, struct file *filp)
876} 883}
877 884
878static const struct file_operations memory_fops = { 885static const struct file_operations memory_fops = {
879 .open = memory_open, 886 .open = memory_open,
880}; 887};
881 888
882static char *mem_devnode(struct device *dev, mode_t *mode) 889static char *mem_devnode(struct device *dev, mode_t *mode)
@@ -897,7 +904,7 @@ static int __init chr_dev_init(void)
897 if (err) 904 if (err)
898 return err; 905 return err;
899 906
900 if (register_chrdev(MEM_MAJOR,"mem",&memory_fops)) 907 if (register_chrdev(MEM_MAJOR, "mem", &memory_fops))
901 printk("unable to get major %d for memory devs\n", MEM_MAJOR); 908 printk("unable to get major %d for memory devs\n", MEM_MAJOR);
902 909
903 mem_class = class_create(THIS_MODULE, "mem"); 910 mem_class = class_create(THIS_MODULE, "mem");
diff --git a/drivers/char/mmtimer.c b/drivers/char/mmtimer.c
index 918711aa56f3..04fd0d843b3b 100644
--- a/drivers/char/mmtimer.c
+++ b/drivers/char/mmtimer.c
@@ -546,7 +546,7 @@ static void mmtimer_tasklet(unsigned long data)
546{ 546{
547 int nodeid = data; 547 int nodeid = data;
548 struct mmtimer_node *mn = &timers[nodeid]; 548 struct mmtimer_node *mn = &timers[nodeid];
549 struct mmtimer *x = rb_entry(mn->next, struct mmtimer, list); 549 struct mmtimer *x;
550 struct k_itimer *t; 550 struct k_itimer *t;
551 unsigned long flags; 551 unsigned long flags;
552 552
diff --git a/drivers/char/n_tty.c b/drivers/char/n_tty.c
index 2e50f4dfc79c..bdae8327143c 100644
--- a/drivers/char/n_tty.c
+++ b/drivers/char/n_tty.c
@@ -48,6 +48,7 @@
48#include <linux/audit.h> 48#include <linux/audit.h>
49#include <linux/file.h> 49#include <linux/file.h>
50#include <linux/uaccess.h> 50#include <linux/uaccess.h>
51#include <linux/module.h>
51 52
52#include <asm/system.h> 53#include <asm/system.h>
53 54
@@ -2091,3 +2092,19 @@ struct tty_ldisc_ops tty_ldisc_N_TTY = {
2091 .receive_buf = n_tty_receive_buf, 2092 .receive_buf = n_tty_receive_buf,
2092 .write_wakeup = n_tty_write_wakeup 2093 .write_wakeup = n_tty_write_wakeup
2093}; 2094};
2095
2096/**
2097 * n_tty_inherit_ops - inherit N_TTY methods
2098 * @ops: struct tty_ldisc_ops where to save N_TTY methods
2099 *
2100 * Used by a generic struct tty_ldisc_ops to easily inherit N_TTY
2101 * methods.
2102 */
2103
2104void n_tty_inherit_ops(struct tty_ldisc_ops *ops)
2105{
2106 *ops = tty_ldisc_N_TTY;
2107 ops->owner = NULL;
2108 ops->refcount = ops->flags = 0;
2109}
2110EXPORT_SYMBOL_GPL(n_tty_inherit_ops);
diff --git a/drivers/char/pty.c b/drivers/char/pty.c
index 385c44b3034f..5ee424817263 100644
--- a/drivers/char/pty.c
+++ b/drivers/char/pty.c
@@ -220,7 +220,7 @@ static void pty_set_termios(struct tty_struct *tty,
220 * @tty: tty being resized 220 * @tty: tty being resized
221 * @ws: window size being set. 221 * @ws: window size being set.
222 * 222 *
223 * Update the termios variables and send the neccessary signals to 223 * Update the termios variables and send the necessary signals to
224 * peform a terminal resize correctly 224 * peform a terminal resize correctly
225 */ 225 */
226 226
diff --git a/drivers/char/random.c b/drivers/char/random.c
index 2849713d2231..2fd3d39995d5 100644
--- a/drivers/char/random.c
+++ b/drivers/char/random.c
@@ -1191,7 +1191,7 @@ const struct file_operations urandom_fops = {
1191void generate_random_uuid(unsigned char uuid_out[16]) 1191void generate_random_uuid(unsigned char uuid_out[16])
1192{ 1192{
1193 get_random_bytes(uuid_out, 16); 1193 get_random_bytes(uuid_out, 16);
1194 /* Set UUID version to 4 --- truely random generation */ 1194 /* Set UUID version to 4 --- truly random generation */
1195 uuid_out[6] = (uuid_out[6] & 0x0F) | 0x40; 1195 uuid_out[6] = (uuid_out[6] & 0x0F) | 0x40;
1196 /* Set the UUID variant to DCE */ 1196 /* Set the UUID variant to DCE */
1197 uuid_out[8] = (uuid_out[8] & 0x3F) | 0x80; 1197 uuid_out[8] = (uuid_out[8] & 0x3F) | 0x80;
diff --git a/drivers/char/serial167.c b/drivers/char/serial167.c
index 986aa606a6b6..1ec3d5cd748f 100644
--- a/drivers/char/serial167.c
+++ b/drivers/char/serial167.c
@@ -1989,7 +1989,7 @@ void mvme167_serial_console_setup(int cflag)
1989 /* 1989 /*
1990 * Attempt to set up all channels to something reasonable, and 1990 * Attempt to set up all channels to something reasonable, and
1991 * bang out a INIT_CHAN command. We should then be able to limit 1991 * bang out a INIT_CHAN command. We should then be able to limit
1992 * the ammount of fiddling we have to do in normal running. 1992 * the amount of fiddling we have to do in normal running.
1993 */ 1993 */
1994 1994
1995 for (ch = 3; ch >= 0; ch--) { 1995 for (ch = 3; ch >= 0; ch--) {
diff --git a/drivers/char/tty_audit.c b/drivers/char/tty_audit.c
index ac16fbec72d0..283a15bc84e3 100644
--- a/drivers/char/tty_audit.c
+++ b/drivers/char/tty_audit.c
@@ -148,7 +148,6 @@ void tty_audit_fork(struct signal_struct *sig)
148 spin_lock_irq(&current->sighand->siglock); 148 spin_lock_irq(&current->sighand->siglock);
149 sig->audit_tty = current->signal->audit_tty; 149 sig->audit_tty = current->signal->audit_tty;
150 spin_unlock_irq(&current->sighand->siglock); 150 spin_unlock_irq(&current->sighand->siglock);
151 sig->tty_audit_buf = NULL;
152} 151}
153 152
154/** 153/**
diff --git a/drivers/char/tty_io.c b/drivers/char/tty_io.c
index dcb9083ecde0..a42c466f7092 100644
--- a/drivers/char/tty_io.c
+++ b/drivers/char/tty_io.c
@@ -2028,7 +2028,7 @@ static int tiocgwinsz(struct tty_struct *tty, struct winsize __user *arg)
2028 * @rows: rows (character) 2028 * @rows: rows (character)
2029 * @cols: cols (character) 2029 * @cols: cols (character)
2030 * 2030 *
2031 * Update the termios variables and send the neccessary signals to 2031 * Update the termios variables and send the necessary signals to
2032 * peform a terminal resize correctly 2032 * peform a terminal resize correctly
2033 */ 2033 */
2034 2034
diff --git a/drivers/char/vt.c b/drivers/char/vt.c
index 50faa1fb0f06..bd1d1164fec5 100644
--- a/drivers/char/vt.c
+++ b/drivers/char/vt.c
@@ -821,7 +821,7 @@ static inline int resize_screen(struct vc_data *vc, int width, int height,
821 * 821 *
822 * Resize a virtual console, clipping according to the actual constraints. 822 * Resize a virtual console, clipping according to the actual constraints.
823 * If the caller passes a tty structure then update the termios winsize 823 * If the caller passes a tty structure then update the termios winsize
824 * information and perform any neccessary signal handling. 824 * information and perform any necessary signal handling.
825 * 825 *
826 * Caller must hold the console semaphore. Takes the termios mutex and 826 * Caller must hold the console semaphore. Takes the termios mutex and
827 * ctrl_lock of the tty IFF a tty is passed. 827 * ctrl_lock of the tty IFF a tty is passed.
@@ -2119,8 +2119,6 @@ static int do_con_write(struct tty_struct *tty, const unsigned char *buf, int co
2119 uint8_t inverse; 2119 uint8_t inverse;
2120 uint8_t width; 2120 uint8_t width;
2121 u16 himask, charmask; 2121 u16 himask, charmask;
2122 const unsigned char *orig_buf = NULL;
2123 int orig_count;
2124 2122
2125 if (in_interrupt()) 2123 if (in_interrupt())
2126 return count; 2124 return count;
@@ -2142,8 +2140,6 @@ static int do_con_write(struct tty_struct *tty, const unsigned char *buf, int co
2142 release_console_sem(); 2140 release_console_sem();
2143 return 0; 2141 return 0;
2144 } 2142 }
2145 orig_buf = buf;
2146 orig_count = count;
2147 2143
2148 himask = vc->vc_hi_font_mask; 2144 himask = vc->vc_hi_font_mask;
2149 charmask = himask ? 0x1ff : 0xff; 2145 charmask = himask ? 0x1ff : 0xff;