diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2013-02-21 16:41:04 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2013-02-21 16:41:04 -0500 |
commit | 21eaab6d19ed43e82ed39c8deb7f192134fb4a0e (patch) | |
tree | d995205afdcb7f47462bcd28067dc0c4ab0b7b02 /drivers/tty/hvc/hvsi.c | |
parent | 74e1a2a39355b2d3ae8c60c78d8add162c6d7183 (diff) | |
parent | 9e17df37d710f8998e9cb10a548304fe33d4a5c2 (diff) |
Merge tag 'tty-3.9-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty
Pull tty/serial patches from Greg Kroah-Hartman:
"Here's the big tty/serial driver patches for 3.9-rc1.
More tty port rework and fixes from Jiri here, as well as lots of
individual serial driver updates and fixes.
All of these have been in the linux-next tree for a while."
* tag 'tty-3.9-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty: (140 commits)
tty: mxser: improve error handling in mxser_probe() and mxser_module_init()
serial: imx: fix uninitialized variable warning
serial: tegra: assume CONFIG_OF
TTY: do not update atime/mtime on read/write
lguest: select CONFIG_TTY to build properly.
ARM defconfigs: add missing inclusions of linux/platform_device.h
fb/exynos: include platform_device.h
ARM: sa1100/assabet: include platform_device.h directly
serial: imx: Fix recursive locking bug
pps: Fix build breakage from decoupling pps from tty
tty: Remove ancient hardpps()
pps: Additional cleanups in uart_handle_dcd_change
pps: Move timestamp read into PPS code proper
pps: Don't crash the machine when exiting will do
pps: Fix a use-after free bug when unregistering a source.
pps: Use pps_lookup_dev to reduce ldisc coupling
pps: Add pps_lookup_dev() function
tty: serial: uartlite: Support uartlite on big and little endian systems
tty: serial: uartlite: Fix sparse and checkpatch warnings
serial/arc-uart: Miscll DT related updates (Grant's review comments)
...
Fix up trivial conflicts, mostly just due to the TTY config option
clashing with the EXPERIMENTAL removal.
Diffstat (limited to 'drivers/tty/hvc/hvsi.c')
-rw-r--r-- | drivers/tty/hvc/hvsi.c | 32 |
1 files changed, 13 insertions, 19 deletions
diff --git a/drivers/tty/hvc/hvsi.c b/drivers/tty/hvc/hvsi.c index 68357a6e4de9..ef95a154854a 100644 --- a/drivers/tty/hvc/hvsi.c +++ b/drivers/tty/hvc/hvsi.c | |||
@@ -329,8 +329,7 @@ static void hvsi_recv_query(struct hvsi_struct *hp, uint8_t *packet) | |||
329 | } | 329 | } |
330 | } | 330 | } |
331 | 331 | ||
332 | static void hvsi_insert_chars(struct hvsi_struct *hp, struct tty_struct *tty, | 332 | static void hvsi_insert_chars(struct hvsi_struct *hp, const char *buf, int len) |
333 | const char *buf, int len) | ||
334 | { | 333 | { |
335 | int i; | 334 | int i; |
336 | 335 | ||
@@ -346,7 +345,7 @@ static void hvsi_insert_chars(struct hvsi_struct *hp, struct tty_struct *tty, | |||
346 | continue; | 345 | continue; |
347 | } | 346 | } |
348 | #endif /* CONFIG_MAGIC_SYSRQ */ | 347 | #endif /* CONFIG_MAGIC_SYSRQ */ |
349 | tty_insert_flip_char(tty, c, 0); | 348 | tty_insert_flip_char(&hp->port, c, 0); |
350 | } | 349 | } |
351 | } | 350 | } |
352 | 351 | ||
@@ -359,8 +358,7 @@ static void hvsi_insert_chars(struct hvsi_struct *hp, struct tty_struct *tty, | |||
359 | * revisited. | 358 | * revisited. |
360 | */ | 359 | */ |
361 | #define TTY_THRESHOLD_THROTTLE 128 | 360 | #define TTY_THRESHOLD_THROTTLE 128 |
362 | static bool hvsi_recv_data(struct hvsi_struct *hp, struct tty_struct *tty, | 361 | static bool hvsi_recv_data(struct hvsi_struct *hp, const uint8_t *packet) |
363 | const uint8_t *packet) | ||
364 | { | 362 | { |
365 | const struct hvsi_header *header = (const struct hvsi_header *)packet; | 363 | const struct hvsi_header *header = (const struct hvsi_header *)packet; |
366 | const uint8_t *data = packet + sizeof(struct hvsi_header); | 364 | const uint8_t *data = packet + sizeof(struct hvsi_header); |
@@ -377,7 +375,7 @@ static bool hvsi_recv_data(struct hvsi_struct *hp, struct tty_struct *tty, | |||
377 | datalen = TTY_THRESHOLD_THROTTLE; | 375 | datalen = TTY_THRESHOLD_THROTTLE; |
378 | } | 376 | } |
379 | 377 | ||
380 | hvsi_insert_chars(hp, tty, data, datalen); | 378 | hvsi_insert_chars(hp, data, datalen); |
381 | 379 | ||
382 | if (overflow > 0) { | 380 | if (overflow > 0) { |
383 | /* | 381 | /* |
@@ -438,9 +436,7 @@ static int hvsi_load_chunk(struct hvsi_struct *hp, struct tty_struct *tty, | |||
438 | case VS_DATA_PACKET_HEADER: | 436 | case VS_DATA_PACKET_HEADER: |
439 | if (!is_open(hp)) | 437 | if (!is_open(hp)) |
440 | break; | 438 | break; |
441 | if (tty == NULL) | 439 | flip = hvsi_recv_data(hp, packet); |
442 | break; /* no tty buffer to put data in */ | ||
443 | flip = hvsi_recv_data(hp, tty, packet); | ||
444 | break; | 440 | break; |
445 | case VS_CONTROL_PACKET_HEADER: | 441 | case VS_CONTROL_PACKET_HEADER: |
446 | hvsi_recv_control(hp, packet, tty, handshake); | 442 | hvsi_recv_control(hp, packet, tty, handshake); |
@@ -469,17 +465,17 @@ static int hvsi_load_chunk(struct hvsi_struct *hp, struct tty_struct *tty, | |||
469 | compact_inbuf(hp, packet); | 465 | compact_inbuf(hp, packet); |
470 | 466 | ||
471 | if (flip) | 467 | if (flip) |
472 | tty_flip_buffer_push(tty); | 468 | tty_flip_buffer_push(&hp->port); |
473 | 469 | ||
474 | return 1; | 470 | return 1; |
475 | } | 471 | } |
476 | 472 | ||
477 | static void hvsi_send_overflow(struct hvsi_struct *hp, struct tty_struct *tty) | 473 | static void hvsi_send_overflow(struct hvsi_struct *hp) |
478 | { | 474 | { |
479 | pr_debug("%s: delivering %i bytes overflow\n", __func__, | 475 | pr_debug("%s: delivering %i bytes overflow\n", __func__, |
480 | hp->n_throttle); | 476 | hp->n_throttle); |
481 | 477 | ||
482 | hvsi_insert_chars(hp, tty, hp->throttle_buf, hp->n_throttle); | 478 | hvsi_insert_chars(hp, hp->throttle_buf, hp->n_throttle); |
483 | hp->n_throttle = 0; | 479 | hp->n_throttle = 0; |
484 | } | 480 | } |
485 | 481 | ||
@@ -514,8 +510,8 @@ static irqreturn_t hvsi_interrupt(int irq, void *arg) | |||
514 | if (tty && hp->n_throttle && !test_bit(TTY_THROTTLED, &tty->flags)) { | 510 | if (tty && hp->n_throttle && !test_bit(TTY_THROTTLED, &tty->flags)) { |
515 | /* we weren't hung up and we weren't throttled, so we can | 511 | /* we weren't hung up and we weren't throttled, so we can |
516 | * deliver the rest now */ | 512 | * deliver the rest now */ |
517 | hvsi_send_overflow(hp, tty); | 513 | hvsi_send_overflow(hp); |
518 | tty_flip_buffer_push(tty); | 514 | tty_flip_buffer_push(&hp->port); |
519 | } | 515 | } |
520 | spin_unlock_irqrestore(&hp->lock, flags); | 516 | spin_unlock_irqrestore(&hp->lock, flags); |
521 | 517 | ||
@@ -1001,8 +997,8 @@ static void hvsi_unthrottle(struct tty_struct *tty) | |||
1001 | 997 | ||
1002 | spin_lock_irqsave(&hp->lock, flags); | 998 | spin_lock_irqsave(&hp->lock, flags); |
1003 | if (hp->n_throttle) { | 999 | if (hp->n_throttle) { |
1004 | hvsi_send_overflow(hp, tty); | 1000 | hvsi_send_overflow(hp); |
1005 | tty_flip_buffer_push(tty); | 1001 | tty_flip_buffer_push(&hp->port); |
1006 | } | 1002 | } |
1007 | spin_unlock_irqrestore(&hp->lock, flags); | 1003 | spin_unlock_irqrestore(&hp->lock, flags); |
1008 | 1004 | ||
@@ -1187,9 +1183,7 @@ static int __init hvsi_console_init(void) | |||
1187 | hvsi_wait = poll_for_state; /* no irqs yet; must poll */ | 1183 | hvsi_wait = poll_for_state; /* no irqs yet; must poll */ |
1188 | 1184 | ||
1189 | /* search device tree for vty nodes */ | 1185 | /* search device tree for vty nodes */ |
1190 | for (vty = of_find_compatible_node(NULL, "serial", "hvterm-protocol"); | 1186 | for_each_compatible_node(vty, "serial", "hvterm-protocol") { |
1191 | vty != NULL; | ||
1192 | vty = of_find_compatible_node(vty, "serial", "hvterm-protocol")) { | ||
1193 | struct hvsi_struct *hp; | 1187 | struct hvsi_struct *hp; |
1194 | const uint32_t *vtermno, *irq; | 1188 | const uint32_t *vtermno, *irq; |
1195 | 1189 | ||