diff options
38 files changed, 232 insertions, 126 deletions
diff --git a/Documentation/usb/typec.rst b/Documentation/usb/typec.rst index b67a46779de9..8a7249f2ff04 100644 --- a/Documentation/usb/typec.rst +++ b/Documentation/usb/typec.rst | |||
| @@ -114,8 +114,7 @@ the details during registration. The class offers the following API for | |||
| 114 | registering/unregistering cables and their plugs: | 114 | registering/unregistering cables and their plugs: |
| 115 | 115 | ||
| 116 | .. kernel-doc:: drivers/usb/typec/typec.c | 116 | .. kernel-doc:: drivers/usb/typec/typec.c |
| 117 | :functions: typec_register_cable typec_unregister_cable typec_register_plug | 117 | :functions: typec_register_cable typec_unregister_cable typec_register_plug typec_unregister_plug |
| 118 | typec_unregister_plug | ||
| 119 | 118 | ||
| 120 | The class will provide a handle to struct typec_cable and struct typec_plug if | 119 | The class will provide a handle to struct typec_cable and struct typec_plug if |
| 121 | the registration is successful, or NULL if it isn't. | 120 | the registration is successful, or NULL if it isn't. |
| @@ -137,8 +136,7 @@ during connection of a partner or cable, the port driver must use the following | |||
| 137 | APIs to report it to the class: | 136 | APIs to report it to the class: |
| 138 | 137 | ||
| 139 | .. kernel-doc:: drivers/usb/typec/typec.c | 138 | .. kernel-doc:: drivers/usb/typec/typec.c |
| 140 | :functions: typec_set_data_role typec_set_pwr_role typec_set_vconn_role | 139 | :functions: typec_set_data_role typec_set_pwr_role typec_set_vconn_role typec_set_pwr_opmode |
| 141 | typec_set_pwr_opmode | ||
| 142 | 140 | ||
| 143 | Alternate Modes | 141 | Alternate Modes |
| 144 | ~~~~~~~~~~~~~~~ | 142 | ~~~~~~~~~~~~~~~ |
diff --git a/drivers/usb/core/devio.c b/drivers/usb/core/devio.c index cfc3cff6e8d5..8e6ef671be9b 100644 --- a/drivers/usb/core/devio.c +++ b/drivers/usb/core/devio.c | |||
| @@ -475,11 +475,11 @@ static void snoop_urb(struct usb_device *udev, | |||
| 475 | 475 | ||
| 476 | if (userurb) { /* Async */ | 476 | if (userurb) { /* Async */ |
| 477 | if (when == SUBMIT) | 477 | if (when == SUBMIT) |
| 478 | dev_info(&udev->dev, "userurb %p, ep%d %s-%s, " | 478 | dev_info(&udev->dev, "userurb %pK, ep%d %s-%s, " |
| 479 | "length %u\n", | 479 | "length %u\n", |
| 480 | userurb, ep, t, d, length); | 480 | userurb, ep, t, d, length); |
| 481 | else | 481 | else |
| 482 | dev_info(&udev->dev, "userurb %p, ep%d %s-%s, " | 482 | dev_info(&udev->dev, "userurb %pK, ep%d %s-%s, " |
| 483 | "actual_length %u status %d\n", | 483 | "actual_length %u status %d\n", |
| 484 | userurb, ep, t, d, length, | 484 | userurb, ep, t, d, length, |
| 485 | timeout_or_status); | 485 | timeout_or_status); |
| @@ -1895,7 +1895,7 @@ static int proc_reapurb(struct usb_dev_state *ps, void __user *arg) | |||
| 1895 | if (as) { | 1895 | if (as) { |
| 1896 | int retval; | 1896 | int retval; |
| 1897 | 1897 | ||
| 1898 | snoop(&ps->dev->dev, "reap %p\n", as->userurb); | 1898 | snoop(&ps->dev->dev, "reap %pK\n", as->userurb); |
| 1899 | retval = processcompl(as, (void __user * __user *)arg); | 1899 | retval = processcompl(as, (void __user * __user *)arg); |
| 1900 | free_async(as); | 1900 | free_async(as); |
| 1901 | return retval; | 1901 | return retval; |
| @@ -1912,7 +1912,7 @@ static int proc_reapurbnonblock(struct usb_dev_state *ps, void __user *arg) | |||
| 1912 | 1912 | ||
| 1913 | as = async_getcompleted(ps); | 1913 | as = async_getcompleted(ps); |
| 1914 | if (as) { | 1914 | if (as) { |
| 1915 | snoop(&ps->dev->dev, "reap %p\n", as->userurb); | 1915 | snoop(&ps->dev->dev, "reap %pK\n", as->userurb); |
| 1916 | retval = processcompl(as, (void __user * __user *)arg); | 1916 | retval = processcompl(as, (void __user * __user *)arg); |
| 1917 | free_async(as); | 1917 | free_async(as); |
| 1918 | } else { | 1918 | } else { |
| @@ -2043,7 +2043,7 @@ static int proc_reapurb_compat(struct usb_dev_state *ps, void __user *arg) | |||
| 2043 | if (as) { | 2043 | if (as) { |
| 2044 | int retval; | 2044 | int retval; |
| 2045 | 2045 | ||
| 2046 | snoop(&ps->dev->dev, "reap %p\n", as->userurb); | 2046 | snoop(&ps->dev->dev, "reap %pK\n", as->userurb); |
| 2047 | retval = processcompl_compat(as, (void __user * __user *)arg); | 2047 | retval = processcompl_compat(as, (void __user * __user *)arg); |
| 2048 | free_async(as); | 2048 | free_async(as); |
| 2049 | return retval; | 2049 | return retval; |
| @@ -2060,7 +2060,7 @@ static int proc_reapurbnonblock_compat(struct usb_dev_state *ps, void __user *ar | |||
| 2060 | 2060 | ||
| 2061 | as = async_getcompleted(ps); | 2061 | as = async_getcompleted(ps); |
| 2062 | if (as) { | 2062 | if (as) { |
| 2063 | snoop(&ps->dev->dev, "reap %p\n", as->userurb); | 2063 | snoop(&ps->dev->dev, "reap %pK\n", as->userurb); |
| 2064 | retval = processcompl_compat(as, (void __user * __user *)arg); | 2064 | retval = processcompl_compat(as, (void __user * __user *)arg); |
| 2065 | free_async(as); | 2065 | free_async(as); |
| 2066 | } else { | 2066 | } else { |
| @@ -2489,7 +2489,7 @@ static long usbdev_do_ioctl(struct file *file, unsigned int cmd, | |||
| 2489 | #endif | 2489 | #endif |
| 2490 | 2490 | ||
| 2491 | case USBDEVFS_DISCARDURB: | 2491 | case USBDEVFS_DISCARDURB: |
| 2492 | snoop(&dev->dev, "%s: DISCARDURB %p\n", __func__, p); | 2492 | snoop(&dev->dev, "%s: DISCARDURB %pK\n", __func__, p); |
| 2493 | ret = proc_unlinkurb(ps, p); | 2493 | ret = proc_unlinkurb(ps, p); |
| 2494 | break; | 2494 | break; |
| 2495 | 2495 | ||
diff --git a/drivers/usb/core/hcd.c b/drivers/usb/core/hcd.c index 49550790a3cb..5dea98358c05 100644 --- a/drivers/usb/core/hcd.c +++ b/drivers/usb/core/hcd.c | |||
| @@ -1723,7 +1723,7 @@ int usb_hcd_unlink_urb (struct urb *urb, int status) | |||
| 1723 | if (retval == 0) | 1723 | if (retval == 0) |
| 1724 | retval = -EINPROGRESS; | 1724 | retval = -EINPROGRESS; |
| 1725 | else if (retval != -EIDRM && retval != -EBUSY) | 1725 | else if (retval != -EIDRM && retval != -EBUSY) |
| 1726 | dev_dbg(&udev->dev, "hcd_unlink_urb %p fail %d\n", | 1726 | dev_dbg(&udev->dev, "hcd_unlink_urb %pK fail %d\n", |
| 1727 | urb, retval); | 1727 | urb, retval); |
| 1728 | usb_put_dev(udev); | 1728 | usb_put_dev(udev); |
| 1729 | } | 1729 | } |
| @@ -1890,7 +1890,7 @@ rescan: | |||
| 1890 | /* kick hcd */ | 1890 | /* kick hcd */ |
| 1891 | unlink1(hcd, urb, -ESHUTDOWN); | 1891 | unlink1(hcd, urb, -ESHUTDOWN); |
| 1892 | dev_dbg (hcd->self.controller, | 1892 | dev_dbg (hcd->self.controller, |
| 1893 | "shutdown urb %p ep%d%s%s\n", | 1893 | "shutdown urb %pK ep%d%s%s\n", |
| 1894 | urb, usb_endpoint_num(&ep->desc), | 1894 | urb, usb_endpoint_num(&ep->desc), |
| 1895 | is_in ? "in" : "out", | 1895 | is_in ? "in" : "out", |
| 1896 | ({ char *s; | 1896 | ({ char *s; |
| @@ -2520,6 +2520,7 @@ struct usb_hcd *__usb_create_hcd(const struct hc_driver *driver, | |||
| 2520 | hcd->bandwidth_mutex = kmalloc(sizeof(*hcd->bandwidth_mutex), | 2520 | hcd->bandwidth_mutex = kmalloc(sizeof(*hcd->bandwidth_mutex), |
| 2521 | GFP_KERNEL); | 2521 | GFP_KERNEL); |
| 2522 | if (!hcd->bandwidth_mutex) { | 2522 | if (!hcd->bandwidth_mutex) { |
| 2523 | kfree(hcd->address0_mutex); | ||
| 2523 | kfree(hcd); | 2524 | kfree(hcd); |
| 2524 | dev_dbg(dev, "hcd bandwidth mutex alloc failed\n"); | 2525 | dev_dbg(dev, "hcd bandwidth mutex alloc failed\n"); |
| 2525 | return NULL; | 2526 | return NULL; |
diff --git a/drivers/usb/core/hub.c b/drivers/usb/core/hub.c index 9dca59ef18b3..b8bb20d7acdb 100644 --- a/drivers/usb/core/hub.c +++ b/drivers/usb/core/hub.c | |||
| @@ -362,7 +362,8 @@ static void usb_set_lpm_parameters(struct usb_device *udev) | |||
| 362 | } | 362 | } |
| 363 | 363 | ||
| 364 | /* USB 2.0 spec Section 11.24.4.5 */ | 364 | /* USB 2.0 spec Section 11.24.4.5 */ |
| 365 | static int get_hub_descriptor(struct usb_device *hdev, void *data) | 365 | static int get_hub_descriptor(struct usb_device *hdev, |
| 366 | struct usb_hub_descriptor *desc) | ||
| 366 | { | 367 | { |
| 367 | int i, ret, size; | 368 | int i, ret, size; |
| 368 | unsigned dtype; | 369 | unsigned dtype; |
| @@ -378,10 +379,18 @@ static int get_hub_descriptor(struct usb_device *hdev, void *data) | |||
| 378 | for (i = 0; i < 3; i++) { | 379 | for (i = 0; i < 3; i++) { |
| 379 | ret = usb_control_msg(hdev, usb_rcvctrlpipe(hdev, 0), | 380 | ret = usb_control_msg(hdev, usb_rcvctrlpipe(hdev, 0), |
| 380 | USB_REQ_GET_DESCRIPTOR, USB_DIR_IN | USB_RT_HUB, | 381 | USB_REQ_GET_DESCRIPTOR, USB_DIR_IN | USB_RT_HUB, |
| 381 | dtype << 8, 0, data, size, | 382 | dtype << 8, 0, desc, size, |
| 382 | USB_CTRL_GET_TIMEOUT); | 383 | USB_CTRL_GET_TIMEOUT); |
| 383 | if (ret >= (USB_DT_HUB_NONVAR_SIZE + 2)) | 384 | if (hub_is_superspeed(hdev)) { |
| 385 | if (ret == size) | ||
| 386 | return ret; | ||
| 387 | } else if (ret >= USB_DT_HUB_NONVAR_SIZE + 2) { | ||
| 388 | /* Make sure we have the DeviceRemovable field. */ | ||
| 389 | size = USB_DT_HUB_NONVAR_SIZE + desc->bNbrPorts / 8 + 1; | ||
| 390 | if (ret < size) | ||
| 391 | return -EMSGSIZE; | ||
| 384 | return ret; | 392 | return ret; |
| 393 | } | ||
| 385 | } | 394 | } |
| 386 | return -EINVAL; | 395 | return -EINVAL; |
| 387 | } | 396 | } |
| @@ -1313,7 +1322,7 @@ static int hub_configure(struct usb_hub *hub, | |||
| 1313 | } | 1322 | } |
| 1314 | mutex_init(&hub->status_mutex); | 1323 | mutex_init(&hub->status_mutex); |
| 1315 | 1324 | ||
| 1316 | hub->descriptor = kmalloc(sizeof(*hub->descriptor), GFP_KERNEL); | 1325 | hub->descriptor = kzalloc(sizeof(*hub->descriptor), GFP_KERNEL); |
| 1317 | if (!hub->descriptor) { | 1326 | if (!hub->descriptor) { |
| 1318 | ret = -ENOMEM; | 1327 | ret = -ENOMEM; |
| 1319 | goto fail; | 1328 | goto fail; |
| @@ -1321,13 +1330,19 @@ static int hub_configure(struct usb_hub *hub, | |||
| 1321 | 1330 | ||
| 1322 | /* Request the entire hub descriptor. | 1331 | /* Request the entire hub descriptor. |
| 1323 | * hub->descriptor can handle USB_MAXCHILDREN ports, | 1332 | * hub->descriptor can handle USB_MAXCHILDREN ports, |
| 1324 | * but the hub can/will return fewer bytes here. | 1333 | * but a (non-SS) hub can/will return fewer bytes here. |
| 1325 | */ | 1334 | */ |
| 1326 | ret = get_hub_descriptor(hdev, hub->descriptor); | 1335 | ret = get_hub_descriptor(hdev, hub->descriptor); |
| 1327 | if (ret < 0) { | 1336 | if (ret < 0) { |
| 1328 | message = "can't read hub descriptor"; | 1337 | message = "can't read hub descriptor"; |
| 1329 | goto fail; | 1338 | goto fail; |
| 1330 | } else if (hub->descriptor->bNbrPorts > USB_MAXCHILDREN) { | 1339 | } |
| 1340 | |||
| 1341 | maxchild = USB_MAXCHILDREN; | ||
| 1342 | if (hub_is_superspeed(hdev)) | ||
| 1343 | maxchild = min_t(unsigned, maxchild, USB_SS_MAXPORTS); | ||
| 1344 | |||
| 1345 | if (hub->descriptor->bNbrPorts > maxchild) { | ||
| 1331 | message = "hub has too many ports!"; | 1346 | message = "hub has too many ports!"; |
| 1332 | ret = -ENODEV; | 1347 | ret = -ENODEV; |
| 1333 | goto fail; | 1348 | goto fail; |
diff --git a/drivers/usb/core/of.c b/drivers/usb/core/of.c index d787f195a9a6..d563cbcf76cf 100644 --- a/drivers/usb/core/of.c +++ b/drivers/usb/core/of.c | |||
| @@ -53,6 +53,9 @@ EXPORT_SYMBOL_GPL(usb_of_get_child_node); | |||
| 53 | * | 53 | * |
| 54 | * Find the companion device from platform bus. | 54 | * Find the companion device from platform bus. |
| 55 | * | 55 | * |
| 56 | * Takes a reference to the returned struct device which needs to be dropped | ||
| 57 | * after use. | ||
| 58 | * | ||
| 56 | * Return: On success, a pointer to the companion device, %NULL on failure. | 59 | * Return: On success, a pointer to the companion device, %NULL on failure. |
| 57 | */ | 60 | */ |
| 58 | struct device *usb_of_get_companion_dev(struct device *dev) | 61 | struct device *usb_of_get_companion_dev(struct device *dev) |
diff --git a/drivers/usb/core/urb.c b/drivers/usb/core/urb.c index d75cb8c0f7df..47903d510955 100644 --- a/drivers/usb/core/urb.c +++ b/drivers/usb/core/urb.c | |||
| @@ -338,7 +338,7 @@ int usb_submit_urb(struct urb *urb, gfp_t mem_flags) | |||
| 338 | if (!urb || !urb->complete) | 338 | if (!urb || !urb->complete) |
| 339 | return -EINVAL; | 339 | return -EINVAL; |
| 340 | if (urb->hcpriv) { | 340 | if (urb->hcpriv) { |
| 341 | WARN_ONCE(1, "URB %p submitted while active\n", urb); | 341 | WARN_ONCE(1, "URB %pK submitted while active\n", urb); |
| 342 | return -EBUSY; | 342 | return -EBUSY; |
| 343 | } | 343 | } |
| 344 | 344 | ||
diff --git a/drivers/usb/dwc3/dwc3-keystone.c b/drivers/usb/dwc3/dwc3-keystone.c index 72664700b8a2..12ee23f53cdd 100644 --- a/drivers/usb/dwc3/dwc3-keystone.c +++ b/drivers/usb/dwc3/dwc3-keystone.c | |||
| @@ -107,6 +107,10 @@ static int kdwc3_probe(struct platform_device *pdev) | |||
| 107 | return PTR_ERR(kdwc->usbss); | 107 | return PTR_ERR(kdwc->usbss); |
| 108 | 108 | ||
| 109 | kdwc->clk = devm_clk_get(kdwc->dev, "usb"); | 109 | kdwc->clk = devm_clk_get(kdwc->dev, "usb"); |
| 110 | if (IS_ERR(kdwc->clk)) { | ||
| 111 | dev_err(kdwc->dev, "unable to get usb clock\n"); | ||
| 112 | return PTR_ERR(kdwc->clk); | ||
| 113 | } | ||
| 110 | 114 | ||
| 111 | error = clk_prepare_enable(kdwc->clk); | 115 | error = clk_prepare_enable(kdwc->clk); |
| 112 | if (error < 0) { | 116 | if (error < 0) { |
diff --git a/drivers/usb/dwc3/dwc3-pci.c b/drivers/usb/dwc3/dwc3-pci.c index a15ec71d0423..84a2cebfc712 100644 --- a/drivers/usb/dwc3/dwc3-pci.c +++ b/drivers/usb/dwc3/dwc3-pci.c | |||
| @@ -39,6 +39,8 @@ | |||
| 39 | #define PCI_DEVICE_ID_INTEL_APL 0x5aaa | 39 | #define PCI_DEVICE_ID_INTEL_APL 0x5aaa |
| 40 | #define PCI_DEVICE_ID_INTEL_KBP 0xa2b0 | 40 | #define PCI_DEVICE_ID_INTEL_KBP 0xa2b0 |
| 41 | #define PCI_DEVICE_ID_INTEL_GLK 0x31aa | 41 | #define PCI_DEVICE_ID_INTEL_GLK 0x31aa |
| 42 | #define PCI_DEVICE_ID_INTEL_CNPLP 0x9dee | ||
| 43 | #define PCI_DEVICE_ID_INTEL_CNPH 0xa36e | ||
| 42 | 44 | ||
| 43 | #define PCI_INTEL_BXT_DSM_UUID "732b85d5-b7a7-4a1b-9ba0-4bbd00ffd511" | 45 | #define PCI_INTEL_BXT_DSM_UUID "732b85d5-b7a7-4a1b-9ba0-4bbd00ffd511" |
| 44 | #define PCI_INTEL_BXT_FUNC_PMU_PWR 4 | 46 | #define PCI_INTEL_BXT_FUNC_PMU_PWR 4 |
| @@ -270,6 +272,8 @@ static const struct pci_device_id dwc3_pci_id_table[] = { | |||
| 270 | { PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_APL), }, | 272 | { PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_APL), }, |
| 271 | { PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_KBP), }, | 273 | { PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_KBP), }, |
| 272 | { PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_GLK), }, | 274 | { PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_GLK), }, |
| 275 | { PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_CNPLP), }, | ||
| 276 | { PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_CNPH), }, | ||
| 273 | { PCI_DEVICE(PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_NL_USB), }, | 277 | { PCI_DEVICE(PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_NL_USB), }, |
| 274 | { } /* Terminating Entry */ | 278 | { } /* Terminating Entry */ |
| 275 | }; | 279 | }; |
diff --git a/drivers/usb/dwc3/gadget.c b/drivers/usb/dwc3/gadget.c index 6f6f0b3be3ad..aea9a5b948b4 100644 --- a/drivers/usb/dwc3/gadget.c +++ b/drivers/usb/dwc3/gadget.c | |||
| @@ -1261,14 +1261,24 @@ static int __dwc3_gadget_ep_queue(struct dwc3_ep *dep, struct dwc3_request *req) | |||
| 1261 | __dwc3_gadget_start_isoc(dwc, dep, cur_uf); | 1261 | __dwc3_gadget_start_isoc(dwc, dep, cur_uf); |
| 1262 | dep->flags &= ~DWC3_EP_PENDING_REQUEST; | 1262 | dep->flags &= ~DWC3_EP_PENDING_REQUEST; |
| 1263 | } | 1263 | } |
| 1264 | return 0; | ||
| 1264 | } | 1265 | } |
| 1265 | return 0; | 1266 | |
| 1267 | if ((dep->flags & DWC3_EP_BUSY) && | ||
| 1268 | !(dep->flags & DWC3_EP_MISSED_ISOC)) { | ||
| 1269 | WARN_ON_ONCE(!dep->resource_index); | ||
| 1270 | ret = __dwc3_gadget_kick_transfer(dep, | ||
| 1271 | dep->resource_index); | ||
| 1272 | } | ||
| 1273 | |||
| 1274 | goto out; | ||
| 1266 | } | 1275 | } |
| 1267 | 1276 | ||
| 1268 | if (!dwc3_calc_trbs_left(dep)) | 1277 | if (!dwc3_calc_trbs_left(dep)) |
| 1269 | return 0; | 1278 | return 0; |
| 1270 | 1279 | ||
| 1271 | ret = __dwc3_gadget_kick_transfer(dep, 0); | 1280 | ret = __dwc3_gadget_kick_transfer(dep, 0); |
| 1281 | out: | ||
| 1272 | if (ret == -EBUSY) | 1282 | if (ret == -EBUSY) |
| 1273 | ret = 0; | 1283 | ret = 0; |
| 1274 | 1284 | ||
| @@ -3026,6 +3036,15 @@ static irqreturn_t dwc3_check_event_buf(struct dwc3_event_buffer *evt) | |||
| 3026 | return IRQ_HANDLED; | 3036 | return IRQ_HANDLED; |
| 3027 | } | 3037 | } |
| 3028 | 3038 | ||
| 3039 | /* | ||
| 3040 | * With PCIe legacy interrupt, test shows that top-half irq handler can | ||
| 3041 | * be called again after HW interrupt deassertion. Check if bottom-half | ||
| 3042 | * irq event handler completes before caching new event to prevent | ||
| 3043 | * losing events. | ||
| 3044 | */ | ||
| 3045 | if (evt->flags & DWC3_EVENT_PENDING) | ||
| 3046 | return IRQ_HANDLED; | ||
| 3047 | |||
| 3029 | count = dwc3_readl(dwc->regs, DWC3_GEVNTCOUNT(0)); | 3048 | count = dwc3_readl(dwc->regs, DWC3_GEVNTCOUNT(0)); |
| 3030 | count &= DWC3_GEVNTCOUNT_MASK; | 3049 | count &= DWC3_GEVNTCOUNT_MASK; |
| 3031 | if (!count) | 3050 | if (!count) |
diff --git a/drivers/usb/gadget/function/f_fs.c b/drivers/usb/gadget/function/f_fs.c index 71dd27c0d7f2..47dda3450abd 100644 --- a/drivers/usb/gadget/function/f_fs.c +++ b/drivers/usb/gadget/function/f_fs.c | |||
| @@ -1858,12 +1858,12 @@ static int ffs_func_eps_enable(struct ffs_function *func) | |||
| 1858 | ep->ep->driver_data = ep; | 1858 | ep->ep->driver_data = ep; |
| 1859 | ep->ep->desc = ds; | 1859 | ep->ep->desc = ds; |
| 1860 | 1860 | ||
| 1861 | comp_desc = (struct usb_ss_ep_comp_descriptor *)(ds + | 1861 | if (needs_comp_desc) { |
| 1862 | USB_DT_ENDPOINT_SIZE); | 1862 | comp_desc = (struct usb_ss_ep_comp_descriptor *)(ds + |
| 1863 | ep->ep->maxburst = comp_desc->bMaxBurst + 1; | 1863 | USB_DT_ENDPOINT_SIZE); |
| 1864 | 1864 | ep->ep->maxburst = comp_desc->bMaxBurst + 1; | |
| 1865 | if (needs_comp_desc) | ||
| 1866 | ep->ep->comp_desc = comp_desc; | 1865 | ep->ep->comp_desc = comp_desc; |
| 1866 | } | ||
| 1867 | 1867 | ||
| 1868 | ret = usb_ep_enable(ep->ep); | 1868 | ret = usb_ep_enable(ep->ep); |
| 1869 | if (likely(!ret)) { | 1869 | if (likely(!ret)) { |
diff --git a/drivers/usb/gadget/function/u_serial.c b/drivers/usb/gadget/function/u_serial.c index 000677c991b0..9b0805f55ad7 100644 --- a/drivers/usb/gadget/function/u_serial.c +++ b/drivers/usb/gadget/function/u_serial.c | |||
| @@ -1256,7 +1256,7 @@ static void gserial_console_exit(void) | |||
| 1256 | struct gscons_info *info = &gscons_info; | 1256 | struct gscons_info *info = &gscons_info; |
| 1257 | 1257 | ||
| 1258 | unregister_console(&gserial_cons); | 1258 | unregister_console(&gserial_cons); |
| 1259 | if (info->console_thread != NULL) | 1259 | if (!IS_ERR_OR_NULL(info->console_thread)) |
| 1260 | kthread_stop(info->console_thread); | 1260 | kthread_stop(info->console_thread); |
| 1261 | gs_buf_free(&info->con_buf); | 1261 | gs_buf_free(&info->con_buf); |
| 1262 | } | 1262 | } |
diff --git a/drivers/usb/gadget/udc/dummy_hcd.c b/drivers/usb/gadget/udc/dummy_hcd.c index c79081952ea0..ccabb51cb98d 100644 --- a/drivers/usb/gadget/udc/dummy_hcd.c +++ b/drivers/usb/gadget/udc/dummy_hcd.c | |||
| @@ -2008,7 +2008,7 @@ ss_hub_descriptor(struct usb_hub_descriptor *desc) | |||
| 2008 | HUB_CHAR_COMMON_OCPM); | 2008 | HUB_CHAR_COMMON_OCPM); |
| 2009 | desc->bNbrPorts = 1; | 2009 | desc->bNbrPorts = 1; |
| 2010 | desc->u.ss.bHubHdrDecLat = 0x04; /* Worst case: 0.4 micro sec*/ | 2010 | desc->u.ss.bHubHdrDecLat = 0x04; /* Worst case: 0.4 micro sec*/ |
| 2011 | desc->u.ss.DeviceRemovable = 0xffff; | 2011 | desc->u.ss.DeviceRemovable = 0; |
| 2012 | } | 2012 | } |
| 2013 | 2013 | ||
| 2014 | static inline void hub_descriptor(struct usb_hub_descriptor *desc) | 2014 | static inline void hub_descriptor(struct usb_hub_descriptor *desc) |
| @@ -2020,8 +2020,8 @@ static inline void hub_descriptor(struct usb_hub_descriptor *desc) | |||
| 2020 | HUB_CHAR_INDV_PORT_LPSM | | 2020 | HUB_CHAR_INDV_PORT_LPSM | |
| 2021 | HUB_CHAR_COMMON_OCPM); | 2021 | HUB_CHAR_COMMON_OCPM); |
| 2022 | desc->bNbrPorts = 1; | 2022 | desc->bNbrPorts = 1; |
| 2023 | desc->u.hs.DeviceRemovable[0] = 0xff; | 2023 | desc->u.hs.DeviceRemovable[0] = 0; |
| 2024 | desc->u.hs.DeviceRemovable[1] = 0xff; | 2024 | desc->u.hs.DeviceRemovable[1] = 0xff; /* PortPwrCtrlMask */ |
| 2025 | } | 2025 | } |
| 2026 | 2026 | ||
| 2027 | static int dummy_hub_control( | 2027 | static int dummy_hub_control( |
diff --git a/drivers/usb/host/ehci-platform.c b/drivers/usb/host/ehci-platform.c index bc7b9be12f54..f1908ea9fbd8 100644 --- a/drivers/usb/host/ehci-platform.c +++ b/drivers/usb/host/ehci-platform.c | |||
| @@ -384,8 +384,10 @@ static int ehci_platform_resume(struct device *dev) | |||
| 384 | } | 384 | } |
| 385 | 385 | ||
| 386 | companion_dev = usb_of_get_companion_dev(hcd->self.controller); | 386 | companion_dev = usb_of_get_companion_dev(hcd->self.controller); |
| 387 | if (companion_dev) | 387 | if (companion_dev) { |
| 388 | device_pm_wait_for_dev(hcd->self.controller, companion_dev); | 388 | device_pm_wait_for_dev(hcd->self.controller, companion_dev); |
| 389 | put_device(companion_dev); | ||
| 390 | } | ||
| 389 | 391 | ||
| 390 | ehci_resume(hcd, priv->reset_on_resume); | 392 | ehci_resume(hcd, priv->reset_on_resume); |
| 391 | return 0; | 393 | return 0; |
diff --git a/drivers/usb/host/r8a66597-hcd.c b/drivers/usb/host/r8a66597-hcd.c index bfa7fa3d2eea..7bf78be1fd32 100644 --- a/drivers/usb/host/r8a66597-hcd.c +++ b/drivers/usb/host/r8a66597-hcd.c | |||
| @@ -1269,7 +1269,7 @@ static void set_td_timer(struct r8a66597 *r8a66597, struct r8a66597_td *td) | |||
| 1269 | time = 30; | 1269 | time = 30; |
| 1270 | break; | 1270 | break; |
| 1271 | default: | 1271 | default: |
| 1272 | time = 300; | 1272 | time = 50; |
| 1273 | break; | 1273 | break; |
| 1274 | } | 1274 | } |
| 1275 | 1275 | ||
| @@ -1785,6 +1785,7 @@ static void r8a66597_td_timer(unsigned long _r8a66597) | |||
| 1785 | pipe = td->pipe; | 1785 | pipe = td->pipe; |
| 1786 | pipe_stop(r8a66597, pipe); | 1786 | pipe_stop(r8a66597, pipe); |
| 1787 | 1787 | ||
| 1788 | /* Select a different address or endpoint */ | ||
| 1788 | new_td = td; | 1789 | new_td = td; |
| 1789 | do { | 1790 | do { |
| 1790 | list_move_tail(&new_td->queue, | 1791 | list_move_tail(&new_td->queue, |
| @@ -1794,7 +1795,8 @@ static void r8a66597_td_timer(unsigned long _r8a66597) | |||
| 1794 | new_td = td; | 1795 | new_td = td; |
| 1795 | break; | 1796 | break; |
| 1796 | } | 1797 | } |
| 1797 | } while (td != new_td && td->address == new_td->address); | 1798 | } while (td != new_td && td->address == new_td->address && |
| 1799 | td->pipe->info.epnum == new_td->pipe->info.epnum); | ||
| 1798 | 1800 | ||
| 1799 | start_transfer(r8a66597, new_td); | 1801 | start_transfer(r8a66597, new_td); |
| 1800 | 1802 | ||
diff --git a/drivers/usb/host/xhci-hub.c b/drivers/usb/host/xhci-hub.c index 5e3e9d4c6956..0dde49c35dd2 100644 --- a/drivers/usb/host/xhci-hub.c +++ b/drivers/usb/host/xhci-hub.c | |||
| @@ -419,7 +419,7 @@ static int xhci_stop_device(struct xhci_hcd *xhci, int slot_id, int suspend) | |||
| 419 | wait_for_completion(cmd->completion); | 419 | wait_for_completion(cmd->completion); |
| 420 | 420 | ||
| 421 | if (cmd->status == COMP_COMMAND_ABORTED || | 421 | if (cmd->status == COMP_COMMAND_ABORTED || |
| 422 | cmd->status == COMP_STOPPED) { | 422 | cmd->status == COMP_COMMAND_RING_STOPPED) { |
| 423 | xhci_warn(xhci, "Timeout while waiting for stop endpoint command\n"); | 423 | xhci_warn(xhci, "Timeout while waiting for stop endpoint command\n"); |
| 424 | ret = -ETIME; | 424 | ret = -ETIME; |
| 425 | } | 425 | } |
diff --git a/drivers/usb/host/xhci-mem.c b/drivers/usb/host/xhci-mem.c index bbe22bcc550a..1f1687e888d6 100644 --- a/drivers/usb/host/xhci-mem.c +++ b/drivers/usb/host/xhci-mem.c | |||
| @@ -56,7 +56,7 @@ static struct xhci_segment *xhci_segment_alloc(struct xhci_hcd *xhci, | |||
| 56 | } | 56 | } |
| 57 | 57 | ||
| 58 | if (max_packet) { | 58 | if (max_packet) { |
| 59 | seg->bounce_buf = kzalloc(max_packet, flags | GFP_DMA); | 59 | seg->bounce_buf = kzalloc(max_packet, flags); |
| 60 | if (!seg->bounce_buf) { | 60 | if (!seg->bounce_buf) { |
| 61 | dma_pool_free(xhci->segment_pool, seg->trbs, dma); | 61 | dma_pool_free(xhci->segment_pool, seg->trbs, dma); |
| 62 | kfree(seg); | 62 | kfree(seg); |
| @@ -1724,7 +1724,7 @@ static int scratchpad_alloc(struct xhci_hcd *xhci, gfp_t flags) | |||
| 1724 | xhci->dcbaa->dev_context_ptrs[0] = cpu_to_le64(xhci->scratchpad->sp_dma); | 1724 | xhci->dcbaa->dev_context_ptrs[0] = cpu_to_le64(xhci->scratchpad->sp_dma); |
| 1725 | for (i = 0; i < num_sp; i++) { | 1725 | for (i = 0; i < num_sp; i++) { |
| 1726 | dma_addr_t dma; | 1726 | dma_addr_t dma; |
| 1727 | void *buf = dma_alloc_coherent(dev, xhci->page_size, &dma, | 1727 | void *buf = dma_zalloc_coherent(dev, xhci->page_size, &dma, |
| 1728 | flags); | 1728 | flags); |
| 1729 | if (!buf) | 1729 | if (!buf) |
| 1730 | goto fail_sp4; | 1730 | goto fail_sp4; |
| @@ -2307,10 +2307,11 @@ static int xhci_setup_port_arrays(struct xhci_hcd *xhci, gfp_t flags) | |||
| 2307 | /* Place limits on the number of roothub ports so that the hub | 2307 | /* Place limits on the number of roothub ports so that the hub |
| 2308 | * descriptors aren't longer than the USB core will allocate. | 2308 | * descriptors aren't longer than the USB core will allocate. |
| 2309 | */ | 2309 | */ |
| 2310 | if (xhci->num_usb3_ports > 15) { | 2310 | if (xhci->num_usb3_ports > USB_SS_MAXPORTS) { |
| 2311 | xhci_dbg_trace(xhci, trace_xhci_dbg_init, | 2311 | xhci_dbg_trace(xhci, trace_xhci_dbg_init, |
| 2312 | "Limiting USB 3.0 roothub ports to 15."); | 2312 | "Limiting USB 3.0 roothub ports to %u.", |
| 2313 | xhci->num_usb3_ports = 15; | 2313 | USB_SS_MAXPORTS); |
| 2314 | xhci->num_usb3_ports = USB_SS_MAXPORTS; | ||
| 2314 | } | 2315 | } |
| 2315 | if (xhci->num_usb2_ports > USB_MAXCHILDREN) { | 2316 | if (xhci->num_usb2_ports > USB_MAXCHILDREN) { |
| 2316 | xhci_dbg_trace(xhci, trace_xhci_dbg_init, | 2317 | xhci_dbg_trace(xhci, trace_xhci_dbg_init, |
diff --git a/drivers/usb/host/xhci-pci.c b/drivers/usb/host/xhci-pci.c index 7b86508ac8cf..fcf1f3f63e7a 100644 --- a/drivers/usb/host/xhci-pci.c +++ b/drivers/usb/host/xhci-pci.c | |||
| @@ -52,6 +52,7 @@ | |||
| 52 | #define PCI_DEVICE_ID_INTEL_BROXTON_M_XHCI 0x0aa8 | 52 | #define PCI_DEVICE_ID_INTEL_BROXTON_M_XHCI 0x0aa8 |
| 53 | #define PCI_DEVICE_ID_INTEL_BROXTON_B_XHCI 0x1aa8 | 53 | #define PCI_DEVICE_ID_INTEL_BROXTON_B_XHCI 0x1aa8 |
| 54 | #define PCI_DEVICE_ID_INTEL_APL_XHCI 0x5aa8 | 54 | #define PCI_DEVICE_ID_INTEL_APL_XHCI 0x5aa8 |
| 55 | #define PCI_DEVICE_ID_INTEL_DNV_XHCI 0x19d0 | ||
| 55 | 56 | ||
| 56 | static const char hcd_name[] = "xhci_hcd"; | 57 | static const char hcd_name[] = "xhci_hcd"; |
| 57 | 58 | ||
| @@ -166,7 +167,8 @@ static void xhci_pci_quirks(struct device *dev, struct xhci_hcd *xhci) | |||
| 166 | pdev->device == PCI_DEVICE_ID_INTEL_CHERRYVIEW_XHCI || | 167 | pdev->device == PCI_DEVICE_ID_INTEL_CHERRYVIEW_XHCI || |
| 167 | pdev->device == PCI_DEVICE_ID_INTEL_BROXTON_M_XHCI || | 168 | pdev->device == PCI_DEVICE_ID_INTEL_BROXTON_M_XHCI || |
| 168 | pdev->device == PCI_DEVICE_ID_INTEL_BROXTON_B_XHCI || | 169 | pdev->device == PCI_DEVICE_ID_INTEL_BROXTON_B_XHCI || |
| 169 | pdev->device == PCI_DEVICE_ID_INTEL_APL_XHCI)) { | 170 | pdev->device == PCI_DEVICE_ID_INTEL_APL_XHCI || |
| 171 | pdev->device == PCI_DEVICE_ID_INTEL_DNV_XHCI)) { | ||
| 170 | xhci->quirks |= XHCI_PME_STUCK_QUIRK; | 172 | xhci->quirks |= XHCI_PME_STUCK_QUIRK; |
| 171 | } | 173 | } |
| 172 | if (pdev->vendor == PCI_VENDOR_ID_INTEL && | 174 | if (pdev->vendor == PCI_VENDOR_ID_INTEL && |
| @@ -175,7 +177,8 @@ static void xhci_pci_quirks(struct device *dev, struct xhci_hcd *xhci) | |||
| 175 | } | 177 | } |
| 176 | if (pdev->vendor == PCI_VENDOR_ID_INTEL && | 178 | if (pdev->vendor == PCI_VENDOR_ID_INTEL && |
| 177 | (pdev->device == PCI_DEVICE_ID_INTEL_CHERRYVIEW_XHCI || | 179 | (pdev->device == PCI_DEVICE_ID_INTEL_CHERRYVIEW_XHCI || |
| 178 | pdev->device == PCI_DEVICE_ID_INTEL_APL_XHCI)) | 180 | pdev->device == PCI_DEVICE_ID_INTEL_APL_XHCI || |
| 181 | pdev->device == PCI_DEVICE_ID_INTEL_DNV_XHCI)) | ||
| 179 | xhci->quirks |= XHCI_MISSING_CAS; | 182 | xhci->quirks |= XHCI_MISSING_CAS; |
| 180 | 183 | ||
| 181 | if (pdev->vendor == PCI_VENDOR_ID_ETRON && | 184 | if (pdev->vendor == PCI_VENDOR_ID_ETRON && |
diff --git a/drivers/usb/host/xhci-plat.c b/drivers/usb/host/xhci-plat.c index 7c2a9e7c8e0f..c04144b25a67 100644 --- a/drivers/usb/host/xhci-plat.c +++ b/drivers/usb/host/xhci-plat.c | |||
| @@ -177,7 +177,7 @@ static int xhci_plat_probe(struct platform_device *pdev) | |||
| 177 | 177 | ||
| 178 | irq = platform_get_irq(pdev, 0); | 178 | irq = platform_get_irq(pdev, 0); |
| 179 | if (irq < 0) | 179 | if (irq < 0) |
| 180 | return -ENODEV; | 180 | return irq; |
| 181 | 181 | ||
| 182 | /* | 182 | /* |
| 183 | * sysdev must point to a device that is known to the system firmware | 183 | * sysdev must point to a device that is known to the system firmware |
diff --git a/drivers/usb/host/xhci-ring.c b/drivers/usb/host/xhci-ring.c index 74bf5c60a260..03f63f50afb6 100644 --- a/drivers/usb/host/xhci-ring.c +++ b/drivers/usb/host/xhci-ring.c | |||
| @@ -323,7 +323,7 @@ static void xhci_handle_stopped_cmd_ring(struct xhci_hcd *xhci, | |||
| 323 | if (i_cmd->status != COMP_COMMAND_ABORTED) | 323 | if (i_cmd->status != COMP_COMMAND_ABORTED) |
| 324 | continue; | 324 | continue; |
| 325 | 325 | ||
| 326 | i_cmd->status = COMP_STOPPED; | 326 | i_cmd->status = COMP_COMMAND_RING_STOPPED; |
| 327 | 327 | ||
| 328 | xhci_dbg(xhci, "Turn aborted command %p to no-op\n", | 328 | xhci_dbg(xhci, "Turn aborted command %p to no-op\n", |
| 329 | i_cmd->command_trb); | 329 | i_cmd->command_trb); |
| @@ -641,8 +641,8 @@ static void xhci_giveback_urb_in_irq(struct xhci_hcd *xhci, | |||
| 641 | xhci_urb_free_priv(urb_priv); | 641 | xhci_urb_free_priv(urb_priv); |
| 642 | usb_hcd_unlink_urb_from_ep(hcd, urb); | 642 | usb_hcd_unlink_urb_from_ep(hcd, urb); |
| 643 | spin_unlock(&xhci->lock); | 643 | spin_unlock(&xhci->lock); |
| 644 | usb_hcd_giveback_urb(hcd, urb, status); | ||
| 645 | trace_xhci_urb_giveback(urb); | 644 | trace_xhci_urb_giveback(urb); |
| 645 | usb_hcd_giveback_urb(hcd, urb, status); | ||
| 646 | spin_lock(&xhci->lock); | 646 | spin_lock(&xhci->lock); |
| 647 | } | 647 | } |
| 648 | 648 | ||
| @@ -1380,7 +1380,7 @@ static void handle_cmd_completion(struct xhci_hcd *xhci, | |||
| 1380 | cmd_comp_code = GET_COMP_CODE(le32_to_cpu(event->status)); | 1380 | cmd_comp_code = GET_COMP_CODE(le32_to_cpu(event->status)); |
| 1381 | 1381 | ||
| 1382 | /* If CMD ring stopped we own the trbs between enqueue and dequeue */ | 1382 | /* If CMD ring stopped we own the trbs between enqueue and dequeue */ |
| 1383 | if (cmd_comp_code == COMP_STOPPED) { | 1383 | if (cmd_comp_code == COMP_COMMAND_RING_STOPPED) { |
| 1384 | complete_all(&xhci->cmd_ring_stop_completion); | 1384 | complete_all(&xhci->cmd_ring_stop_completion); |
| 1385 | return; | 1385 | return; |
| 1386 | } | 1386 | } |
| @@ -1436,8 +1436,8 @@ static void handle_cmd_completion(struct xhci_hcd *xhci, | |||
| 1436 | break; | 1436 | break; |
| 1437 | case TRB_CMD_NOOP: | 1437 | case TRB_CMD_NOOP: |
| 1438 | /* Is this an aborted command turned to NO-OP? */ | 1438 | /* Is this an aborted command turned to NO-OP? */ |
| 1439 | if (cmd->status == COMP_STOPPED) | 1439 | if (cmd->status == COMP_COMMAND_RING_STOPPED) |
| 1440 | cmd_comp_code = COMP_STOPPED; | 1440 | cmd_comp_code = COMP_COMMAND_RING_STOPPED; |
| 1441 | break; | 1441 | break; |
| 1442 | case TRB_RESET_EP: | 1442 | case TRB_RESET_EP: |
| 1443 | WARN_ON(slot_id != TRB_TO_SLOT_ID( | 1443 | WARN_ON(slot_id != TRB_TO_SLOT_ID( |
| @@ -2677,11 +2677,12 @@ irqreturn_t xhci_irq(struct usb_hcd *hcd) | |||
| 2677 | struct xhci_hcd *xhci = hcd_to_xhci(hcd); | 2677 | struct xhci_hcd *xhci = hcd_to_xhci(hcd); |
| 2678 | union xhci_trb *event_ring_deq; | 2678 | union xhci_trb *event_ring_deq; |
| 2679 | irqreturn_t ret = IRQ_NONE; | 2679 | irqreturn_t ret = IRQ_NONE; |
| 2680 | unsigned long flags; | ||
| 2680 | dma_addr_t deq; | 2681 | dma_addr_t deq; |
| 2681 | u64 temp_64; | 2682 | u64 temp_64; |
| 2682 | u32 status; | 2683 | u32 status; |
| 2683 | 2684 | ||
| 2684 | spin_lock(&xhci->lock); | 2685 | spin_lock_irqsave(&xhci->lock, flags); |
| 2685 | /* Check if the xHC generated the interrupt, or the irq is shared */ | 2686 | /* Check if the xHC generated the interrupt, or the irq is shared */ |
| 2686 | status = readl(&xhci->op_regs->status); | 2687 | status = readl(&xhci->op_regs->status); |
| 2687 | if (status == ~(u32)0) { | 2688 | if (status == ~(u32)0) { |
| @@ -2707,12 +2708,9 @@ irqreturn_t xhci_irq(struct usb_hcd *hcd) | |||
| 2707 | */ | 2708 | */ |
| 2708 | status |= STS_EINT; | 2709 | status |= STS_EINT; |
| 2709 | writel(status, &xhci->op_regs->status); | 2710 | writel(status, &xhci->op_regs->status); |
| 2710 | /* FIXME when MSI-X is supported and there are multiple vectors */ | ||
| 2711 | /* Clear the MSI-X event interrupt status */ | ||
| 2712 | 2711 | ||
| 2713 | if (hcd->irq) { | 2712 | if (!hcd->msi_enabled) { |
| 2714 | u32 irq_pending; | 2713 | u32 irq_pending; |
| 2715 | /* Acknowledge the PCI interrupt */ | ||
| 2716 | irq_pending = readl(&xhci->ir_set->irq_pending); | 2714 | irq_pending = readl(&xhci->ir_set->irq_pending); |
| 2717 | irq_pending |= IMAN_IP; | 2715 | irq_pending |= IMAN_IP; |
| 2718 | writel(irq_pending, &xhci->ir_set->irq_pending); | 2716 | writel(irq_pending, &xhci->ir_set->irq_pending); |
| @@ -2757,7 +2755,7 @@ irqreturn_t xhci_irq(struct usb_hcd *hcd) | |||
| 2757 | ret = IRQ_HANDLED; | 2755 | ret = IRQ_HANDLED; |
| 2758 | 2756 | ||
| 2759 | out: | 2757 | out: |
| 2760 | spin_unlock(&xhci->lock); | 2758 | spin_unlock_irqrestore(&xhci->lock, flags); |
| 2761 | 2759 | ||
| 2762 | return ret; | 2760 | return ret; |
| 2763 | } | 2761 | } |
diff --git a/drivers/usb/host/xhci.c b/drivers/usb/host/xhci.c index 2d1310220832..30f47d92a610 100644 --- a/drivers/usb/host/xhci.c +++ b/drivers/usb/host/xhci.c | |||
| @@ -359,9 +359,10 @@ static int xhci_try_enable_msi(struct usb_hcd *hcd) | |||
| 359 | /* fall back to msi*/ | 359 | /* fall back to msi*/ |
| 360 | ret = xhci_setup_msi(xhci); | 360 | ret = xhci_setup_msi(xhci); |
| 361 | 361 | ||
| 362 | if (!ret) | 362 | if (!ret) { |
| 363 | /* hcd->irq is 0, we have MSI */ | 363 | hcd->msi_enabled = 1; |
| 364 | return 0; | 364 | return 0; |
| 365 | } | ||
| 365 | 366 | ||
| 366 | if (!pdev->irq) { | 367 | if (!pdev->irq) { |
| 367 | xhci_err(xhci, "No msi-x/msi found and no IRQ in BIOS\n"); | 368 | xhci_err(xhci, "No msi-x/msi found and no IRQ in BIOS\n"); |
| @@ -1763,7 +1764,7 @@ static int xhci_configure_endpoint_result(struct xhci_hcd *xhci, | |||
| 1763 | 1764 | ||
| 1764 | switch (*cmd_status) { | 1765 | switch (*cmd_status) { |
| 1765 | case COMP_COMMAND_ABORTED: | 1766 | case COMP_COMMAND_ABORTED: |
| 1766 | case COMP_STOPPED: | 1767 | case COMP_COMMAND_RING_STOPPED: |
| 1767 | xhci_warn(xhci, "Timeout while waiting for configure endpoint command\n"); | 1768 | xhci_warn(xhci, "Timeout while waiting for configure endpoint command\n"); |
| 1768 | ret = -ETIME; | 1769 | ret = -ETIME; |
| 1769 | break; | 1770 | break; |
| @@ -1813,7 +1814,7 @@ static int xhci_evaluate_context_result(struct xhci_hcd *xhci, | |||
| 1813 | 1814 | ||
| 1814 | switch (*cmd_status) { | 1815 | switch (*cmd_status) { |
| 1815 | case COMP_COMMAND_ABORTED: | 1816 | case COMP_COMMAND_ABORTED: |
| 1816 | case COMP_STOPPED: | 1817 | case COMP_COMMAND_RING_STOPPED: |
| 1817 | xhci_warn(xhci, "Timeout while waiting for evaluate context command\n"); | 1818 | xhci_warn(xhci, "Timeout while waiting for evaluate context command\n"); |
| 1818 | ret = -ETIME; | 1819 | ret = -ETIME; |
| 1819 | break; | 1820 | break; |
| @@ -3432,7 +3433,7 @@ static int xhci_discover_or_reset_device(struct usb_hcd *hcd, | |||
| 3432 | ret = reset_device_cmd->status; | 3433 | ret = reset_device_cmd->status; |
| 3433 | switch (ret) { | 3434 | switch (ret) { |
| 3434 | case COMP_COMMAND_ABORTED: | 3435 | case COMP_COMMAND_ABORTED: |
| 3435 | case COMP_STOPPED: | 3436 | case COMP_COMMAND_RING_STOPPED: |
| 3436 | xhci_warn(xhci, "Timeout waiting for reset device command\n"); | 3437 | xhci_warn(xhci, "Timeout waiting for reset device command\n"); |
| 3437 | ret = -ETIME; | 3438 | ret = -ETIME; |
| 3438 | goto command_cleanup; | 3439 | goto command_cleanup; |
| @@ -3817,7 +3818,7 @@ static int xhci_setup_device(struct usb_hcd *hcd, struct usb_device *udev, | |||
| 3817 | */ | 3818 | */ |
| 3818 | switch (command->status) { | 3819 | switch (command->status) { |
| 3819 | case COMP_COMMAND_ABORTED: | 3820 | case COMP_COMMAND_ABORTED: |
| 3820 | case COMP_STOPPED: | 3821 | case COMP_COMMAND_RING_STOPPED: |
| 3821 | xhci_warn(xhci, "Timeout while waiting for setup device command\n"); | 3822 | xhci_warn(xhci, "Timeout while waiting for setup device command\n"); |
| 3822 | ret = -ETIME; | 3823 | ret = -ETIME; |
| 3823 | break; | 3824 | break; |
diff --git a/drivers/usb/misc/chaoskey.c b/drivers/usb/misc/chaoskey.c index e9cae4d82af2..15d4e64d3b65 100644 --- a/drivers/usb/misc/chaoskey.c +++ b/drivers/usb/misc/chaoskey.c | |||
| @@ -192,7 +192,7 @@ static int chaoskey_probe(struct usb_interface *interface, | |||
| 192 | 192 | ||
| 193 | dev->in_ep = in_ep; | 193 | dev->in_ep = in_ep; |
| 194 | 194 | ||
| 195 | if (udev->descriptor.idVendor != ALEA_VENDOR_ID) | 195 | if (le16_to_cpu(udev->descriptor.idVendor) != ALEA_VENDOR_ID) |
| 196 | dev->reads_started = 1; | 196 | dev->reads_started = 1; |
| 197 | 197 | ||
| 198 | dev->size = size; | 198 | dev->size = size; |
diff --git a/drivers/usb/misc/iowarrior.c b/drivers/usb/misc/iowarrior.c index 77569531b78a..83b05a287b0c 100644 --- a/drivers/usb/misc/iowarrior.c +++ b/drivers/usb/misc/iowarrior.c | |||
| @@ -554,7 +554,7 @@ static long iowarrior_ioctl(struct file *file, unsigned int cmd, | |||
| 554 | info.revision = le16_to_cpu(dev->udev->descriptor.bcdDevice); | 554 | info.revision = le16_to_cpu(dev->udev->descriptor.bcdDevice); |
| 555 | 555 | ||
| 556 | /* 0==UNKNOWN, 1==LOW(usb1.1) ,2=FULL(usb1.1), 3=HIGH(usb2.0) */ | 556 | /* 0==UNKNOWN, 1==LOW(usb1.1) ,2=FULL(usb1.1), 3=HIGH(usb2.0) */ |
| 557 | info.speed = le16_to_cpu(dev->udev->speed); | 557 | info.speed = dev->udev->speed; |
| 558 | info.if_num = dev->interface->cur_altsetting->desc.bInterfaceNumber; | 558 | info.if_num = dev->interface->cur_altsetting->desc.bInterfaceNumber; |
| 559 | info.report_size = dev->report_size; | 559 | info.report_size = dev->report_size; |
| 560 | 560 | ||
diff --git a/drivers/usb/misc/legousbtower.c b/drivers/usb/misc/legousbtower.c index aa3c280fdf8d..0782ac6f5edf 100644 --- a/drivers/usb/misc/legousbtower.c +++ b/drivers/usb/misc/legousbtower.c | |||
| @@ -926,6 +926,7 @@ static int tower_probe (struct usb_interface *interface, const struct usb_device | |||
| 926 | USB_MAJOR, dev->minor); | 926 | USB_MAJOR, dev->minor); |
| 927 | 927 | ||
| 928 | exit: | 928 | exit: |
| 929 | kfree(get_version_reply); | ||
| 929 | return retval; | 930 | return retval; |
| 930 | 931 | ||
| 931 | error: | 932 | error: |
diff --git a/drivers/usb/misc/sisusbvga/sisusb_con.c b/drivers/usb/misc/sisusbvga/sisusb_con.c index 3c6948af726a..f019d80ca9e4 100644 --- a/drivers/usb/misc/sisusbvga/sisusb_con.c +++ b/drivers/usb/misc/sisusbvga/sisusb_con.c | |||
| @@ -973,7 +973,7 @@ sisusbcon_set_origin(struct vc_data *c) | |||
| 973 | 973 | ||
| 974 | mutex_unlock(&sisusb->lock); | 974 | mutex_unlock(&sisusb->lock); |
| 975 | 975 | ||
| 976 | return 1; | 976 | return true; |
| 977 | } | 977 | } |
| 978 | 978 | ||
| 979 | /* Interface routine */ | 979 | /* Interface routine */ |
diff --git a/drivers/usb/musb/musb_host.c b/drivers/usb/musb/musb_host.c index ac3a4952abb4..dbe617a735d8 100644 --- a/drivers/usb/musb/musb_host.c +++ b/drivers/usb/musb/musb_host.c | |||
| @@ -2780,10 +2780,11 @@ int musb_host_setup(struct musb *musb, int power_budget) | |||
| 2780 | int ret; | 2780 | int ret; |
| 2781 | struct usb_hcd *hcd = musb->hcd; | 2781 | struct usb_hcd *hcd = musb->hcd; |
| 2782 | 2782 | ||
| 2783 | MUSB_HST_MODE(musb); | 2783 | if (musb->port_mode == MUSB_PORT_MODE_HOST) { |
| 2784 | musb->xceiv->otg->default_a = 1; | 2784 | MUSB_HST_MODE(musb); |
| 2785 | musb->xceiv->otg->state = OTG_STATE_A_IDLE; | 2785 | musb->xceiv->otg->default_a = 1; |
| 2786 | 2786 | musb->xceiv->otg->state = OTG_STATE_A_IDLE; | |
| 2787 | } | ||
| 2787 | otg_set_host(musb->xceiv->otg, &hcd->self); | 2788 | otg_set_host(musb->xceiv->otg, &hcd->self); |
| 2788 | hcd->self.otg_port = 1; | 2789 | hcd->self.otg_port = 1; |
| 2789 | musb->xceiv->otg->host = &hcd->self; | 2790 | musb->xceiv->otg->host = &hcd->self; |
diff --git a/drivers/usb/musb/tusb6010_omap.c b/drivers/usb/musb/tusb6010_omap.c index 8b43c4b99f04..7870b37e0ea5 100644 --- a/drivers/usb/musb/tusb6010_omap.c +++ b/drivers/usb/musb/tusb6010_omap.c | |||
| @@ -219,6 +219,7 @@ static int tusb_omap_dma_program(struct dma_channel *channel, u16 packet_sz, | |||
| 219 | u32 dma_remaining; | 219 | u32 dma_remaining; |
| 220 | int src_burst, dst_burst; | 220 | int src_burst, dst_burst; |
| 221 | u16 csr; | 221 | u16 csr; |
| 222 | u32 psize; | ||
| 222 | int ch; | 223 | int ch; |
| 223 | s8 dmareq; | 224 | s8 dmareq; |
| 224 | s8 sync_dev; | 225 | s8 sync_dev; |
| @@ -390,15 +391,19 @@ static int tusb_omap_dma_program(struct dma_channel *channel, u16 packet_sz, | |||
| 390 | 391 | ||
| 391 | if (chdat->tx) { | 392 | if (chdat->tx) { |
| 392 | /* Send transfer_packet_sz packets at a time */ | 393 | /* Send transfer_packet_sz packets at a time */ |
| 393 | musb_writel(ep_conf, TUSB_EP_MAX_PACKET_SIZE_OFFSET, | 394 | psize = musb_readl(ep_conf, TUSB_EP_MAX_PACKET_SIZE_OFFSET); |
| 394 | chdat->transfer_packet_sz); | 395 | psize &= ~0x7ff; |
| 396 | psize |= chdat->transfer_packet_sz; | ||
| 397 | musb_writel(ep_conf, TUSB_EP_MAX_PACKET_SIZE_OFFSET, psize); | ||
| 395 | 398 | ||
| 396 | musb_writel(ep_conf, TUSB_EP_TX_OFFSET, | 399 | musb_writel(ep_conf, TUSB_EP_TX_OFFSET, |
| 397 | TUSB_EP_CONFIG_XFR_SIZE(chdat->transfer_len)); | 400 | TUSB_EP_CONFIG_XFR_SIZE(chdat->transfer_len)); |
| 398 | } else { | 401 | } else { |
| 399 | /* Receive transfer_packet_sz packets at a time */ | 402 | /* Receive transfer_packet_sz packets at a time */ |
| 400 | musb_writel(ep_conf, TUSB_EP_MAX_PACKET_SIZE_OFFSET, | 403 | psize = musb_readl(ep_conf, TUSB_EP_MAX_PACKET_SIZE_OFFSET); |
| 401 | chdat->transfer_packet_sz << 16); | 404 | psize &= ~(0x7ff << 16); |
| 405 | psize |= (chdat->transfer_packet_sz << 16); | ||
| 406 | musb_writel(ep_conf, TUSB_EP_MAX_PACKET_SIZE_OFFSET, psize); | ||
| 402 | 407 | ||
| 403 | musb_writel(ep_conf, TUSB_EP_RX_OFFSET, | 408 | musb_writel(ep_conf, TUSB_EP_RX_OFFSET, |
| 404 | TUSB_EP_CONFIG_XFR_SIZE(chdat->transfer_len)); | 409 | TUSB_EP_CONFIG_XFR_SIZE(chdat->transfer_len)); |
diff --git a/drivers/usb/serial/ftdi_sio.c b/drivers/usb/serial/ftdi_sio.c index d38780fa8788..aba74f817dc6 100644 --- a/drivers/usb/serial/ftdi_sio.c +++ b/drivers/usb/serial/ftdi_sio.c | |||
| @@ -809,10 +809,10 @@ static const struct usb_device_id id_table_combined[] = { | |||
| 809 | { USB_DEVICE(FTDI_VID, FTDI_PROPOX_ISPCABLEIII_PID) }, | 809 | { USB_DEVICE(FTDI_VID, FTDI_PROPOX_ISPCABLEIII_PID) }, |
| 810 | { USB_DEVICE(FTDI_VID, CYBER_CORTEX_AV_PID), | 810 | { USB_DEVICE(FTDI_VID, CYBER_CORTEX_AV_PID), |
| 811 | .driver_info = (kernel_ulong_t)&ftdi_jtag_quirk }, | 811 | .driver_info = (kernel_ulong_t)&ftdi_jtag_quirk }, |
| 812 | { USB_DEVICE(OLIMEX_VID, OLIMEX_ARM_USB_OCD_PID), | 812 | { USB_DEVICE_INTERFACE_NUMBER(OLIMEX_VID, OLIMEX_ARM_USB_OCD_PID, 1) }, |
| 813 | .driver_info = (kernel_ulong_t)&ftdi_jtag_quirk }, | 813 | { USB_DEVICE_INTERFACE_NUMBER(OLIMEX_VID, OLIMEX_ARM_USB_OCD_H_PID, 1) }, |
| 814 | { USB_DEVICE(OLIMEX_VID, OLIMEX_ARM_USB_OCD_H_PID), | 814 | { USB_DEVICE_INTERFACE_NUMBER(OLIMEX_VID, OLIMEX_ARM_USB_TINY_PID, 1) }, |
| 815 | .driver_info = (kernel_ulong_t)&ftdi_jtag_quirk }, | 815 | { USB_DEVICE_INTERFACE_NUMBER(OLIMEX_VID, OLIMEX_ARM_USB_TINY_H_PID, 1) }, |
| 816 | { USB_DEVICE(FIC_VID, FIC_NEO1973_DEBUG_PID), | 816 | { USB_DEVICE(FIC_VID, FIC_NEO1973_DEBUG_PID), |
| 817 | .driver_info = (kernel_ulong_t)&ftdi_jtag_quirk }, | 817 | .driver_info = (kernel_ulong_t)&ftdi_jtag_quirk }, |
| 818 | { USB_DEVICE(FTDI_VID, FTDI_OOCDLINK_PID), | 818 | { USB_DEVICE(FTDI_VID, FTDI_OOCDLINK_PID), |
| @@ -1527,9 +1527,9 @@ static int set_serial_info(struct tty_struct *tty, | |||
| 1527 | (new_serial.flags & ASYNC_FLAGS)); | 1527 | (new_serial.flags & ASYNC_FLAGS)); |
| 1528 | priv->custom_divisor = new_serial.custom_divisor; | 1528 | priv->custom_divisor = new_serial.custom_divisor; |
| 1529 | 1529 | ||
| 1530 | check_and_exit: | ||
| 1530 | write_latency_timer(port); | 1531 | write_latency_timer(port); |
| 1531 | 1532 | ||
| 1532 | check_and_exit: | ||
| 1533 | if ((old_priv.flags & ASYNC_SPD_MASK) != | 1533 | if ((old_priv.flags & ASYNC_SPD_MASK) != |
| 1534 | (priv->flags & ASYNC_SPD_MASK)) { | 1534 | (priv->flags & ASYNC_SPD_MASK)) { |
| 1535 | if ((priv->flags & ASYNC_SPD_MASK) == ASYNC_SPD_HI) | 1535 | if ((priv->flags & ASYNC_SPD_MASK) == ASYNC_SPD_HI) |
diff --git a/drivers/usb/serial/ftdi_sio_ids.h b/drivers/usb/serial/ftdi_sio_ids.h index 71fb9e59db71..4fcf1cecb6d7 100644 --- a/drivers/usb/serial/ftdi_sio_ids.h +++ b/drivers/usb/serial/ftdi_sio_ids.h | |||
| @@ -882,6 +882,8 @@ | |||
| 882 | /* Olimex */ | 882 | /* Olimex */ |
| 883 | #define OLIMEX_VID 0x15BA | 883 | #define OLIMEX_VID 0x15BA |
| 884 | #define OLIMEX_ARM_USB_OCD_PID 0x0003 | 884 | #define OLIMEX_ARM_USB_OCD_PID 0x0003 |
| 885 | #define OLIMEX_ARM_USB_TINY_PID 0x0004 | ||
| 886 | #define OLIMEX_ARM_USB_TINY_H_PID 0x002a | ||
| 885 | #define OLIMEX_ARM_USB_OCD_H_PID 0x002b | 887 | #define OLIMEX_ARM_USB_OCD_H_PID 0x002b |
| 886 | 888 | ||
| 887 | /* | 889 | /* |
diff --git a/drivers/usb/serial/io_ti.c b/drivers/usb/serial/io_ti.c index 87798e625d6c..6cefb9cb133d 100644 --- a/drivers/usb/serial/io_ti.c +++ b/drivers/usb/serial/io_ti.c | |||
| @@ -2336,8 +2336,11 @@ static void change_port_settings(struct tty_struct *tty, | |||
| 2336 | if (!baud) { | 2336 | if (!baud) { |
| 2337 | /* pick a default, any default... */ | 2337 | /* pick a default, any default... */ |
| 2338 | baud = 9600; | 2338 | baud = 9600; |
| 2339 | } else | 2339 | } else { |
| 2340 | /* Avoid a zero divisor. */ | ||
| 2341 | baud = min(baud, 461550); | ||
| 2340 | tty_encode_baud_rate(tty, baud, baud); | 2342 | tty_encode_baud_rate(tty, baud, baud); |
| 2343 | } | ||
| 2341 | 2344 | ||
| 2342 | edge_port->baud_rate = baud; | 2345 | edge_port->baud_rate = baud; |
| 2343 | config->wBaudRate = (__u16)((461550L + baud/2) / baud); | 2346 | config->wBaudRate = (__u16)((461550L + baud/2) / baud); |
diff --git a/drivers/usb/serial/ir-usb.c b/drivers/usb/serial/ir-usb.c index 73956d48a0c5..f9734a96d516 100644 --- a/drivers/usb/serial/ir-usb.c +++ b/drivers/usb/serial/ir-usb.c | |||
| @@ -197,6 +197,7 @@ static u8 ir_xbof_change(u8 xbof) | |||
| 197 | static int ir_startup(struct usb_serial *serial) | 197 | static int ir_startup(struct usb_serial *serial) |
| 198 | { | 198 | { |
| 199 | struct usb_irda_cs_descriptor *irda_desc; | 199 | struct usb_irda_cs_descriptor *irda_desc; |
| 200 | int rates; | ||
| 200 | 201 | ||
| 201 | irda_desc = irda_usb_find_class_desc(serial, 0); | 202 | irda_desc = irda_usb_find_class_desc(serial, 0); |
| 202 | if (!irda_desc) { | 203 | if (!irda_desc) { |
| @@ -205,18 +206,20 @@ static int ir_startup(struct usb_serial *serial) | |||
| 205 | return -ENODEV; | 206 | return -ENODEV; |
| 206 | } | 207 | } |
| 207 | 208 | ||
| 209 | rates = le16_to_cpu(irda_desc->wBaudRate); | ||
| 210 | |||
| 208 | dev_dbg(&serial->dev->dev, | 211 | dev_dbg(&serial->dev->dev, |
| 209 | "%s - Baud rates supported:%s%s%s%s%s%s%s%s%s\n", | 212 | "%s - Baud rates supported:%s%s%s%s%s%s%s%s%s\n", |
| 210 | __func__, | 213 | __func__, |
| 211 | (irda_desc->wBaudRate & USB_IRDA_BR_2400) ? " 2400" : "", | 214 | (rates & USB_IRDA_BR_2400) ? " 2400" : "", |
| 212 | (irda_desc->wBaudRate & USB_IRDA_BR_9600) ? " 9600" : "", | 215 | (rates & USB_IRDA_BR_9600) ? " 9600" : "", |
| 213 | (irda_desc->wBaudRate & USB_IRDA_BR_19200) ? " 19200" : "", | 216 | (rates & USB_IRDA_BR_19200) ? " 19200" : "", |
| 214 | (irda_desc->wBaudRate & USB_IRDA_BR_38400) ? " 38400" : "", | 217 | (rates & USB_IRDA_BR_38400) ? " 38400" : "", |
| 215 | (irda_desc->wBaudRate & USB_IRDA_BR_57600) ? " 57600" : "", | 218 | (rates & USB_IRDA_BR_57600) ? " 57600" : "", |
| 216 | (irda_desc->wBaudRate & USB_IRDA_BR_115200) ? " 115200" : "", | 219 | (rates & USB_IRDA_BR_115200) ? " 115200" : "", |
| 217 | (irda_desc->wBaudRate & USB_IRDA_BR_576000) ? " 576000" : "", | 220 | (rates & USB_IRDA_BR_576000) ? " 576000" : "", |
| 218 | (irda_desc->wBaudRate & USB_IRDA_BR_1152000) ? " 1152000" : "", | 221 | (rates & USB_IRDA_BR_1152000) ? " 1152000" : "", |
| 219 | (irda_desc->wBaudRate & USB_IRDA_BR_4000000) ? " 4000000" : ""); | 222 | (rates & USB_IRDA_BR_4000000) ? " 4000000" : ""); |
| 220 | 223 | ||
| 221 | switch (irda_desc->bmAdditionalBOFs) { | 224 | switch (irda_desc->bmAdditionalBOFs) { |
| 222 | case USB_IRDA_AB_48: | 225 | case USB_IRDA_AB_48: |
diff --git a/drivers/usb/serial/mct_u232.c b/drivers/usb/serial/mct_u232.c index edbc81f205c2..70f346f1aa86 100644 --- a/drivers/usb/serial/mct_u232.c +++ b/drivers/usb/serial/mct_u232.c | |||
| @@ -189,7 +189,7 @@ static int mct_u232_set_baud_rate(struct tty_struct *tty, | |||
| 189 | return -ENOMEM; | 189 | return -ENOMEM; |
| 190 | 190 | ||
| 191 | divisor = mct_u232_calculate_baud_rate(serial, value, &speed); | 191 | divisor = mct_u232_calculate_baud_rate(serial, value, &speed); |
| 192 | put_unaligned_le32(cpu_to_le32(divisor), buf); | 192 | put_unaligned_le32(divisor, buf); |
| 193 | rc = usb_control_msg(serial->dev, usb_sndctrlpipe(serial->dev, 0), | 193 | rc = usb_control_msg(serial->dev, usb_sndctrlpipe(serial->dev, 0), |
| 194 | MCT_U232_SET_BAUD_RATE_REQUEST, | 194 | MCT_U232_SET_BAUD_RATE_REQUEST, |
| 195 | MCT_U232_SET_REQUEST_TYPE, | 195 | MCT_U232_SET_REQUEST_TYPE, |
diff --git a/drivers/usb/serial/option.c b/drivers/usb/serial/option.c index af67a0de6b5d..3bf61acfc26b 100644 --- a/drivers/usb/serial/option.c +++ b/drivers/usb/serial/option.c | |||
| @@ -281,6 +281,7 @@ static void option_instat_callback(struct urb *urb); | |||
| 281 | #define TELIT_PRODUCT_LE922_USBCFG0 0x1042 | 281 | #define TELIT_PRODUCT_LE922_USBCFG0 0x1042 |
| 282 | #define TELIT_PRODUCT_LE922_USBCFG3 0x1043 | 282 | #define TELIT_PRODUCT_LE922_USBCFG3 0x1043 |
| 283 | #define TELIT_PRODUCT_LE922_USBCFG5 0x1045 | 283 | #define TELIT_PRODUCT_LE922_USBCFG5 0x1045 |
| 284 | #define TELIT_PRODUCT_ME910 0x1100 | ||
| 284 | #define TELIT_PRODUCT_LE920 0x1200 | 285 | #define TELIT_PRODUCT_LE920 0x1200 |
| 285 | #define TELIT_PRODUCT_LE910 0x1201 | 286 | #define TELIT_PRODUCT_LE910 0x1201 |
| 286 | #define TELIT_PRODUCT_LE910_USBCFG4 0x1206 | 287 | #define TELIT_PRODUCT_LE910_USBCFG4 0x1206 |
| @@ -640,6 +641,11 @@ static const struct option_blacklist_info simcom_sim7100e_blacklist = { | |||
| 640 | .reserved = BIT(5) | BIT(6), | 641 | .reserved = BIT(5) | BIT(6), |
| 641 | }; | 642 | }; |
| 642 | 643 | ||
| 644 | static const struct option_blacklist_info telit_me910_blacklist = { | ||
| 645 | .sendsetup = BIT(0), | ||
| 646 | .reserved = BIT(1) | BIT(3), | ||
| 647 | }; | ||
| 648 | |||
| 643 | static const struct option_blacklist_info telit_le910_blacklist = { | 649 | static const struct option_blacklist_info telit_le910_blacklist = { |
| 644 | .sendsetup = BIT(0), | 650 | .sendsetup = BIT(0), |
| 645 | .reserved = BIT(1) | BIT(2), | 651 | .reserved = BIT(1) | BIT(2), |
| @@ -1235,6 +1241,8 @@ static const struct usb_device_id option_ids[] = { | |||
| 1235 | .driver_info = (kernel_ulong_t)&telit_le922_blacklist_usbcfg3 }, | 1241 | .driver_info = (kernel_ulong_t)&telit_le922_blacklist_usbcfg3 }, |
| 1236 | { USB_DEVICE_INTERFACE_CLASS(TELIT_VENDOR_ID, TELIT_PRODUCT_LE922_USBCFG5, 0xff), | 1242 | { USB_DEVICE_INTERFACE_CLASS(TELIT_VENDOR_ID, TELIT_PRODUCT_LE922_USBCFG5, 0xff), |
| 1237 | .driver_info = (kernel_ulong_t)&telit_le922_blacklist_usbcfg0 }, | 1243 | .driver_info = (kernel_ulong_t)&telit_le922_blacklist_usbcfg0 }, |
| 1244 | { USB_DEVICE(TELIT_VENDOR_ID, TELIT_PRODUCT_ME910), | ||
| 1245 | .driver_info = (kernel_ulong_t)&telit_me910_blacklist }, | ||
| 1238 | { USB_DEVICE(TELIT_VENDOR_ID, TELIT_PRODUCT_LE910), | 1246 | { USB_DEVICE(TELIT_VENDOR_ID, TELIT_PRODUCT_LE910), |
| 1239 | .driver_info = (kernel_ulong_t)&telit_le910_blacklist }, | 1247 | .driver_info = (kernel_ulong_t)&telit_le910_blacklist }, |
| 1240 | { USB_DEVICE(TELIT_VENDOR_ID, TELIT_PRODUCT_LE910_USBCFG4), | 1248 | { USB_DEVICE(TELIT_VENDOR_ID, TELIT_PRODUCT_LE910_USBCFG4), |
diff --git a/drivers/usb/serial/qcserial.c b/drivers/usb/serial/qcserial.c index 38b3f0d8cd58..fd509ed6cf70 100644 --- a/drivers/usb/serial/qcserial.c +++ b/drivers/usb/serial/qcserial.c | |||
| @@ -162,6 +162,8 @@ static const struct usb_device_id id_table[] = { | |||
| 162 | {DEVICE_SWI(0x1199, 0x9071)}, /* Sierra Wireless MC74xx */ | 162 | {DEVICE_SWI(0x1199, 0x9071)}, /* Sierra Wireless MC74xx */ |
| 163 | {DEVICE_SWI(0x1199, 0x9078)}, /* Sierra Wireless EM74xx */ | 163 | {DEVICE_SWI(0x1199, 0x9078)}, /* Sierra Wireless EM74xx */ |
| 164 | {DEVICE_SWI(0x1199, 0x9079)}, /* Sierra Wireless EM74xx */ | 164 | {DEVICE_SWI(0x1199, 0x9079)}, /* Sierra Wireless EM74xx */ |
| 165 | {DEVICE_SWI(0x1199, 0x907a)}, /* Sierra Wireless EM74xx QDL */ | ||
| 166 | {DEVICE_SWI(0x1199, 0x907b)}, /* Sierra Wireless EM74xx */ | ||
| 165 | {DEVICE_SWI(0x413c, 0x81a2)}, /* Dell Wireless 5806 Gobi(TM) 4G LTE Mobile Broadband Card */ | 167 | {DEVICE_SWI(0x413c, 0x81a2)}, /* Dell Wireless 5806 Gobi(TM) 4G LTE Mobile Broadband Card */ |
| 166 | {DEVICE_SWI(0x413c, 0x81a3)}, /* Dell Wireless 5570 HSPA+ (42Mbps) Mobile Broadband Card */ | 168 | {DEVICE_SWI(0x413c, 0x81a3)}, /* Dell Wireless 5570 HSPA+ (42Mbps) Mobile Broadband Card */ |
| 167 | {DEVICE_SWI(0x413c, 0x81a4)}, /* Dell Wireless 5570e HSPA+ (42Mbps) Mobile Broadband Card */ | 169 | {DEVICE_SWI(0x413c, 0x81a4)}, /* Dell Wireless 5570e HSPA+ (42Mbps) Mobile Broadband Card */ |
diff --git a/drivers/usb/storage/ene_ub6250.c b/drivers/usb/storage/ene_ub6250.c index 369f3c24815a..44af719194b2 100644 --- a/drivers/usb/storage/ene_ub6250.c +++ b/drivers/usb/storage/ene_ub6250.c | |||
| @@ -446,6 +446,10 @@ struct ms_lib_ctrl { | |||
| 446 | #define SD_BLOCK_LEN 9 | 446 | #define SD_BLOCK_LEN 9 |
| 447 | 447 | ||
| 448 | struct ene_ub6250_info { | 448 | struct ene_ub6250_info { |
| 449 | |||
| 450 | /* I/O bounce buffer */ | ||
| 451 | u8 *bbuf; | ||
| 452 | |||
| 449 | /* for 6250 code */ | 453 | /* for 6250 code */ |
| 450 | struct SD_STATUS SD_Status; | 454 | struct SD_STATUS SD_Status; |
| 451 | struct MS_STATUS MS_Status; | 455 | struct MS_STATUS MS_Status; |
| @@ -493,8 +497,11 @@ static int ene_load_bincode(struct us_data *us, unsigned char flag); | |||
| 493 | 497 | ||
| 494 | static void ene_ub6250_info_destructor(void *extra) | 498 | static void ene_ub6250_info_destructor(void *extra) |
| 495 | { | 499 | { |
| 500 | struct ene_ub6250_info *info = (struct ene_ub6250_info *) extra; | ||
| 501 | |||
| 496 | if (!extra) | 502 | if (!extra) |
| 497 | return; | 503 | return; |
| 504 | kfree(info->bbuf); | ||
| 498 | } | 505 | } |
| 499 | 506 | ||
| 500 | static int ene_send_scsi_cmd(struct us_data *us, u8 fDir, void *buf, int use_sg) | 507 | static int ene_send_scsi_cmd(struct us_data *us, u8 fDir, void *buf, int use_sg) |
| @@ -860,8 +867,9 @@ static int ms_read_readpage(struct us_data *us, u32 PhyBlockAddr, | |||
| 860 | u8 PageNum, u32 *PageBuf, struct ms_lib_type_extdat *ExtraDat) | 867 | u8 PageNum, u32 *PageBuf, struct ms_lib_type_extdat *ExtraDat) |
| 861 | { | 868 | { |
| 862 | struct bulk_cb_wrap *bcb = (struct bulk_cb_wrap *) us->iobuf; | 869 | struct bulk_cb_wrap *bcb = (struct bulk_cb_wrap *) us->iobuf; |
| 870 | struct ene_ub6250_info *info = (struct ene_ub6250_info *) us->extra; | ||
| 871 | u8 *bbuf = info->bbuf; | ||
| 863 | int result; | 872 | int result; |
| 864 | u8 ExtBuf[4]; | ||
| 865 | u32 bn = PhyBlockAddr * 0x20 + PageNum; | 873 | u32 bn = PhyBlockAddr * 0x20 + PageNum; |
| 866 | 874 | ||
| 867 | result = ene_load_bincode(us, MS_RW_PATTERN); | 875 | result = ene_load_bincode(us, MS_RW_PATTERN); |
| @@ -901,7 +909,7 @@ static int ms_read_readpage(struct us_data *us, u32 PhyBlockAddr, | |||
| 901 | bcb->CDB[2] = (unsigned char)(PhyBlockAddr>>16); | 909 | bcb->CDB[2] = (unsigned char)(PhyBlockAddr>>16); |
| 902 | bcb->CDB[6] = 0x01; | 910 | bcb->CDB[6] = 0x01; |
| 903 | 911 | ||
| 904 | result = ene_send_scsi_cmd(us, FDIR_READ, &ExtBuf, 0); | 912 | result = ene_send_scsi_cmd(us, FDIR_READ, bbuf, 0); |
| 905 | if (result != USB_STOR_XFER_GOOD) | 913 | if (result != USB_STOR_XFER_GOOD) |
| 906 | return USB_STOR_TRANSPORT_ERROR; | 914 | return USB_STOR_TRANSPORT_ERROR; |
| 907 | 915 | ||
| @@ -910,9 +918,9 @@ static int ms_read_readpage(struct us_data *us, u32 PhyBlockAddr, | |||
| 910 | ExtraDat->status0 = 0x10; /* Not yet,fireware support */ | 918 | ExtraDat->status0 = 0x10; /* Not yet,fireware support */ |
| 911 | 919 | ||
| 912 | ExtraDat->status1 = 0x00; /* Not yet,fireware support */ | 920 | ExtraDat->status1 = 0x00; /* Not yet,fireware support */ |
| 913 | ExtraDat->ovrflg = ExtBuf[0]; | 921 | ExtraDat->ovrflg = bbuf[0]; |
| 914 | ExtraDat->mngflg = ExtBuf[1]; | 922 | ExtraDat->mngflg = bbuf[1]; |
| 915 | ExtraDat->logadr = memstick_logaddr(ExtBuf[2], ExtBuf[3]); | 923 | ExtraDat->logadr = memstick_logaddr(bbuf[2], bbuf[3]); |
| 916 | 924 | ||
| 917 | return USB_STOR_TRANSPORT_GOOD; | 925 | return USB_STOR_TRANSPORT_GOOD; |
| 918 | } | 926 | } |
| @@ -1332,8 +1340,9 @@ static int ms_lib_read_extra(struct us_data *us, u32 PhyBlock, | |||
| 1332 | u8 PageNum, struct ms_lib_type_extdat *ExtraDat) | 1340 | u8 PageNum, struct ms_lib_type_extdat *ExtraDat) |
| 1333 | { | 1341 | { |
| 1334 | struct bulk_cb_wrap *bcb = (struct bulk_cb_wrap *) us->iobuf; | 1342 | struct bulk_cb_wrap *bcb = (struct bulk_cb_wrap *) us->iobuf; |
| 1343 | struct ene_ub6250_info *info = (struct ene_ub6250_info *) us->extra; | ||
| 1344 | u8 *bbuf = info->bbuf; | ||
| 1335 | int result; | 1345 | int result; |
| 1336 | u8 ExtBuf[4]; | ||
| 1337 | 1346 | ||
| 1338 | memset(bcb, 0, sizeof(struct bulk_cb_wrap)); | 1347 | memset(bcb, 0, sizeof(struct bulk_cb_wrap)); |
| 1339 | bcb->Signature = cpu_to_le32(US_BULK_CB_SIGN); | 1348 | bcb->Signature = cpu_to_le32(US_BULK_CB_SIGN); |
| @@ -1347,7 +1356,7 @@ static int ms_lib_read_extra(struct us_data *us, u32 PhyBlock, | |||
| 1347 | bcb->CDB[2] = (unsigned char)(PhyBlock>>16); | 1356 | bcb->CDB[2] = (unsigned char)(PhyBlock>>16); |
| 1348 | bcb->CDB[6] = 0x01; | 1357 | bcb->CDB[6] = 0x01; |
| 1349 | 1358 | ||
| 1350 | result = ene_send_scsi_cmd(us, FDIR_READ, &ExtBuf, 0); | 1359 | result = ene_send_scsi_cmd(us, FDIR_READ, bbuf, 0); |
| 1351 | if (result != USB_STOR_XFER_GOOD) | 1360 | if (result != USB_STOR_XFER_GOOD) |
| 1352 | return USB_STOR_TRANSPORT_ERROR; | 1361 | return USB_STOR_TRANSPORT_ERROR; |
| 1353 | 1362 | ||
| @@ -1355,9 +1364,9 @@ static int ms_lib_read_extra(struct us_data *us, u32 PhyBlock, | |||
| 1355 | ExtraDat->intr = 0x80; /* Not yet, waiting for fireware support */ | 1364 | ExtraDat->intr = 0x80; /* Not yet, waiting for fireware support */ |
| 1356 | ExtraDat->status0 = 0x10; /* Not yet, waiting for fireware support */ | 1365 | ExtraDat->status0 = 0x10; /* Not yet, waiting for fireware support */ |
| 1357 | ExtraDat->status1 = 0x00; /* Not yet, waiting for fireware support */ | 1366 | ExtraDat->status1 = 0x00; /* Not yet, waiting for fireware support */ |
| 1358 | ExtraDat->ovrflg = ExtBuf[0]; | 1367 | ExtraDat->ovrflg = bbuf[0]; |
| 1359 | ExtraDat->mngflg = ExtBuf[1]; | 1368 | ExtraDat->mngflg = bbuf[1]; |
| 1360 | ExtraDat->logadr = memstick_logaddr(ExtBuf[2], ExtBuf[3]); | 1369 | ExtraDat->logadr = memstick_logaddr(bbuf[2], bbuf[3]); |
| 1361 | 1370 | ||
| 1362 | return USB_STOR_TRANSPORT_GOOD; | 1371 | return USB_STOR_TRANSPORT_GOOD; |
| 1363 | } | 1372 | } |
| @@ -1556,9 +1565,9 @@ static int ms_lib_scan_logicalblocknumber(struct us_data *us, u16 btBlk1st) | |||
| 1556 | u16 PhyBlock, newblk, i; | 1565 | u16 PhyBlock, newblk, i; |
| 1557 | u16 LogStart, LogEnde; | 1566 | u16 LogStart, LogEnde; |
| 1558 | struct ms_lib_type_extdat extdat; | 1567 | struct ms_lib_type_extdat extdat; |
| 1559 | u8 buf[0x200]; | ||
| 1560 | u32 count = 0, index = 0; | 1568 | u32 count = 0, index = 0; |
| 1561 | struct ene_ub6250_info *info = (struct ene_ub6250_info *) us->extra; | 1569 | struct ene_ub6250_info *info = (struct ene_ub6250_info *) us->extra; |
| 1570 | u8 *bbuf = info->bbuf; | ||
| 1562 | 1571 | ||
| 1563 | for (PhyBlock = 0; PhyBlock < info->MS_Lib.NumberOfPhyBlock;) { | 1572 | for (PhyBlock = 0; PhyBlock < info->MS_Lib.NumberOfPhyBlock;) { |
| 1564 | ms_lib_phy_to_log_range(PhyBlock, &LogStart, &LogEnde); | 1573 | ms_lib_phy_to_log_range(PhyBlock, &LogStart, &LogEnde); |
| @@ -1572,14 +1581,16 @@ static int ms_lib_scan_logicalblocknumber(struct us_data *us, u16 btBlk1st) | |||
| 1572 | } | 1581 | } |
| 1573 | 1582 | ||
| 1574 | if (count == PhyBlock) { | 1583 | if (count == PhyBlock) { |
| 1575 | ms_lib_read_extrablock(us, PhyBlock, 0, 0x80, &buf); | 1584 | ms_lib_read_extrablock(us, PhyBlock, 0, 0x80, |
| 1585 | bbuf); | ||
| 1576 | count += 0x80; | 1586 | count += 0x80; |
| 1577 | } | 1587 | } |
| 1578 | index = (PhyBlock % 0x80) * 4; | 1588 | index = (PhyBlock % 0x80) * 4; |
| 1579 | 1589 | ||
| 1580 | extdat.ovrflg = buf[index]; | 1590 | extdat.ovrflg = bbuf[index]; |
| 1581 | extdat.mngflg = buf[index+1]; | 1591 | extdat.mngflg = bbuf[index+1]; |
| 1582 | extdat.logadr = memstick_logaddr(buf[index+2], buf[index+3]); | 1592 | extdat.logadr = memstick_logaddr(bbuf[index+2], |
| 1593 | bbuf[index+3]); | ||
| 1583 | 1594 | ||
| 1584 | if ((extdat.ovrflg & MS_REG_OVR_BKST) != MS_REG_OVR_BKST_OK) { | 1595 | if ((extdat.ovrflg & MS_REG_OVR_BKST) != MS_REG_OVR_BKST_OK) { |
| 1585 | ms_lib_setacquired_errorblock(us, PhyBlock); | 1596 | ms_lib_setacquired_errorblock(us, PhyBlock); |
| @@ -2062,9 +2073,9 @@ static int ene_ms_init(struct us_data *us) | |||
| 2062 | { | 2073 | { |
| 2063 | struct bulk_cb_wrap *bcb = (struct bulk_cb_wrap *) us->iobuf; | 2074 | struct bulk_cb_wrap *bcb = (struct bulk_cb_wrap *) us->iobuf; |
| 2064 | int result; | 2075 | int result; |
| 2065 | u8 buf[0x200]; | ||
| 2066 | u16 MSP_BlockSize, MSP_UserAreaBlocks; | 2076 | u16 MSP_BlockSize, MSP_UserAreaBlocks; |
| 2067 | struct ene_ub6250_info *info = (struct ene_ub6250_info *) us->extra; | 2077 | struct ene_ub6250_info *info = (struct ene_ub6250_info *) us->extra; |
| 2078 | u8 *bbuf = info->bbuf; | ||
| 2068 | 2079 | ||
| 2069 | printk(KERN_INFO "transport --- ENE_MSInit\n"); | 2080 | printk(KERN_INFO "transport --- ENE_MSInit\n"); |
| 2070 | 2081 | ||
| @@ -2083,13 +2094,13 @@ static int ene_ms_init(struct us_data *us) | |||
| 2083 | bcb->CDB[0] = 0xF1; | 2094 | bcb->CDB[0] = 0xF1; |
| 2084 | bcb->CDB[1] = 0x01; | 2095 | bcb->CDB[1] = 0x01; |
| 2085 | 2096 | ||
| 2086 | result = ene_send_scsi_cmd(us, FDIR_READ, &buf, 0); | 2097 | result = ene_send_scsi_cmd(us, FDIR_READ, bbuf, 0); |
| 2087 | if (result != USB_STOR_XFER_GOOD) { | 2098 | if (result != USB_STOR_XFER_GOOD) { |
| 2088 | printk(KERN_ERR "Execution MS Init Code Fail !!\n"); | 2099 | printk(KERN_ERR "Execution MS Init Code Fail !!\n"); |
| 2089 | return USB_STOR_TRANSPORT_ERROR; | 2100 | return USB_STOR_TRANSPORT_ERROR; |
| 2090 | } | 2101 | } |
| 2091 | /* the same part to test ENE */ | 2102 | /* the same part to test ENE */ |
| 2092 | info->MS_Status = *(struct MS_STATUS *)&buf[0]; | 2103 | info->MS_Status = *(struct MS_STATUS *) bbuf; |
| 2093 | 2104 | ||
| 2094 | if (info->MS_Status.Insert && info->MS_Status.Ready) { | 2105 | if (info->MS_Status.Insert && info->MS_Status.Ready) { |
| 2095 | printk(KERN_INFO "Insert = %x\n", info->MS_Status.Insert); | 2106 | printk(KERN_INFO "Insert = %x\n", info->MS_Status.Insert); |
| @@ -2098,15 +2109,15 @@ static int ene_ms_init(struct us_data *us) | |||
| 2098 | printk(KERN_INFO "IsMSPHG = %x\n", info->MS_Status.IsMSPHG); | 2109 | printk(KERN_INFO "IsMSPHG = %x\n", info->MS_Status.IsMSPHG); |
| 2099 | printk(KERN_INFO "WtP= %x\n", info->MS_Status.WtP); | 2110 | printk(KERN_INFO "WtP= %x\n", info->MS_Status.WtP); |
| 2100 | if (info->MS_Status.IsMSPro) { | 2111 | if (info->MS_Status.IsMSPro) { |
| 2101 | MSP_BlockSize = (buf[6] << 8) | buf[7]; | 2112 | MSP_BlockSize = (bbuf[6] << 8) | bbuf[7]; |
| 2102 | MSP_UserAreaBlocks = (buf[10] << 8) | buf[11]; | 2113 | MSP_UserAreaBlocks = (bbuf[10] << 8) | bbuf[11]; |
| 2103 | info->MSP_TotalBlock = MSP_BlockSize * MSP_UserAreaBlocks; | 2114 | info->MSP_TotalBlock = MSP_BlockSize * MSP_UserAreaBlocks; |
| 2104 | } else { | 2115 | } else { |
| 2105 | ms_card_init(us); /* Card is MS (to ms.c)*/ | 2116 | ms_card_init(us); /* Card is MS (to ms.c)*/ |
| 2106 | } | 2117 | } |
| 2107 | usb_stor_dbg(us, "MS Init Code OK !!\n"); | 2118 | usb_stor_dbg(us, "MS Init Code OK !!\n"); |
| 2108 | } else { | 2119 | } else { |
| 2109 | usb_stor_dbg(us, "MS Card Not Ready --- %x\n", buf[0]); | 2120 | usb_stor_dbg(us, "MS Card Not Ready --- %x\n", bbuf[0]); |
| 2110 | return USB_STOR_TRANSPORT_ERROR; | 2121 | return USB_STOR_TRANSPORT_ERROR; |
| 2111 | } | 2122 | } |
| 2112 | 2123 | ||
| @@ -2116,9 +2127,9 @@ static int ene_ms_init(struct us_data *us) | |||
| 2116 | static int ene_sd_init(struct us_data *us) | 2127 | static int ene_sd_init(struct us_data *us) |
| 2117 | { | 2128 | { |
| 2118 | int result; | 2129 | int result; |
| 2119 | u8 buf[0x200]; | ||
| 2120 | struct bulk_cb_wrap *bcb = (struct bulk_cb_wrap *) us->iobuf; | 2130 | struct bulk_cb_wrap *bcb = (struct bulk_cb_wrap *) us->iobuf; |
| 2121 | struct ene_ub6250_info *info = (struct ene_ub6250_info *) us->extra; | 2131 | struct ene_ub6250_info *info = (struct ene_ub6250_info *) us->extra; |
| 2132 | u8 *bbuf = info->bbuf; | ||
| 2122 | 2133 | ||
| 2123 | usb_stor_dbg(us, "transport --- ENE_SDInit\n"); | 2134 | usb_stor_dbg(us, "transport --- ENE_SDInit\n"); |
| 2124 | /* SD Init Part-1 */ | 2135 | /* SD Init Part-1 */ |
| @@ -2152,17 +2163,17 @@ static int ene_sd_init(struct us_data *us) | |||
| 2152 | bcb->Flags = US_BULK_FLAG_IN; | 2163 | bcb->Flags = US_BULK_FLAG_IN; |
| 2153 | bcb->CDB[0] = 0xF1; | 2164 | bcb->CDB[0] = 0xF1; |
| 2154 | 2165 | ||
| 2155 | result = ene_send_scsi_cmd(us, FDIR_READ, &buf, 0); | 2166 | result = ene_send_scsi_cmd(us, FDIR_READ, bbuf, 0); |
| 2156 | if (result != USB_STOR_XFER_GOOD) { | 2167 | if (result != USB_STOR_XFER_GOOD) { |
| 2157 | usb_stor_dbg(us, "Execution SD Init Code Fail !!\n"); | 2168 | usb_stor_dbg(us, "Execution SD Init Code Fail !!\n"); |
| 2158 | return USB_STOR_TRANSPORT_ERROR; | 2169 | return USB_STOR_TRANSPORT_ERROR; |
| 2159 | } | 2170 | } |
| 2160 | 2171 | ||
| 2161 | info->SD_Status = *(struct SD_STATUS *)&buf[0]; | 2172 | info->SD_Status = *(struct SD_STATUS *) bbuf; |
| 2162 | if (info->SD_Status.Insert && info->SD_Status.Ready) { | 2173 | if (info->SD_Status.Insert && info->SD_Status.Ready) { |
| 2163 | struct SD_STATUS *s = &info->SD_Status; | 2174 | struct SD_STATUS *s = &info->SD_Status; |
| 2164 | 2175 | ||
| 2165 | ene_get_card_status(us, (unsigned char *)&buf); | 2176 | ene_get_card_status(us, bbuf); |
| 2166 | usb_stor_dbg(us, "Insert = %x\n", s->Insert); | 2177 | usb_stor_dbg(us, "Insert = %x\n", s->Insert); |
| 2167 | usb_stor_dbg(us, "Ready = %x\n", s->Ready); | 2178 | usb_stor_dbg(us, "Ready = %x\n", s->Ready); |
| 2168 | usb_stor_dbg(us, "IsMMC = %x\n", s->IsMMC); | 2179 | usb_stor_dbg(us, "IsMMC = %x\n", s->IsMMC); |
| @@ -2170,7 +2181,7 @@ static int ene_sd_init(struct us_data *us) | |||
| 2170 | usb_stor_dbg(us, "HiSpeed = %x\n", s->HiSpeed); | 2181 | usb_stor_dbg(us, "HiSpeed = %x\n", s->HiSpeed); |
| 2171 | usb_stor_dbg(us, "WtP = %x\n", s->WtP); | 2182 | usb_stor_dbg(us, "WtP = %x\n", s->WtP); |
| 2172 | } else { | 2183 | } else { |
| 2173 | usb_stor_dbg(us, "SD Card Not Ready --- %x\n", buf[0]); | 2184 | usb_stor_dbg(us, "SD Card Not Ready --- %x\n", bbuf[0]); |
| 2174 | return USB_STOR_TRANSPORT_ERROR; | 2185 | return USB_STOR_TRANSPORT_ERROR; |
| 2175 | } | 2186 | } |
| 2176 | return USB_STOR_TRANSPORT_GOOD; | 2187 | return USB_STOR_TRANSPORT_GOOD; |
| @@ -2180,13 +2191,15 @@ static int ene_sd_init(struct us_data *us) | |||
| 2180 | static int ene_init(struct us_data *us) | 2191 | static int ene_init(struct us_data *us) |
| 2181 | { | 2192 | { |
| 2182 | int result; | 2193 | int result; |
| 2183 | u8 misc_reg03 = 0; | 2194 | u8 misc_reg03; |
| 2184 | struct ene_ub6250_info *info = (struct ene_ub6250_info *)(us->extra); | 2195 | struct ene_ub6250_info *info = (struct ene_ub6250_info *)(us->extra); |
| 2196 | u8 *bbuf = info->bbuf; | ||
| 2185 | 2197 | ||
| 2186 | result = ene_get_card_type(us, REG_CARD_STATUS, &misc_reg03); | 2198 | result = ene_get_card_type(us, REG_CARD_STATUS, bbuf); |
| 2187 | if (result != USB_STOR_XFER_GOOD) | 2199 | if (result != USB_STOR_XFER_GOOD) |
| 2188 | return USB_STOR_TRANSPORT_ERROR; | 2200 | return USB_STOR_TRANSPORT_ERROR; |
| 2189 | 2201 | ||
| 2202 | misc_reg03 = bbuf[0]; | ||
| 2190 | if (misc_reg03 & 0x01) { | 2203 | if (misc_reg03 & 0x01) { |
| 2191 | if (!info->SD_Status.Ready) { | 2204 | if (!info->SD_Status.Ready) { |
| 2192 | result = ene_sd_init(us); | 2205 | result = ene_sd_init(us); |
| @@ -2303,8 +2316,9 @@ static int ene_ub6250_probe(struct usb_interface *intf, | |||
| 2303 | const struct usb_device_id *id) | 2316 | const struct usb_device_id *id) |
| 2304 | { | 2317 | { |
| 2305 | int result; | 2318 | int result; |
| 2306 | u8 misc_reg03 = 0; | 2319 | u8 misc_reg03; |
| 2307 | struct us_data *us; | 2320 | struct us_data *us; |
| 2321 | struct ene_ub6250_info *info; | ||
| 2308 | 2322 | ||
| 2309 | result = usb_stor_probe1(&us, intf, id, | 2323 | result = usb_stor_probe1(&us, intf, id, |
| 2310 | (id - ene_ub6250_usb_ids) + ene_ub6250_unusual_dev_list, | 2324 | (id - ene_ub6250_usb_ids) + ene_ub6250_unusual_dev_list, |
| @@ -2313,11 +2327,16 @@ static int ene_ub6250_probe(struct usb_interface *intf, | |||
| 2313 | return result; | 2327 | return result; |
| 2314 | 2328 | ||
| 2315 | /* FIXME: where should the code alloc extra buf ? */ | 2329 | /* FIXME: where should the code alloc extra buf ? */ |
| 2316 | if (!us->extra) { | 2330 | us->extra = kzalloc(sizeof(struct ene_ub6250_info), GFP_KERNEL); |
| 2317 | us->extra = kzalloc(sizeof(struct ene_ub6250_info), GFP_KERNEL); | 2331 | if (!us->extra) |
| 2318 | if (!us->extra) | 2332 | return -ENOMEM; |
| 2319 | return -ENOMEM; | 2333 | us->extra_destructor = ene_ub6250_info_destructor; |
| 2320 | us->extra_destructor = ene_ub6250_info_destructor; | 2334 | |
| 2335 | info = (struct ene_ub6250_info *)(us->extra); | ||
| 2336 | info->bbuf = kmalloc(512, GFP_KERNEL); | ||
| 2337 | if (!info->bbuf) { | ||
| 2338 | kfree(us->extra); | ||
| 2339 | return -ENOMEM; | ||
| 2321 | } | 2340 | } |
| 2322 | 2341 | ||
| 2323 | us->transport_name = "ene_ub6250"; | 2342 | us->transport_name = "ene_ub6250"; |
| @@ -2329,12 +2348,13 @@ static int ene_ub6250_probe(struct usb_interface *intf, | |||
| 2329 | return result; | 2348 | return result; |
| 2330 | 2349 | ||
| 2331 | /* probe card type */ | 2350 | /* probe card type */ |
| 2332 | result = ene_get_card_type(us, REG_CARD_STATUS, &misc_reg03); | 2351 | result = ene_get_card_type(us, REG_CARD_STATUS, info->bbuf); |
| 2333 | if (result != USB_STOR_XFER_GOOD) { | 2352 | if (result != USB_STOR_XFER_GOOD) { |
| 2334 | usb_stor_disconnect(intf); | 2353 | usb_stor_disconnect(intf); |
| 2335 | return USB_STOR_TRANSPORT_ERROR; | 2354 | return USB_STOR_TRANSPORT_ERROR; |
| 2336 | } | 2355 | } |
| 2337 | 2356 | ||
| 2357 | misc_reg03 = info->bbuf[0]; | ||
| 2338 | if (!(misc_reg03 & 0x01)) { | 2358 | if (!(misc_reg03 & 0x01)) { |
| 2339 | pr_info("ums_eneub6250: This driver only supports SD/MS cards. " | 2359 | pr_info("ums_eneub6250: This driver only supports SD/MS cards. " |
| 2340 | "It does not support SM cards.\n"); | 2360 | "It does not support SM cards.\n"); |
diff --git a/drivers/usb/usbip/vhci_hcd.c b/drivers/usb/usbip/vhci_hcd.c index 5d8b2c261940..0585078638db 100644 --- a/drivers/usb/usbip/vhci_hcd.c +++ b/drivers/usb/usbip/vhci_hcd.c | |||
| @@ -235,14 +235,19 @@ done: | |||
| 235 | 235 | ||
| 236 | static inline void hub_descriptor(struct usb_hub_descriptor *desc) | 236 | static inline void hub_descriptor(struct usb_hub_descriptor *desc) |
| 237 | { | 237 | { |
| 238 | int width; | ||
| 239 | |||
| 238 | memset(desc, 0, sizeof(*desc)); | 240 | memset(desc, 0, sizeof(*desc)); |
| 239 | desc->bDescriptorType = USB_DT_HUB; | 241 | desc->bDescriptorType = USB_DT_HUB; |
| 240 | desc->bDescLength = 9; | ||
| 241 | desc->wHubCharacteristics = cpu_to_le16( | 242 | desc->wHubCharacteristics = cpu_to_le16( |
| 242 | HUB_CHAR_INDV_PORT_LPSM | HUB_CHAR_COMMON_OCPM); | 243 | HUB_CHAR_INDV_PORT_LPSM | HUB_CHAR_COMMON_OCPM); |
| 244 | |||
| 243 | desc->bNbrPorts = VHCI_HC_PORTS; | 245 | desc->bNbrPorts = VHCI_HC_PORTS; |
| 244 | desc->u.hs.DeviceRemovable[0] = 0xff; | 246 | BUILD_BUG_ON(VHCI_HC_PORTS > USB_MAXCHILDREN); |
| 245 | desc->u.hs.DeviceRemovable[1] = 0xff; | 247 | width = desc->bNbrPorts / 8 + 1; |
| 248 | desc->bDescLength = USB_DT_HUB_NONVAR_SIZE + 2 * width; | ||
| 249 | memset(&desc->u.hs.DeviceRemovable[0], 0, width); | ||
| 250 | memset(&desc->u.hs.DeviceRemovable[width], 0xff, width); | ||
| 246 | } | 251 | } |
| 247 | 252 | ||
| 248 | static int vhci_hub_control(struct usb_hcd *hcd, u16 typeReq, u16 wValue, | 253 | static int vhci_hub_control(struct usb_hcd *hcd, u16 typeReq, u16 wValue, |
diff --git a/drivers/uwb/i1480/dfu/usb.c b/drivers/uwb/i1480/dfu/usb.c index 6345e85822a4..a50cf45e530f 100644 --- a/drivers/uwb/i1480/dfu/usb.c +++ b/drivers/uwb/i1480/dfu/usb.c | |||
| @@ -341,6 +341,7 @@ error_submit_ep1: | |||
| 341 | static | 341 | static |
| 342 | int i1480_usb_probe(struct usb_interface *iface, const struct usb_device_id *id) | 342 | int i1480_usb_probe(struct usb_interface *iface, const struct usb_device_id *id) |
| 343 | { | 343 | { |
| 344 | struct usb_device *udev = interface_to_usbdev(iface); | ||
| 344 | struct i1480_usb *i1480_usb; | 345 | struct i1480_usb *i1480_usb; |
| 345 | struct i1480 *i1480; | 346 | struct i1480 *i1480; |
| 346 | struct device *dev = &iface->dev; | 347 | struct device *dev = &iface->dev; |
| @@ -352,8 +353,8 @@ int i1480_usb_probe(struct usb_interface *iface, const struct usb_device_id *id) | |||
| 352 | iface->cur_altsetting->desc.bInterfaceNumber); | 353 | iface->cur_altsetting->desc.bInterfaceNumber); |
| 353 | goto error; | 354 | goto error; |
| 354 | } | 355 | } |
| 355 | if (iface->num_altsetting > 1 | 356 | if (iface->num_altsetting > 1 && |
| 356 | && interface_to_usbdev(iface)->descriptor.idProduct == 0xbabe) { | 357 | le16_to_cpu(udev->descriptor.idProduct) == 0xbabe) { |
| 357 | /* Need altsetting #1 [HW QUIRK] or EP1 won't work */ | 358 | /* Need altsetting #1 [HW QUIRK] or EP1 won't work */ |
| 358 | result = usb_set_interface(interface_to_usbdev(iface), 0, 1); | 359 | result = usb_set_interface(interface_to_usbdev(iface), 0, 1); |
| 359 | if (result < 0) | 360 | if (result < 0) |
diff --git a/include/linux/usb/hcd.h b/include/linux/usb/hcd.h index a469999a106d..50398b69ca44 100644 --- a/include/linux/usb/hcd.h +++ b/include/linux/usb/hcd.h | |||
| @@ -148,6 +148,7 @@ struct usb_hcd { | |||
| 148 | unsigned rh_registered:1;/* is root hub registered? */ | 148 | unsigned rh_registered:1;/* is root hub registered? */ |
| 149 | unsigned rh_pollable:1; /* may we poll the root hub? */ | 149 | unsigned rh_pollable:1; /* may we poll the root hub? */ |
| 150 | unsigned msix_enabled:1; /* driver has MSI-X enabled? */ | 150 | unsigned msix_enabled:1; /* driver has MSI-X enabled? */ |
| 151 | unsigned msi_enabled:1; /* driver has MSI enabled? */ | ||
| 151 | unsigned remove_phy:1; /* auto-remove USB phy */ | 152 | unsigned remove_phy:1; /* auto-remove USB phy */ |
| 152 | 153 | ||
| 153 | /* The next flag is a stopgap, to be removed when all the HCDs | 154 | /* The next flag is a stopgap, to be removed when all the HCDs |
diff --git a/include/uapi/linux/usb/ch11.h b/include/uapi/linux/usb/ch11.h index 361297e96f58..576c704e3fb8 100644 --- a/include/uapi/linux/usb/ch11.h +++ b/include/uapi/linux/usb/ch11.h | |||
| @@ -22,6 +22,9 @@ | |||
| 22 | */ | 22 | */ |
| 23 | #define USB_MAXCHILDREN 31 | 23 | #define USB_MAXCHILDREN 31 |
| 24 | 24 | ||
| 25 | /* See USB 3.1 spec Table 10-5 */ | ||
| 26 | #define USB_SS_MAXPORTS 15 | ||
| 27 | |||
| 25 | /* | 28 | /* |
| 26 | * Hub request types | 29 | * Hub request types |
| 27 | */ | 30 | */ |
