Commit ec99f05fcb972de9208bec234dd9ca1b23381146

Authored by Dan Murphy

Merge branch 'master' of http://git.kernel.org/pub/scm/linux/kernel/git/torvalds…

…/linux into ti-linux-3.15.y

* 'master' of http://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux:
  libata: Blacklist queued trim for Crucial M500
  md: always set MD_RECOVERY_INTR when interrupting a reshape thread.
  xhci: delete endpoints from bandwidth list before freeing whole device
  staging: r8192e_pci: fix htons error
  usb: pci-quirks: Prevent Sony VAIO t-series from switching usb ports
  md: always set MD_RECOVERY_INTR when aborting a reshape or other "resync".
  USB: cdc-wdm: properly include types.h
  usb: cdc-wdm: export cdc-wdm uapi header
  USB: serial: option: add support for Novatel E371 PCIe card
  USB: ftdi_sio: add NovaTech OrionLXm product ID
  USB: io_ti: fix firmware download on big-endian machines (part 2)
  USB: Avoid runtime suspend loops for HCDs that can't handle suspend/resume
  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
  x86, vdso: Fix an OOPS accessing the HPET mapping w/o an HPET

Signed-off-by: Dan Murphy <DMurphy@ti.com>

Showing 21 changed files Side-by-side Diff

arch/x86/vdso/vdso32-setup.c
... ... @@ -155,6 +155,7 @@
155 155 unsigned long addr;
156 156 int ret = 0;
157 157 struct vm_area_struct *vma;
  158 + static struct page *no_pages[] = {NULL};
158 159  
159 160 #ifdef CONFIG_X86_X32_ABI
160 161 if (test_thread_flag(TIF_X32))
... ... @@ -193,7 +194,7 @@
193 194 addr - VDSO_OFFSET(VDSO_PREV_PAGES),
194 195 VDSO_OFFSET(VDSO_PREV_PAGES),
195 196 VM_READ,
196   - NULL);
  197 + no_pages);
