Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge tag 'staging-3.15-rc8' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging

Pull staging driver fixes from Greg KH:
"Here are some staging driver fixes for 3.15.

Three are for the speakup drivers (one fixes a regression caused in
3.15-rc, and the other two resolve a tty issue found by Ben Hutchings)
The comedi and r8192e_pci driver fixes also resolve reported issues"

* tag 'staging-3.15-rc8' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging:
staging: r8192e_pci: fix htons error
Staging: speakup: Update __speakup_paste_selection() tty (ab)usage to match vt
Staging: speakup: Move pasting into a work item
staging: comedi: ni_daq_700: add mux settling delay
speakup: fix incorrect perms on speakup_acntsa.c

+54 -14
+2
drivers/staging/comedi/drivers/ni_daq_700.c
··· 139 139 /* write channel to multiplexer */ 140 140 /* set mask scan bit high to disable scanning */ 141 141 outb(chan | 0x80, dev->iobase + CMD_R1); 142 + /* mux needs 2us to really settle [Fred Brooks]. */ 143 + udelay(2); 142 144 143 145 /* convert n samples */ 144 146 for (n = 0; n < insn->n; n++) {
+1 -1
drivers/staging/rtl8192e/rtllib_tx.c
··· 171 171 snap->oui[1] = oui[1]; 172 172 snap->oui[2] = oui[2]; 173 173 174 - *(u16 *)(data + SNAP_SIZE) = h_proto; 174 + *(__be16 *)(data + SNAP_SIZE) = htons(h_proto); 175 175 176 176 return SNAP_SIZE + sizeof(u16); 177 177 }
+1
drivers/staging/speakup/main.c
··· 2218 2218 unregister_keyboard_notifier(&keyboard_notifier_block); 2219 2219 unregister_vt_notifier(&vt_notifier_block); 2220 2220 speakup_unregister_devsynth(); 2221 + speakup_cancel_paste(); 2221 2222 del_timer(&cursor_timer); 2222 2223 kthread_stop(speakup_task); 2223 2224 speakup_task = NULL;
+43 -9
drivers/staging/speakup/selection.c
··· 4 4 #include <linux/sched.h> 5 5 #include <linux/device.h> /* for dev_warn */ 6 6 #include <linux/selection.h> 7 + #include <linux/workqueue.h> 8 + #include <linux/tty.h> 9 + #include <linux/tty_flip.h> 10 + #include <asm/cmpxchg.h> 7 11 8 12 #include "speakup.h" 9 13 ··· 125 121 return 0; 126 122 } 127 123 128 - /* TODO: move to some helper thread, probably. That'd fix having to check for 129 - * in_atomic(). */ 130 - int speakup_paste_selection(struct tty_struct *tty) 124 + struct speakup_paste_work { 125 + struct work_struct work; 126 + struct tty_struct *tty; 127 + }; 128 + 129 + static void __speakup_paste_selection(struct work_struct *work) 131 130 { 131 + struct speakup_paste_work *spw = 132 + container_of(work, struct speakup_paste_work, work); 133 + struct tty_struct *tty = xchg(&spw->tty, NULL); 132 134 struct vc_data *vc = (struct vc_data *) tty->driver_data; 133 135 int pasted = 0, count; 136 + struct tty_ldisc *ld; 134 137 DECLARE_WAITQUEUE(wait, current); 138 + 139 + ld = tty_ldisc_ref_wait(tty); 140 + tty_buffer_lock_exclusive(&vc->port); 141 + 135 142 add_wait_queue(&vc->paste_wait, &wait); 136 143 while (sel_buffer && sel_buffer_lth > pasted) { 137 144 set_current_state(TASK_INTERRUPTIBLE); 138 145 if (test_bit(TTY_THROTTLED, &tty->flags)) { 139 - if (in_atomic()) 140 - /* if we are in an interrupt handler, abort */ 141 - break; 142 146 schedule(); 143 147 continue; 144 148 } 145 149 count = sel_buffer_lth - pasted; 146 - count = min_t(int, count, tty->receive_room); 147 - tty->ldisc->ops->receive_buf(tty, sel_buffer + pasted, 148 - NULL, count); 150 + count = tty_ldisc_receive_buf(ld, sel_buffer + pasted, NULL, 151 + count); 149 152 pasted += count; 150 153 } 151 154 remove_wait_queue(&vc->paste_wait, &wait); 152 155 current->state = TASK_RUNNING; 156 + 157 + tty_buffer_unlock_exclusive(&vc->port); 158 + tty_ldisc_deref(ld); 159 + tty_kref_put(tty); 160 + } 161 + 162 + static struct speakup_paste_work speakup_paste_work = { 163 + .work = __WORK_INITIALIZER(speakup_paste_work.work, 164 + __speakup_paste_selection) 165 + }; 166 + 167 + int speakup_paste_selection(struct tty_struct *tty) 168 + { 169 + if (cmpxchg(&speakup_paste_work.tty, NULL, tty) != NULL) 170 + return -EBUSY; 171 + 172 + tty_kref_get(tty); 173 + schedule_work_on(WORK_CPU_UNBOUND, &speakup_paste_work.work); 153 174 return 0; 154 175 } 155 176 177 + void speakup_cancel_paste(void) 178 + { 179 + cancel_work_sync(&speakup_paste_work.work); 180 + tty_kref_put(speakup_paste_work.tty); 181 + }
+1
drivers/staging/speakup/speakup.h
··· 75 75 extern void speakup_clear_selection(void); 76 76 extern int speakup_set_selection(struct tty_struct *tty); 77 77 extern int speakup_paste_selection(struct tty_struct *tty); 78 + extern void speakup_cancel_paste(void); 78 79 extern void speakup_register_devsynth(void); 79 80 extern void speakup_unregister_devsynth(void); 80 81 extern void synth_write(const char *buf, size_t count);
+4 -4
drivers/staging/speakup/speakup_acntsa.c
··· 60 60 __ATTR(vol, S_IWUGO|S_IRUGO, spk_var_show, spk_var_store); 61 61 62 62 static struct kobj_attribute delay_time_attribute = 63 - __ATTR(delay_time, S_IRUSR|S_IRUGO, spk_var_show, spk_var_store); 63 + __ATTR(delay_time, S_IWUSR|S_IRUGO, spk_var_show, spk_var_store); 64 64 static struct kobj_attribute direct_attribute = 65 65 __ATTR(direct, S_IWUGO|S_IRUGO, spk_var_show, spk_var_store); 66 66 static struct kobj_attribute full_time_attribute = 67 - __ATTR(full_time, S_IRUSR|S_IRUGO, spk_var_show, spk_var_store); 67 + __ATTR(full_time, S_IWUSR|S_IRUGO, spk_var_show, spk_var_store); 68 68 static struct kobj_attribute jiffy_delta_attribute = 69 - __ATTR(jiffy_delta, S_IRUSR|S_IRUGO, spk_var_show, spk_var_store); 69 + __ATTR(jiffy_delta, S_IWUSR|S_IRUGO, spk_var_show, spk_var_store); 70 70 static struct kobj_attribute trigger_time_attribute = 71 - __ATTR(trigger_time, S_IRUSR|S_IRUGO, spk_var_show, spk_var_store); 71 + __ATTR(trigger_time, S_IWUSR|S_IRUGO, spk_var_show, spk_var_store); 72 72 73 73 /* 74 74 * Create a group of attributes so that we can create and destroy them all
+2
drivers/tty/tty_buffer.c
··· 60 60 atomic_inc(&buf->priority); 61 61 mutex_lock(&buf->lock); 62 62 } 63 + EXPORT_SYMBOL_GPL(tty_buffer_lock_exclusive); 63 64 64 65 void tty_buffer_unlock_exclusive(struct tty_port *port) 65 66 { ··· 74 73 if (restart) 75 74 queue_work(system_unbound_wq, &buf->work); 76 75 } 76 + EXPORT_SYMBOL_GPL(tty_buffer_unlock_exclusive); 77 77 78 78 /** 79 79 * tty_buffer_space_avail - return unused buffer space