diff options
author | James Morris <jmorris@namei.org> | 2010-03-30 17:39:27 -0400 |
---|---|---|
committer | James Morris <jmorris@namei.org> | 2010-03-30 17:39:27 -0400 |
commit | d25d6fa1a95f465ff1ec4458ca15e30b2c8dffec (patch) | |
tree | 7362b182dedd825fc762ef7706830837e42943af /drivers/char | |
parent | 225a9be24d799aa16d543c31fb09f0c9ed1d9caa (diff) | |
parent | 2eaa9cfdf33b8d7fb7aff27792192e0019ae8fc6 (diff) |
Merge branch 'master' into next
Diffstat (limited to 'drivers/char')
-rw-r--r-- | drivers/char/ChangeLog | 775 | ||||
-rw-r--r-- | drivers/char/agp/Kconfig | 2 | ||||
-rw-r--r-- | drivers/char/agp/intel-agp.c | 153 | ||||
-rw-r--r-- | drivers/char/applicom.c | 2 | ||||
-rw-r--r-- | drivers/char/hpet.c | 4 | ||||
-rw-r--r-- | drivers/char/hvc_console.c | 31 | ||||
-rw-r--r-- | drivers/char/hvc_iseries.c | 2 | ||||
-rw-r--r-- | drivers/char/hvc_iucv.c | 6 | ||||
-rw-r--r-- | drivers/char/hw_random/n2-drv.c | 2 | ||||
-rw-r--r-- | drivers/char/ip2/i2hw.h | 2 | ||||
-rw-r--r-- | drivers/char/ipmi/ipmi_msghandler.c | 10 | ||||
-rw-r--r-- | drivers/char/ipmi/ipmi_si_intf.c | 71 | ||||
-rw-r--r-- | drivers/char/mem.c | 195 | ||||
-rw-r--r-- | drivers/char/mmtimer.c | 2 | ||||
-rw-r--r-- | drivers/char/n_tty.c | 17 | ||||
-rw-r--r-- | drivers/char/pty.c | 2 | ||||
-rw-r--r-- | drivers/char/random.c | 2 | ||||
-rw-r--r-- | drivers/char/serial167.c | 2 | ||||
-rw-r--r-- | drivers/char/tty_audit.c | 1 | ||||
-rw-r--r-- | drivers/char/tty_buffer.c | 4 | ||||
-rw-r--r-- | drivers/char/tty_io.c | 2 | ||||
-rw-r--r-- | drivers/char/tty_port.c | 2 | ||||
-rw-r--r-- | drivers/char/virtio_console.c | 44 | ||||
-rw-r--r-- | drivers/char/vt.c | 6 | ||||
-rw-r--r-- | drivers/char/vt_ioctl.c | 39 |
25 files changed, 425 insertions, 953 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 @@ | |||
1 | 2001-08-11 Tim Waugh <twaugh@redhat.com> | ||
2 | |||
3 | * serial.c (get_pci_port): Deal with awkward Titan cards. | ||
4 | |||
5 | 1998-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 | |||
10 | Thu 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 | |||
18 | Mon 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 | |||
24 | Mon 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 | |||
34 | Sat 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 | |||
68 | Thu 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 | |||
82 | Wed 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 | |||
92 | Thu 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 | |||
99 | Wed 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 | |||
104 | Tue 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 | |||
111 | Sun 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 | |||
121 | Thu 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 | |||
133 | Wed 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 | |||
141 | Wed 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 | |||
151 | Thu 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 | |||
195 | Thu 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 | |||
201 | Fri 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 | |||
214 | Sat 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 | |||
237 | Wed 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 | |||
242 | Sun 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 | |||
285 | Tue 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 | |||
302 | Wed 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 | |||
333 | Tue 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 | |||
348 | Mon 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 | |||
364 | Sun 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 | |||
378 | Sat 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 | |||
383 | Fri 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 | |||
388 | Wed 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 | |||
400 | Tue 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 | |||
411 | Sat 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 | |||
425 | Wed 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 | |||
438 | Tue 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 | |||
460 | Wed 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 | |||
473 | Wed 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 | |||
481 | Sat 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 | |||
488 | Fri 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 | |||
505 | Sun 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 | |||
517 | Sun 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 | |||
526 | Sat 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 | |||
531 | Thu 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 | |||
547 | Thu 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 | |||
553 | Thu 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 | |||
558 | Thu 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 | |||
565 | Wed 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 | |||
576 | Thu 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 | |||
587 | Wed 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 | |||
599 | Tue 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 | |||
606 | Sat 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 | |||
612 | Fri 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 | |||
628 | Sun 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 | |||
633 | Wed 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 | |||
640 | Sat 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 | |||
646 | Thu 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 | |||
665 | Mon 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 | |||
671 | Fri 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 | |||
678 | Thu 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 | |||
684 | Tue 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 | |||
692 | Sun 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 | |||
711 | Sun 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 | |||
727 | Thu 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 | |||
734 | Sat 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 | |||
749 | Fri 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 | |||
762 | Thu 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 | ||
58 | config AGP_AMD64 | 58 | config 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 8a713f1e9653..b78d5c381efe 100644 --- a/drivers/char/agp/intel-agp.c +++ b/drivers/char/agp/intel-agp.c | |||
@@ -11,6 +11,9 @@ | |||
11 | #include <asm/smp.h> | 11 | #include <asm/smp.h> |
12 | #include "agp.h" | 12 | #include "agp.h" |
13 | 13 | ||
14 | int intel_agp_enabled; | ||
15 | EXPORT_SYMBOL(intel_agp_enabled); | ||
16 | |||
14 | /* | 17 | /* |
15 | * If we have Intel graphics, we're not going to have anything other than | 18 | * If we have Intel graphics, we're not going to have anything other than |
16 | * an Intel IOMMU. So make the correct use of the PCI DMA API contingent | 19 | * an Intel IOMMU. So make the correct use of the PCI DMA API contingent |
@@ -65,6 +68,10 @@ | |||
65 | #define PCI_DEVICE_ID_INTEL_IRONLAKE_MA_HB 0x0062 | 68 | #define PCI_DEVICE_ID_INTEL_IRONLAKE_MA_HB 0x0062 |
66 | #define PCI_DEVICE_ID_INTEL_IRONLAKE_MC2_HB 0x006a | 69 | #define PCI_DEVICE_ID_INTEL_IRONLAKE_MC2_HB 0x006a |
67 | #define PCI_DEVICE_ID_INTEL_IRONLAKE_M_IG 0x0046 | 70 | #define PCI_DEVICE_ID_INTEL_IRONLAKE_M_IG 0x0046 |
71 | #define PCI_DEVICE_ID_INTEL_SANDYBRIDGE_HB 0x0100 | ||
72 | #define PCI_DEVICE_ID_INTEL_SANDYBRIDGE_IG 0x0102 | ||
73 | #define PCI_DEVICE_ID_INTEL_SANDYBRIDGE_M_HB 0x0104 | ||
74 | #define PCI_DEVICE_ID_INTEL_SANDYBRIDGE_M_IG 0x0106 | ||
68 | 75 | ||
69 | /* cover 915 and 945 variants */ | 76 | /* cover 915 and 945 variants */ |
70 | #define IS_I915 (agp_bridge->dev->device == PCI_DEVICE_ID_INTEL_E7221_HB || \ | 77 | #define IS_I915 (agp_bridge->dev->device == PCI_DEVICE_ID_INTEL_E7221_HB || \ |
@@ -90,6 +97,9 @@ | |||
90 | #define IS_PINEVIEW (agp_bridge->dev->device == PCI_DEVICE_ID_INTEL_PINEVIEW_M_HB || \ | 97 | #define IS_PINEVIEW (agp_bridge->dev->device == PCI_DEVICE_ID_INTEL_PINEVIEW_M_HB || \ |
91 | agp_bridge->dev->device == PCI_DEVICE_ID_INTEL_PINEVIEW_HB) | 98 | agp_bridge->dev->device == PCI_DEVICE_ID_INTEL_PINEVIEW_HB) |
92 | 99 | ||
100 | #define IS_SNB (agp_bridge->dev->device == PCI_DEVICE_ID_INTEL_SANDYBRIDGE_HB || \ | ||
101 | agp_bridge->dev->device == PCI_DEVICE_ID_INTEL_SANDYBRIDGE_M_HB) | ||
102 | |||
93 | #define IS_G4X (agp_bridge->dev->device == PCI_DEVICE_ID_INTEL_EAGLELAKE_HB || \ | 103 | #define IS_G4X (agp_bridge->dev->device == PCI_DEVICE_ID_INTEL_EAGLELAKE_HB || \ |
94 | agp_bridge->dev->device == PCI_DEVICE_ID_INTEL_Q45_HB || \ | 104 | agp_bridge->dev->device == PCI_DEVICE_ID_INTEL_Q45_HB || \ |
95 | agp_bridge->dev->device == PCI_DEVICE_ID_INTEL_G45_HB || \ | 105 | agp_bridge->dev->device == PCI_DEVICE_ID_INTEL_G45_HB || \ |
@@ -99,7 +109,8 @@ | |||
99 | agp_bridge->dev->device == PCI_DEVICE_ID_INTEL_IRONLAKE_D_HB || \ | 109 | agp_bridge->dev->device == PCI_DEVICE_ID_INTEL_IRONLAKE_D_HB || \ |
100 | agp_bridge->dev->device == PCI_DEVICE_ID_INTEL_IRONLAKE_M_HB || \ | 110 | agp_bridge->dev->device == PCI_DEVICE_ID_INTEL_IRONLAKE_M_HB || \ |
101 | agp_bridge->dev->device == PCI_DEVICE_ID_INTEL_IRONLAKE_MA_HB || \ | 111 | agp_bridge->dev->device == PCI_DEVICE_ID_INTEL_IRONLAKE_MA_HB || \ |
102 | agp_bridge->dev->device == PCI_DEVICE_ID_INTEL_IRONLAKE_MC2_HB) | 112 | agp_bridge->dev->device == PCI_DEVICE_ID_INTEL_IRONLAKE_MC2_HB || \ |
113 | IS_SNB) | ||
103 | 114 | ||
104 | extern int agp_memory_reserved; | 115 | extern int agp_memory_reserved; |
105 | 116 | ||
@@ -148,6 +159,29 @@ extern int agp_memory_reserved; | |||
148 | #define INTEL_I7505_AGPCTRL 0x70 | 159 | #define INTEL_I7505_AGPCTRL 0x70 |
149 | #define INTEL_I7505_MCHCFG 0x50 | 160 | #define INTEL_I7505_MCHCFG 0x50 |
150 | 161 | ||
162 | #define SNB_GMCH_CTRL 0x50 | ||
163 | #define SNB_GMCH_GMS_STOLEN_MASK 0xF8 | ||
164 | #define SNB_GMCH_GMS_STOLEN_32M (1 << 3) | ||
165 | #define SNB_GMCH_GMS_STOLEN_64M (2 << 3) | ||
166 | #define SNB_GMCH_GMS_STOLEN_96M (3 << 3) | ||
167 | #define SNB_GMCH_GMS_STOLEN_128M (4 << 3) | ||
168 | #define SNB_GMCH_GMS_STOLEN_160M (5 << 3) | ||
169 | #define SNB_GMCH_GMS_STOLEN_192M (6 << 3) | ||
170 | #define SNB_GMCH_GMS_STOLEN_224M (7 << 3) | ||
171 | #define SNB_GMCH_GMS_STOLEN_256M (8 << 3) | ||
172 | #define SNB_GMCH_GMS_STOLEN_288M (9 << 3) | ||
173 | #define SNB_GMCH_GMS_STOLEN_320M (0xa << 3) | ||
174 | #define SNB_GMCH_GMS_STOLEN_352M (0xb << 3) | ||
175 | #define SNB_GMCH_GMS_STOLEN_384M (0xc << 3) | ||
176 | #define SNB_GMCH_GMS_STOLEN_416M (0xd << 3) | ||
177 | #define SNB_GMCH_GMS_STOLEN_448M (0xe << 3) | ||
178 | #define SNB_GMCH_GMS_STOLEN_480M (0xf << 3) | ||
179 | #define SNB_GMCH_GMS_STOLEN_512M (0x10 << 3) | ||
180 | #define SNB_GTT_SIZE_0M (0 << 8) | ||
181 | #define SNB_GTT_SIZE_1M (1 << 8) | ||
182 | #define SNB_GTT_SIZE_2M (2 << 8) | ||
183 | #define SNB_GTT_SIZE_MASK (3 << 8) | ||
184 | |||
151 | static const struct aper_size_info_fixed intel_i810_sizes[] = | 185 | static const struct aper_size_info_fixed intel_i810_sizes[] = |
152 | { | 186 | { |
153 | {64, 16384, 4}, | 187 | {64, 16384, 4}, |
@@ -270,7 +304,7 @@ static void intel_agp_insert_sg_entries(struct agp_memory *mem, | |||
270 | j++; | 304 | j++; |
271 | } | 305 | } |
272 | } else { | 306 | } else { |
273 | /* sg may merge pages, but we have to seperate | 307 | /* sg may merge pages, but we have to separate |
274 | * per-page addr for GTT */ | 308 | * per-page addr for GTT */ |
275 | unsigned int len, m; | 309 | unsigned int len, m; |
276 | 310 | ||
@@ -294,6 +328,13 @@ static void intel_agp_insert_sg_entries(struct agp_memory *mem, | |||
294 | off_t pg_start, int mask_type) | 328 | off_t pg_start, int mask_type) |
295 | { | 329 | { |
296 | int i, j; | 330 | int i, j; |
331 | u32 cache_bits = 0; | ||
332 | |||
333 | if (agp_bridge->dev->device == PCI_DEVICE_ID_INTEL_SANDYBRIDGE_HB || | ||
334 | agp_bridge->dev->device == PCI_DEVICE_ID_INTEL_SANDYBRIDGE_M_HB) | ||
335 | { | ||
336 | cache_bits = I830_PTE_SYSTEM_CACHED; | ||
337 | } | ||
297 | 338 | ||
298 | for (i = 0, j = pg_start; i < mem->page_count; i++, j++) { | 339 | for (i = 0, j = pg_start; i < mem->page_count; i++, j++) { |
299 | writel(agp_bridge->driver->mask_memory(agp_bridge, | 340 | writel(agp_bridge->driver->mask_memory(agp_bridge, |
@@ -614,7 +655,7 @@ static struct aper_size_info_fixed intel_i830_sizes[] = | |||
614 | static void intel_i830_init_gtt_entries(void) | 655 | static void intel_i830_init_gtt_entries(void) |
615 | { | 656 | { |
616 | u16 gmch_ctrl; | 657 | u16 gmch_ctrl; |
617 | int gtt_entries; | 658 | int gtt_entries = 0; |
618 | u8 rdct; | 659 | u8 rdct; |
619 | int local = 0; | 660 | int local = 0; |
620 | static const int ddt[4] = { 0, 16, 32, 64 }; | 661 | static const int ddt[4] = { 0, 16, 32, 64 }; |
@@ -706,6 +747,63 @@ static void intel_i830_init_gtt_entries(void) | |||
706 | gtt_entries = 0; | 747 | gtt_entries = 0; |
707 | break; | 748 | break; |
708 | } | 749 | } |
750 | } else if (agp_bridge->dev->device == PCI_DEVICE_ID_INTEL_SANDYBRIDGE_HB || | ||
751 | agp_bridge->dev->device == PCI_DEVICE_ID_INTEL_SANDYBRIDGE_M_HB) { | ||
752 | /* | ||
753 | * SandyBridge has new memory control reg at 0x50.w | ||
754 | */ | ||
755 | u16 snb_gmch_ctl; | ||
756 | pci_read_config_word(intel_private.pcidev, SNB_GMCH_CTRL, &snb_gmch_ctl); | ||
757 | switch (snb_gmch_ctl & SNB_GMCH_GMS_STOLEN_MASK) { | ||
758 | case SNB_GMCH_GMS_STOLEN_32M: | ||
759 | gtt_entries = MB(32) - KB(size); | ||
760 | break; | ||
761 | case SNB_GMCH_GMS_STOLEN_64M: | ||
762 | gtt_entries = MB(64) - KB(size); | ||
763 | break; | ||
764 | case SNB_GMCH_GMS_STOLEN_96M: | ||
765 | gtt_entries = MB(96) - KB(size); | ||
766 | break; | ||
767 | case SNB_GMCH_GMS_STOLEN_128M: | ||
768 | gtt_entries = MB(128) - KB(size); | ||
769 | break; | ||
770 | case SNB_GMCH_GMS_STOLEN_160M: | ||
771 | gtt_entries = MB(160) - KB(size); | ||
772 | break; | ||
773 | case SNB_GMCH_GMS_STOLEN_192M: | ||
774 | gtt_entries = MB(192) - KB(size); | ||
775 | break; | ||
776 | case SNB_GMCH_GMS_STOLEN_224M: | ||
777 | gtt_entries = MB(224) - KB(size); | ||
778 | break; | ||
779 | case SNB_GMCH_GMS_STOLEN_256M: | ||
780 | gtt_entries = MB(256) - KB(size); | ||
781 | break; | ||
782 | case SNB_GMCH_GMS_STOLEN_288M: | ||
783 | gtt_entries = MB(288) - KB(size); | ||
784 | break; | ||
785 | case SNB_GMCH_GMS_STOLEN_320M: | ||
786 | gtt_entries = MB(320) - KB(size); | ||
787 | break; | ||
788 | case SNB_GMCH_GMS_STOLEN_352M: | ||
789 | gtt_entries = MB(352) - KB(size); | ||
790 | break; | ||
791 | case SNB_GMCH_GMS_STOLEN_384M: | ||
792 | gtt_entries = MB(384) - KB(size); | ||
793 | break; | ||
794 | case SNB_GMCH_GMS_STOLEN_416M: | ||
795 | gtt_entries = MB(416) - KB(size); | ||
796 | break; | ||
797 | case SNB_GMCH_GMS_STOLEN_448M: | ||
798 | gtt_entries = MB(448) - KB(size); | ||
799 | break; | ||
800 | case SNB_GMCH_GMS_STOLEN_480M: | ||
801 | gtt_entries = MB(480) - KB(size); | ||
802 | break; | ||
803 | case SNB_GMCH_GMS_STOLEN_512M: | ||
804 | gtt_entries = MB(512) - KB(size); | ||
805 | break; | ||
806 | } | ||
709 | } else { | 807 | } else { |
710 | switch (gmch_ctrl & I855_GMCH_GMS_MASK) { | 808 | switch (gmch_ctrl & I855_GMCH_GMS_MASK) { |
711 | case I855_GMCH_GMS_STOLEN_1M: | 809 | case I855_GMCH_GMS_STOLEN_1M: |
@@ -1108,6 +1206,9 @@ static void intel_i9xx_setup_flush(void) | |||
1108 | if (intel_private.ifp_resource.start) | 1206 | if (intel_private.ifp_resource.start) |
1109 | return; | 1207 | return; |
1110 | 1208 | ||
1209 | if (IS_SNB) | ||
1210 | return; | ||
1211 | |||
1111 | /* setup a resource for this object */ | 1212 | /* setup a resource for this object */ |
1112 | intel_private.ifp_resource.name = "Intel Flush Page"; | 1213 | intel_private.ifp_resource.name = "Intel Flush Page"; |
1113 | intel_private.ifp_resource.flags = IORESOURCE_MEM; | 1214 | intel_private.ifp_resource.flags = IORESOURCE_MEM; |
@@ -1346,6 +1447,8 @@ static unsigned long intel_i965_mask_memory(struct agp_bridge_data *bridge, | |||
1346 | 1447 | ||
1347 | static void intel_i965_get_gtt_range(int *gtt_offset, int *gtt_size) | 1448 | static void intel_i965_get_gtt_range(int *gtt_offset, int *gtt_size) |
1348 | { | 1449 | { |
1450 | u16 snb_gmch_ctl; | ||
1451 | |||
1349 | switch (agp_bridge->dev->device) { | 1452 | switch (agp_bridge->dev->device) { |
1350 | case PCI_DEVICE_ID_INTEL_GM45_HB: | 1453 | case PCI_DEVICE_ID_INTEL_GM45_HB: |
1351 | case PCI_DEVICE_ID_INTEL_EAGLELAKE_HB: | 1454 | case PCI_DEVICE_ID_INTEL_EAGLELAKE_HB: |
@@ -1359,6 +1462,25 @@ static void intel_i965_get_gtt_range(int *gtt_offset, int *gtt_size) | |||
1359 | case PCI_DEVICE_ID_INTEL_IRONLAKE_MC2_HB: | 1462 | case PCI_DEVICE_ID_INTEL_IRONLAKE_MC2_HB: |
1360 | *gtt_offset = *gtt_size = MB(2); | 1463 | *gtt_offset = *gtt_size = MB(2); |
1361 | break; | 1464 | break; |
1465 | case PCI_DEVICE_ID_INTEL_SANDYBRIDGE_HB: | ||
1466 | case PCI_DEVICE_ID_INTEL_SANDYBRIDGE_M_HB: | ||
1467 | *gtt_offset = MB(2); | ||
1468 | |||
1469 | pci_read_config_word(intel_private.pcidev, SNB_GMCH_CTRL, &snb_gmch_ctl); | ||
1470 | switch (snb_gmch_ctl & SNB_GTT_SIZE_MASK) { | ||
1471 | default: | ||
1472 | case SNB_GTT_SIZE_0M: | ||
1473 | printk(KERN_ERR "Bad GTT size mask: 0x%04x.\n", snb_gmch_ctl); | ||
1474 | *gtt_size = MB(0); | ||
1475 | break; | ||
1476 | case SNB_GTT_SIZE_1M: | ||
1477 | *gtt_size = MB(1); | ||
1478 | break; | ||
1479 | case SNB_GTT_SIZE_2M: | ||
1480 | *gtt_size = MB(2); | ||
1481 | break; | ||
1482 | } | ||
1483 | break; | ||
1362 | default: | 1484 | default: |
1363 | *gtt_offset = *gtt_size = KB(512); | 1485 | *gtt_offset = *gtt_size = KB(512); |
1364 | } | 1486 | } |
@@ -2338,9 +2460,9 @@ static const struct intel_driver_description { | |||
2338 | NULL, &intel_g33_driver }, | 2460 | NULL, &intel_g33_driver }, |
2339 | { PCI_DEVICE_ID_INTEL_Q33_HB, PCI_DEVICE_ID_INTEL_Q33_IG, 0, "Q33", | 2461 | { PCI_DEVICE_ID_INTEL_Q33_HB, PCI_DEVICE_ID_INTEL_Q33_IG, 0, "Q33", |
2340 | NULL, &intel_g33_driver }, | 2462 | NULL, &intel_g33_driver }, |
2341 | { PCI_DEVICE_ID_INTEL_PINEVIEW_M_HB, PCI_DEVICE_ID_INTEL_PINEVIEW_M_IG, 0, "Pineview", | 2463 | { PCI_DEVICE_ID_INTEL_PINEVIEW_M_HB, PCI_DEVICE_ID_INTEL_PINEVIEW_M_IG, 0, "GMA3150", |
2342 | NULL, &intel_g33_driver }, | 2464 | NULL, &intel_g33_driver }, |
2343 | { PCI_DEVICE_ID_INTEL_PINEVIEW_HB, PCI_DEVICE_ID_INTEL_PINEVIEW_IG, 0, "Pineview", | 2465 | { PCI_DEVICE_ID_INTEL_PINEVIEW_HB, PCI_DEVICE_ID_INTEL_PINEVIEW_IG, 0, "GMA3150", |
2344 | NULL, &intel_g33_driver }, | 2466 | NULL, &intel_g33_driver }, |
2345 | { PCI_DEVICE_ID_INTEL_GM45_HB, PCI_DEVICE_ID_INTEL_GM45_IG, 0, | 2467 | { PCI_DEVICE_ID_INTEL_GM45_HB, PCI_DEVICE_ID_INTEL_GM45_IG, 0, |
2346 | "GM45", NULL, &intel_i965_driver }, | 2468 | "GM45", NULL, &intel_i965_driver }, |
@@ -2355,13 +2477,17 @@ static const struct intel_driver_description { | |||
2355 | { PCI_DEVICE_ID_INTEL_G41_HB, PCI_DEVICE_ID_INTEL_G41_IG, 0, | 2477 | { PCI_DEVICE_ID_INTEL_G41_HB, PCI_DEVICE_ID_INTEL_G41_IG, 0, |
2356 | "G41", NULL, &intel_i965_driver }, | 2478 | "G41", NULL, &intel_i965_driver }, |
2357 | { PCI_DEVICE_ID_INTEL_IRONLAKE_D_HB, PCI_DEVICE_ID_INTEL_IRONLAKE_D_IG, 0, | 2479 | { PCI_DEVICE_ID_INTEL_IRONLAKE_D_HB, PCI_DEVICE_ID_INTEL_IRONLAKE_D_IG, 0, |
2358 | "Ironlake/D", NULL, &intel_i965_driver }, | 2480 | "HD Graphics", NULL, &intel_i965_driver }, |
2359 | { PCI_DEVICE_ID_INTEL_IRONLAKE_M_HB, PCI_DEVICE_ID_INTEL_IRONLAKE_M_IG, 0, | 2481 | { PCI_DEVICE_ID_INTEL_IRONLAKE_M_HB, PCI_DEVICE_ID_INTEL_IRONLAKE_M_IG, 0, |
2360 | "Ironlake/M", NULL, &intel_i965_driver }, | 2482 | "HD Graphics", NULL, &intel_i965_driver }, |
2361 | { PCI_DEVICE_ID_INTEL_IRONLAKE_MA_HB, PCI_DEVICE_ID_INTEL_IRONLAKE_M_IG, 0, | 2483 | { PCI_DEVICE_ID_INTEL_IRONLAKE_MA_HB, PCI_DEVICE_ID_INTEL_IRONLAKE_M_IG, 0, |
2362 | "Ironlake/MA", NULL, &intel_i965_driver }, | 2484 | "HD Graphics", NULL, &intel_i965_driver }, |
2363 | { PCI_DEVICE_ID_INTEL_IRONLAKE_MC2_HB, PCI_DEVICE_ID_INTEL_IRONLAKE_M_IG, 0, | 2485 | { PCI_DEVICE_ID_INTEL_IRONLAKE_MC2_HB, PCI_DEVICE_ID_INTEL_IRONLAKE_M_IG, 0, |
2364 | "Ironlake/MC2", NULL, &intel_i965_driver }, | 2486 | "HD Graphics", NULL, &intel_i965_driver }, |
2487 | { PCI_DEVICE_ID_INTEL_SANDYBRIDGE_HB, PCI_DEVICE_ID_INTEL_SANDYBRIDGE_IG, 0, | ||
2488 | "Sandybridge", NULL, &intel_i965_driver }, | ||
2489 | { PCI_DEVICE_ID_INTEL_SANDYBRIDGE_M_HB, PCI_DEVICE_ID_INTEL_SANDYBRIDGE_M_IG, 0, | ||
2490 | "Sandybridge", NULL, &intel_i965_driver }, | ||
2365 | { 0, 0, 0, NULL, NULL, NULL } | 2491 | { 0, 0, 0, NULL, NULL, NULL } |
2366 | }; | 2492 | }; |
2367 | 2493 | ||
@@ -2371,7 +2497,7 @@ static int __devinit agp_intel_probe(struct pci_dev *pdev, | |||
2371 | struct agp_bridge_data *bridge; | 2497 | struct agp_bridge_data *bridge; |
2372 | u8 cap_ptr = 0; | 2498 | u8 cap_ptr = 0; |
2373 | struct resource *r; | 2499 | struct resource *r; |
2374 | int i; | 2500 | int i, err; |
2375 | 2501 | ||
2376 | cap_ptr = pci_find_capability(pdev, PCI_CAP_ID_AGP); | 2502 | cap_ptr = pci_find_capability(pdev, PCI_CAP_ID_AGP); |
2377 | 2503 | ||
@@ -2463,7 +2589,10 @@ static int __devinit agp_intel_probe(struct pci_dev *pdev, | |||
2463 | } | 2589 | } |
2464 | 2590 | ||
2465 | pci_set_drvdata(pdev, bridge); | 2591 | pci_set_drvdata(pdev, bridge); |
2466 | return agp_add_bridge(bridge); | 2592 | err = agp_add_bridge(bridge); |
2593 | if (!err) | ||
2594 | intel_agp_enabled = 1; | ||
2595 | return err; | ||
2467 | } | 2596 | } |
2468 | 2597 | ||
2469 | static void __devexit agp_intel_remove(struct pci_dev *pdev) | 2598 | static void __devexit agp_intel_remove(struct pci_dev *pdev) |
@@ -2568,6 +2697,8 @@ static struct pci_device_id agp_intel_pci_table[] = { | |||
2568 | ID(PCI_DEVICE_ID_INTEL_IRONLAKE_M_HB), | 2697 | ID(PCI_DEVICE_ID_INTEL_IRONLAKE_M_HB), |
2569 | ID(PCI_DEVICE_ID_INTEL_IRONLAKE_MA_HB), | 2698 | ID(PCI_DEVICE_ID_INTEL_IRONLAKE_MA_HB), |
2570 | ID(PCI_DEVICE_ID_INTEL_IRONLAKE_MC2_HB), | 2699 | ID(PCI_DEVICE_ID_INTEL_IRONLAKE_MC2_HB), |
2700 | ID(PCI_DEVICE_ID_INTEL_SANDYBRIDGE_HB), | ||
2701 | ID(PCI_DEVICE_ID_INTEL_SANDYBRIDGE_M_HB), | ||
2571 | { } | 2702 | { } |
2572 | }; | 2703 | }; |
2573 | 2704 | ||
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/hpet.c b/drivers/char/hpet.c index e481c5938bad..9c5eea3ea4de 100644 --- a/drivers/char/hpet.c +++ b/drivers/char/hpet.c | |||
@@ -215,9 +215,7 @@ static void hpet_timer_set_irq(struct hpet_dev *devp) | |||
215 | else | 215 | else |
216 | v &= ~0xffff; | 216 | v &= ~0xffff; |
217 | 217 | ||
218 | for (irq = find_first_bit(&v, HPET_MAX_IRQ); irq < HPET_MAX_IRQ; | 218 | for_each_set_bit(irq, &v, HPET_MAX_IRQ) { |
219 | irq = find_next_bit(&v, HPET_MAX_IRQ, 1 + irq)) { | ||
220 | |||
221 | if (irq >= nr_irqs) { | 219 | if (irq >= nr_irqs) { |
222 | irq = HPET_MAX_IRQ; | 220 | irq = HPET_MAX_IRQ; |
223 | break; | 221 | break; |
diff --git a/drivers/char/hvc_console.c b/drivers/char/hvc_console.c index 465185fc0f52..ba55bba151b9 100644 --- a/drivers/char/hvc_console.c +++ b/drivers/char/hvc_console.c | |||
@@ -312,6 +312,7 @@ static int hvc_open(struct tty_struct *tty, struct file * filp) | |||
312 | spin_lock_irqsave(&hp->lock, flags); | 312 | spin_lock_irqsave(&hp->lock, flags); |
313 | /* Check and then increment for fast path open. */ | 313 | /* Check and then increment for fast path open. */ |
314 | if (hp->count++ > 0) { | 314 | if (hp->count++ > 0) { |
315 | tty_kref_get(tty); | ||
315 | spin_unlock_irqrestore(&hp->lock, flags); | 316 | spin_unlock_irqrestore(&hp->lock, flags); |
316 | hvc_kick(); | 317 | hvc_kick(); |
317 | return 0; | 318 | return 0; |
@@ -319,7 +320,7 @@ static int hvc_open(struct tty_struct *tty, struct file * filp) | |||
319 | 320 | ||
320 | tty->driver_data = hp; | 321 | tty->driver_data = hp; |
321 | 322 | ||
322 | hp->tty = tty; | 323 | hp->tty = tty_kref_get(tty); |
323 | 324 | ||
324 | spin_unlock_irqrestore(&hp->lock, flags); | 325 | spin_unlock_irqrestore(&hp->lock, flags); |
325 | 326 | ||
@@ -336,6 +337,7 @@ static int hvc_open(struct tty_struct *tty, struct file * filp) | |||
336 | spin_lock_irqsave(&hp->lock, flags); | 337 | spin_lock_irqsave(&hp->lock, flags); |
337 | hp->tty = NULL; | 338 | hp->tty = NULL; |
338 | spin_unlock_irqrestore(&hp->lock, flags); | 339 | spin_unlock_irqrestore(&hp->lock, flags); |
340 | tty_kref_put(tty); | ||
339 | tty->driver_data = NULL; | 341 | tty->driver_data = NULL; |
340 | kref_put(&hp->kref, destroy_hvc_struct); | 342 | kref_put(&hp->kref, destroy_hvc_struct); |
341 | printk(KERN_ERR "hvc_open: request_irq failed with rc %d.\n", rc); | 343 | printk(KERN_ERR "hvc_open: request_irq failed with rc %d.\n", rc); |
@@ -363,13 +365,18 @@ static void hvc_close(struct tty_struct *tty, struct file * filp) | |||
363 | return; | 365 | return; |
364 | 366 | ||
365 | hp = tty->driver_data; | 367 | hp = tty->driver_data; |
368 | |||
366 | spin_lock_irqsave(&hp->lock, flags); | 369 | spin_lock_irqsave(&hp->lock, flags); |
370 | tty_kref_get(tty); | ||
367 | 371 | ||
368 | if (--hp->count == 0) { | 372 | if (--hp->count == 0) { |
369 | /* We are done with the tty pointer now. */ | 373 | /* We are done with the tty pointer now. */ |
370 | hp->tty = NULL; | 374 | hp->tty = NULL; |
371 | spin_unlock_irqrestore(&hp->lock, flags); | 375 | spin_unlock_irqrestore(&hp->lock, flags); |
372 | 376 | ||
377 | /* Put the ref obtained in hvc_open() */ | ||
378 | tty_kref_put(tty); | ||
379 | |||
373 | if (hp->ops->notifier_del) | 380 | if (hp->ops->notifier_del) |
374 | hp->ops->notifier_del(hp, hp->data); | 381 | hp->ops->notifier_del(hp, hp->data); |
375 | 382 | ||
@@ -389,6 +396,7 @@ static void hvc_close(struct tty_struct *tty, struct file * filp) | |||
389 | spin_unlock_irqrestore(&hp->lock, flags); | 396 | spin_unlock_irqrestore(&hp->lock, flags); |
390 | } | 397 | } |
391 | 398 | ||
399 | tty_kref_put(tty); | ||
392 | kref_put(&hp->kref, destroy_hvc_struct); | 400 | kref_put(&hp->kref, destroy_hvc_struct); |
393 | } | 401 | } |
394 | 402 | ||
@@ -424,10 +432,11 @@ static void hvc_hangup(struct tty_struct *tty) | |||
424 | spin_unlock_irqrestore(&hp->lock, flags); | 432 | spin_unlock_irqrestore(&hp->lock, flags); |
425 | 433 | ||
426 | if (hp->ops->notifier_hangup) | 434 | if (hp->ops->notifier_hangup) |
427 | hp->ops->notifier_hangup(hp, hp->data); | 435 | hp->ops->notifier_hangup(hp, hp->data); |
428 | 436 | ||
429 | while(temp_open_count) { | 437 | while(temp_open_count) { |
430 | --temp_open_count; | 438 | --temp_open_count; |
439 | tty_kref_put(tty); | ||
431 | kref_put(&hp->kref, destroy_hvc_struct); | 440 | kref_put(&hp->kref, destroy_hvc_struct); |
432 | } | 441 | } |
433 | } | 442 | } |
@@ -592,7 +601,7 @@ int hvc_poll(struct hvc_struct *hp) | |||
592 | } | 601 | } |
593 | 602 | ||
594 | /* No tty attached, just skip */ | 603 | /* No tty attached, just skip */ |
595 | tty = hp->tty; | 604 | tty = tty_kref_get(hp->tty); |
596 | if (tty == NULL) | 605 | if (tty == NULL) |
597 | goto bail; | 606 | goto bail; |
598 | 607 | ||
@@ -672,6 +681,8 @@ int hvc_poll(struct hvc_struct *hp) | |||
672 | 681 | ||
673 | tty_flip_buffer_push(tty); | 682 | tty_flip_buffer_push(tty); |
674 | } | 683 | } |
684 | if (tty) | ||
685 | tty_kref_put(tty); | ||
675 | 686 | ||
676 | return poll_mask; | 687 | return poll_mask; |
677 | } | 688 | } |
@@ -807,7 +818,7 @@ int hvc_remove(struct hvc_struct *hp) | |||
807 | struct tty_struct *tty; | 818 | struct tty_struct *tty; |
808 | 819 | ||
809 | spin_lock_irqsave(&hp->lock, flags); | 820 | spin_lock_irqsave(&hp->lock, flags); |
810 | tty = hp->tty; | 821 | tty = tty_kref_get(hp->tty); |
811 | 822 | ||
812 | if (hp->index < MAX_NR_HVC_CONSOLES) | 823 | if (hp->index < MAX_NR_HVC_CONSOLES) |
813 | vtermnos[hp->index] = -1; | 824 | vtermnos[hp->index] = -1; |
@@ -819,18 +830,18 @@ int hvc_remove(struct hvc_struct *hp) | |||
819 | /* | 830 | /* |
820 | * We 'put' the instance that was grabbed when the kref instance | 831 | * We 'put' the instance that was grabbed when the kref instance |
821 | * was initialized using kref_init(). Let the last holder of this | 832 | * was initialized using kref_init(). Let the last holder of this |
822 | * kref cause it to be removed, which will probably be the tty_hangup | 833 | * kref cause it to be removed, which will probably be the tty_vhangup |
823 | * below. | 834 | * below. |
824 | */ | 835 | */ |
825 | kref_put(&hp->kref, destroy_hvc_struct); | 836 | kref_put(&hp->kref, destroy_hvc_struct); |
826 | 837 | ||
827 | /* | 838 | /* |
828 | * This function call will auto chain call hvc_hangup. The tty should | 839 | * This function call will auto chain call hvc_hangup. |
829 | * always be valid at this time unless a simultaneous tty close already | ||
830 | * cleaned up the hvc_struct. | ||
831 | */ | 840 | */ |
832 | if (tty) | 841 | if (tty) { |
833 | tty_hangup(tty); | 842 | tty_vhangup(tty); |
843 | tty_kref_put(tty); | ||
844 | } | ||
834 | return 0; | 845 | return 0; |
835 | } | 846 | } |
836 | EXPORT_SYMBOL_GPL(hvc_remove); | 847 | EXPORT_SYMBOL_GPL(hvc_remove); |
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 | ||
560 | 2) It may be hard-coded into your source by including a .h file (typically | 560 | 2) 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_msghandler.c b/drivers/char/ipmi/ipmi_msghandler.c index ec5e3f8df648..c6ad4234378d 100644 --- a/drivers/char/ipmi/ipmi_msghandler.c +++ b/drivers/char/ipmi/ipmi_msghandler.c | |||
@@ -2272,42 +2272,52 @@ static int create_files(struct bmc_device *bmc) | |||
2272 | bmc->device_id_attr.attr.name = "device_id"; | 2272 | bmc->device_id_attr.attr.name = "device_id"; |
2273 | bmc->device_id_attr.attr.mode = S_IRUGO; | 2273 | bmc->device_id_attr.attr.mode = S_IRUGO; |
2274 | bmc->device_id_attr.show = device_id_show; | 2274 | bmc->device_id_attr.show = device_id_show; |
2275 | sysfs_attr_init(&bmc->device_id_attr.attr); | ||
2275 | 2276 | ||
2276 | bmc->provides_dev_sdrs_attr.attr.name = "provides_device_sdrs"; | 2277 | bmc->provides_dev_sdrs_attr.attr.name = "provides_device_sdrs"; |
2277 | bmc->provides_dev_sdrs_attr.attr.mode = S_IRUGO; | 2278 | bmc->provides_dev_sdrs_attr.attr.mode = S_IRUGO; |
2278 | bmc->provides_dev_sdrs_attr.show = provides_dev_sdrs_show; | 2279 | bmc->provides_dev_sdrs_attr.show = provides_dev_sdrs_show; |
2280 | sysfs_attr_init(&bmc->provides_dev_sdrs_attr.attr); | ||
2279 | 2281 | ||
2280 | bmc->revision_attr.attr.name = "revision"; | 2282 | bmc->revision_attr.attr.name = "revision"; |
2281 | bmc->revision_attr.attr.mode = S_IRUGO; | 2283 | bmc->revision_attr.attr.mode = S_IRUGO; |
2282 | bmc->revision_attr.show = revision_show; | 2284 | bmc->revision_attr.show = revision_show; |
2285 | sysfs_attr_init(&bmc->revision_attr.attr); | ||
2283 | 2286 | ||
2284 | bmc->firmware_rev_attr.attr.name = "firmware_revision"; | 2287 | bmc->firmware_rev_attr.attr.name = "firmware_revision"; |
2285 | bmc->firmware_rev_attr.attr.mode = S_IRUGO; | 2288 | bmc->firmware_rev_attr.attr.mode = S_IRUGO; |
2286 | bmc->firmware_rev_attr.show = firmware_rev_show; | 2289 | bmc->firmware_rev_attr.show = firmware_rev_show; |
2290 | sysfs_attr_init(&bmc->firmware_rev_attr.attr); | ||
2287 | 2291 | ||
2288 | bmc->version_attr.attr.name = "ipmi_version"; | 2292 | bmc->version_attr.attr.name = "ipmi_version"; |
2289 | bmc->version_attr.attr.mode = S_IRUGO; | 2293 | bmc->version_attr.attr.mode = S_IRUGO; |
2290 | bmc->version_attr.show = ipmi_version_show; | 2294 | bmc->version_attr.show = ipmi_version_show; |
2295 | sysfs_attr_init(&bmc->version_attr.attr); | ||
2291 | 2296 | ||
2292 | bmc->add_dev_support_attr.attr.name = "additional_device_support"; | 2297 | bmc->add_dev_support_attr.attr.name = "additional_device_support"; |
2293 | bmc->add_dev_support_attr.attr.mode = S_IRUGO; | 2298 | bmc->add_dev_support_attr.attr.mode = S_IRUGO; |
2294 | bmc->add_dev_support_attr.show = add_dev_support_show; | 2299 | bmc->add_dev_support_attr.show = add_dev_support_show; |
2300 | sysfs_attr_init(&bmc->add_dev_support_attr.attr); | ||
2295 | 2301 | ||
2296 | bmc->manufacturer_id_attr.attr.name = "manufacturer_id"; | 2302 | bmc->manufacturer_id_attr.attr.name = "manufacturer_id"; |
2297 | bmc->manufacturer_id_attr.attr.mode = S_IRUGO; | 2303 | bmc->manufacturer_id_attr.attr.mode = S_IRUGO; |
2298 | bmc->manufacturer_id_attr.show = manufacturer_id_show; | 2304 | bmc->manufacturer_id_attr.show = manufacturer_id_show; |
2305 | sysfs_attr_init(&bmc->manufacturer_id_attr.attr); | ||
2299 | 2306 | ||
2300 | bmc->product_id_attr.attr.name = "product_id"; | 2307 | bmc->product_id_attr.attr.name = "product_id"; |
2301 | bmc->product_id_attr.attr.mode = S_IRUGO; | 2308 | bmc->product_id_attr.attr.mode = S_IRUGO; |
2302 | bmc->product_id_attr.show = product_id_show; | 2309 | bmc->product_id_attr.show = product_id_show; |
2310 | sysfs_attr_init(&bmc->product_id_attr.attr); | ||
2303 | 2311 | ||
2304 | bmc->guid_attr.attr.name = "guid"; | 2312 | bmc->guid_attr.attr.name = "guid"; |
2305 | bmc->guid_attr.attr.mode = S_IRUGO; | 2313 | bmc->guid_attr.attr.mode = S_IRUGO; |
2306 | bmc->guid_attr.show = guid_show; | 2314 | bmc->guid_attr.show = guid_show; |
2315 | sysfs_attr_init(&bmc->guid_attr.attr); | ||
2307 | 2316 | ||
2308 | bmc->aux_firmware_rev_attr.attr.name = "aux_firmware_revision"; | 2317 | bmc->aux_firmware_rev_attr.attr.name = "aux_firmware_revision"; |
2309 | bmc->aux_firmware_rev_attr.attr.mode = S_IRUGO; | 2318 | bmc->aux_firmware_rev_attr.attr.mode = S_IRUGO; |
2310 | bmc->aux_firmware_rev_attr.show = aux_firmware_rev_show; | 2319 | bmc->aux_firmware_rev_attr.show = aux_firmware_rev_show; |
2320 | sysfs_attr_init(&bmc->aux_firmware_rev_attr.attr); | ||
2311 | 2321 | ||
2312 | err = device_create_file(&bmc->dev->dev, | 2322 | err = device_create_file(&bmc->dev->dev, |
2313 | &bmc->device_id_attr); | 2323 | &bmc->device_id_attr); |
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 { | |||
295 | static int force_kipmid[SI_MAX_PARMS]; | 295 | static int force_kipmid[SI_MAX_PARMS]; |
296 | static int num_force_kipmid; | 296 | static int num_force_kipmid; |
297 | 297 | ||
298 | static unsigned int kipmid_max_busy_us[SI_MAX_PARMS]; | ||
299 | static int num_max_busy_us; | ||
300 | |||
298 | static int unload_when_empty = 1; | 301 | static int unload_when_empty = 1; |
299 | 302 | ||
300 | static int try_smi_init(struct smi_info *smi); | 303 | static 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 | */ | ||
936 | static inline void ipmi_si_set_not_busy(struct timespec *ts) | ||
937 | { | ||
938 | ts->tv_nsec = -1; | ||
939 | } | ||
940 | static inline int ipmi_si_is_busy(struct timespec *ts) | ||
941 | { | ||
942 | return ts->tv_nsec != -1; | ||
943 | } | ||
944 | |||
945 | static 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 | */ | ||
928 | static int ipmi_thread(void *data) | 979 | static 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]; | |||
1144 | static unsigned int num_regsizes; | 1201 | static unsigned int num_regsizes; |
1145 | static int regshifts[SI_MAX_PARMS]; | 1202 | static int regshifts[SI_MAX_PARMS]; |
1146 | static unsigned int num_regshifts; | 1203 | static unsigned int num_regshifts; |
1147 | static int slave_addrs[SI_MAX_PARMS]; | 1204 | static int slave_addrs[SI_MAX_PARMS]; /* Leaving 0 chooses the default value */ |
1148 | static unsigned int num_slave_addrs; | 1205 | static 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); | |||
1212 | MODULE_PARM_DESC(unload_when_empty, "Unload the module if no interfaces are" | 1269 | MODULE_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."); |
1272 | module_param_array(kipmid_max_busy_us, uint, &num_max_busy_us, 0644); | ||
1273 | MODULE_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 | ||
1217 | static void std_irq_cleanup(struct smi_info *info) | 1279 | static 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 | */ | ||
52 | static 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 |
78 | static inline int valid_phys_addr_range(unsigned long addr, size_t count) | 48 | static 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 | ||
118 | void __attribute__((weak)) unxlate_dev_mem_ptr(unsigned long phys, void *addr) | 88 | void __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 | */ |
126 | static ssize_t read_mem(struct file * file, char __user * buf, | 96 | static 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 | ||
183 | static ssize_t write_mem(struct file * file, const char __user * buf, | 153 | static 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 | ||
245 | int __attribute__((weak)) phys_mem_access_prot_allowed(struct file *file, | 215 | int __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 | */ | ||
228 | static 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 | |||
252 | static pgprot_t phys_mem_access_prot(struct file *file, unsigned long pfn, | 255 | static 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 | ||
297 | static int mmap_mem(struct file * file, struct vm_area_struct * vma) | 300 | static 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 |
332 | static int mmap_kmem(struct file * file, struct vm_area_struct * vma) | 335 | static 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 | */ |
392 | static ssize_t read_kmem(struct file *file, char __user *buf, | 395 | static 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 | ||
468 | static inline ssize_t | 471 | static ssize_t do_write_kmem(unsigned long p, const char __user *buf, |
469 | do_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 | */ |
521 | static ssize_t write_kmem(struct file * file, const char __user * buf, | 522 | static 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 |
573 | static ssize_t read_port(struct file * file, char __user * buf, | 574 | static 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 | ||
591 | static ssize_t write_port(struct file * file, const char __user * buf, | 592 | static 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 | ||
615 | static ssize_t read_null(struct file * file, char __user * buf, | 616 | static 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 | ||
621 | static ssize_t write_null(struct file * file, const char __user * buf, | 622 | static 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 | ||
633 | static ssize_t splice_write_null(struct pipe_inode_info *pipe,struct file *out, | 634 | static 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 | ||
639 | static ssize_t read_zero(struct file * file, char __user * buf, | 640 | static 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 | ||
670 | static int mmap_zero(struct file * file, struct vm_area_struct * vma) | 671 | static 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 | ||
680 | static ssize_t write_full(struct file * file, const char __user * buf, | 681 | static 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 | 692 | static loff_t null_lseek(struct file *file, loff_t offset, int orig) | |
692 | static 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 | */ |
705 | static loff_t memory_lseek(struct file * file, loff_t offset, int orig) | 705 | static 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 | ||
806 | static ssize_t kmsg_write(struct file * file, const char __user * buf, | 813 | static 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 | ||
827 | static const struct file_operations kmsg_fops = { | 834 | static const struct file_operations kmsg_fops = { |
828 | .write = kmsg_write, | 835 | .write = kmsg_write, |
829 | }; | 836 | }; |
830 | 837 | ||
831 | static const struct memdev { | 838 | static const struct memdev { |
@@ -876,7 +883,7 @@ static int memory_open(struct inode *inode, struct file *filp) | |||
876 | } | 883 | } |
877 | 884 | ||
878 | static const struct file_operations memory_fops = { | 885 | static const struct file_operations memory_fops = { |
879 | .open = memory_open, | 886 | .open = memory_open, |
880 | }; | 887 | }; |
881 | 888 | ||
882 | static char *mem_devnode(struct device *dev, mode_t *mode) | 889 | static 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 | |||
2104 | void 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 | } | ||
2110 | EXPORT_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 = { | |||
1191 | void generate_random_uuid(unsigned char uuid_out[16]) | 1191 | void 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(¤t->sighand->siglock); | 148 | spin_lock_irq(¤t->sighand->siglock); |
149 | sig->audit_tty = current->signal->audit_tty; | 149 | sig->audit_tty = current->signal->audit_tty; |
150 | spin_unlock_irq(¤t->sighand->siglock); | 150 | spin_unlock_irq(¤t->sighand->siglock); |
151 | sig->tty_audit_buf = NULL; | ||
152 | } | 151 | } |
153 | 152 | ||
154 | /** | 153 | /** |
diff --git a/drivers/char/tty_buffer.c b/drivers/char/tty_buffer.c index af8d97715728..7ee52164d474 100644 --- a/drivers/char/tty_buffer.c +++ b/drivers/char/tty_buffer.c | |||
@@ -248,7 +248,7 @@ int tty_insert_flip_string_fixed_flag(struct tty_struct *tty, | |||
248 | { | 248 | { |
249 | int copied = 0; | 249 | int copied = 0; |
250 | do { | 250 | do { |
251 | int goal = min(size - copied, TTY_BUFFER_PAGE); | 251 | int goal = min_t(size_t, size - copied, TTY_BUFFER_PAGE); |
252 | int space = tty_buffer_request_room(tty, goal); | 252 | int space = tty_buffer_request_room(tty, goal); |
253 | struct tty_buffer *tb = tty->buf.tail; | 253 | struct tty_buffer *tb = tty->buf.tail; |
254 | /* If there is no space then tb may be NULL */ | 254 | /* If there is no space then tb may be NULL */ |
@@ -285,7 +285,7 @@ int tty_insert_flip_string_flags(struct tty_struct *tty, | |||
285 | { | 285 | { |
286 | int copied = 0; | 286 | int copied = 0; |
287 | do { | 287 | do { |
288 | int goal = min(size - copied, TTY_BUFFER_PAGE); | 288 | int goal = min_t(size_t, size - copied, TTY_BUFFER_PAGE); |
289 | int space = tty_buffer_request_room(tty, goal); | 289 | int space = tty_buffer_request_room(tty, goal); |
290 | struct tty_buffer *tb = tty->buf.tail; | 290 | struct tty_buffer *tb = tty->buf.tail; |
291 | /* If there is no space then tb may be NULL */ | 291 | /* If there is no space then tb may be NULL */ |
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/tty_port.c b/drivers/char/tty_port.c index be492dd66437..a3bd1d0b66cf 100644 --- a/drivers/char/tty_port.c +++ b/drivers/char/tty_port.c | |||
@@ -119,7 +119,7 @@ EXPORT_SYMBOL(tty_port_tty_set); | |||
119 | static void tty_port_shutdown(struct tty_port *port) | 119 | static void tty_port_shutdown(struct tty_port *port) |
120 | { | 120 | { |
121 | mutex_lock(&port->mutex); | 121 | mutex_lock(&port->mutex); |
122 | if (port->ops->shutdown && | 122 | if (port->ops->shutdown && !port->console && |
123 | test_and_clear_bit(ASYNCB_INITIALIZED, &port->flags)) | 123 | test_and_clear_bit(ASYNCB_INITIALIZED, &port->flags)) |
124 | port->ops->shutdown(port); | 124 | port->ops->shutdown(port); |
125 | mutex_unlock(&port->mutex); | 125 | mutex_unlock(&port->mutex); |
diff --git a/drivers/char/virtio_console.c b/drivers/char/virtio_console.c index 213373b5f17f..44288ce0cb45 100644 --- a/drivers/char/virtio_console.c +++ b/drivers/char/virtio_console.c | |||
@@ -379,7 +379,7 @@ static ssize_t send_control_msg(struct port *port, unsigned int event, | |||
379 | struct scatterlist sg[1]; | 379 | struct scatterlist sg[1]; |
380 | struct virtio_console_control cpkt; | 380 | struct virtio_console_control cpkt; |
381 | struct virtqueue *vq; | 381 | struct virtqueue *vq; |
382 | int len; | 382 | unsigned int len; |
383 | 383 | ||
384 | if (!use_multiport(port->portdev)) | 384 | if (!use_multiport(port->portdev)) |
385 | return 0; | 385 | return 0; |
@@ -681,6 +681,10 @@ static void resize_console(struct port *port) | |||
681 | struct virtio_device *vdev; | 681 | struct virtio_device *vdev; |
682 | struct winsize ws; | 682 | struct winsize ws; |
683 | 683 | ||
684 | /* The port could have been hot-unplugged */ | ||
685 | if (!port) | ||
686 | return; | ||
687 | |||
684 | vdev = port->portdev->vdev; | 688 | vdev = port->portdev->vdev; |
685 | if (virtio_has_feature(vdev, VIRTIO_CONSOLE_F_SIZE)) { | 689 | if (virtio_has_feature(vdev, VIRTIO_CONSOLE_F_SIZE)) { |
686 | vdev->config->get(vdev, | 690 | vdev->config->get(vdev, |
@@ -947,11 +951,18 @@ static void handle_control_message(struct ports_device *portdev, | |||
947 | */ | 951 | */ |
948 | err = sysfs_create_group(&port->dev->kobj, | 952 | err = sysfs_create_group(&port->dev->kobj, |
949 | &port_attribute_group); | 953 | &port_attribute_group); |
950 | if (err) | 954 | if (err) { |
951 | dev_err(port->dev, | 955 | dev_err(port->dev, |
952 | "Error %d creating sysfs device attributes\n", | 956 | "Error %d creating sysfs device attributes\n", |
953 | err); | 957 | err); |
954 | 958 | } else { | |
959 | /* | ||
960 | * Generate a udev event so that appropriate | ||
961 | * symlinks can be created based on udev | ||
962 | * rules. | ||
963 | */ | ||
964 | kobject_uevent(&port->dev->kobj, KOBJ_CHANGE); | ||
965 | } | ||
955 | break; | 966 | break; |
956 | case VIRTIO_CONSOLE_PORT_REMOVE: | 967 | case VIRTIO_CONSOLE_PORT_REMOVE: |
957 | /* | 968 | /* |
@@ -1071,27 +1082,27 @@ static void config_intr(struct virtio_device *vdev) | |||
1071 | static unsigned int fill_queue(struct virtqueue *vq, spinlock_t *lock) | 1082 | static unsigned int fill_queue(struct virtqueue *vq, spinlock_t *lock) |
1072 | { | 1083 | { |
1073 | struct port_buffer *buf; | 1084 | struct port_buffer *buf; |
1074 | unsigned int ret; | 1085 | unsigned int nr_added_bufs; |
1075 | int err; | 1086 | int ret; |
1076 | 1087 | ||
1077 | ret = 0; | 1088 | nr_added_bufs = 0; |
1078 | do { | 1089 | do { |
1079 | buf = alloc_buf(PAGE_SIZE); | 1090 | buf = alloc_buf(PAGE_SIZE); |
1080 | if (!buf) | 1091 | if (!buf) |
1081 | break; | 1092 | break; |
1082 | 1093 | ||
1083 | spin_lock_irq(lock); | 1094 | spin_lock_irq(lock); |
1084 | err = add_inbuf(vq, buf); | 1095 | ret = add_inbuf(vq, buf); |
1085 | if (err < 0) { | 1096 | if (ret < 0) { |
1086 | spin_unlock_irq(lock); | 1097 | spin_unlock_irq(lock); |
1087 | free_buf(buf); | 1098 | free_buf(buf); |
1088 | break; | 1099 | break; |
1089 | } | 1100 | } |
1090 | ret++; | 1101 | nr_added_bufs++; |
1091 | spin_unlock_irq(lock); | 1102 | spin_unlock_irq(lock); |
1092 | } while (err > 0); | 1103 | } while (ret > 0); |
1093 | 1104 | ||
1094 | return ret; | 1105 | return nr_added_bufs; |
1095 | } | 1106 | } |
1096 | 1107 | ||
1097 | static int add_port(struct ports_device *portdev, u32 id) | 1108 | static int add_port(struct ports_device *portdev, u32 id) |
@@ -1100,6 +1111,7 @@ static int add_port(struct ports_device *portdev, u32 id) | |||
1100 | struct port *port; | 1111 | struct port *port; |
1101 | struct port_buffer *buf; | 1112 | struct port_buffer *buf; |
1102 | dev_t devt; | 1113 | dev_t devt; |
1114 | unsigned int nr_added_bufs; | ||
1103 | int err; | 1115 | int err; |
1104 | 1116 | ||
1105 | port = kmalloc(sizeof(*port), GFP_KERNEL); | 1117 | port = kmalloc(sizeof(*port), GFP_KERNEL); |
@@ -1144,8 +1156,8 @@ static int add_port(struct ports_device *portdev, u32 id) | |||
1144 | init_waitqueue_head(&port->waitqueue); | 1156 | init_waitqueue_head(&port->waitqueue); |
1145 | 1157 | ||
1146 | /* Fill the in_vq with buffers so the host can send us data. */ | 1158 | /* Fill the in_vq with buffers so the host can send us data. */ |
1147 | err = fill_queue(port->in_vq, &port->inbuf_lock); | 1159 | nr_added_bufs = fill_queue(port->in_vq, &port->inbuf_lock); |
1148 | if (!err) { | 1160 | if (!nr_added_bufs) { |
1149 | dev_err(port->dev, "Error allocating inbufs\n"); | 1161 | dev_err(port->dev, "Error allocating inbufs\n"); |
1150 | err = -ENOMEM; | 1162 | err = -ENOMEM; |
1151 | goto free_device; | 1163 | goto free_device; |
@@ -1442,12 +1454,14 @@ static int __devinit virtcons_probe(struct virtio_device *vdev) | |||
1442 | INIT_LIST_HEAD(&portdev->ports); | 1454 | INIT_LIST_HEAD(&portdev->ports); |
1443 | 1455 | ||
1444 | if (multiport) { | 1456 | if (multiport) { |
1457 | unsigned int nr_added_bufs; | ||
1458 | |||
1445 | spin_lock_init(&portdev->cvq_lock); | 1459 | spin_lock_init(&portdev->cvq_lock); |
1446 | INIT_WORK(&portdev->control_work, &control_work_handler); | 1460 | INIT_WORK(&portdev->control_work, &control_work_handler); |
1447 | INIT_WORK(&portdev->config_work, &config_work_handler); | 1461 | INIT_WORK(&portdev->config_work, &config_work_handler); |
1448 | 1462 | ||
1449 | err = fill_queue(portdev->c_ivq, &portdev->cvq_lock); | 1463 | nr_added_bufs = fill_queue(portdev->c_ivq, &portdev->cvq_lock); |
1450 | if (!err) { | 1464 | if (!nr_added_bufs) { |
1451 | dev_err(&vdev->dev, | 1465 | dev_err(&vdev->dev, |
1452 | "Error allocating buffers for control queue\n"); | 1466 | "Error allocating buffers for control queue\n"); |
1453 | err = -ENOMEM; | 1467 | err = -ENOMEM; |
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; |
diff --git a/drivers/char/vt_ioctl.c b/drivers/char/vt_ioctl.c index 87778dcf8727..6aa10284104a 100644 --- a/drivers/char/vt_ioctl.c +++ b/drivers/char/vt_ioctl.c | |||
@@ -888,7 +888,7 @@ int vt_ioctl(struct tty_struct *tty, struct file * file, | |||
888 | ret = -EFAULT; | 888 | ret = -EFAULT; |
889 | goto out; | 889 | goto out; |
890 | } | 890 | } |
891 | if (tmp.mode != VT_AUTO && tmp.mode != VT_PROCESS && tmp.mode != VT_PROCESS_AUTO) { | 891 | if (tmp.mode != VT_AUTO && tmp.mode != VT_PROCESS) { |
892 | ret = -EINVAL; | 892 | ret = -EINVAL; |
893 | goto out; | 893 | goto out; |
894 | } | 894 | } |
@@ -1622,7 +1622,7 @@ static void complete_change_console(struct vc_data *vc) | |||
1622 | * telling it that it has acquired. Also check if it has died and | 1622 | * telling it that it has acquired. Also check if it has died and |
1623 | * clean up (similar to logic employed in change_console()) | 1623 | * clean up (similar to logic employed in change_console()) |
1624 | */ | 1624 | */ |
1625 | if (vc->vt_mode.mode == VT_PROCESS || vc->vt_mode.mode == VT_PROCESS_AUTO) { | 1625 | if (vc->vt_mode.mode == VT_PROCESS) { |
1626 | /* | 1626 | /* |
1627 | * Send the signal as privileged - kill_pid() will | 1627 | * Send the signal as privileged - kill_pid() will |
1628 | * tell us if the process has gone or something else | 1628 | * tell us if the process has gone or something else |
@@ -1682,7 +1682,7 @@ void change_console(struct vc_data *new_vc) | |||
1682 | * vt to auto control. | 1682 | * vt to auto control. |
1683 | */ | 1683 | */ |
1684 | vc = vc_cons[fg_console].d; | 1684 | vc = vc_cons[fg_console].d; |
1685 | if (vc->vt_mode.mode == VT_PROCESS || vc->vt_mode.mode == VT_PROCESS_AUTO) { | 1685 | if (vc->vt_mode.mode == VT_PROCESS) { |
1686 | /* | 1686 | /* |
1687 | * Send the signal as privileged - kill_pid() will | 1687 | * Send the signal as privileged - kill_pid() will |
1688 | * tell us if the process has gone or something else | 1688 | * tell us if the process has gone or something else |
@@ -1693,28 +1693,27 @@ void change_console(struct vc_data *new_vc) | |||
1693 | */ | 1693 | */ |
1694 | vc->vt_newvt = new_vc->vc_num; | 1694 | vc->vt_newvt = new_vc->vc_num; |
1695 | if (kill_pid(vc->vt_pid, vc->vt_mode.relsig, 1) == 0) { | 1695 | if (kill_pid(vc->vt_pid, vc->vt_mode.relsig, 1) == 0) { |
1696 | if(vc->vt_mode.mode == VT_PROCESS) | ||
1697 | /* | ||
1698 | * It worked. Mark the vt to switch to and | ||
1699 | * return. The process needs to send us a | ||
1700 | * VT_RELDISP ioctl to complete the switch. | ||
1701 | */ | ||
1702 | return; | ||
1703 | } else { | ||
1704 | /* | 1696 | /* |
1705 | * The controlling process has died, so we revert back to | 1697 | * It worked. Mark the vt to switch to and |
1706 | * normal operation. In this case, we'll also change back | 1698 | * return. The process needs to send us a |
1707 | * to KD_TEXT mode. I'm not sure if this is strictly correct | 1699 | * VT_RELDISP ioctl to complete the switch. |
1708 | * but it saves the agony when the X server dies and the screen | ||
1709 | * remains blanked due to KD_GRAPHICS! It would be nice to do | ||
1710 | * this outside of VT_PROCESS but there is no single process | ||
1711 | * to account for and tracking tty count may be undesirable. | ||
1712 | */ | 1700 | */ |
1713 | reset_vc(vc); | 1701 | return; |
1714 | } | 1702 | } |
1715 | 1703 | ||
1716 | /* | 1704 | /* |
1717 | * Fall through to normal (VT_AUTO and VT_PROCESS_AUTO) handling of the switch... | 1705 | * The controlling process has died, so we revert back to |
1706 | * normal operation. In this case, we'll also change back | ||
1707 | * to KD_TEXT mode. I'm not sure if this is strictly correct | ||
1708 | * but it saves the agony when the X server dies and the screen | ||
1709 | * remains blanked due to KD_GRAPHICS! It would be nice to do | ||
1710 | * this outside of VT_PROCESS but there is no single process | ||
1711 | * to account for and tracking tty count may be undesirable. | ||
1712 | */ | ||
1713 | reset_vc(vc); | ||
1714 | |||
1715 | /* | ||
1716 | * Fall through to normal (VT_AUTO) handling of the switch... | ||
1718 | */ | 1717 | */ |
1719 | } | 1718 | } |
1720 | 1719 | ||