197 198  
198 199 if (IS_ERR(vma)) {
199 200 ret = PTR_ERR(vma);
drivers/ata/libata-core.c
... ... @@ -4224,10 +4224,10 @@
4224 4224 { "PIONEER DVD-RW DVR-216D", NULL, ATA_HORKAGE_NOSETXFER },
4225 4225  
4226 4226 /* devices that don't properly handle queued TRIM commands */
4227   - { "Micron_M500*", "MU0[1-4]*", ATA_HORKAGE_NO_NCQ_TRIM, },
4228   - { "Crucial_CT???M500SSD*", "MU0[1-4]*", ATA_HORKAGE_NO_NCQ_TRIM, },
4229   - { "Micron_M550*", NULL, ATA_HORKAGE_NO_NCQ_TRIM, },
4230   - { "Crucial_CT???M550SSD*", NULL, ATA_HORKAGE_NO_NCQ_TRIM, },
  4227 + { "Micron_M500*", NULL, ATA_HORKAGE_NO_NCQ_TRIM, },
  4228 + { "Crucial_CT???M500SSD*", NULL, ATA_HORKAGE_NO_NCQ_TRIM, },
  4229 + { "Micron_M550*", NULL, ATA_HORKAGE_NO_NCQ_TRIM, },
  4230 + { "Crucial_CT???M550SSD*", NULL, ATA_HORKAGE_NO_NCQ_TRIM, },
4231 4231  
4232 4232 /*
4233 4233 * Some WD SATA-I drives spin up and down erratically when the link
... ... @@ -7381,8 +7381,10 @@
7381 7381 /* just incase thread restarts... */
7382 7382 if (test_bit(MD_RECOVERY_DONE, &mddev->recovery))
7383 7383 return;
7384   - if (mddev->ro) /* never try to sync a read-only array */
  7384 + if (mddev->ro) {/* never try to sync a read-only array */
  7385 + set_bit(MD_RECOVERY_INTR, &mddev->recovery);
7385 7386 return;
  7387 + }
7386 7388  
7387 7389 if (test_bit(MD_RECOVERY_SYNC, &mddev->recovery)) {
7388 7390 if (test_bit(MD_RECOVERY_CHECK, &mddev->recovery)) {
... ... @@ -7824,6 +7826,7 @@
7824 7826 /* There is no thread, but we need to call
7825 7827 * ->spare_active and clear saved_raid_disk
7826 7828 */
  7829 + set_bit(MD_RECOVERY_INTR, &mddev->recovery);
7827 7830 md_reap_sync_thread(mddev);
7828 7831 clear_bit(MD_RECOVERY_NEEDED, &mddev->recovery);
7829 7832 goto unlock;
drivers/staging/comedi/drivers/ni_daq_700.c
... ... @@ -139,6 +139,8 @@
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++) {
drivers/staging/rtl8192e/rtllib_tx.c
... ... @@ -171,7 +171,7 @@
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 }
drivers/staging/speakup/main.c
... ... @@ -2218,6 +2218,7 @@
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;
drivers/staging/speakup/selection.c
... ... @@ -4,6 +4,10 @@
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  
10 14  
11 15  
12 16  
13 17  
14 18  
15 19  
16 20  
... ... @@ -121,31 +125,62 @@
121 125 return 0;
122 126 }
123 127  
124   -/* TODO: move to some helper thread, probably. That'd fix having to check for
125   - * in_atomic(). */
126   -int speakup_paste_selection(struct tty_struct *tty)
  128 +struct speakup_paste_work {
  129 + struct work_struct work;
  130 + struct tty_struct *tty;
  131 +};
  132 +
  133 +static void __speakup_paste_selection(struct work_struct *work)
127 134 {
  135 + struct speakup_paste_work *spw =
  136 + container_of(work, struct speakup_paste_work, work);
  137 + struct tty_struct *tty = xchg(&spw->tty, NULL);
128 138 struct vc_data *vc = (struct vc_data *) tty->driver_data;
129 139 int pasted = 0, count;
  140 + struct tty_ldisc *ld;
130 141 DECLARE_WAITQUEUE(wait, current);
  142 +
  143 + ld = tty_ldisc_ref_wait(tty);
  144 + tty_buffer_lock_exclusive(&vc->port);
  145 +
131 146 add_wait_queue(&vc->paste_wait, &wait);
132 147 while (sel_buffer && sel_buffer_lth > pasted) {
133 148 set_current_state(TASK_INTERRUPTIBLE);
134 149 if (test_bit(TTY_THROTTLED, &tty->flags)) {
135   - if (in_atomic())
136   - /* if we are in an interrupt handler, abort */
137   - break;
138 150 schedule();
139 151 continue;
140 152 }
141 153 count = sel_buffer_lth - pasted;
142   - count = min_t(int, count, tty->receive_room);
143   - tty->ldisc->ops->receive_buf(tty, sel_buffer + pasted,
144   - NULL, count);
  154 + count = tty_ldisc_receive_buf(ld, sel_buffer + pasted, NULL,
  155 + count);
145 156 pasted += count;
146 157 }
147 158 remove_wait_queue(&vc->paste_wait, &wait);
148 159 current->state = TASK_RUNNING;
  160 +
  161 + tty_buffer_unlock_exclusive(&vc->port);
  162 + tty_ldisc_deref(ld);
  163 + tty_kref_put(tty);
  164 +}
  165 +
  166 +static struct speakup_paste_work speakup_paste_work = {
  167 + .work = __WORK_INITIALIZER(speakup_paste_work.work,
  168 + __speakup_paste_selection)
  169 +};
  170 +
  171 +int speakup_paste_selection(struct tty_struct *tty)
  172 +{
  173 + if (cmpxchg(&speakup_paste_work.tty, NULL, tty) != NULL)
  174 + return -EBUSY;
  175 +
  176 + tty_kref_get(tty);
  177 + schedule_work_on(WORK_CPU_UNBOUND, &speakup_paste_work.work);
149 178 return 0;
  179 +}
  180 +
  181 +void speakup_cancel_paste(void)
  182 +{
  183 + cancel_work_sync(&speakup_paste_work.work);
  184 + tty_kref_put(speakup_paste_work.tty);
150 185 }
drivers/staging/speakup/speakup.h
... ... @@ -75,6 +75,7 @@
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);
drivers/staging/speakup/speakup_acntsa.c
... ... @@ -60,15 +60,15 @@
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
drivers/tty/tty_buffer.c
... ... @@ -60,6 +60,7 @@
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 {
... ... @@ -73,6 +74,7 @@
73 74 if (restart)
74 75 queue_work(system_unbound_wq, &buf->work);
75 76 }
  77 +EXPORT_SYMBOL_GPL(tty_buffer_unlock_exclusive);
