aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/char
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/char')
-rw-r--r--drivers/char/briq_panel.c7
-rw-r--r--drivers/char/hvc_console.c49
-rw-r--r--drivers/char/hvc_iseries.c2
-rw-r--r--drivers/char/hvc_vio.c2
-rw-r--r--drivers/char/hvsi.c4
-rw-r--r--drivers/char/tpm/tpm_atmel.h4
-rw-r--r--drivers/char/watchdog/Kconfig2
7 files changed, 46 insertions, 24 deletions
diff --git a/drivers/char/briq_panel.c b/drivers/char/briq_panel.c
index 8dcf9d20f449..c70d52ace8b2 100644
--- a/drivers/char/briq_panel.c
+++ b/drivers/char/briq_panel.c
@@ -202,13 +202,16 @@ static struct miscdevice briq_panel_miscdev = {
202 202
203static int __init briq_panel_init(void) 203static int __init briq_panel_init(void)
204{ 204{
205 struct device_node *root = find_path_device("/"); 205 struct device_node *root = of_find_node_by_path("/");
206 const char *machine; 206 const char *machine;
207 int i; 207 int i;
208 208
209 machine = get_property(root, "model", NULL); 209 machine = get_property(root, "model", NULL);
210 if (!machine || strncmp(machine, "TotalImpact,BRIQ-1", 18) != 0) 210 if (!machine || strncmp(machine, "TotalImpact,BRIQ-1", 18) != 0) {
211 of_node_put(root);
211 return -ENODEV; 212 return -ENODEV;
213 }
214 of_node_put(root);
212 215
213 printk(KERN_INFO 216 printk(KERN_INFO
214 "briq_panel: v%s Dr. Karsten Jeppesen (kj@totalimpact.com)\n", 217 "briq_panel: v%s Dr. Karsten Jeppesen (kj@totalimpact.com)\n",
diff --git a/drivers/char/hvc_console.c b/drivers/char/hvc_console.c
index a0a88aa23f5b..0f9ed7b46a6d 100644
--- a/drivers/char/hvc_console.c
+++ b/drivers/char/hvc_console.c
@@ -47,8 +47,6 @@
47#define HVC_MAJOR 229 47#define HVC_MAJOR 229
48#define HVC_MINOR 0 48#define HVC_MINOR 0
49 49
50#define TIMEOUT (10)
51
52/* 50/*
53 * Wait this long per iteration while trying to push buffered data to the 51 * Wait this long per iteration while trying to push buffered data to the
54 * hypervisor before allowing the tty to complete a close operation. 52 * hypervisor before allowing the tty to complete a close operation.
@@ -104,12 +102,12 @@ static DEFINE_SPINLOCK(hvc_structs_lock);
104/* 102/*
105 * This value is used to assign a tty->index value to a hvc_struct based 103 * This value is used to assign a tty->index value to a hvc_struct based
106 * upon order of exposure via hvc_probe(), when we can not match it to 104 * upon order of exposure via hvc_probe(), when we can not match it to
107 * a console canidate registered with hvc_instantiate(). 105 * a console candidate registered with hvc_instantiate().
108 */ 106 */
109static int last_hvc = -1; 107static int last_hvc = -1;
110 108
111/* 109/*
112 * Do not call this function with either the hvc_strucst_lock or the hvc_struct 110 * Do not call this function with either the hvc_structs_lock or the hvc_struct
113 * lock held. If successful, this function increments the kobject reference 111 * lock held. If successful, this function increments the kobject reference
114 * count against the target hvc_struct so it should be released when finished. 112 * count against the target hvc_struct so it should be released when finished.
115 */ 113 */
@@ -162,7 +160,7 @@ void hvc_console_print(struct console *co, const char *b, unsigned count)
162 if (index >= MAX_NR_HVC_CONSOLES) 160 if (index >= MAX_NR_HVC_CONSOLES)
163 return; 161 return;
164 162
165 /* This console adapter was removed so it is not useable. */ 163 /* This console adapter was removed so it is not usable. */
166 if (vtermnos[index] < 0) 164 if (vtermnos[index] < 0)
167 return; 165 return;
168 166
@@ -220,7 +218,7 @@ struct console hvc_con_driver = {
220}; 218};
221 219
222/* 220/*
223 * Early console initialization. Preceeds driver initialization. 221 * Early console initialization. Precedes driver initialization.
224 * 222 *
225 * (1) we are first, and the user specified another driver 223 * (1) we are first, and the user specified another driver
226 * -- index will remain -1 224 * -- index will remain -1
@@ -257,7 +255,7 @@ int hvc_instantiate(uint32_t vtermno, int index, struct hv_ops *ops)
257 if (vtermnos[index] != -1) 255 if (vtermnos[index] != -1)
258 return -1; 256 return -1;
259 257
260 /* make sure no no tty has been registerd in this index */ 258 /* make sure no no tty has been registered in this index */
261 hp = hvc_get_by_index(index); 259 hp = hvc_get_by_index(index);
262 if (hp) { 260 if (hp) {
263 kobject_put(&hp->kobj); 261 kobject_put(&hp->kobj);
@@ -267,7 +265,7 @@ int hvc_instantiate(uint32_t vtermno, int index, struct hv_ops *ops)
267 vtermnos[index] = vtermno; 265 vtermnos[index] = vtermno;
268 cons_ops[index] = ops; 266 cons_ops[index] = ops;
269 267
270 /* reserve all indices upto and including this index */ 268 /* reserve all indices up to and including this index */
271 if (last_hvc < index) 269 if (last_hvc < index)
272 last_hvc = index; 270 last_hvc = index;
273 271
@@ -528,7 +526,7 @@ static int hvc_write(struct tty_struct *tty, const unsigned char *buf, int count
528 526
529/* 527/*
530 * This is actually a contract between the driver and the tty layer outlining 528 * This is actually a contract between the driver and the tty layer outlining
531 * how much write room the driver can guarentee will be sent OR BUFFERED. This 529 * how much write room the driver can guarantee will be sent OR BUFFERED. This
532 * driver MUST honor the return value. 530 * driver MUST honor the return value.
533 */ 531 */
534static int hvc_write_room(struct tty_struct *tty) 532static int hvc_write_room(struct tty_struct *tty)
@@ -550,6 +548,18 @@ static int hvc_chars_in_buffer(struct tty_struct *tty)
550 return hp->n_outbuf; 548 return hp->n_outbuf;
551} 549}
552 550
551/*
552 * timeout will vary between the MIN and MAX values defined here. By default
553 * and during console activity we will use a default MIN_TIMEOUT of 10. When
554 * the console is idle, we increase the timeout value on each pass through
555 * msleep until we reach the max. This may be noticeable as a brief (average
556 * one second) delay on the console before the console responds to input when
557 * there has been no input for some time.
558 */
559#define MIN_TIMEOUT (10)
560#define MAX_TIMEOUT (2000)
561static u32 timeout = MIN_TIMEOUT;
562
553#define HVC_POLL_READ 0x00000001 563#define HVC_POLL_READ 0x00000001
554#define HVC_POLL_WRITE 0x00000002 564#define HVC_POLL_WRITE 0x00000002
555 565
@@ -642,9 +652,14 @@ static int hvc_poll(struct hvc_struct *hp)
642 bail: 652 bail:
643 spin_unlock_irqrestore(&hp->lock, flags); 653 spin_unlock_irqrestore(&hp->lock, flags);
644 654
645 if (read_total) 655 if (read_total) {
656 /* Activity is occurring, so reset the polling backoff value to
657 a minimum for performance. */
658 timeout = MIN_TIMEOUT;
659
646 tty_flip_buffer_push(tty); 660 tty_flip_buffer_push(tty);
647 661 }
662
648 return poll_mask; 663 return poll_mask;
649} 664}
650 665
@@ -688,8 +703,12 @@ int khvcd(void *unused)
688 if (!hvc_kicked) { 703 if (!hvc_kicked) {
689 if (poll_mask == 0) 704 if (poll_mask == 0)
690 schedule(); 705 schedule();
691 else 706 else {
692 msleep_interruptible(TIMEOUT); 707 if (timeout < MAX_TIMEOUT)
708 timeout += (timeout >> 6) + 1;
709
710 msleep_interruptible(timeout);
711 }
693 } 712 }
694 __set_current_state(TASK_RUNNING); 713 __set_current_state(TASK_RUNNING);
695 } while (!kthread_should_stop()); 714 } while (!kthread_should_stop());
@@ -794,7 +813,7 @@ int __devexit hvc_remove(struct hvc_struct *hp)
794 813
795 /* 814 /*
796 * We 'put' the instance that was grabbed when the kobject instance 815 * We 'put' the instance that was grabbed when the kobject instance
797 * was intialized using kobject_init(). Let the last holder of this 816 * was initialized using kobject_init(). Let the last holder of this
798 * kobject cause it to be removed, which will probably be the tty_hangup 817 * kobject cause it to be removed, which will probably be the tty_hangup
799 * below. 818 * below.
800 */ 819 */
@@ -850,7 +869,7 @@ int __init hvc_init(void)
850} 869}
851module_init(hvc_init); 870module_init(hvc_init);
852 871
853/* This isn't particularily necessary due to this being a console driver 872/* This isn't particularly necessary due to this being a console driver
854 * but it is nice to be thorough. 873 * but it is nice to be thorough.
855 */ 874 */
856static void __exit hvc_exit(void) 875static void __exit hvc_exit(void)
diff --git a/drivers/char/hvc_iseries.c b/drivers/char/hvc_iseries.c
index f144a947bd17..ec420fe8a908 100644
--- a/drivers/char/hvc_iseries.c
+++ b/drivers/char/hvc_iseries.c
@@ -575,7 +575,7 @@ static int hvc_find_vtys(void)
575 (num_found >= VTTY_PORTS)) 575 (num_found >= VTTY_PORTS))
576 break; 576 break;
577 577
578 vtermno = get_property(vty, "reg", NULL); 578 vtermno = of_get_property(vty, "reg", NULL);
579 if (!vtermno) 579 if (!vtermno)
580 continue; 580 continue;
581 581
diff --git a/drivers/char/hvc_vio.c b/drivers/char/hvc_vio.c
index f9c00844d2bf..94a542e20efb 100644
--- a/drivers/char/hvc_vio.c
+++ b/drivers/char/hvc_vio.c
@@ -153,7 +153,7 @@ static int hvc_find_vtys(void)
153 if (num_found >= MAX_NR_HVC_CONSOLES) 153 if (num_found >= MAX_NR_HVC_CONSOLES)
154 break; 154 break;
155 155
156 vtermno = get_property(vty, "reg", NULL); 156 vtermno = of_get_property(vty, "reg", NULL);
157 if (!vtermno) 157 if (!vtermno)
158 continue; 158 continue;
159 159
diff --git a/drivers/char/hvsi.c b/drivers/char/hvsi.c
index 50315d6364fd..d5a752da322f 100644
--- a/drivers/char/hvsi.c
+++ b/drivers/char/hvsi.c
@@ -1279,8 +1279,8 @@ static int __init hvsi_console_init(void)
1279 struct hvsi_struct *hp; 1279 struct hvsi_struct *hp;
1280 const uint32_t *vtermno, *irq; 1280 const uint32_t *vtermno, *irq;
1281 1281
1282 vtermno = get_property(vty, "reg", NULL); 1282 vtermno = of_get_property(vty, "reg", NULL);
1283 irq = get_property(vty, "interrupts", NULL); 1283 irq = of_get_property(vty, "interrupts", NULL);
1284 if (!vtermno || !irq) 1284 if (!vtermno || !irq)
1285 continue; 1285 continue;
1286 1286
diff --git a/drivers/char/tpm/tpm_atmel.h b/drivers/char/tpm/tpm_atmel.h
index aefd683c60b7..3c852009196e 100644
--- a/drivers/char/tpm/tpm_atmel.h
+++ b/drivers/char/tpm/tpm_atmel.h
@@ -53,8 +53,8 @@ static void __iomem * atmel_get_base_addr(unsigned long *base, int *region_size)
53 } 53 }
54 54
55 reg = get_property(dn, "reg", &reglen); 55 reg = get_property(dn, "reg", &reglen);
56 naddrc = prom_n_addr_cells(dn); 56 naddrc = of_n_addr_cells(dn);
57 nsizec = prom_n_size_cells(dn); 57 nsizec = of_n_size_cells(dn);
58 58
59 of_node_put(dn); 59 of_node_put(dn);
60 60
diff --git a/drivers/char/watchdog/Kconfig b/drivers/char/watchdog/Kconfig
index e812aa129e28..60198a78974c 100644
--- a/drivers/char/watchdog/Kconfig
+++ b/drivers/char/watchdog/Kconfig
@@ -548,7 +548,7 @@ config MV64X60_WDT
548 depends on WATCHDOG && MV64X60 548 depends on WATCHDOG && MV64X60
549 549
550config BOOKE_WDT 550config BOOKE_WDT
551 tristate "PowerPC Book-E Watchdog Timer" 551 bool "PowerPC Book-E Watchdog Timer"
552 depends on WATCHDOG && (BOOKE || 4xx) 552 depends on WATCHDOG && (BOOKE || 4xx)
553 ---help--- 553 ---help---
554 Please see Documentation/watchdog/watchdog-api.txt for 554 Please see Documentation/watchdog/watchdog-api.txt for