diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2013-03-28 18:54:25 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2013-03-28 18:54:25 -0400 |
commit | 0776ce03b1348d39ba3035ea3ee3d268a42912ce (patch) | |
tree | 24b9533ad5b05aeb02a730019f6860211253e1fd | |
parent | 045ecc26a06459c5c88eade6e545bb109a1cdb38 (diff) | |
parent | 482b0b5d82bd916cc0c55a2abf65bdc69023b843 (diff) |
Merge tag 'usb-3.9-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb
Pull USB fixes from Greg Kroah-Hartman:
"Here are some USB fixes to resolve issues reported recently, as well
as a new device id for the ftdi_sio driver."
* tag 'usb-3.9-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb:
usb: ftdi_sio: Add support for Mitsubishi FX-USB-AW/-BD
usb: Fix compile error by selecting USB_OTG_UTILS
USB: serial: fix hang when opening port
USB: EHCI: fix bug in iTD/siTD DMA pool allocation
xhci: Don't warn on empty ring for suspended devices.
usb: xhci: Fix TRB transfer length macro used for Event TRB.
usb/acpi: binding xhci root hub usb port with ACPI
usb: add find_raw_port_number callback to struct hc_driver()
usb: xhci: fix build warning
-rw-r--r-- | drivers/usb/core/hcd.c | 8 | ||||
-rw-r--r-- | drivers/usb/core/usb-acpi.c | 8 | ||||
-rw-r--r-- | drivers/usb/gadget/Kconfig | 1 | ||||
-rw-r--r-- | drivers/usb/host/ehci-sched.c | 2 | ||||
-rw-r--r-- | drivers/usb/host/xhci-mem.c | 36 | ||||
-rw-r--r-- | drivers/usb/host/xhci-pci.c | 1 | ||||
-rw-r--r-- | drivers/usb/host/xhci-ring.c | 61 | ||||
-rw-r--r-- | drivers/usb/host/xhci.c | 22 | ||||
-rw-r--r-- | drivers/usb/host/xhci.h | 5 | ||||
-rw-r--r-- | drivers/usb/phy/Kconfig | 1 | ||||
-rw-r--r-- | drivers/usb/serial/ftdi_sio.c | 1 | ||||
-rw-r--r-- | drivers/usb/serial/ftdi_sio_ids.h | 7 | ||||
-rw-r--r-- | drivers/usb/serial/usb-serial.c | 1 | ||||
-rw-r--r-- | include/linux/usb/hcd.h | 2 |
14 files changed, 101 insertions, 55 deletions
diff --git a/drivers/usb/core/hcd.c b/drivers/usb/core/hcd.c index 99b34a30354f..f9ec44cbb82f 100644 --- a/drivers/usb/core/hcd.c +++ b/drivers/usb/core/hcd.c | |||
@@ -2412,6 +2412,14 @@ int usb_hcd_is_primary_hcd(struct usb_hcd *hcd) | |||
2412 | } | 2412 | } |
2413 | EXPORT_SYMBOL_GPL(usb_hcd_is_primary_hcd); | 2413 | EXPORT_SYMBOL_GPL(usb_hcd_is_primary_hcd); |
2414 | 2414 | ||
2415 | int usb_hcd_find_raw_port_number(struct usb_hcd *hcd, int port1) | ||
2416 | { | ||
2417 | if (!hcd->driver->find_raw_port_number) | ||
2418 | return port1; | ||
2419 | |||
2420 | return hcd->driver->find_raw_port_number(hcd, port1); | ||
2421 | } | ||
2422 | |||
2415 | static int usb_hcd_request_irqs(struct usb_hcd *hcd, | 2423 | static int usb_hcd_request_irqs(struct usb_hcd *hcd, |
2416 | unsigned int irqnum, unsigned long irqflags) | 2424 | unsigned int irqnum, unsigned long irqflags) |
2417 | { | 2425 | { |
diff --git a/drivers/usb/core/usb-acpi.c b/drivers/usb/core/usb-acpi.c index b6f4bad3f756..255c14464bf2 100644 --- a/drivers/usb/core/usb-acpi.c +++ b/drivers/usb/core/usb-acpi.c | |||
@@ -15,6 +15,7 @@ | |||
15 | #include <linux/kernel.h> | 15 | #include <linux/kernel.h> |
16 | #include <linux/acpi.h> | 16 | #include <linux/acpi.h> |
17 | #include <linux/pci.h> | 17 | #include <linux/pci.h> |
18 | #include <linux/usb/hcd.h> | ||
18 | #include <acpi/acpi_bus.h> | 19 | #include <acpi/acpi_bus.h> |
19 | 20 | ||
20 | #include "usb.h" | 21 | #include "usb.h" |
@@ -188,8 +189,13 @@ static int usb_acpi_find_device(struct device *dev, acpi_handle *handle) | |||
188 | * connected to. | 189 | * connected to. |
189 | */ | 190 | */ |
190 | if (!udev->parent) { | 191 | if (!udev->parent) { |
191 | *handle = acpi_get_child(DEVICE_ACPI_HANDLE(&udev->dev), | 192 | struct usb_hcd *hcd = bus_to_hcd(udev->bus); |
193 | int raw_port_num; | ||
194 | |||
195 | raw_port_num = usb_hcd_find_raw_port_number(hcd, | ||
192 | port_num); | 196 | port_num); |
197 | *handle = acpi_get_child(DEVICE_ACPI_HANDLE(&udev->dev), | ||
198 | raw_port_num); | ||
193 | if (!*handle) | 199 | if (!*handle) |
194 | return -ENODEV; | 200 | return -ENODEV; |
195 | } else { | 201 | } else { |
diff --git a/drivers/usb/gadget/Kconfig b/drivers/usb/gadget/Kconfig index 5a0c541daf89..c7525b1cad74 100644 --- a/drivers/usb/gadget/Kconfig +++ b/drivers/usb/gadget/Kconfig | |||
@@ -145,6 +145,7 @@ config USB_LPC32XX | |||
145 | tristate "LPC32XX USB Peripheral Controller" | 145 | tristate "LPC32XX USB Peripheral Controller" |
146 | depends on ARCH_LPC32XX | 146 | depends on ARCH_LPC32XX |
147 | select USB_ISP1301 | 147 | select USB_ISP1301 |
148 | select USB_OTG_UTILS | ||
148 | help | 149 | help |
149 | This option selects the USB device controller in the LPC32xx SoC. | 150 | This option selects the USB device controller in the LPC32xx SoC. |
150 | 151 | ||
diff --git a/drivers/usb/host/ehci-sched.c b/drivers/usb/host/ehci-sched.c index b476daf49f6f..010f686d8881 100644 --- a/drivers/usb/host/ehci-sched.c +++ b/drivers/usb/host/ehci-sched.c | |||
@@ -1214,6 +1214,7 @@ itd_urb_transaction ( | |||
1214 | 1214 | ||
1215 | memset (itd, 0, sizeof *itd); | 1215 | memset (itd, 0, sizeof *itd); |
1216 | itd->itd_dma = itd_dma; | 1216 | itd->itd_dma = itd_dma; |
1217 | itd->frame = 9999; /* an invalid value */ | ||
1217 | list_add (&itd->itd_list, &sched->td_list); | 1218 | list_add (&itd->itd_list, &sched->td_list); |
1218 | } | 1219 | } |
1219 | spin_unlock_irqrestore (&ehci->lock, flags); | 1220 | spin_unlock_irqrestore (&ehci->lock, flags); |
@@ -1915,6 +1916,7 @@ sitd_urb_transaction ( | |||
1915 | 1916 | ||
1916 | memset (sitd, 0, sizeof *sitd); | 1917 | memset (sitd, 0, sizeof *sitd); |
1917 | sitd->sitd_dma = sitd_dma; | 1918 | sitd->sitd_dma = sitd_dma; |
1919 | sitd->frame = 9999; /* an invalid value */ | ||
1918 | list_add (&sitd->sitd_list, &iso_sched->td_list); | 1920 | list_add (&sitd->sitd_list, &iso_sched->td_list); |
1919 | } | 1921 | } |
1920 | 1922 | ||
diff --git a/drivers/usb/host/xhci-mem.c b/drivers/usb/host/xhci-mem.c index 35616ffbe3ae..6dc238c592bc 100644 --- a/drivers/usb/host/xhci-mem.c +++ b/drivers/usb/host/xhci-mem.c | |||
@@ -1022,44 +1022,24 @@ void xhci_copy_ep0_dequeue_into_input_ctx(struct xhci_hcd *xhci, | |||
1022 | * is attached to (or the roothub port its ancestor hub is attached to). All we | 1022 | * is attached to (or the roothub port its ancestor hub is attached to). All we |
1023 | * know is the index of that port under either the USB 2.0 or the USB 3.0 | 1023 | * know is the index of that port under either the USB 2.0 or the USB 3.0 |
1024 | * roothub, but that doesn't give us the real index into the HW port status | 1024 | * roothub, but that doesn't give us the real index into the HW port status |
1025 | * registers. Scan through the xHCI roothub port array, looking for the Nth | 1025 | * registers. Call xhci_find_raw_port_number() to get real index. |
1026 | * entry of the correct port speed. Return the port number of that entry. | ||
1027 | */ | 1026 | */ |
1028 | static u32 xhci_find_real_port_number(struct xhci_hcd *xhci, | 1027 | static u32 xhci_find_real_port_number(struct xhci_hcd *xhci, |
1029 | struct usb_device *udev) | 1028 | struct usb_device *udev) |
1030 | { | 1029 | { |
1031 | struct usb_device *top_dev; | 1030 | struct usb_device *top_dev; |
1032 | unsigned int num_similar_speed_ports; | 1031 | struct usb_hcd *hcd; |
1033 | unsigned int faked_port_num; | 1032 | |
1034 | int i; | 1033 | if (udev->speed == USB_SPEED_SUPER) |
1034 | hcd = xhci->shared_hcd; | ||
1035 | else | ||
1036 | hcd = xhci->main_hcd; | ||
1035 | 1037 | ||
1036 | for (top_dev = udev; top_dev->parent && top_dev->parent->parent; | 1038 | for (top_dev = udev; top_dev->parent && top_dev->parent->parent; |
1037 | top_dev = top_dev->parent) | 1039 | top_dev = top_dev->parent) |
1038 | /* Found device below root hub */; | 1040 | /* Found device below root hub */; |
1039 | faked_port_num = top_dev->portnum; | ||
1040 | for (i = 0, num_similar_speed_ports = 0; | ||
1041 | i < HCS_MAX_PORTS(xhci->hcs_params1); i++) { | ||
1042 | u8 port_speed = xhci->port_array[i]; | ||
1043 | |||
1044 | /* | ||
1045 | * Skip ports that don't have known speeds, or have duplicate | ||
1046 | * Extended Capabilities port speed entries. | ||
1047 | */ | ||
1048 | if (port_speed == 0 || port_speed == DUPLICATE_ENTRY) | ||
1049 | continue; | ||
1050 | 1041 | ||
1051 | /* | 1042 | return xhci_find_raw_port_number(hcd, top_dev->portnum); |
1052 | * USB 3.0 ports are always under a USB 3.0 hub. USB 2.0 and | ||
1053 | * 1.1 ports are under the USB 2.0 hub. If the port speed | ||
1054 | * matches the device speed, it's a similar speed port. | ||
1055 | */ | ||
1056 | if ((port_speed == 0x03) == (udev->speed == USB_SPEED_SUPER)) | ||
1057 | num_similar_speed_ports++; | ||
1058 | if (num_similar_speed_ports == faked_port_num) | ||
1059 | /* Roothub ports are numbered from 1 to N */ | ||
1060 | return i+1; | ||
1061 | } | ||
1062 | return 0; | ||
1063 | } | 1043 | } |
1064 | 1044 | ||
1065 | /* Setup an xHCI virtual device for a Set Address command */ | 1045 | /* Setup an xHCI virtual device for a Set Address command */ |
diff --git a/drivers/usb/host/xhci-pci.c b/drivers/usb/host/xhci-pci.c index af259e0ec172..1a30c380043c 100644 --- a/drivers/usb/host/xhci-pci.c +++ b/drivers/usb/host/xhci-pci.c | |||
@@ -313,6 +313,7 @@ static const struct hc_driver xhci_pci_hc_driver = { | |||
313 | .set_usb2_hw_lpm = xhci_set_usb2_hardware_lpm, | 313 | .set_usb2_hw_lpm = xhci_set_usb2_hardware_lpm, |
314 | .enable_usb3_lpm_timeout = xhci_enable_usb3_lpm_timeout, | 314 | .enable_usb3_lpm_timeout = xhci_enable_usb3_lpm_timeout, |
315 | .disable_usb3_lpm_timeout = xhci_disable_usb3_lpm_timeout, | 315 | .disable_usb3_lpm_timeout = xhci_disable_usb3_lpm_timeout, |
316 | .find_raw_port_number = xhci_find_raw_port_number, | ||
316 | }; | 317 | }; |
317 | 318 | ||
318 | /*-------------------------------------------------------------------------*/ | 319 | /*-------------------------------------------------------------------------*/ |
diff --git a/drivers/usb/host/xhci-ring.c b/drivers/usb/host/xhci-ring.c index 882875465301..1969c001b3f9 100644 --- a/drivers/usb/host/xhci-ring.c +++ b/drivers/usb/host/xhci-ring.c | |||
@@ -1599,14 +1599,20 @@ static void handle_port_status(struct xhci_hcd *xhci, | |||
1599 | max_ports = HCS_MAX_PORTS(xhci->hcs_params1); | 1599 | max_ports = HCS_MAX_PORTS(xhci->hcs_params1); |
1600 | if ((port_id <= 0) || (port_id > max_ports)) { | 1600 | if ((port_id <= 0) || (port_id > max_ports)) { |
1601 | xhci_warn(xhci, "Invalid port id %d\n", port_id); | 1601 | xhci_warn(xhci, "Invalid port id %d\n", port_id); |
1602 | bogus_port_status = true; | 1602 | inc_deq(xhci, xhci->event_ring); |
1603 | goto cleanup; | 1603 | return; |
1604 | } | 1604 | } |
1605 | 1605 | ||
1606 | /* Figure out which usb_hcd this port is attached to: | 1606 | /* Figure out which usb_hcd this port is attached to: |
1607 | * is it a USB 3.0 port or a USB 2.0/1.1 port? | 1607 | * is it a USB 3.0 port or a USB 2.0/1.1 port? |
1608 | */ | 1608 | */ |
1609 | major_revision = xhci->port_array[port_id - 1]; | 1609 | major_revision = xhci->port_array[port_id - 1]; |
1610 | |||
1611 | /* Find the right roothub. */ | ||
1612 | hcd = xhci_to_hcd(xhci); | ||
1613 | if ((major_revision == 0x03) != (hcd->speed == HCD_USB3)) | ||
1614 | hcd = xhci->shared_hcd; | ||
1615 | |||
1610 | if (major_revision == 0) { | 1616 | if (major_revision == 0) { |
1611 | xhci_warn(xhci, "Event for port %u not in " | 1617 | xhci_warn(xhci, "Event for port %u not in " |
1612 | "Extended Capabilities, ignoring.\n", | 1618 | "Extended Capabilities, ignoring.\n", |
@@ -1629,10 +1635,6 @@ static void handle_port_status(struct xhci_hcd *xhci, | |||
1629 | * into the index into the ports on the correct split roothub, and the | 1635 | * into the index into the ports on the correct split roothub, and the |
1630 | * correct bus_state structure. | 1636 | * correct bus_state structure. |
1631 | */ | 1637 | */ |
1632 | /* Find the right roothub. */ | ||
1633 | hcd = xhci_to_hcd(xhci); | ||
1634 | if ((major_revision == 0x03) != (hcd->speed == HCD_USB3)) | ||
1635 | hcd = xhci->shared_hcd; | ||
1636 | bus_state = &xhci->bus_state[hcd_index(hcd)]; | 1638 | bus_state = &xhci->bus_state[hcd_index(hcd)]; |
1637 | if (hcd->speed == HCD_USB3) | 1639 | if (hcd->speed == HCD_USB3) |
1638 | port_array = xhci->usb3_ports; | 1640 | port_array = xhci->usb3_ports; |
@@ -2027,8 +2029,8 @@ static int process_ctrl_td(struct xhci_hcd *xhci, struct xhci_td *td, | |||
2027 | if (event_trb != ep_ring->dequeue && | 2029 | if (event_trb != ep_ring->dequeue && |
2028 | event_trb != td->last_trb) | 2030 | event_trb != td->last_trb) |
2029 | td->urb->actual_length = | 2031 | td->urb->actual_length = |
2030 | td->urb->transfer_buffer_length | 2032 | td->urb->transfer_buffer_length - |
2031 | - TRB_LEN(le32_to_cpu(event->transfer_len)); | 2033 | EVENT_TRB_LEN(le32_to_cpu(event->transfer_len)); |
2032 | else | 2034 | else |
2033 | td->urb->actual_length = 0; | 2035 | td->urb->actual_length = 0; |
2034 | 2036 | ||
@@ -2060,7 +2062,7 @@ static int process_ctrl_td(struct xhci_hcd *xhci, struct xhci_td *td, | |||
2060 | /* Maybe the event was for the data stage? */ | 2062 | /* Maybe the event was for the data stage? */ |
2061 | td->urb->actual_length = | 2063 | td->urb->actual_length = |
2062 | td->urb->transfer_buffer_length - | 2064 | td->urb->transfer_buffer_length - |
2063 | TRB_LEN(le32_to_cpu(event->transfer_len)); | 2065 | EVENT_TRB_LEN(le32_to_cpu(event->transfer_len)); |
2064 | xhci_dbg(xhci, "Waiting for status " | 2066 | xhci_dbg(xhci, "Waiting for status " |
2065 | "stage event\n"); | 2067 | "stage event\n"); |
2066 | return 0; | 2068 | return 0; |
@@ -2096,7 +2098,7 @@ static int process_isoc_td(struct xhci_hcd *xhci, struct xhci_td *td, | |||
2096 | /* handle completion code */ | 2098 | /* handle completion code */ |
2097 | switch (trb_comp_code) { | 2099 | switch (trb_comp_code) { |
2098 | case COMP_SUCCESS: | 2100 | case COMP_SUCCESS: |
2099 | if (TRB_LEN(le32_to_cpu(event->transfer_len)) == 0) { | 2101 | if (EVENT_TRB_LEN(le32_to_cpu(event->transfer_len)) == 0) { |
2100 | frame->status = 0; | 2102 | frame->status = 0; |
2101 | break; | 2103 | break; |
2102 | } | 2104 | } |
@@ -2141,7 +2143,7 @@ static int process_isoc_td(struct xhci_hcd *xhci, struct xhci_td *td, | |||
2141 | len += TRB_LEN(le32_to_cpu(cur_trb->generic.field[2])); | 2143 | len += TRB_LEN(le32_to_cpu(cur_trb->generic.field[2])); |
2142 | } | 2144 | } |
2143 | len += TRB_LEN(le32_to_cpu(cur_trb->generic.field[2])) - | 2145 | len += TRB_LEN(le32_to_cpu(cur_trb->generic.field[2])) - |
2144 | TRB_LEN(le32_to_cpu(event->transfer_len)); | 2146 | EVENT_TRB_LEN(le32_to_cpu(event->transfer_len)); |
2145 | 2147 | ||
2146 | if (trb_comp_code != COMP_STOP_INVAL) { | 2148 | if (trb_comp_code != COMP_STOP_INVAL) { |
2147 | frame->actual_length = len; | 2149 | frame->actual_length = len; |
@@ -2199,7 +2201,7 @@ static int process_bulk_intr_td(struct xhci_hcd *xhci, struct xhci_td *td, | |||
2199 | case COMP_SUCCESS: | 2201 | case COMP_SUCCESS: |
2200 | /* Double check that the HW transferred everything. */ | 2202 | /* Double check that the HW transferred everything. */ |
2201 | if (event_trb != td->last_trb || | 2203 | if (event_trb != td->last_trb || |
2202 | TRB_LEN(le32_to_cpu(event->transfer_len)) != 0) { | 2204 | EVENT_TRB_LEN(le32_to_cpu(event->transfer_len)) != 0) { |
2203 | xhci_warn(xhci, "WARN Successful completion " | 2205 | xhci_warn(xhci, "WARN Successful completion " |
2204 | "on short TX\n"); | 2206 | "on short TX\n"); |
2205 | if (td->urb->transfer_flags & URB_SHORT_NOT_OK) | 2207 | if (td->urb->transfer_flags & URB_SHORT_NOT_OK) |
@@ -2227,18 +2229,18 @@ static int process_bulk_intr_td(struct xhci_hcd *xhci, struct xhci_td *td, | |||
2227 | "%d bytes untransferred\n", | 2229 | "%d bytes untransferred\n", |
2228 | td->urb->ep->desc.bEndpointAddress, | 2230 | td->urb->ep->desc.bEndpointAddress, |
2229 | td->urb->transfer_buffer_length, | 2231 | td->urb->transfer_buffer_length, |
2230 | TRB_LEN(le32_to_cpu(event->transfer_len))); | 2232 | EVENT_TRB_LEN(le32_to_cpu(event->transfer_len))); |
2231 | /* Fast path - was this the last TRB in the TD for this URB? */ | 2233 | /* Fast path - was this the last TRB in the TD for this URB? */ |
2232 | if (event_trb == td->last_trb) { | 2234 | if (event_trb == td->last_trb) { |
2233 | if (TRB_LEN(le32_to_cpu(event->transfer_len)) != 0) { | 2235 | if (EVENT_TRB_LEN(le32_to_cpu(event->transfer_len)) != 0) { |
2234 | td->urb->actual_length = | 2236 | td->urb->actual_length = |
2235 | td->urb->transfer_buffer_length - | 2237 | td->urb->transfer_buffer_length - |
2236 | TRB_LEN(le32_to_cpu(event->transfer_len)); | 2238 | EVENT_TRB_LEN(le32_to_cpu(event->transfer_len)); |
2237 | if (td->urb->transfer_buffer_length < | 2239 | if (td->urb->transfer_buffer_length < |
2238 | td->urb->actual_length) { | 2240 | td->urb->actual_length) { |
2239 | xhci_warn(xhci, "HC gave bad length " | 2241 | xhci_warn(xhci, "HC gave bad length " |
2240 | "of %d bytes left\n", | 2242 | "of %d bytes left\n", |
2241 | TRB_LEN(le32_to_cpu(event->transfer_len))); | 2243 | EVENT_TRB_LEN(le32_to_cpu(event->transfer_len))); |
2242 | td->urb->actual_length = 0; | 2244 | td->urb->actual_length = 0; |
2243 | if (td->urb->transfer_flags & URB_SHORT_NOT_OK) | 2245 | if (td->urb->transfer_flags & URB_SHORT_NOT_OK) |
2244 | *status = -EREMOTEIO; | 2246 | *status = -EREMOTEIO; |
@@ -2280,7 +2282,7 @@ static int process_bulk_intr_td(struct xhci_hcd *xhci, struct xhci_td *td, | |||
2280 | if (trb_comp_code != COMP_STOP_INVAL) | 2282 | if (trb_comp_code != COMP_STOP_INVAL) |
2281 | td->urb->actual_length += | 2283 | td->urb->actual_length += |
2282 | TRB_LEN(le32_to_cpu(cur_trb->generic.field[2])) - | 2284 | TRB_LEN(le32_to_cpu(cur_trb->generic.field[2])) - |
2283 | TRB_LEN(le32_to_cpu(event->transfer_len)); | 2285 | EVENT_TRB_LEN(le32_to_cpu(event->transfer_len)); |
2284 | } | 2286 | } |
2285 | 2287 | ||
2286 | return finish_td(xhci, td, event_trb, event, ep, status, false); | 2288 | return finish_td(xhci, td, event_trb, event, ep, status, false); |
@@ -2368,7 +2370,7 @@ static int handle_tx_event(struct xhci_hcd *xhci, | |||
2368 | * transfer type | 2370 | * transfer type |
2369 | */ | 2371 | */ |
2370 | case COMP_SUCCESS: | 2372 | case COMP_SUCCESS: |
2371 | if (TRB_LEN(le32_to_cpu(event->transfer_len)) == 0) | 2373 | if (EVENT_TRB_LEN(le32_to_cpu(event->transfer_len)) == 0) |
2372 | break; | 2374 | break; |
2373 | if (xhci->quirks & XHCI_TRUST_TX_LENGTH) | 2375 | if (xhci->quirks & XHCI_TRUST_TX_LENGTH) |
2374 | trb_comp_code = COMP_SHORT_TX; | 2376 | trb_comp_code = COMP_SHORT_TX; |
@@ -2461,14 +2463,21 @@ static int handle_tx_event(struct xhci_hcd *xhci, | |||
2461 | * TD list. | 2463 | * TD list. |
2462 | */ | 2464 | */ |
2463 | if (list_empty(&ep_ring->td_list)) { | 2465 | if (list_empty(&ep_ring->td_list)) { |
2464 | xhci_warn(xhci, "WARN Event TRB for slot %d ep %d " | 2466 | /* |
2465 | "with no TDs queued?\n", | 2467 | * A stopped endpoint may generate an extra completion |
2466 | TRB_TO_SLOT_ID(le32_to_cpu(event->flags)), | 2468 | * event if the device was suspended. Don't print |
2467 | ep_index); | 2469 | * warnings. |
2468 | xhci_dbg(xhci, "Event TRB with TRB type ID %u\n", | 2470 | */ |
2469 | (le32_to_cpu(event->flags) & | 2471 | if (!(trb_comp_code == COMP_STOP || |
2470 | TRB_TYPE_BITMASK)>>10); | 2472 | trb_comp_code == COMP_STOP_INVAL)) { |
2471 | xhci_print_trb_offsets(xhci, (union xhci_trb *) event); | 2473 | xhci_warn(xhci, "WARN Event TRB for slot %d ep %d with no TDs queued?\n", |
2474 | TRB_TO_SLOT_ID(le32_to_cpu(event->flags)), | ||
2475 | ep_index); | ||
2476 | xhci_dbg(xhci, "Event TRB with TRB type ID %u\n", | ||
2477 | (le32_to_cpu(event->flags) & | ||
2478 | TRB_TYPE_BITMASK)>>10); | ||
2479 | xhci_print_trb_offsets(xhci, (union xhci_trb *) event); | ||
2480 | } | ||
2472 | if (ep->skip) { | 2481 | if (ep->skip) { |
2473 | ep->skip = false; | 2482 | ep->skip = false; |
2474 | xhci_dbg(xhci, "td_list is empty while skip " | 2483 | xhci_dbg(xhci, "td_list is empty while skip " |
diff --git a/drivers/usb/host/xhci.c b/drivers/usb/host/xhci.c index 849470b18831..53b8f89a0b1c 100644 --- a/drivers/usb/host/xhci.c +++ b/drivers/usb/host/xhci.c | |||
@@ -3779,6 +3779,28 @@ int xhci_address_device(struct usb_hcd *hcd, struct usb_device *udev) | |||
3779 | return 0; | 3779 | return 0; |
3780 | } | 3780 | } |
3781 | 3781 | ||
3782 | /* | ||
3783 | * Transfer the port index into real index in the HW port status | ||
3784 | * registers. Caculate offset between the port's PORTSC register | ||
3785 | * and port status base. Divide the number of per port register | ||
3786 | * to get the real index. The raw port number bases 1. | ||
3787 | */ | ||
3788 | int xhci_find_raw_port_number(struct usb_hcd *hcd, int port1) | ||
3789 | { | ||
3790 | struct xhci_hcd *xhci = hcd_to_xhci(hcd); | ||
3791 | __le32 __iomem *base_addr = &xhci->op_regs->port_status_base; | ||
3792 | __le32 __iomem *addr; | ||
3793 | int raw_port; | ||
3794 | |||
3795 | if (hcd->speed != HCD_USB3) | ||
3796 | addr = xhci->usb2_ports[port1 - 1]; | ||
3797 | else | ||
3798 | addr = xhci->usb3_ports[port1 - 1]; | ||
3799 | |||
3800 | raw_port = (addr - base_addr)/NUM_PORT_REGS + 1; | ||
3801 | return raw_port; | ||
3802 | } | ||
3803 | |||
3782 | #ifdef CONFIG_USB_SUSPEND | 3804 | #ifdef CONFIG_USB_SUSPEND |
3783 | 3805 | ||
3784 | /* BESL to HIRD Encoding array for USB2 LPM */ | 3806 | /* BESL to HIRD Encoding array for USB2 LPM */ |
diff --git a/drivers/usb/host/xhci.h b/drivers/usb/host/xhci.h index 2c510e4a7d4c..63582719e0fb 100644 --- a/drivers/usb/host/xhci.h +++ b/drivers/usb/host/xhci.h | |||
@@ -972,6 +972,10 @@ struct xhci_transfer_event { | |||
972 | __le32 flags; | 972 | __le32 flags; |
973 | }; | 973 | }; |
974 | 974 | ||
975 | /* Transfer event TRB length bit mask */ | ||
976 | /* bits 0:23 */ | ||
977 | #define EVENT_TRB_LEN(p) ((p) & 0xffffff) | ||
978 | |||
975 | /** Transfer Event bit fields **/ | 979 | /** Transfer Event bit fields **/ |
976 | #define TRB_TO_EP_ID(p) (((p) >> 16) & 0x1f) | 980 | #define TRB_TO_EP_ID(p) (((p) >> 16) & 0x1f) |
977 | 981 | ||
@@ -1829,6 +1833,7 @@ void xhci_test_and_clear_bit(struct xhci_hcd *xhci, __le32 __iomem **port_array, | |||
1829 | int xhci_hub_control(struct usb_hcd *hcd, u16 typeReq, u16 wValue, u16 wIndex, | 1833 | int xhci_hub_control(struct usb_hcd *hcd, u16 typeReq, u16 wValue, u16 wIndex, |
1830 | char *buf, u16 wLength); | 1834 | char *buf, u16 wLength); |
1831 | int xhci_hub_status_data(struct usb_hcd *hcd, char *buf); | 1835 | int xhci_hub_status_data(struct usb_hcd *hcd, char *buf); |
1836 | int xhci_find_raw_port_number(struct usb_hcd *hcd, int port1); | ||
1832 | 1837 | ||
1833 | #ifdef CONFIG_PM | 1838 | #ifdef CONFIG_PM |
1834 | int xhci_bus_suspend(struct usb_hcd *hcd); | 1839 | int xhci_bus_suspend(struct usb_hcd *hcd); |
diff --git a/drivers/usb/phy/Kconfig b/drivers/usb/phy/Kconfig index 65217a590068..90549382eba5 100644 --- a/drivers/usb/phy/Kconfig +++ b/drivers/usb/phy/Kconfig | |||
@@ -38,6 +38,7 @@ config USB_ISP1301 | |||
38 | tristate "NXP ISP1301 USB transceiver support" | 38 | tristate "NXP ISP1301 USB transceiver support" |
39 | depends on USB || USB_GADGET | 39 | depends on USB || USB_GADGET |
40 | depends on I2C | 40 | depends on I2C |
41 | select USB_OTG_UTILS | ||
41 | help | 42 | help |
42 | Say Y here to add support for the NXP ISP1301 USB transceiver driver. | 43 | Say Y here to add support for the NXP ISP1301 USB transceiver driver. |
43 | This chip is typically used as USB transceiver for USB host, gadget | 44 | This chip is typically used as USB transceiver for USB host, gadget |
diff --git a/drivers/usb/serial/ftdi_sio.c b/drivers/usb/serial/ftdi_sio.c index d4809d551473..9886180e45f1 100644 --- a/drivers/usb/serial/ftdi_sio.c +++ b/drivers/usb/serial/ftdi_sio.c | |||
@@ -640,6 +640,7 @@ static struct usb_device_id id_table_combined [] = { | |||
640 | { USB_DEVICE(FTDI_VID, FTDI_RM_CANVIEW_PID) }, | 640 | { USB_DEVICE(FTDI_VID, FTDI_RM_CANVIEW_PID) }, |
641 | { USB_DEVICE(ACTON_VID, ACTON_SPECTRAPRO_PID) }, | 641 | { USB_DEVICE(ACTON_VID, ACTON_SPECTRAPRO_PID) }, |
642 | { USB_DEVICE(CONTEC_VID, CONTEC_COM1USBH_PID) }, | 642 | { USB_DEVICE(CONTEC_VID, CONTEC_COM1USBH_PID) }, |
643 | { USB_DEVICE(MITSUBISHI_VID, MITSUBISHI_FXUSB_PID) }, | ||
643 | { USB_DEVICE(BANDB_VID, BANDB_USOTL4_PID) }, | 644 | { USB_DEVICE(BANDB_VID, BANDB_USOTL4_PID) }, |
644 | { USB_DEVICE(BANDB_VID, BANDB_USTL4_PID) }, | 645 | { USB_DEVICE(BANDB_VID, BANDB_USTL4_PID) }, |
645 | { USB_DEVICE(BANDB_VID, BANDB_USO9ML2_PID) }, | 646 | { USB_DEVICE(BANDB_VID, BANDB_USO9ML2_PID) }, |
diff --git a/drivers/usb/serial/ftdi_sio_ids.h b/drivers/usb/serial/ftdi_sio_ids.h index 9d359e189a64..e79861eeed4c 100644 --- a/drivers/usb/serial/ftdi_sio_ids.h +++ b/drivers/usb/serial/ftdi_sio_ids.h | |||
@@ -584,6 +584,13 @@ | |||
584 | #define CONTEC_COM1USBH_PID 0x8311 /* COM-1(USB)H */ | 584 | #define CONTEC_COM1USBH_PID 0x8311 /* COM-1(USB)H */ |
585 | 585 | ||
586 | /* | 586 | /* |
587 | * Mitsubishi Electric Corp. (http://www.meau.com) | ||
588 | * Submitted by Konstantin Holoborodko | ||
589 | */ | ||
590 | #define MITSUBISHI_VID 0x06D3 | ||
591 | #define MITSUBISHI_FXUSB_PID 0x0284 /* USB/RS422 converters: FX-USB-AW/-BD */ | ||
592 | |||
593 | /* | ||
587 | * Definitions for B&B Electronics products. | 594 | * Definitions for B&B Electronics products. |
588 | */ | 595 | */ |
589 | #define BANDB_VID 0x0856 /* B&B Electronics Vendor ID */ | 596 | #define BANDB_VID 0x0856 /* B&B Electronics Vendor ID */ |
diff --git a/drivers/usb/serial/usb-serial.c b/drivers/usb/serial/usb-serial.c index 2e70efa08b77..5d9b178484fd 100644 --- a/drivers/usb/serial/usb-serial.c +++ b/drivers/usb/serial/usb-serial.c | |||
@@ -903,6 +903,7 @@ static int usb_serial_probe(struct usb_interface *interface, | |||
903 | port->port.ops = &serial_port_ops; | 903 | port->port.ops = &serial_port_ops; |
904 | port->serial = serial; | 904 | port->serial = serial; |
905 | spin_lock_init(&port->lock); | 905 | spin_lock_init(&port->lock); |
906 | init_waitqueue_head(&port->delta_msr_wait); | ||
906 | /* Keep this for private driver use for the moment but | 907 | /* Keep this for private driver use for the moment but |
907 | should probably go away */ | 908 | should probably go away */ |
908 | INIT_WORK(&port->work, usb_serial_port_work); | 909 | INIT_WORK(&port->work, usb_serial_port_work); |
diff --git a/include/linux/usb/hcd.h b/include/linux/usb/hcd.h index 0a78df5f6cfd..59694b5e5e90 100644 --- a/include/linux/usb/hcd.h +++ b/include/linux/usb/hcd.h | |||
@@ -357,6 +357,7 @@ struct hc_driver { | |||
357 | */ | 357 | */ |
358 | int (*disable_usb3_lpm_timeout)(struct usb_hcd *, | 358 | int (*disable_usb3_lpm_timeout)(struct usb_hcd *, |
359 | struct usb_device *, enum usb3_link_state state); | 359 | struct usb_device *, enum usb3_link_state state); |
360 | int (*find_raw_port_number)(struct usb_hcd *, int); | ||
360 | }; | 361 | }; |
361 | 362 | ||
362 | extern int usb_hcd_link_urb_to_ep(struct usb_hcd *hcd, struct urb *urb); | 363 | extern int usb_hcd_link_urb_to_ep(struct usb_hcd *hcd, struct urb *urb); |
@@ -396,6 +397,7 @@ extern int usb_hcd_is_primary_hcd(struct usb_hcd *hcd); | |||
396 | extern int usb_add_hcd(struct usb_hcd *hcd, | 397 | extern int usb_add_hcd(struct usb_hcd *hcd, |
397 | unsigned int irqnum, unsigned long irqflags); | 398 | unsigned int irqnum, unsigned long irqflags); |
398 | extern void usb_remove_hcd(struct usb_hcd *hcd); | 399 | extern void usb_remove_hcd(struct usb_hcd *hcd); |
400 | extern int usb_hcd_find_raw_port_number(struct usb_hcd *hcd, int port1); | ||
399 | 401 | ||
400 | struct platform_device; | 402 | struct platform_device; |
401 | extern void usb_hcd_platform_shutdown(struct platform_device *dev); | 403 | extern void usb_hcd_platform_shutdown(struct platform_device *dev); |