76 78  
77 79 /**
78 80 * tty_buffer_space_avail - return unused buffer space
drivers/usb/core/driver.c
... ... @@ -1822,10 +1822,13 @@
1822 1822 if (status == -EAGAIN || status == -EBUSY)
1823 1823 usb_mark_last_busy(udev);
1824 1824  
1825   - /* The PM core reacts badly unless the return code is 0,
1826   - * -EAGAIN, or -EBUSY, so always return -EBUSY on an error.
  1825 + /*
  1826 + * The PM core reacts badly unless the return code is 0,
  1827 + * -EAGAIN, or -EBUSY, so always return -EBUSY on an error
  1828 + * (except for root hubs, because they don't suspend through
  1829 + * an upstream port like other USB devices).
1827 1830 */
1828   - if (status != 0)
  1831 + if (status != 0 && udev->parent)
1829 1832 return -EBUSY;
1830 1833 return status;
1831 1834 }
drivers/usb/core/hub.c
... ... @@ -1691,8 +1691,19 @@
1691 1691 */
1692 1692 pm_runtime_set_autosuspend_delay(&hdev->dev, 0);
1693 1693  
1694   - /* Hubs have proper suspend/resume support. */
1695   - usb_enable_autosuspend(hdev);
  1694 + /*
  1695 + * Hubs have proper suspend/resume support, except for root hubs
  1696 + * where the controller driver doesn't have bus_suspend and
  1697 + * bus_resume methods.
  1698 + */
  1699 + if (hdev->parent) { /* normal device */
  1700 + usb_enable_autosuspend(hdev);
  1701 + } else { /* root hub */
  1702 + const struct hc_driver *drv = bus_to_hcd(hdev->bus)->driver;
  1703 +
  1704 + if (drv->bus_suspend && drv->bus_resume)
  1705 + usb_enable_autosuspend(hdev);
  1706 + }
1696 1707  
1697 1708 if (hdev->level == MAX_TOPO_LEVEL) {
1698 1709 dev_err(&intf->dev,
drivers/usb/host/pci-quirks.c
... ... @@ -847,6 +847,13 @@
847 847 bool ehci_found = false;
848 848 struct pci_dev *companion = NULL;
849 849  
  850 + /* Sony VAIO t-series with subsystem device ID 90a8 is not capable of
  851 + * switching ports from EHCI to xHCI
  852 + */
  853 + if (xhci_pdev->subsystem_vendor == PCI_VENDOR_ID_SONY &&
  854 + xhci_pdev->subsystem_device == 0x90a8)
  855 + return;
  856 +
850 857 /* make sure an intel EHCI controller exists */
851 858 for_each_pci_dev(companion) {
852 859 if (companion->class == PCI_CLASS_SERIAL_USB_EHCI &&
drivers/usb/host/xhci-mem.c
... ... @@ -1822,6 +1822,16 @@
1822 1822 kfree(cur_cd);
1823 1823 }
1824 1824  
  1825 + num_ports = HCS_MAX_PORTS(xhci->hcs_params1);
  1826 + for (i = 0; i < num_ports; i++) {
  1827 + struct xhci_interval_bw_table *bwt = &xhci->rh_bw[i].bw_table;
  1828 + for (j = 0; j < XHCI_MAX_INTERVAL; j++) {
  1829 + struct list_head *ep = &bwt->interval_bw[j].endpoints;
  1830 + while (!list_empty(ep))
  1831 + list_del_init(ep->next);
  1832 + }
  1833 + }
  1834 +
1825 1835 for (i = 1; i < MAX_HC_SLOTS; ++i)
1826 1836 xhci_free_virt_device(xhci, i);
1827 1837  
... ... @@ -1856,16 +1866,6 @@
1856 1866  
1857 1867 if (!xhci->rh_bw)
1858 1868 goto no_bw;
1859   -
1860   - num_ports = HCS_MAX_PORTS(xhci->hcs_params1);
1861   - for (i = 0; i < num_ports; i++) {
1862   - struct xhci_interval_bw_table *bwt = &xhci->rh_bw[i].bw_table;
1863   - for (j = 0; j < XHCI_MAX_INTERVAL; j++) {
1864   - struct list_head *ep = &bwt->interval_bw[j].endpoints;
1865   - while (!list_empty(ep))
1866   - list_del_init(ep->next);
1867   - }
1868   - }
1869 1869  
1870 1870 for (i = 0; i < num_ports; i++) {
1871 1871 struct xhci_tt_bw_info *tt, *n;
drivers/usb/serial/ftdi_sio.c
... ... @@ -580,6 +580,8 @@
580 580 { USB_DEVICE(FTDI_VID, FTDI_TAVIR_STK500_PID) },
581 581 { USB_DEVICE(FTDI_VID, FTDI_TIAO_UMPA_PID),
582 582 .driver_info = (kernel_ulong_t)&ftdi_jtag_quirk },
  583 + { USB_DEVICE(FTDI_VID, FTDI_NT_ORIONLXM_PID),
  584 + .driver_info = (kernel_ulong_t)&ftdi_jtag_quirk },
583 585 /*
584 586 * ELV devices:
585 587 */
drivers/usb/serial/ftdi_sio_ids.h
... ... @@ -538,6 +538,11 @@
538 538 */
539 539 #define FTDI_TIAO_UMPA_PID 0x8a98 /* TIAO/DIYGADGET USB Multi-Protocol Adapter */
540 540  
  541 +/*
  542 + * NovaTech product ids (FTDI_VID)
  543 + */
  544 +#define FTDI_NT_ORIONLXM_PID 0x7c90 /* OrionLXm Substation Automation Platform */
  545 +
541 546  
542 547 /********************************/
543 548 /** third-party VID/PID combos **/
drivers/usb/serial/io_ti.c
... ... @@ -821,7 +821,7 @@
821 821 firmware_rec = (struct ti_i2c_firmware_rec*)i2c_header->Data;
822 822  
823 823 i2c_header->Type = I2C_DESC_TYPE_FIRMWARE_BLANK;
824   - i2c_header->Size = (__u16)buffer_size;
  824 + i2c_header->Size = cpu_to_le16(buffer_size);
825 825 i2c_header->CheckSum = cs;
826 826 firmware_rec->Ver_Major = OperationalMajorVersion;
827 827 firmware_rec->Ver_Minor = OperationalMinorVersion;
drivers/usb/serial/io_usbvend.h
... ... @@ -594,7 +594,7 @@
594 594  
595 595 struct ti_i2c_desc {
596 596 __u8 Type; // Type of descriptor
597   - __u16 Size; // Size of data only not including header
  597 + __le16 Size; // Size of data only not including header
598 598 __u8 CheckSum; // Checksum (8 bit sum of data only)
599 599 __u8 Data[0]; // Data starts here
600 600 } __attribute__((packed));
drivers/usb/serial/option.c
... ... @@ -161,6 +161,7 @@
161 161 #define NOVATELWIRELESS_PRODUCT_HSPA_EMBEDDED_FULLSPEED 0x9000
162 162 #define NOVATELWIRELESS_PRODUCT_HSPA_EMBEDDED_HIGHSPEED 0x9001
163 163 #define NOVATELWIRELESS_PRODUCT_E362 0x9010
  164 +#define NOVATELWIRELESS_PRODUCT_E371 0x9011
164 165 #define NOVATELWIRELESS_PRODUCT_G2 0xA010
165 166 #define NOVATELWIRELESS_PRODUCT_MC551 0xB001
166 167  
... ... @@ -1012,6 +1013,7 @@
1012 1013 /* Novatel Ovation MC551 a.k.a. Verizon USB551L */
1013 1014 { USB_DEVICE_AND_INTERFACE_INFO(NOVATELWIRELESS_VENDOR_ID, NOVATELWIRELESS_PRODUCT_MC551, 0xff, 0xff, 0xff) },
1014 1015 { USB_DEVICE_AND_INTERFACE_INFO(NOVATELWIRELESS_VENDOR_ID, NOVATELWIRELESS_PRODUCT_E362, 0xff, 0xff, 0xff) },
  1016 + { USB_DEVICE_AND_INTERFACE_INFO(NOVATELWIRELESS_VENDOR_ID, NOVATELWIRELESS_PRODUCT_E371, 0xff, 0xff, 0xff) },
1015 1017  
1016 1018 { USB_DEVICE(AMOI_VENDOR_ID, AMOI_PRODUCT_H01) },
1017 1019 { USB_DEVICE(AMOI_VENDOR_ID, AMOI_PRODUCT_H01A) },
include/uapi/linux/usb/Kbuild
1 1 # UAPI Header export list
2 2 header-y += audio.h
3 3 header-y += cdc.h
  4 +header-y += cdc-wdm.h
4 5 header-y += ch11.h
5 6 header-y += ch9.h
6 7 header-y += functionfs.h
include/uapi/linux/usb/cdc-wdm.h
... ... @@ -9,6 +9,8 @@
9 9 #ifndef _UAPI__LINUX_USB_CDC_WDM_H
10 10 #define _UAPI__LINUX_USB_CDC_WDM_H
11 11  
  12 +#include <linux/types.h>
  13 +
12 14 /*
13 15 * This IOCTL is used to retrieve the wMaxCommand for the device,
14 16 * defining the message limit for both reading and writing.