diff options
| author | Linus Torvalds <torvalds@linux-foundation.org> | 2014-04-27 13:24:17 -0400 |
|---|---|---|
| committer | Linus Torvalds <torvalds@linux-foundation.org> | 2014-04-27 13:24:17 -0400 |
| commit | fefb82756e9fd89d0c0d5983e056df81d51eb075 (patch) | |
| tree | f68d8d894d915fa64502bad8a0b83c811e2ff2e2 | |
| parent | e9dba837640d960f56bef22ff08611955ff8a5b4 (diff) | |
| parent | 34f972d6156fe9eea2ab7bb418c71f9d1d5c8e7b (diff) | |
Merge tag 'usb-3.15-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb
Pull USB fixes from Greg KH:
"Here are a number of USB fixes for 3.15-rc3. The majority are gadget
fixes, as we didn't get any of those in for 3.15-rc2. The others are
all over the place, and there's a number of new device id addtions as
well."
* tag 'usb-3.15-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb: (35 commits)
usb: option: add and update a number of CMOTech devices
usb: option: add Alcatel L800MA
usb: option: add Olivetti Olicard 500
usb: qcserial: add Sierra Wireless MC7305/MC7355
usb: qcserial: add Sierra Wireless MC73xx
usb: qcserial: add Sierra Wireless EM7355
USB: io_ti: fix firmware download on big-endian machines
usb/xhci: fix compilation warning when !CONFIG_PCI && !CONFIG_PM
xhci: extend quirk for Renesas cards
xhci: Switch Intel Lynx Point ports to EHCI on shutdown.
usb: xhci: Prefer endpoint context dequeue pointer over stopped_trb
phy: core: make NULL a valid phy reference if !CONFIG_GENERIC_PHY
phy: fix kernel oops in phy_lookup()
phy: restore OMAP_CONTROL_PHY dependencies
phy: exynos: fix building as a module
USB: serial: fix sysfs-attribute removal deadlock
usb: wusbcore: fix panic in wusbhc_chid_set
usb: wusbcore: convert nested lock to use spin_lock instead of spin_lock_irq
uwb: don't call spin_unlock_irq in a USB completion handler
usb: chipidea: coordinate usb phy initialization for different phy type
...
29 files changed, 304 insertions, 162 deletions
diff --git a/drivers/phy/Kconfig b/drivers/phy/Kconfig index 3bb05f17b9b4..4906c27fa3bd 100644 --- a/drivers/phy/Kconfig +++ b/drivers/phy/Kconfig | |||
| @@ -33,6 +33,7 @@ config PHY_MVEBU_SATA | |||
| 33 | 33 | ||
| 34 | config OMAP_CONTROL_PHY | 34 | config OMAP_CONTROL_PHY |
| 35 | tristate "OMAP CONTROL PHY Driver" | 35 | tristate "OMAP CONTROL PHY Driver" |
| 36 | depends on ARCH_OMAP2PLUS || COMPILE_TEST | ||
| 36 | help | 37 | help |
| 37 | Enable this to add support for the PHY part present in the control | 38 | Enable this to add support for the PHY part present in the control |
| 38 | module. This driver has API to power on the USB2 PHY and to write to | 39 | module. This driver has API to power on the USB2 PHY and to write to |
diff --git a/drivers/phy/Makefile b/drivers/phy/Makefile index 2faf78edc864..7728518572a4 100644 --- a/drivers/phy/Makefile +++ b/drivers/phy/Makefile | |||
| @@ -13,8 +13,9 @@ obj-$(CONFIG_TI_PIPE3) += phy-ti-pipe3.o | |||
| 13 | obj-$(CONFIG_TWL4030_USB) += phy-twl4030-usb.o | 13 | obj-$(CONFIG_TWL4030_USB) += phy-twl4030-usb.o |
| 14 | obj-$(CONFIG_PHY_EXYNOS5250_SATA) += phy-exynos5250-sata.o | 14 | obj-$(CONFIG_PHY_EXYNOS5250_SATA) += phy-exynos5250-sata.o |
| 15 | obj-$(CONFIG_PHY_SUN4I_USB) += phy-sun4i-usb.o | 15 | obj-$(CONFIG_PHY_SUN4I_USB) += phy-sun4i-usb.o |
| 16 | obj-$(CONFIG_PHY_SAMSUNG_USB2) += phy-samsung-usb2.o | 16 | obj-$(CONFIG_PHY_SAMSUNG_USB2) += phy-exynos-usb2.o |
| 17 | obj-$(CONFIG_PHY_EXYNOS4210_USB2) += phy-exynos4210-usb2.o | 17 | phy-exynos-usb2-y += phy-samsung-usb2.o |
| 18 | obj-$(CONFIG_PHY_EXYNOS4X12_USB2) += phy-exynos4x12-usb2.o | 18 | phy-exynos-usb2-$(CONFIG_PHY_EXYNOS4210_USB2) += phy-exynos4210-usb2.o |
| 19 | obj-$(CONFIG_PHY_EXYNOS5250_USB2) += phy-exynos5250-usb2.o | 19 | phy-exynos-usb2-$(CONFIG_PHY_EXYNOS4X12_USB2) += phy-exynos4x12-usb2.o |
| 20 | phy-exynos-usb2-$(CONFIG_PHY_EXYNOS5250_USB2) += phy-exynos5250-usb2.o | ||
| 20 | obj-$(CONFIG_PHY_XGENE) += phy-xgene.o | 21 | obj-$(CONFIG_PHY_XGENE) += phy-xgene.o |
diff --git a/drivers/phy/phy-core.c b/drivers/phy/phy-core.c index 623b71c54b3e..c64a2f3b2d62 100644 --- a/drivers/phy/phy-core.c +++ b/drivers/phy/phy-core.c | |||
| @@ -64,6 +64,9 @@ static struct phy *phy_lookup(struct device *device, const char *port) | |||
| 64 | class_dev_iter_init(&iter, phy_class, NULL, NULL); | 64 | class_dev_iter_init(&iter, phy_class, NULL, NULL); |
| 65 | while ((dev = class_dev_iter_next(&iter))) { | 65 | while ((dev = class_dev_iter_next(&iter))) { |
| 66 | phy = to_phy(dev); | 66 | phy = to_phy(dev); |
| 67 | |||
| 68 | if (!phy->init_data) | ||
| 69 | continue; | ||
| 67 | count = phy->init_data->num_consumers; | 70 | count = phy->init_data->num_consumers; |
| 68 | consumers = phy->init_data->consumers; | 71 | consumers = phy->init_data->consumers; |
| 69 | while (count--) { | 72 | while (count--) { |
diff --git a/drivers/usb/chipidea/core.c b/drivers/usb/chipidea/core.c index ca6831c5b763..1cd5d0ba587c 100644 --- a/drivers/usb/chipidea/core.c +++ b/drivers/usb/chipidea/core.c | |||
| @@ -277,6 +277,39 @@ static void hw_phymode_configure(struct ci_hdrc *ci) | |||
| 277 | } | 277 | } |
| 278 | 278 | ||
| 279 | /** | 279 | /** |
| 280 | * ci_usb_phy_init: initialize phy according to different phy type | ||
| 281 | * @ci: the controller | ||
| 282 | * | ||
| 283 | * This function returns an error code if usb_phy_init has failed | ||
| 284 | */ | ||
| 285 | static int ci_usb_phy_init(struct ci_hdrc *ci) | ||
| 286 | { | ||
| 287 | int ret; | ||
| 288 | |||
| 289 | switch (ci->platdata->phy_mode) { | ||
| 290 | case USBPHY_INTERFACE_MODE_UTMI: | ||
| 291 | case USBPHY_INTERFACE_MODE_UTMIW: | ||
| 292 | case USBPHY_INTERFACE_MODE_HSIC: | ||
| 293 | ret = usb_phy_init(ci->transceiver); | ||
| 294 | if (ret) | ||
| 295 | return ret; | ||
| 296 | hw_phymode_configure(ci); | ||
| 297 | break; | ||
| 298 | case USBPHY_INTERFACE_MODE_ULPI: | ||
| 299 | case USBPHY_INTERFACE_MODE_SERIAL: | ||
| 300 | hw_phymode_configure(ci); | ||
| 301 | ret = usb_phy_init(ci->transceiver); | ||
| 302 | if (ret) | ||
| 303 | return ret; | ||
| 304 | break; | ||
| 305 | default: | ||
| 306 | ret = usb_phy_init(ci->transceiver); | ||
| 307 | } | ||
| 308 | |||
| 309 | return ret; | ||
| 310 | } | ||
| 311 | |||
| 312 | /** | ||
| 280 | * hw_device_reset: resets chip (execute without interruption) | 313 | * hw_device_reset: resets chip (execute without interruption) |
| 281 | * @ci: the controller | 314 | * @ci: the controller |
| 282 | * | 315 | * |
| @@ -543,8 +576,6 @@ static int ci_hdrc_probe(struct platform_device *pdev) | |||
| 543 | return -ENODEV; | 576 | return -ENODEV; |
| 544 | } | 577 | } |
| 545 | 578 | ||
| 546 | hw_phymode_configure(ci); | ||
| 547 | |||
| 548 | if (ci->platdata->phy) | 579 | if (ci->platdata->phy) |
| 549 | ci->transceiver = ci->platdata->phy; | 580 | ci->transceiver = ci->platdata->phy; |
| 550 | else | 581 | else |
| @@ -564,7 +595,7 @@ static int ci_hdrc_probe(struct platform_device *pdev) | |||
| 564 | return -EPROBE_DEFER; | 595 | return -EPROBE_DEFER; |
| 565 | } | 596 | } |
| 566 | 597 | ||
| 567 | ret = usb_phy_init(ci->transceiver); | 598 | ret = ci_usb_phy_init(ci); |
| 568 | if (ret) { | 599 | if (ret) { |
| 569 | dev_err(dev, "unable to init phy: %d\n", ret); | 600 | dev_err(dev, "unable to init phy: %d\n", ret); |
| 570 | return ret; | 601 | return ret; |
diff --git a/drivers/usb/dwc3/core.c b/drivers/usb/dwc3/core.c index d001417e8e37..10aaaae9af25 100644 --- a/drivers/usb/dwc3/core.c +++ b/drivers/usb/dwc3/core.c | |||
| @@ -821,6 +821,7 @@ static void dwc3_complete(struct device *dev) | |||
| 821 | 821 | ||
| 822 | spin_lock_irqsave(&dwc->lock, flags); | 822 | spin_lock_irqsave(&dwc->lock, flags); |
| 823 | 823 | ||
| 824 | dwc3_event_buffers_setup(dwc); | ||
| 824 | switch (dwc->dr_mode) { | 825 | switch (dwc->dr_mode) { |
| 825 | case USB_DR_MODE_PERIPHERAL: | 826 | case USB_DR_MODE_PERIPHERAL: |
| 826 | case USB_DR_MODE_OTG: | 827 | case USB_DR_MODE_OTG: |
| @@ -828,7 +829,6 @@ static void dwc3_complete(struct device *dev) | |||
| 828 | /* FALLTHROUGH */ | 829 | /* FALLTHROUGH */ |
| 829 | case USB_DR_MODE_HOST: | 830 | case USB_DR_MODE_HOST: |
| 830 | default: | 831 | default: |
| 831 | dwc3_event_buffers_setup(dwc); | ||
| 832 | break; | 832 | break; |
| 833 | } | 833 | } |
| 834 | 834 | ||
diff --git a/drivers/usb/dwc3/gadget.c b/drivers/usb/dwc3/gadget.c index a740eac74d56..70715eeededd 100644 --- a/drivers/usb/dwc3/gadget.c +++ b/drivers/usb/dwc3/gadget.c | |||
| @@ -187,15 +187,12 @@ int dwc3_gadget_resize_tx_fifos(struct dwc3 *dwc) | |||
| 187 | * improve this algorithm so that we better use the internal | 187 | * improve this algorithm so that we better use the internal |
| 188 | * FIFO space | 188 | * FIFO space |
| 189 | */ | 189 | */ |
| 190 | for (num = 0; num < DWC3_ENDPOINTS_NUM; num++) { | 190 | for (num = 0; num < dwc->num_in_eps; num++) { |
| 191 | struct dwc3_ep *dep = dwc->eps[num]; | 191 | /* bit0 indicates direction; 1 means IN ep */ |
| 192 | int fifo_number = dep->number >> 1; | 192 | struct dwc3_ep *dep = dwc->eps[(num << 1) | 1]; |
| 193 | int mult = 1; | 193 | int mult = 1; |
| 194 | int tmp; | 194 | int tmp; |
| 195 | 195 | ||
| 196 | if (!(dep->number & 1)) | ||
| 197 | continue; | ||
| 198 | |||
| 199 | if (!(dep->flags & DWC3_EP_ENABLED)) | 196 | if (!(dep->flags & DWC3_EP_ENABLED)) |
| 200 | continue; | 197 | continue; |
| 201 | 198 | ||
| @@ -224,8 +221,7 @@ int dwc3_gadget_resize_tx_fifos(struct dwc3 *dwc) | |||
| 224 | dev_vdbg(dwc->dev, "%s: Fifo Addr %04x Size %d\n", | 221 | dev_vdbg(dwc->dev, "%s: Fifo Addr %04x Size %d\n", |
| 225 | dep->name, last_fifo_depth, fifo_size & 0xffff); | 222 | dep->name, last_fifo_depth, fifo_size & 0xffff); |
| 226 | 223 | ||
| 227 | dwc3_writel(dwc->regs, DWC3_GTXFIFOSIZ(fifo_number), | 224 | dwc3_writel(dwc->regs, DWC3_GTXFIFOSIZ(num), fifo_size); |
| 228 | fifo_size); | ||
| 229 | 225 | ||
| 230 | last_fifo_depth += (fifo_size & 0xffff); | 226 | last_fifo_depth += (fifo_size & 0xffff); |
| 231 | } | 227 | } |
diff --git a/drivers/usb/gadget/f_fs.c b/drivers/usb/gadget/f_fs.c index 2e164dca08e8..1e12b3ee56fd 100644 --- a/drivers/usb/gadget/f_fs.c +++ b/drivers/usb/gadget/f_fs.c | |||
| @@ -745,6 +745,12 @@ static ssize_t ffs_epfile_io(struct file *file, struct ffs_io_data *io_data) | |||
| 745 | */ | 745 | */ |
| 746 | struct usb_gadget *gadget = epfile->ffs->gadget; | 746 | struct usb_gadget *gadget = epfile->ffs->gadget; |
| 747 | 747 | ||
| 748 | spin_lock_irq(&epfile->ffs->eps_lock); | ||
| 749 | /* In the meantime, endpoint got disabled or changed. */ | ||
| 750 | if (epfile->ep != ep) { | ||
| 751 | spin_unlock_irq(&epfile->ffs->eps_lock); | ||
| 752 | return -ESHUTDOWN; | ||
| 753 | } | ||
| 748 | /* | 754 | /* |
| 749 | * Controller may require buffer size to be aligned to | 755 | * Controller may require buffer size to be aligned to |
| 750 | * maxpacketsize of an out endpoint. | 756 | * maxpacketsize of an out endpoint. |
| @@ -752,6 +758,7 @@ static ssize_t ffs_epfile_io(struct file *file, struct ffs_io_data *io_data) | |||
| 752 | data_len = io_data->read ? | 758 | data_len = io_data->read ? |
| 753 | usb_ep_align_maybe(gadget, ep->ep, io_data->len) : | 759 | usb_ep_align_maybe(gadget, ep->ep, io_data->len) : |
| 754 | io_data->len; | 760 | io_data->len; |
| 761 | spin_unlock_irq(&epfile->ffs->eps_lock); | ||
| 755 | 762 | ||
| 756 | data = kmalloc(data_len, GFP_KERNEL); | 763 | data = kmalloc(data_len, GFP_KERNEL); |
| 757 | if (unlikely(!data)) | 764 | if (unlikely(!data)) |
diff --git a/drivers/usb/gadget/f_rndis.c b/drivers/usb/gadget/f_rndis.c index c11761ce5113..9a4f49dc6ac4 100644 --- a/drivers/usb/gadget/f_rndis.c +++ b/drivers/usb/gadget/f_rndis.c | |||
| @@ -377,7 +377,7 @@ static struct sk_buff *rndis_add_header(struct gether *port, | |||
| 377 | if (skb2) | 377 | if (skb2) |
| 378 | rndis_add_hdr(skb2); | 378 | rndis_add_hdr(skb2); |
| 379 | 379 | ||
| 380 | dev_kfree_skb_any(skb); | 380 | dev_kfree_skb(skb); |
| 381 | return skb2; | 381 | return skb2; |
| 382 | } | 382 | } |
| 383 | 383 | ||
diff --git a/drivers/usb/gadget/fsl_udc_core.c b/drivers/usb/gadget/fsl_udc_core.c index 15960af0f67e..a2f26cdb56fe 100644 --- a/drivers/usb/gadget/fsl_udc_core.c +++ b/drivers/usb/gadget/fsl_udc_core.c | |||
| @@ -1219,6 +1219,10 @@ static int fsl_pullup(struct usb_gadget *gadget, int is_on) | |||
| 1219 | struct fsl_udc *udc; | 1219 | struct fsl_udc *udc; |
| 1220 | 1220 | ||
| 1221 | udc = container_of(gadget, struct fsl_udc, gadget); | 1221 | udc = container_of(gadget, struct fsl_udc, gadget); |
| 1222 | |||
| 1223 | if (!udc->vbus_active) | ||
| 1224 | return -EOPNOTSUPP; | ||
| 1225 | |||
| 1222 | udc->softconnect = (is_on != 0); | 1226 | udc->softconnect = (is_on != 0); |
| 1223 | if (can_pullup(udc)) | 1227 | if (can_pullup(udc)) |
| 1224 | fsl_writel((fsl_readl(&dr_regs->usbcmd) | USB_CMD_RUN_STOP), | 1228 | fsl_writel((fsl_readl(&dr_regs->usbcmd) | USB_CMD_RUN_STOP), |
| @@ -2532,8 +2536,8 @@ static int __exit fsl_udc_remove(struct platform_device *pdev) | |||
| 2532 | if (!udc_controller) | 2536 | if (!udc_controller) |
| 2533 | return -ENODEV; | 2537 | return -ENODEV; |
| 2534 | 2538 | ||
| 2535 | usb_del_gadget_udc(&udc_controller->gadget); | ||
| 2536 | udc_controller->done = &done; | 2539 | udc_controller->done = &done; |
| 2540 | usb_del_gadget_udc(&udc_controller->gadget); | ||
| 2537 | 2541 | ||
| 2538 | fsl_udc_clk_release(); | 2542 | fsl_udc_clk_release(); |
| 2539 | 2543 | ||
diff --git a/drivers/usb/gadget/inode.c b/drivers/usb/gadget/inode.c index b5be6f0308c2..a925d0cbcd41 100644 --- a/drivers/usb/gadget/inode.c +++ b/drivers/usb/gadget/inode.c | |||
| @@ -2043,6 +2043,7 @@ gadgetfs_fill_super (struct super_block *sb, void *opts, int silent) | |||
| 2043 | return -ESRCH; | 2043 | return -ESRCH; |
| 2044 | 2044 | ||
| 2045 | /* fake probe to determine $CHIP */ | 2045 | /* fake probe to determine $CHIP */ |
| 2046 | CHIP = NULL; | ||
| 2046 | usb_gadget_probe_driver(&probe_driver); | 2047 | usb_gadget_probe_driver(&probe_driver); |
| 2047 | if (!CHIP) | 2048 | if (!CHIP) |
| 2048 | return -ENODEV; | 2049 | return -ENODEV; |
diff --git a/drivers/usb/gadget/rndis.c b/drivers/usb/gadget/rndis.c index d822d822efb3..7ed452d90f4d 100644 --- a/drivers/usb/gadget/rndis.c +++ b/drivers/usb/gadget/rndis.c | |||
| @@ -35,6 +35,7 @@ | |||
| 35 | #include <asm/byteorder.h> | 35 | #include <asm/byteorder.h> |
| 36 | #include <asm/unaligned.h> | 36 | #include <asm/unaligned.h> |
| 37 | 37 | ||
| 38 | #include "u_rndis.h" | ||
| 38 | 39 | ||
| 39 | #undef VERBOSE_DEBUG | 40 | #undef VERBOSE_DEBUG |
| 40 | 41 | ||
diff --git a/drivers/usb/gadget/u_ether.c b/drivers/usb/gadget/u_ether.c index 50d09c289137..b7d4f82872b7 100644 --- a/drivers/usb/gadget/u_ether.c +++ b/drivers/usb/gadget/u_ether.c | |||
| @@ -48,8 +48,6 @@ | |||
| 48 | 48 | ||
| 49 | #define UETH__VERSION "29-May-2008" | 49 | #define UETH__VERSION "29-May-2008" |
| 50 | 50 | ||
| 51 | #define GETHER_NAPI_WEIGHT 32 | ||
| 52 | |||
| 53 | struct eth_dev { | 51 | struct eth_dev { |
| 54 | /* lock is held while accessing port_usb | 52 | /* lock is held while accessing port_usb |
| 55 | */ | 53 | */ |
| @@ -74,7 +72,6 @@ struct eth_dev { | |||
| 74 | struct sk_buff_head *list); | 72 | struct sk_buff_head *list); |
| 75 | 73 | ||
| 76 | struct work_struct work; | 74 | struct work_struct work; |
| 77 | struct napi_struct rx_napi; | ||
| 78 | 75 | ||
| 79 | unsigned long todo; | 76 | unsigned long todo; |
| 80 | #define WORK_RX_MEMORY 0 | 77 | #define WORK_RX_MEMORY 0 |
| @@ -256,16 +253,18 @@ enomem: | |||
| 256 | DBG(dev, "rx submit --> %d\n", retval); | 253 | DBG(dev, "rx submit --> %d\n", retval); |
| 257 | if (skb) | 254 | if (skb) |
| 258 | dev_kfree_skb_any(skb); | 255 | dev_kfree_skb_any(skb); |
| 256 | spin_lock_irqsave(&dev->req_lock, flags); | ||
| 257 | list_add(&req->list, &dev->rx_reqs); | ||
| 258 | spin_unlock_irqrestore(&dev->req_lock, flags); | ||
| 259 | } | 259 | } |
| 260 | return retval; | 260 | return retval; |
| 261 | } | 261 | } |
| 262 | 262 | ||
| 263 | static void rx_complete(struct usb_ep *ep, struct usb_request *req) | 263 | static void rx_complete(struct usb_ep *ep, struct usb_request *req) |
| 264 | { | 264 | { |
| 265 | struct sk_buff *skb = req->context; | 265 | struct sk_buff *skb = req->context, *skb2; |
| 266 | struct eth_dev *dev = ep->driver_data; | 266 | struct eth_dev *dev = ep->driver_data; |
| 267 | int status = req->status; | 267 | int status = req->status; |
| 268 | bool rx_queue = 0; | ||
| 269 | 268 | ||
| 270 | switch (status) { | 269 | switch (status) { |
| 271 | 270 | ||
| @@ -289,8 +288,30 @@ static void rx_complete(struct usb_ep *ep, struct usb_request *req) | |||
| 289 | } else { | 288 | } else { |
| 290 | skb_queue_tail(&dev->rx_frames, skb); | 289 | skb_queue_tail(&dev->rx_frames, skb); |
| 291 | } | 290 | } |
| 292 | if (!status) | 291 | skb = NULL; |
| 293 | rx_queue = 1; | 292 | |
| 293 | skb2 = skb_dequeue(&dev->rx_frames); | ||
| 294 | while (skb2) { | ||
| 295 | if (status < 0 | ||
| 296 | || ETH_HLEN > skb2->len | ||
| 297 | || skb2->len > VLAN_ETH_FRAME_LEN) { | ||
| 298 | dev->net->stats.rx_errors++; | ||
| 299 | dev->net->stats.rx_length_errors++; | ||
| 300 | DBG(dev, "rx length %d\n", skb2->len); | ||
| 301 | dev_kfree_skb_any(skb2); | ||
| 302 | goto next_frame; | ||
| 303 | } | ||
| 304 | skb2->protocol = eth_type_trans(skb2, dev->net); | ||
| 305 | dev->net->stats.rx_packets++; | ||
| 306 | dev->net->stats.rx_bytes += skb2->len; | ||
| 307 | |||
| 308 | /* no buffer copies needed, unless hardware can't | ||
| 309 | * use skb buffers. | ||
| 310 | */ | ||
| 311 | status = netif_rx(skb2); | ||
| 312 | next_frame: | ||
| 313 | skb2 = skb_dequeue(&dev->rx_frames); | ||
| 314 | } | ||
| 294 | break; | 315 | break; |
| 295 | 316 | ||
| 296 | /* software-driven interface shutdown */ | 317 | /* software-driven interface shutdown */ |
| @@ -313,20 +334,22 @@ quiesce: | |||
| 313 | /* FALLTHROUGH */ | 334 | /* FALLTHROUGH */ |
| 314 | 335 | ||
| 315 | default: | 336 | default: |
| 316 | rx_queue = 1; | ||
| 317 | dev_kfree_skb_any(skb); | ||
| 318 | dev->net->stats.rx_errors++; | 337 | dev->net->stats.rx_errors++; |
| 319 | DBG(dev, "rx status %d\n", status); | 338 | DBG(dev, "rx status %d\n", status); |
| 320 | break; | 339 | break; |
| 321 | } | 340 | } |
| 322 | 341 | ||
| 342 | if (skb) | ||
| 343 | dev_kfree_skb_any(skb); | ||
| 344 | if (!netif_running(dev->net)) { | ||
| 323 | clean: | 345 | clean: |
| 324 | spin_lock(&dev->req_lock); | 346 | spin_lock(&dev->req_lock); |
| 325 | list_add(&req->list, &dev->rx_reqs); | 347 | list_add(&req->list, &dev->rx_reqs); |
| 326 | spin_unlock(&dev->req_lock); | 348 | spin_unlock(&dev->req_lock); |
| 327 | 349 | req = NULL; | |
| 328 | if (rx_queue && likely(napi_schedule_prep(&dev->rx_napi))) | 350 | } |
| 329 | __napi_schedule(&dev->rx_napi); | 351 | if (req) |
| 352 | rx_submit(dev, req, GFP_ATOMIC); | ||
| 330 | } | 353 | } |
| 331 | 354 | ||
| 332 | static int prealloc(struct list_head *list, struct usb_ep *ep, unsigned n) | 355 | static int prealloc(struct list_head *list, struct usb_ep *ep, unsigned n) |
| @@ -391,24 +414,16 @@ static void rx_fill(struct eth_dev *dev, gfp_t gfp_flags) | |||
| 391 | { | 414 | { |
| 392 | struct usb_request *req; | 415 | struct usb_request *req; |
| 393 | unsigned long flags; | 416 | unsigned long flags; |
| 394 | int rx_counts = 0; | ||
| 395 | 417 | ||
| 396 | /* fill unused rxq slots with some skb */ | 418 | /* fill unused rxq slots with some skb */ |
| 397 | spin_lock_irqsave(&dev->req_lock, flags); | 419 | spin_lock_irqsave(&dev->req_lock, flags); |
| 398 | while (!list_empty(&dev->rx_reqs)) { | 420 | while (!list_empty(&dev->rx_reqs)) { |
| 399 | |||
| 400 | if (++rx_counts > qlen(dev->gadget, dev->qmult)) | ||
| 401 | break; | ||
| 402 | |||
| 403 | req = container_of(dev->rx_reqs.next, | 421 | req = container_of(dev->rx_reqs.next, |
| 404 | struct usb_request, list); | 422 | struct usb_request, list); |
| 405 | list_del_init(&req->list); | 423 | list_del_init(&req->list); |
| 406 | spin_unlock_irqrestore(&dev->req_lock, flags); | 424 | spin_unlock_irqrestore(&dev->req_lock, flags); |
| 407 | 425 | ||
| 408 | if (rx_submit(dev, req, gfp_flags) < 0) { | 426 | if (rx_submit(dev, req, gfp_flags) < 0) { |
| 409 | spin_lock_irqsave(&dev->req_lock, flags); | ||
| 410 | list_add(&req->list, &dev->rx_reqs); | ||
| 411 | spin_unlock_irqrestore(&dev->req_lock, flags); | ||
| 412 | defer_kevent(dev, WORK_RX_MEMORY); | 427 | defer_kevent(dev, WORK_RX_MEMORY); |
| 413 | return; | 428 | return; |
| 414 | } | 429 | } |
| @@ -418,41 +433,6 @@ static void rx_fill(struct eth_dev *dev, gfp_t gfp_flags) | |||
| 418 | spin_unlock_irqrestore(&dev->req_lock, flags); | 433 | spin_unlock_irqrestore(&dev->req_lock, flags); |
| 419 | } | 434 | } |
| 420 | 435 | ||
| 421 | static int gether_poll(struct napi_struct *napi, int budget) | ||
| 422 | { | ||
| 423 | struct eth_dev *dev = container_of(napi, struct eth_dev, rx_napi); | ||
| 424 | struct sk_buff *skb; | ||
| 425 | unsigned int work_done = 0; | ||
| 426 | int status = 0; | ||
| 427 | |||
| 428 | while ((skb = skb_dequeue(&dev->rx_frames))) { | ||
| 429 | if (status < 0 | ||
| 430 | || ETH_HLEN > skb->len | ||
| 431 | || skb->len > VLAN_ETH_FRAME_LEN) { | ||
| 432 | dev->net->stats.rx_errors++; | ||
| 433 | dev->net->stats.rx_length_errors++; | ||
| 434 | DBG(dev, "rx length %d\n", skb->len); | ||
| 435 | dev_kfree_skb_any(skb); | ||
| 436 | continue; | ||
| 437 | } | ||
| 438 | skb->protocol = eth_type_trans(skb, dev->net); | ||
| 439 | dev->net->stats.rx_packets++; | ||
| 440 | dev->net->stats.rx_bytes += skb->len; | ||
| 441 | |||
| 442 | status = netif_rx_ni(skb); | ||
| 443 | } | ||
| 444 | |||
| 445 | if (netif_running(dev->net)) { | ||
| 446 | rx_fill(dev, GFP_KERNEL); | ||
| 447 | work_done++; | ||
| 448 | } | ||
| 449 | |||
| 450 | if (work_done < budget) | ||
| 451 | napi_complete(&dev->rx_napi); | ||
| 452 | |||
| 453 | return work_done; | ||
| 454 | } | ||
| 455 | |||
| 456 | static void eth_work(struct work_struct *work) | 436 | static void eth_work(struct work_struct *work) |
| 457 | { | 437 | { |
| 458 | struct eth_dev *dev = container_of(work, struct eth_dev, work); | 438 | struct eth_dev *dev = container_of(work, struct eth_dev, work); |
| @@ -645,7 +625,6 @@ static void eth_start(struct eth_dev *dev, gfp_t gfp_flags) | |||
| 645 | /* and open the tx floodgates */ | 625 | /* and open the tx floodgates */ |
| 646 | atomic_set(&dev->tx_qlen, 0); | 626 | atomic_set(&dev->tx_qlen, 0); |
| 647 | netif_wake_queue(dev->net); | 627 | netif_wake_queue(dev->net); |
| 648 | napi_enable(&dev->rx_napi); | ||
| 649 | } | 628 | } |
| 650 | 629 | ||
| 651 | static int eth_open(struct net_device *net) | 630 | static int eth_open(struct net_device *net) |
| @@ -672,7 +651,6 @@ static int eth_stop(struct net_device *net) | |||
| 672 | unsigned long flags; | 651 | unsigned long flags; |
| 673 | 652 | ||
| 674 | VDBG(dev, "%s\n", __func__); | 653 | VDBG(dev, "%s\n", __func__); |
| 675 | napi_disable(&dev->rx_napi); | ||
| 676 | netif_stop_queue(net); | 654 | netif_stop_queue(net); |
| 677 | 655 | ||
| 678 | DBG(dev, "stop stats: rx/tx %ld/%ld, errs %ld/%ld\n", | 656 | DBG(dev, "stop stats: rx/tx %ld/%ld, errs %ld/%ld\n", |
| @@ -790,7 +768,6 @@ struct eth_dev *gether_setup_name(struct usb_gadget *g, | |||
| 790 | return ERR_PTR(-ENOMEM); | 768 | return ERR_PTR(-ENOMEM); |
| 791 | 769 | ||
| 792 | dev = netdev_priv(net); | 770 | dev = netdev_priv(net); |
| 793 | netif_napi_add(net, &dev->rx_napi, gether_poll, GETHER_NAPI_WEIGHT); | ||
| 794 | spin_lock_init(&dev->lock); | 771 | spin_lock_init(&dev->lock); |
| 795 | spin_lock_init(&dev->req_lock); | 772 | spin_lock_init(&dev->req_lock); |
| 796 | INIT_WORK(&dev->work, eth_work); | 773 | INIT_WORK(&dev->work, eth_work); |
| @@ -853,7 +830,6 @@ struct net_device *gether_setup_name_default(const char *netname) | |||
| 853 | return ERR_PTR(-ENOMEM); | 830 | return ERR_PTR(-ENOMEM); |
| 854 | 831 | ||
| 855 | dev = netdev_priv(net); | 832 | dev = netdev_priv(net); |
| 856 | netif_napi_add(net, &dev->rx_napi, gether_poll, GETHER_NAPI_WEIGHT); | ||
| 857 | spin_lock_init(&dev->lock); | 833 | spin_lock_init(&dev->lock); |
| 858 | spin_lock_init(&dev->req_lock); | 834 | spin_lock_init(&dev->req_lock); |
| 859 | INIT_WORK(&dev->work, eth_work); | 835 | INIT_WORK(&dev->work, eth_work); |
| @@ -1137,7 +1113,6 @@ void gether_disconnect(struct gether *link) | |||
| 1137 | { | 1113 | { |
| 1138 | struct eth_dev *dev = link->ioport; | 1114 | struct eth_dev *dev = link->ioport; |
| 1139 | struct usb_request *req; | 1115 | struct usb_request *req; |
| 1140 | struct sk_buff *skb; | ||
| 1141 | 1116 | ||
| 1142 | WARN_ON(!dev); | 1117 | WARN_ON(!dev); |
| 1143 | if (!dev) | 1118 | if (!dev) |
| @@ -1164,12 +1139,6 @@ void gether_disconnect(struct gether *link) | |||
| 1164 | spin_lock(&dev->req_lock); | 1139 | spin_lock(&dev->req_lock); |
| 1165 | } | 1140 | } |
| 1166 | spin_unlock(&dev->req_lock); | 1141 | spin_unlock(&dev->req_lock); |
| 1167 | |||
| 1168 | spin_lock(&dev->rx_frames.lock); | ||
| 1169 | while ((skb = __skb_dequeue(&dev->rx_frames))) | ||
| 1170 | dev_kfree_skb_any(skb); | ||
| 1171 | spin_unlock(&dev->rx_frames.lock); | ||
| 1172 | |||
| 1173 | link->in_ep->driver_data = NULL; | 1142 | link->in_ep->driver_data = NULL; |
| 1174 | link->in_ep->desc = NULL; | 1143 | link->in_ep->desc = NULL; |
| 1175 | 1144 | ||
diff --git a/drivers/usb/gadget/zero.c b/drivers/usb/gadget/zero.c index 9f170c53e3d9..134f354ede62 100644 --- a/drivers/usb/gadget/zero.c +++ b/drivers/usb/gadget/zero.c | |||
| @@ -300,7 +300,7 @@ static int __init zero_bind(struct usb_composite_dev *cdev) | |||
| 300 | ss_opts->isoc_interval = gzero_options.isoc_interval; | 300 | ss_opts->isoc_interval = gzero_options.isoc_interval; |
| 301 | ss_opts->isoc_maxpacket = gzero_options.isoc_maxpacket; | 301 | ss_opts->isoc_maxpacket = gzero_options.isoc_maxpacket; |
| 302 | ss_opts->isoc_mult = gzero_options.isoc_mult; | 302 | ss_opts->isoc_mult = gzero_options.isoc_mult; |
| 303 | ss_opts->isoc_maxburst = gzero_options.isoc_maxpacket; | 303 | ss_opts->isoc_maxburst = gzero_options.isoc_maxburst; |
| 304 | ss_opts->bulk_buflen = gzero_options.bulk_buflen; | 304 | ss_opts->bulk_buflen = gzero_options.bulk_buflen; |
| 305 | 305 | ||
| 306 | func_ss = usb_get_function(func_inst_ss); | 306 | func_ss = usb_get_function(func_inst_ss); |
diff --git a/drivers/usb/host/xhci-pci.c b/drivers/usb/host/xhci-pci.c index 47390e369cd4..35d447780707 100644 --- a/drivers/usb/host/xhci-pci.c +++ b/drivers/usb/host/xhci-pci.c | |||
| @@ -134,6 +134,8 @@ static void xhci_pci_quirks(struct device *dev, struct xhci_hcd *xhci) | |||
| 134 | */ | 134 | */ |
| 135 | if (pdev->subsystem_vendor == PCI_VENDOR_ID_HP) | 135 | if (pdev->subsystem_vendor == PCI_VENDOR_ID_HP) |
| 136 | xhci->quirks |= XHCI_SPURIOUS_WAKEUP; | 136 | xhci->quirks |= XHCI_SPURIOUS_WAKEUP; |
| 137 | |||
| 138 | xhci->quirks |= XHCI_SPURIOUS_REBOOT; | ||
| 137 | } | 139 | } |
| 138 | if (pdev->vendor == PCI_VENDOR_ID_ETRON && | 140 | if (pdev->vendor == PCI_VENDOR_ID_ETRON && |
| 139 | pdev->device == PCI_DEVICE_ID_ASROCK_P67) { | 141 | pdev->device == PCI_DEVICE_ID_ASROCK_P67) { |
| @@ -143,9 +145,7 @@ static void xhci_pci_quirks(struct device *dev, struct xhci_hcd *xhci) | |||
| 143 | xhci->quirks |= XHCI_TRUST_TX_LENGTH; | 145 | xhci->quirks |= XHCI_TRUST_TX_LENGTH; |
| 144 | } | 146 | } |
| 145 | if (pdev->vendor == PCI_VENDOR_ID_RENESAS && | 147 | if (pdev->vendor == PCI_VENDOR_ID_RENESAS && |
| 146 | pdev->device == 0x0015 && | 148 | pdev->device == 0x0015) |
| 147 | pdev->subsystem_vendor == PCI_VENDOR_ID_SAMSUNG && | ||
| 148 | pdev->subsystem_device == 0xc0cd) | ||
| 149 | xhci->quirks |= XHCI_RESET_ON_RESUME; | 149 | xhci->quirks |= XHCI_RESET_ON_RESUME; |
| 150 | if (pdev->vendor == PCI_VENDOR_ID_VIA) | 150 | if (pdev->vendor == PCI_VENDOR_ID_VIA) |
| 151 | xhci->quirks |= XHCI_RESET_ON_RESUME; | 151 | xhci->quirks |= XHCI_RESET_ON_RESUME; |
diff --git a/drivers/usb/host/xhci-ring.c b/drivers/usb/host/xhci-ring.c index 5f926bea5ab1..7a0e3c720c00 100644 --- a/drivers/usb/host/xhci-ring.c +++ b/drivers/usb/host/xhci-ring.c | |||
| @@ -550,6 +550,7 @@ void xhci_find_new_dequeue_state(struct xhci_hcd *xhci, | |||
| 550 | struct xhci_ring *ep_ring; | 550 | struct xhci_ring *ep_ring; |
| 551 | struct xhci_generic_trb *trb; | 551 | struct xhci_generic_trb *trb; |
| 552 | dma_addr_t addr; | 552 | dma_addr_t addr; |
| 553 | u64 hw_dequeue; | ||
| 553 | 554 | ||
| 554 | ep_ring = xhci_triad_to_transfer_ring(xhci, slot_id, | 555 | ep_ring = xhci_triad_to_transfer_ring(xhci, slot_id, |
| 555 | ep_index, stream_id); | 556 | ep_index, stream_id); |
| @@ -559,16 +560,6 @@ void xhci_find_new_dequeue_state(struct xhci_hcd *xhci, | |||
| 559 | stream_id); | 560 | stream_id); |
| 560 | return; | 561 | return; |
| 561 | } | 562 | } |
| 562 | state->new_cycle_state = 0; | ||
| 563 | xhci_dbg_trace(xhci, trace_xhci_dbg_cancel_urb, | ||
| 564 | "Finding segment containing stopped TRB."); | ||
| 565 | state->new_deq_seg = find_trb_seg(cur_td->start_seg, | ||
| 566 | dev->eps[ep_index].stopped_trb, | ||
| 567 | &state->new_cycle_state); | ||
| 568 | if (!state->new_deq_seg) { | ||
| 569 | WARN_ON(1); | ||
| 570 | return; | ||
| 571 | } | ||
| 572 | 563 | ||
| 573 | /* Dig out the cycle state saved by the xHC during the stop ep cmd */ | 564 | /* Dig out the cycle state saved by the xHC during the stop ep cmd */ |
| 574 | xhci_dbg_trace(xhci, trace_xhci_dbg_cancel_urb, | 565 | xhci_dbg_trace(xhci, trace_xhci_dbg_cancel_urb, |
| @@ -577,46 +568,57 @@ void xhci_find_new_dequeue_state(struct xhci_hcd *xhci, | |||
| 577 | if (ep->ep_state & EP_HAS_STREAMS) { | 568 | if (ep->ep_state & EP_HAS_STREAMS) { |
| 578 | struct xhci_stream_ctx *ctx = | 569 | struct xhci_stream_ctx *ctx = |
| 579 | &ep->stream_info->stream_ctx_array[stream_id]; | 570 | &ep->stream_info->stream_ctx_array[stream_id]; |
| 580 | state->new_cycle_state = 0x1 & le64_to_cpu(ctx->stream_ring); | 571 | hw_dequeue = le64_to_cpu(ctx->stream_ring); |
| 581 | } else { | 572 | } else { |
| 582 | struct xhci_ep_ctx *ep_ctx | 573 | struct xhci_ep_ctx *ep_ctx |
| 583 | = xhci_get_ep_ctx(xhci, dev->out_ctx, ep_index); | 574 | = xhci_get_ep_ctx(xhci, dev->out_ctx, ep_index); |
| 584 | state->new_cycle_state = 0x1 & le64_to_cpu(ep_ctx->deq); | 575 | hw_dequeue = le64_to_cpu(ep_ctx->deq); |
| 585 | } | 576 | } |
| 586 | 577 | ||
| 578 | /* Find virtual address and segment of hardware dequeue pointer */ | ||
| 579 | state->new_deq_seg = ep_ring->deq_seg; | ||
| 580 | state->new_deq_ptr = ep_ring->dequeue; | ||
| 581 | while (xhci_trb_virt_to_dma(state->new_deq_seg, state->new_deq_ptr) | ||
| 582 | != (dma_addr_t)(hw_dequeue & ~0xf)) { | ||
| 583 | next_trb(xhci, ep_ring, &state->new_deq_seg, | ||
| 584 | &state->new_deq_ptr); | ||
| 585 | if (state->new_deq_ptr == ep_ring->dequeue) { | ||
| 586 | WARN_ON(1); | ||
| 587 | return; | ||
| 588 | } | ||
| 589 | } | ||
| 590 | /* | ||
| 591 | * Find cycle state for last_trb, starting at old cycle state of | ||
| 592 | * hw_dequeue. If there is only one segment ring, find_trb_seg() will | ||
| 593 | * return immediately and cannot toggle the cycle state if this search | ||
| 594 | * wraps around, so add one more toggle manually in that case. | ||
| 595 | */ | ||
| 596 | state->new_cycle_state = hw_dequeue & 0x1; | ||
| 597 | if (ep_ring->first_seg == ep_ring->first_seg->next && | ||
| 598 | cur_td->last_trb < state->new_deq_ptr) | ||
| 599 | state->new_cycle_state ^= 0x1; | ||
| 600 | |||
| 587 | state->new_deq_ptr = cur_td->last_trb; | 601 | state->new_deq_ptr = cur_td->last_trb; |
| 588 | xhci_dbg_trace(xhci, trace_xhci_dbg_cancel_urb, | 602 | xhci_dbg_trace(xhci, trace_xhci_dbg_cancel_urb, |
| 589 | "Finding segment containing last TRB in TD."); | 603 | "Finding segment containing last TRB in TD."); |
| 590 | state->new_deq_seg = find_trb_seg(state->new_deq_seg, | 604 | state->new_deq_seg = find_trb_seg(state->new_deq_seg, |
| 591 | state->new_deq_ptr, | 605 | state->new_deq_ptr, &state->new_cycle_state); |
| 592 | &state->new_cycle_state); | ||
| 593 | if (!state->new_deq_seg) { | 606 | if (!state->new_deq_seg) { |
| 594 | WARN_ON(1); | 607 | WARN_ON(1); |
| 595 | return; | 608 | return; |
| 596 | } | 609 | } |
| 597 | 610 | ||
| 611 | /* Increment to find next TRB after last_trb. Cycle if appropriate. */ | ||
| 598 | trb = &state->new_deq_ptr->generic; | 612 | trb = &state->new_deq_ptr->generic; |
| 599 | if (TRB_TYPE_LINK_LE32(trb->field[3]) && | 613 | if (TRB_TYPE_LINK_LE32(trb->field[3]) && |
| 600 | (trb->field[3] & cpu_to_le32(LINK_TOGGLE))) | 614 | (trb->field[3] & cpu_to_le32(LINK_TOGGLE))) |
| 601 | state->new_cycle_state ^= 0x1; | 615 | state->new_cycle_state ^= 0x1; |
| 602 | next_trb(xhci, ep_ring, &state->new_deq_seg, &state->new_deq_ptr); | 616 | next_trb(xhci, ep_ring, &state->new_deq_seg, &state->new_deq_ptr); |
| 603 | 617 | ||
| 604 | /* | 618 | /* Don't update the ring cycle state for the producer (us). */ |
| 605 | * If there is only one segment in a ring, find_trb_seg()'s while loop | ||
| 606 | * will not run, and it will return before it has a chance to see if it | ||
| 607 | * needs to toggle the cycle bit. It can't tell if the stalled transfer | ||
| 608 | * ended just before the link TRB on a one-segment ring, or if the TD | ||
| 609 | * wrapped around the top of the ring, because it doesn't have the TD in | ||
| 610 | * question. Look for the one-segment case where stalled TRB's address | ||
| 611 | * is greater than the new dequeue pointer address. | ||
| 612 | */ | ||
| 613 | if (ep_ring->first_seg == ep_ring->first_seg->next && | ||
| 614 | state->new_deq_ptr < dev->eps[ep_index].stopped_trb) | ||
| 615 | state->new_cycle_state ^= 0x1; | ||
| 616 | xhci_dbg_trace(xhci, trace_xhci_dbg_cancel_urb, | 619 | xhci_dbg_trace(xhci, trace_xhci_dbg_cancel_urb, |
| 617 | "Cycle state = 0x%x", state->new_cycle_state); | 620 | "Cycle state = 0x%x", state->new_cycle_state); |
| 618 | 621 | ||
| 619 | /* Don't update the ring cycle state for the producer (us). */ | ||
| 620 | xhci_dbg_trace(xhci, trace_xhci_dbg_cancel_urb, | 622 | xhci_dbg_trace(xhci, trace_xhci_dbg_cancel_urb, |
| 621 | "New dequeue segment = %p (virtual)", | 623 | "New dequeue segment = %p (virtual)", |
| 622 | state->new_deq_seg); | 624 | state->new_deq_seg); |
| @@ -799,7 +801,6 @@ static void xhci_handle_cmd_stop_ep(struct xhci_hcd *xhci, int slot_id, | |||
| 799 | if (list_empty(&ep->cancelled_td_list)) { | 801 | if (list_empty(&ep->cancelled_td_list)) { |
| 800 | xhci_stop_watchdog_timer_in_irq(xhci, ep); | 802 | xhci_stop_watchdog_timer_in_irq(xhci, ep); |
| 801 | ep->stopped_td = NULL; | 803 | ep->stopped_td = NULL; |
| 802 | ep->stopped_trb = NULL; | ||
| 803 | ring_doorbell_for_active_rings(xhci, slot_id, ep_index); | 804 | ring_doorbell_for_active_rings(xhci, slot_id, ep_index); |
| 804 | return; | 805 | return; |
| 805 | } | 806 | } |
| @@ -867,11 +868,9 @@ remove_finished_td: | |||
| 867 | ring_doorbell_for_active_rings(xhci, slot_id, ep_index); | 868 | ring_doorbell_for_active_rings(xhci, slot_id, ep_index); |
| 868 | } | 869 | } |
| 869 | 870 | ||
| 870 | /* Clear stopped_td and stopped_trb if endpoint is not halted */ | 871 | /* Clear stopped_td if endpoint is not halted */ |
| 871 | if (!(ep->ep_state & EP_HALTED)) { | 872 | if (!(ep->ep_state & EP_HALTED)) |
| 872 | ep->stopped_td = NULL; | 873 | ep->stopped_td = NULL; |
| 873 | ep->stopped_trb = NULL; | ||
| 874 | } | ||
| 875 | 874 | ||
| 876 | /* | 875 | /* |
| 877 | * Drop the lock and complete the URBs in the cancelled TD list. | 876 | * Drop the lock and complete the URBs in the cancelled TD list. |
| @@ -1941,14 +1940,12 @@ static void xhci_cleanup_halted_endpoint(struct xhci_hcd *xhci, | |||
| 1941 | struct xhci_virt_ep *ep = &xhci->devs[slot_id]->eps[ep_index]; | 1940 | struct xhci_virt_ep *ep = &xhci->devs[slot_id]->eps[ep_index]; |
| 1942 | ep->ep_state |= EP_HALTED; | 1941 | ep->ep_state |= EP_HALTED; |
| 1943 | ep->stopped_td = td; | 1942 | ep->stopped_td = td; |
| 1944 | ep->stopped_trb = event_trb; | ||
| 1945 | ep->stopped_stream = stream_id; | 1943 | ep->stopped_stream = stream_id; |
| 1946 | 1944 | ||
| 1947 | xhci_queue_reset_ep(xhci, slot_id, ep_index); | 1945 | xhci_queue_reset_ep(xhci, slot_id, ep_index); |
| 1948 | xhci_cleanup_stalled_ring(xhci, td->urb->dev, ep_index); | 1946 | xhci_cleanup_stalled_ring(xhci, td->urb->dev, ep_index); |
| 1949 | 1947 | ||
| 1950 | ep->stopped_td = NULL; | 1948 | ep->stopped_td = NULL; |
| 1951 | ep->stopped_trb = NULL; | ||
| 1952 | ep->stopped_stream = 0; | 1949 | ep->stopped_stream = 0; |
| 1953 | 1950 | ||
| 1954 | xhci_ring_cmd_db(xhci); | 1951 | xhci_ring_cmd_db(xhci); |
| @@ -2030,7 +2027,6 @@ static int finish_td(struct xhci_hcd *xhci, struct xhci_td *td, | |||
| 2030 | * the ring dequeue pointer or take this TD off any lists yet. | 2027 | * the ring dequeue pointer or take this TD off any lists yet. |
| 2031 | */ | 2028 | */ |
| 2032 | ep->stopped_td = td; | 2029 | ep->stopped_td = td; |
| 2033 | ep->stopped_trb = event_trb; | ||
| 2034 | return 0; | 2030 | return 0; |
| 2035 | } else { | 2031 | } else { |
| 2036 | if (trb_comp_code == COMP_STALL) { | 2032 | if (trb_comp_code == COMP_STALL) { |
| @@ -2042,7 +2038,6 @@ static int finish_td(struct xhci_hcd *xhci, struct xhci_td *td, | |||
| 2042 | * USB class driver clear the stall later. | 2038 | * USB class driver clear the stall later. |
| 2043 | */ | 2039 | */ |
| 2044 | ep->stopped_td = td; | 2040 | ep->stopped_td = td; |
| 2045 | ep->stopped_trb = event_trb; | ||
| 2046 | ep->stopped_stream = ep_ring->stream_id; | 2041 | ep->stopped_stream = ep_ring->stream_id; |
| 2047 | } else if (xhci_requires_manual_halt_cleanup(xhci, | 2042 | } else if (xhci_requires_manual_halt_cleanup(xhci, |
| 2048 | ep_ctx, trb_comp_code)) { | 2043 | ep_ctx, trb_comp_code)) { |
diff --git a/drivers/usb/host/xhci.c b/drivers/usb/host/xhci.c index 8fe4e124ddd4..300836972faa 100644 --- a/drivers/usb/host/xhci.c +++ b/drivers/usb/host/xhci.c | |||
| @@ -408,16 +408,16 @@ static int xhci_try_enable_msi(struct usb_hcd *hcd) | |||
| 408 | 408 | ||
| 409 | #else | 409 | #else |
| 410 | 410 | ||
| 411 | static int xhci_try_enable_msi(struct usb_hcd *hcd) | 411 | static inline int xhci_try_enable_msi(struct usb_hcd *hcd) |
| 412 | { | 412 | { |
| 413 | return 0; | 413 | return 0; |
| 414 | } | 414 | } |
| 415 | 415 | ||
| 416 | static void xhci_cleanup_msix(struct xhci_hcd *xhci) | 416 | static inline void xhci_cleanup_msix(struct xhci_hcd *xhci) |
| 417 | { | 417 | { |
| 418 | } | 418 | } |
| 419 | 419 | ||
| 420 | static void xhci_msix_sync_irqs(struct xhci_hcd *xhci) | 420 | static inline void xhci_msix_sync_irqs(struct xhci_hcd *xhci) |
| 421 | { | 421 | { |
| 422 | } | 422 | } |
| 423 | 423 | ||
| @@ -2954,7 +2954,6 @@ void xhci_endpoint_reset(struct usb_hcd *hcd, | |||
| 2954 | xhci_ring_cmd_db(xhci); | 2954 | xhci_ring_cmd_db(xhci); |
| 2955 | } | 2955 | } |
| 2956 | virt_ep->stopped_td = NULL; | 2956 | virt_ep->stopped_td = NULL; |
| 2957 | virt_ep->stopped_trb = NULL; | ||
| 2958 | virt_ep->stopped_stream = 0; | 2957 | virt_ep->stopped_stream = 0; |
| 2959 | spin_unlock_irqrestore(&xhci->lock, flags); | 2958 | spin_unlock_irqrestore(&xhci->lock, flags); |
| 2960 | 2959 | ||
diff --git a/drivers/usb/host/xhci.h b/drivers/usb/host/xhci.h index d280e9213d08..4746816aed3e 100644 --- a/drivers/usb/host/xhci.h +++ b/drivers/usb/host/xhci.h | |||
| @@ -865,8 +865,6 @@ struct xhci_virt_ep { | |||
| 865 | #define EP_GETTING_NO_STREAMS (1 << 5) | 865 | #define EP_GETTING_NO_STREAMS (1 << 5) |
| 866 | /* ---- Related to URB cancellation ---- */ | 866 | /* ---- Related to URB cancellation ---- */ |
| 867 | struct list_head cancelled_td_list; | 867 | struct list_head cancelled_td_list; |
| 868 | /* The TRB that was last reported in a stopped endpoint ring */ | ||
| 869 | union xhci_trb *stopped_trb; | ||
| 870 | struct xhci_td *stopped_td; | 868 | struct xhci_td *stopped_td; |
| 871 | unsigned int stopped_stream; | 869 | unsigned int stopped_stream; |
| 872 | /* Watchdog timer for stop endpoint command to cancel URBs */ | 870 | /* Watchdog timer for stop endpoint command to cancel URBs */ |
diff --git a/drivers/usb/musb/musb_dsps.c b/drivers/usb/musb/musb_dsps.c index 3372ded5def7..e2fd263585de 100644 --- a/drivers/usb/musb/musb_dsps.c +++ b/drivers/usb/musb/musb_dsps.c | |||
| @@ -470,8 +470,9 @@ static int dsps_musb_exit(struct musb *musb) | |||
| 470 | struct dsps_glue *glue = dev_get_drvdata(dev->parent); | 470 | struct dsps_glue *glue = dev_get_drvdata(dev->parent); |
| 471 | 471 | ||
| 472 | del_timer_sync(&glue->timer); | 472 | del_timer_sync(&glue->timer); |
| 473 | |||
| 474 | usb_phy_shutdown(musb->xceiv); | 473 | usb_phy_shutdown(musb->xceiv); |
| 474 | debugfs_remove_recursive(glue->dbgfs_root); | ||
| 475 | |||
| 475 | return 0; | 476 | return 0; |
| 476 | } | 477 | } |
| 477 | 478 | ||
| @@ -708,8 +709,6 @@ static int dsps_remove(struct platform_device *pdev) | |||
| 708 | pm_runtime_put(&pdev->dev); | 709 | pm_runtime_put(&pdev->dev); |
| 709 | pm_runtime_disable(&pdev->dev); | 710 | pm_runtime_disable(&pdev->dev); |
| 710 | 711 | ||
| 711 | debugfs_remove_recursive(glue->dbgfs_root); | ||
| 712 | |||
| 713 | return 0; | 712 | return 0; |
| 714 | } | 713 | } |
| 715 | 714 | ||
diff --git a/drivers/usb/musb/omap2430.c b/drivers/usb/musb/omap2430.c index d341c149a2f9..d369bf1f3936 100644 --- a/drivers/usb/musb/omap2430.c +++ b/drivers/usb/musb/omap2430.c | |||
| @@ -316,7 +316,13 @@ static void omap_musb_mailbox_work(struct work_struct *mailbox_work) | |||
| 316 | { | 316 | { |
| 317 | struct omap2430_glue *glue = container_of(mailbox_work, | 317 | struct omap2430_glue *glue = container_of(mailbox_work, |
| 318 | struct omap2430_glue, omap_musb_mailbox_work); | 318 | struct omap2430_glue, omap_musb_mailbox_work); |
| 319 | struct musb *musb = glue_to_musb(glue); | ||
| 320 | struct device *dev = musb->controller; | ||
| 321 | |||
| 322 | pm_runtime_get_sync(dev); | ||
| 319 | omap_musb_set_mailbox(glue); | 323 | omap_musb_set_mailbox(glue); |
| 324 | pm_runtime_mark_last_busy(dev); | ||
| 325 | pm_runtime_put_autosuspend(dev); | ||
| 320 | } | 326 | } |
| 321 | 327 | ||
| 322 | static irqreturn_t omap2430_musb_interrupt(int irq, void *__hci) | 328 | static irqreturn_t omap2430_musb_interrupt(int irq, void *__hci) |
| @@ -416,6 +422,7 @@ static int omap2430_musb_init(struct musb *musb) | |||
| 416 | omap_musb_set_mailbox(glue); | 422 | omap_musb_set_mailbox(glue); |
| 417 | 423 | ||
| 418 | phy_init(musb->phy); | 424 | phy_init(musb->phy); |
| 425 | phy_power_on(musb->phy); | ||
| 419 | 426 | ||
| 420 | pm_runtime_put_noidle(musb->controller); | 427 | pm_runtime_put_noidle(musb->controller); |
| 421 | return 0; | 428 | return 0; |
| @@ -478,6 +485,7 @@ static int omap2430_musb_exit(struct musb *musb) | |||
| 478 | del_timer_sync(&musb_idle_timer); | 485 | del_timer_sync(&musb_idle_timer); |
| 479 | 486 | ||
| 480 | omap2430_low_level_exit(musb); | 487 | omap2430_low_level_exit(musb); |
| 488 | phy_power_off(musb->phy); | ||
| 481 | phy_exit(musb->phy); | 489 | phy_exit(musb->phy); |
| 482 | 490 | ||
| 483 | return 0; | 491 | return 0; |
diff --git a/drivers/usb/phy/phy-am335x-control.c b/drivers/usb/phy/phy-am335x-control.c index d75196ad5f2f..35b6083b7999 100644 --- a/drivers/usb/phy/phy-am335x-control.c +++ b/drivers/usb/phy/phy-am335x-control.c | |||
| @@ -3,6 +3,7 @@ | |||
| 3 | #include <linux/err.h> | 3 | #include <linux/err.h> |
| 4 | #include <linux/of.h> | 4 | #include <linux/of.h> |
| 5 | #include <linux/io.h> | 5 | #include <linux/io.h> |
| 6 | #include <linux/delay.h> | ||
| 6 | #include "am35x-phy-control.h" | 7 | #include "am35x-phy-control.h" |
| 7 | 8 | ||
| 8 | struct am335x_control_usb { | 9 | struct am335x_control_usb { |
| @@ -86,6 +87,14 @@ static void am335x_phy_power(struct phy_control *phy_ctrl, u32 id, bool on) | |||
| 86 | } | 87 | } |
| 87 | 88 | ||
| 88 | writel(val, usb_ctrl->phy_reg + reg); | 89 | writel(val, usb_ctrl->phy_reg + reg); |
| 90 | |||
| 91 | /* | ||
| 92 | * Give the PHY ~1ms to complete the power up operation. | ||
| 93 | * Tests have shown unstable behaviour if other USB PHY related | ||
| 94 | * registers are written too shortly after such a transition. | ||
| 95 | */ | ||
| 96 | if (on) | ||
| 97 | mdelay(1); | ||
| 89 | } | 98 | } |
| 90 | 99 | ||
| 91 | static const struct phy_control ctrl_am335x = { | 100 | static const struct phy_control ctrl_am335x = { |
diff --git a/drivers/usb/phy/phy.c b/drivers/usb/phy/phy.c index 8afa813d690b..36b6bce33b20 100644 --- a/drivers/usb/phy/phy.c +++ b/drivers/usb/phy/phy.c | |||
| @@ -132,6 +132,9 @@ struct usb_phy *usb_get_phy(enum usb_phy_type type) | |||
| 132 | if (IS_ERR(phy) || !try_module_get(phy->dev->driver->owner)) { | 132 | if (IS_ERR(phy) || !try_module_get(phy->dev->driver->owner)) { |
| 133 | pr_debug("PHY: unable to find transceiver of type %s\n", | 133 | pr_debug("PHY: unable to find transceiver of type %s\n", |
| 134 | usb_phy_type_string(type)); | 134 | usb_phy_type_string(type)); |
| 135 | if (!IS_ERR(phy)) | ||
| 136 | phy = ERR_PTR(-ENODEV); | ||
| 137 | |||
| 135 | goto err0; | 138 | goto err0; |
| 136 | } | 139 | } |
| 137 | 140 | ||
diff --git a/drivers/usb/serial/io_ti.c b/drivers/usb/serial/io_ti.c index a2db5be9c305..df90dae53eb9 100644 --- a/drivers/usb/serial/io_ti.c +++ b/drivers/usb/serial/io_ti.c | |||
| @@ -28,6 +28,7 @@ | |||
| 28 | #include <linux/spinlock.h> | 28 | #include <linux/spinlock.h> |
| 29 | #include <linux/mutex.h> | 29 | #include <linux/mutex.h> |
| 30 | #include <linux/serial.h> | 30 | #include <linux/serial.h> |
| 31 | #include <linux/swab.h> | ||
| 31 | #include <linux/kfifo.h> | 32 | #include <linux/kfifo.h> |
| 32 | #include <linux/ioctl.h> | 33 | #include <linux/ioctl.h> |
| 33 | #include <linux/firmware.h> | 34 | #include <linux/firmware.h> |
| @@ -280,7 +281,7 @@ static int read_download_mem(struct usb_device *dev, int start_address, | |||
| 280 | { | 281 | { |
| 281 | int status = 0; | 282 | int status = 0; |
| 282 | __u8 read_length; | 283 | __u8 read_length; |
| 283 | __be16 be_start_address; | 284 | u16 be_start_address; |
| 284 | 285 | ||
| 285 | dev_dbg(&dev->dev, "%s - @ %x for %d\n", __func__, start_address, length); | 286 | dev_dbg(&dev->dev, "%s - @ %x for %d\n", __func__, start_address, length); |
| 286 | 287 | ||
| @@ -296,10 +297,14 @@ static int read_download_mem(struct usb_device *dev, int start_address, | |||
| 296 | if (read_length > 1) { | 297 | if (read_length > 1) { |
| 297 | dev_dbg(&dev->dev, "%s - @ %x for %d\n", __func__, start_address, read_length); | 298 | dev_dbg(&dev->dev, "%s - @ %x for %d\n", __func__, start_address, read_length); |
| 298 | } | 299 | } |
| 299 | be_start_address = cpu_to_be16(start_address); | 300 | /* |
| 301 | * NOTE: Must use swab as wIndex is sent in little-endian | ||
| 302 | * byte order regardless of host byte order. | ||
| 303 | */ | ||
| 304 | be_start_address = swab16((u16)start_address); | ||
| 300 | status = ti_vread_sync(dev, UMPC_MEMORY_READ, | 305 | status = ti_vread_sync(dev, UMPC_MEMORY_READ, |
| 301 | (__u16)address_type, | 306 | (__u16)address_type, |
| 302 | (__force __u16)be_start_address, | 307 | be_start_address, |
| 303 | buffer, read_length); | 308 | buffer, read_length); |
| 304 | 309 | ||
| 305 | if (status) { | 310 | if (status) { |
| @@ -394,7 +399,7 @@ static int write_i2c_mem(struct edgeport_serial *serial, | |||
| 394 | struct device *dev = &serial->serial->dev->dev; | 399 | struct device *dev = &serial->serial->dev->dev; |
| 395 | int status = 0; | 400 | int status = 0; |
| 396 | int write_length; | 401 | int write_length; |
| 397 | __be16 be_start_address; | 402 | u16 be_start_address; |
| 398 | 403 | ||
| 399 | /* We can only send a maximum of 1 aligned byte page at a time */ | 404 | /* We can only send a maximum of 1 aligned byte page at a time */ |
| 400 | 405 | ||
| @@ -409,11 +414,16 @@ static int write_i2c_mem(struct edgeport_serial *serial, | |||
| 409 | __func__, start_address, write_length); | 414 | __func__, start_address, write_length); |
| 410 | usb_serial_debug_data(dev, __func__, write_length, buffer); | 415 | usb_serial_debug_data(dev, __func__, write_length, buffer); |
| 411 | 416 | ||
| 412 | /* Write first page */ | 417 | /* |
| 413 | be_start_address = cpu_to_be16(start_address); | 418 | * Write first page. |
| 419 | * | ||
| 420 | * NOTE: Must use swab as wIndex is sent in little-endian byte order | ||
| 421 | * regardless of host byte order. | ||
| 422 | */ | ||
| 423 | be_start_address = swab16((u16)start_address); | ||
| 414 | status = ti_vsend_sync(serial->serial->dev, | 424 | status = ti_vsend_sync(serial->serial->dev, |
| 415 | UMPC_MEMORY_WRITE, (__u16)address_type, | 425 | UMPC_MEMORY_WRITE, (__u16)address_type, |
| 416 | (__force __u16)be_start_address, | 426 | be_start_address, |
| 417 | buffer, write_length); | 427 | buffer, write_length); |
| 418 | if (status) { | 428 | if (status) { |
| 419 | dev_dbg(dev, "%s - ERROR %d\n", __func__, status); | 429 | dev_dbg(dev, "%s - ERROR %d\n", __func__, status); |
| @@ -436,11 +446,16 @@ static int write_i2c_mem(struct edgeport_serial *serial, | |||
| 436 | __func__, start_address, write_length); | 446 | __func__, start_address, write_length); |
| 437 | usb_serial_debug_data(dev, __func__, write_length, buffer); | 447 | usb_serial_debug_data(dev, __func__, write_length, buffer); |
| 438 | 448 | ||
| 439 | /* Write next page */ | 449 | /* |
| 440 | be_start_address = cpu_to_be16(start_address); | 450 | * Write next page. |
| 451 | * | ||
| 452 | * NOTE: Must use swab as wIndex is sent in little-endian byte | ||
| 453 | * order regardless of host byte order. | ||
| 454 | */ | ||
| 455 | be_start_address = swab16((u16)start_address); | ||
| 441 | status = ti_vsend_sync(serial->serial->dev, UMPC_MEMORY_WRITE, | 456 | status = ti_vsend_sync(serial->serial->dev, UMPC_MEMORY_WRITE, |
| 442 | (__u16)address_type, | 457 | (__u16)address_type, |
| 443 | (__force __u16)be_start_address, | 458 | be_start_address, |
| 444 | buffer, write_length); | 459 | buffer, write_length); |
| 445 | if (status) { | 460 | if (status) { |
| 446 | dev_err(dev, "%s - ERROR %d\n", __func__, status); | 461 | dev_err(dev, "%s - ERROR %d\n", __func__, status); |
| @@ -585,8 +600,8 @@ static int get_descriptor_addr(struct edgeport_serial *serial, | |||
| 585 | if (rom_desc->Type == desc_type) | 600 | if (rom_desc->Type == desc_type) |
| 586 | return start_address; | 601 | return start_address; |
| 587 | 602 | ||
| 588 | start_address = start_address + sizeof(struct ti_i2c_desc) | 603 | start_address = start_address + sizeof(struct ti_i2c_desc) + |
| 589 | + rom_desc->Size; | 604 | le16_to_cpu(rom_desc->Size); |
| 590 | 605 | ||
| 591 | } while ((start_address < TI_MAX_I2C_SIZE) && rom_desc->Type); | 606 | } while ((start_address < TI_MAX_I2C_SIZE) && rom_desc->Type); |
| 592 | 607 | ||
| @@ -599,7 +614,7 @@ static int valid_csum(struct ti_i2c_desc *rom_desc, __u8 *buffer) | |||
| 599 | __u16 i; | 614 | __u16 i; |
| 600 | __u8 cs = 0; | 615 | __u8 cs = 0; |
| 601 | 616 | ||
| 602 | for (i = 0; i < rom_desc->Size; i++) | 617 | for (i = 0; i < le16_to_cpu(rom_desc->Size); i++) |
| 603 | cs = (__u8)(cs + buffer[i]); | 618 | cs = (__u8)(cs + buffer[i]); |
| 604 | 619 | ||
| 605 | if (cs != rom_desc->CheckSum) { | 620 | if (cs != rom_desc->CheckSum) { |
| @@ -650,7 +665,7 @@ static int check_i2c_image(struct edgeport_serial *serial) | |||
| 650 | break; | 665 | break; |
| 651 | 666 | ||
| 652 | if ((start_address + sizeof(struct ti_i2c_desc) + | 667 | if ((start_address + sizeof(struct ti_i2c_desc) + |
| 653 | rom_desc->Size) > TI_MAX_I2C_SIZE) { | 668 | le16_to_cpu(rom_desc->Size)) > TI_MAX_I2C_SIZE) { |
| 654 | status = -ENODEV; | 669 | status = -ENODEV; |
| 655 | dev_dbg(dev, "%s - structure too big, erroring out.\n", __func__); | 670 | dev_dbg(dev, "%s - structure too big, erroring out.\n", __func__); |
| 656 | break; | 671 | break; |
| @@ -665,7 +680,8 @@ static int check_i2c_image(struct edgeport_serial *serial) | |||
| 665 | /* Read the descriptor data */ | 680 | /* Read the descriptor data */ |
| 666 | status = read_rom(serial, start_address + | 681 | status = read_rom(serial, start_address + |
| 667 | sizeof(struct ti_i2c_desc), | 682 | sizeof(struct ti_i2c_desc), |
| 668 | rom_desc->Size, buffer); | 683 | le16_to_cpu(rom_desc->Size), |
| 684 | buffer); | ||
| 669 | if (status) | 685 | if (status) |
| 670 | break; | 686 | break; |
| 671 | 687 | ||
| @@ -674,7 +690,7 @@ static int check_i2c_image(struct edgeport_serial *serial) | |||
| 674 | break; | 690 | break; |
| 675 | } | 691 | } |
| 676 | start_address = start_address + sizeof(struct ti_i2c_desc) + | 692 | start_address = start_address + sizeof(struct ti_i2c_desc) + |
| 677 | rom_desc->Size; | 693 | le16_to_cpu(rom_desc->Size); |
| 678 | 694 | ||
| 679 | } while ((rom_desc->Type != I2C_DESC_TYPE_ION) && | 695 | } while ((rom_desc->Type != I2C_DESC_TYPE_ION) && |
| 680 | (start_address < TI_MAX_I2C_SIZE)); | 696 | (start_address < TI_MAX_I2C_SIZE)); |
| @@ -712,7 +728,7 @@ static int get_manuf_info(struct edgeport_serial *serial, __u8 *buffer) | |||
| 712 | 728 | ||
| 713 | /* Read the descriptor data */ | 729 | /* Read the descriptor data */ |
| 714 | status = read_rom(serial, start_address+sizeof(struct ti_i2c_desc), | 730 | status = read_rom(serial, start_address+sizeof(struct ti_i2c_desc), |
| 715 | rom_desc->Size, buffer); | 731 | le16_to_cpu(rom_desc->Size), buffer); |
| 716 | if (status) | 732 | if (status) |
| 717 | goto exit; | 733 | goto exit; |
| 718 | 734 | ||
diff --git a/drivers/usb/serial/option.c b/drivers/usb/serial/option.c index 367c7f08b27c..f213ee978516 100644 --- a/drivers/usb/serial/option.c +++ b/drivers/usb/serial/option.c | |||
| @@ -234,8 +234,31 @@ static void option_instat_callback(struct urb *urb); | |||
| 234 | #define QUALCOMM_VENDOR_ID 0x05C6 | 234 | #define QUALCOMM_VENDOR_ID 0x05C6 |
| 235 | 235 | ||
| 236 | #define CMOTECH_VENDOR_ID 0x16d8 | 236 | #define CMOTECH_VENDOR_ID 0x16d8 |
| 237 | #define CMOTECH_PRODUCT_6008 0x6008 | 237 | #define CMOTECH_PRODUCT_6001 0x6001 |
| 238 | #define CMOTECH_PRODUCT_6280 0x6280 | 238 | #define CMOTECH_PRODUCT_CMU_300 0x6002 |
| 239 | #define CMOTECH_PRODUCT_6003 0x6003 | ||
| 240 | #define CMOTECH_PRODUCT_6004 0x6004 | ||
| 241 | #define CMOTECH_PRODUCT_6005 0x6005 | ||
| 242 | #define CMOTECH_PRODUCT_CGU_628A 0x6006 | ||
| 243 | #define CMOTECH_PRODUCT_CHE_628S 0x6007 | ||
| 244 | #define CMOTECH_PRODUCT_CMU_301 0x6008 | ||
| 245 | #define CMOTECH_PRODUCT_CHU_628 0x6280 | ||
| 246 | #define CMOTECH_PRODUCT_CHU_628S 0x6281 | ||
| 247 | #define CMOTECH_PRODUCT_CDU_680 0x6803 | ||
| 248 | #define CMOTECH_PRODUCT_CDU_685A 0x6804 | ||
| 249 | #define CMOTECH_PRODUCT_CHU_720S 0x7001 | ||
| 250 | #define CMOTECH_PRODUCT_7002 0x7002 | ||
| 251 | #define CMOTECH_PRODUCT_CHU_629K 0x7003 | ||
| 252 | #define CMOTECH_PRODUCT_7004 0x7004 | ||
| 253 | #define CMOTECH_PRODUCT_7005 0x7005 | ||
| 254 | #define CMOTECH_PRODUCT_CGU_629 0x7006 | ||
| 255 | #define CMOTECH_PRODUCT_CHU_629S 0x700a | ||
| 256 | #define CMOTECH_PRODUCT_CHU_720I 0x7211 | ||
| 257 | #define CMOTECH_PRODUCT_7212 0x7212 | ||
| 258 | #define CMOTECH_PRODUCT_7213 0x7213 | ||
| 259 | #define CMOTECH_PRODUCT_7251 0x7251 | ||
| 260 | #define CMOTECH_PRODUCT_7252 0x7252 | ||
| 261 | #define CMOTECH_PRODUCT_7253 0x7253 | ||
| 239 | 262 | ||
| 240 | #define TELIT_VENDOR_ID 0x1bc7 | 263 | #define TELIT_VENDOR_ID 0x1bc7 |
| 241 | #define TELIT_PRODUCT_UC864E 0x1003 | 264 | #define TELIT_PRODUCT_UC864E 0x1003 |
| @@ -287,6 +310,7 @@ static void option_instat_callback(struct urb *urb); | |||
| 287 | #define ALCATEL_PRODUCT_X060S_X200 0x0000 | 310 | #define ALCATEL_PRODUCT_X060S_X200 0x0000 |
| 288 | #define ALCATEL_PRODUCT_X220_X500D 0x0017 | 311 | #define ALCATEL_PRODUCT_X220_X500D 0x0017 |
| 289 | #define ALCATEL_PRODUCT_L100V 0x011e | 312 | #define ALCATEL_PRODUCT_L100V 0x011e |
| 313 | #define ALCATEL_PRODUCT_L800MA 0x0203 | ||
| 290 | 314 | ||
| 291 | #define PIRELLI_VENDOR_ID 0x1266 | 315 | #define PIRELLI_VENDOR_ID 0x1266 |
| 292 | #define PIRELLI_PRODUCT_C100_1 0x1002 | 316 | #define PIRELLI_PRODUCT_C100_1 0x1002 |
| @@ -349,6 +373,7 @@ static void option_instat_callback(struct urb *urb); | |||
| 349 | #define OLIVETTI_PRODUCT_OLICARD100 0xc000 | 373 | #define OLIVETTI_PRODUCT_OLICARD100 0xc000 |
| 350 | #define OLIVETTI_PRODUCT_OLICARD145 0xc003 | 374 | #define OLIVETTI_PRODUCT_OLICARD145 0xc003 |
| 351 | #define OLIVETTI_PRODUCT_OLICARD200 0xc005 | 375 | #define OLIVETTI_PRODUCT_OLICARD200 0xc005 |
| 376 | #define OLIVETTI_PRODUCT_OLICARD500 0xc00b | ||
| 352 | 377 | ||
| 353 | /* Celot products */ | 378 | /* Celot products */ |
| 354 | #define CELOT_VENDOR_ID 0x211f | 379 | #define CELOT_VENDOR_ID 0x211f |
| @@ -502,6 +527,10 @@ static const struct option_blacklist_info huawei_cdc12_blacklist = { | |||
| 502 | .reserved = BIT(1) | BIT(2), | 527 | .reserved = BIT(1) | BIT(2), |
| 503 | }; | 528 | }; |
| 504 | 529 | ||
| 530 | static const struct option_blacklist_info net_intf0_blacklist = { | ||
| 531 | .reserved = BIT(0), | ||
| 532 | }; | ||
| 533 | |||
| 505 | static const struct option_blacklist_info net_intf1_blacklist = { | 534 | static const struct option_blacklist_info net_intf1_blacklist = { |
| 506 | .reserved = BIT(1), | 535 | .reserved = BIT(1), |
| 507 | }; | 536 | }; |
| @@ -1035,8 +1064,47 @@ static const struct usb_device_id option_ids[] = { | |||
| 1035 | { USB_DEVICE(QUALCOMM_VENDOR_ID, 0x6613)}, /* Onda H600/ZTE MF330 */ | 1064 | { USB_DEVICE(QUALCOMM_VENDOR_ID, 0x6613)}, /* Onda H600/ZTE MF330 */ |
| 1036 | { USB_DEVICE(QUALCOMM_VENDOR_ID, 0x0023)}, /* ONYX 3G device */ | 1065 | { USB_DEVICE(QUALCOMM_VENDOR_ID, 0x0023)}, /* ONYX 3G device */ |
| 1037 | { USB_DEVICE(QUALCOMM_VENDOR_ID, 0x9000)}, /* SIMCom SIM5218 */ | 1066 | { USB_DEVICE(QUALCOMM_VENDOR_ID, 0x9000)}, /* SIMCom SIM5218 */ |
| 1038 | { USB_DEVICE(CMOTECH_VENDOR_ID, CMOTECH_PRODUCT_6280) }, /* BP3-USB & BP3-EXT HSDPA */ | 1067 | { USB_DEVICE(CMOTECH_VENDOR_ID, CMOTECH_PRODUCT_6001) }, |
| 1039 | { USB_DEVICE(CMOTECH_VENDOR_ID, CMOTECH_PRODUCT_6008) }, | 1068 | { USB_DEVICE(CMOTECH_VENDOR_ID, CMOTECH_PRODUCT_CMU_300) }, |
| 1069 | { USB_DEVICE(CMOTECH_VENDOR_ID, CMOTECH_PRODUCT_6003), | ||
| 1070 | .driver_info = (kernel_ulong_t)&net_intf0_blacklist }, | ||
| 1071 | { USB_DEVICE(CMOTECH_VENDOR_ID, CMOTECH_PRODUCT_6004) }, | ||
| 1072 | { USB_DEVICE(CMOTECH_VENDOR_ID, CMOTECH_PRODUCT_6005) }, | ||
| 1073 | { USB_DEVICE(CMOTECH_VENDOR_ID, CMOTECH_PRODUCT_CGU_628A) }, | ||
| 1074 | { USB_DEVICE(CMOTECH_VENDOR_ID, CMOTECH_PRODUCT_CHE_628S), | ||
| 1075 | .driver_info = (kernel_ulong_t)&net_intf0_blacklist }, | ||
| 1076 | { USB_DEVICE(CMOTECH_VENDOR_ID, CMOTECH_PRODUCT_CMU_301), | ||
| 1077 | .driver_info = (kernel_ulong_t)&net_intf0_blacklist }, | ||
| 1078 | { USB_DEVICE(CMOTECH_VENDOR_ID, CMOTECH_PRODUCT_CHU_628), | ||
| 1079 | .driver_info = (kernel_ulong_t)&net_intf0_blacklist }, | ||
| 1080 | { USB_DEVICE(CMOTECH_VENDOR_ID, CMOTECH_PRODUCT_CHU_628S) }, | ||
| 1081 | { USB_DEVICE(CMOTECH_VENDOR_ID, CMOTECH_PRODUCT_CDU_680) }, | ||
| 1082 | { USB_DEVICE(CMOTECH_VENDOR_ID, CMOTECH_PRODUCT_CDU_685A) }, | ||
| 1083 | { USB_DEVICE(CMOTECH_VENDOR_ID, CMOTECH_PRODUCT_CHU_720S), | ||
| 1084 | .driver_info = (kernel_ulong_t)&net_intf0_blacklist }, | ||
| 1085 | { USB_DEVICE(CMOTECH_VENDOR_ID, CMOTECH_PRODUCT_7002), | ||
| 1086 | .driver_info = (kernel_ulong_t)&net_intf0_blacklist }, | ||
| 1087 | { USB_DEVICE(CMOTECH_VENDOR_ID, CMOTECH_PRODUCT_CHU_629K), | ||
| 1088 | .driver_info = (kernel_ulong_t)&net_intf4_blacklist }, | ||
| 1089 | { USB_DEVICE(CMOTECH_VENDOR_ID, CMOTECH_PRODUCT_7004), | ||
| 1090 | .driver_info = (kernel_ulong_t)&net_intf3_blacklist }, | ||
| 1091 | { USB_DEVICE(CMOTECH_VENDOR_ID, CMOTECH_PRODUCT_7005) }, | ||
| 1092 | { USB_DEVICE(CMOTECH_VENDOR_ID, CMOTECH_PRODUCT_CGU_629), | ||
| 1093 | .driver_info = (kernel_ulong_t)&net_intf5_blacklist }, | ||
| 1094 | { USB_DEVICE(CMOTECH_VENDOR_ID, CMOTECH_PRODUCT_CHU_629S), | ||
| 1095 | .driver_info = (kernel_ulong_t)&net_intf4_blacklist }, | ||
| 1096 | { USB_DEVICE(CMOTECH_VENDOR_ID, CMOTECH_PRODUCT_CHU_720I), | ||
| 1097 | .driver_info = (kernel_ulong_t)&net_intf0_blacklist }, | ||
| 1098 | { USB_DEVICE(CMOTECH_VENDOR_ID, CMOTECH_PRODUCT_7212), | ||
| 1099 | .driver_info = (kernel_ulong_t)&net_intf0_blacklist }, | ||
| 1100 | { USB_DEVICE(CMOTECH_VENDOR_ID, CMOTECH_PRODUCT_7213), | ||
| 1101 | .driver_info = (kernel_ulong_t)&net_intf0_blacklist }, | ||
| 1102 | { USB_DEVICE(CMOTECH_VENDOR_ID, CMOTECH_PRODUCT_7251), | ||
| 1103 | .driver_info = (kernel_ulong_t)&net_intf1_blacklist }, | ||
| 1104 | { USB_DEVICE(CMOTECH_VENDOR_ID, CMOTECH_PRODUCT_7252), | ||
| 1105 | .driver_info = (kernel_ulong_t)&net_intf1_blacklist }, | ||
| 1106 | { USB_DEVICE(CMOTECH_VENDOR_ID, CMOTECH_PRODUCT_7253), | ||
| 1107 | .driver_info = (kernel_ulong_t)&net_intf1_blacklist }, | ||
| 1040 | { USB_DEVICE(TELIT_VENDOR_ID, TELIT_PRODUCT_UC864E) }, | 1108 | { USB_DEVICE(TELIT_VENDOR_ID, TELIT_PRODUCT_UC864E) }, |
| 1041 | { USB_DEVICE(TELIT_VENDOR_ID, TELIT_PRODUCT_UC864G) }, | 1109 | { USB_DEVICE(TELIT_VENDOR_ID, TELIT_PRODUCT_UC864G) }, |
| 1042 | { USB_DEVICE(TELIT_VENDOR_ID, TELIT_PRODUCT_CC864_DUAL) }, | 1110 | { USB_DEVICE(TELIT_VENDOR_ID, TELIT_PRODUCT_CC864_DUAL) }, |
| @@ -1500,6 +1568,8 @@ static const struct usb_device_id option_ids[] = { | |||
| 1500 | .driver_info = (kernel_ulong_t)&net_intf5_blacklist }, | 1568 | .driver_info = (kernel_ulong_t)&net_intf5_blacklist }, |
| 1501 | { USB_DEVICE(ALCATEL_VENDOR_ID, ALCATEL_PRODUCT_L100V), | 1569 | { USB_DEVICE(ALCATEL_VENDOR_ID, ALCATEL_PRODUCT_L100V), |
| 1502 | .driver_info = (kernel_ulong_t)&net_intf4_blacklist }, | 1570 | .driver_info = (kernel_ulong_t)&net_intf4_blacklist }, |
| 1571 | { USB_DEVICE(ALCATEL_VENDOR_ID, ALCATEL_PRODUCT_L800MA), | ||
| 1572 | .driver_info = (kernel_ulong_t)&net_intf2_blacklist }, | ||
| 1503 | { USB_DEVICE(AIRPLUS_VENDOR_ID, AIRPLUS_PRODUCT_MCD650) }, | 1573 | { USB_DEVICE(AIRPLUS_VENDOR_ID, AIRPLUS_PRODUCT_MCD650) }, |
| 1504 | { USB_DEVICE(TLAYTECH_VENDOR_ID, TLAYTECH_PRODUCT_TEU800) }, | 1574 | { USB_DEVICE(TLAYTECH_VENDOR_ID, TLAYTECH_PRODUCT_TEU800) }, |
| 1505 | { USB_DEVICE(LONGCHEER_VENDOR_ID, FOUR_G_SYSTEMS_PRODUCT_W14), | 1575 | { USB_DEVICE(LONGCHEER_VENDOR_ID, FOUR_G_SYSTEMS_PRODUCT_W14), |
| @@ -1545,6 +1615,9 @@ static const struct usb_device_id option_ids[] = { | |||
| 1545 | { USB_DEVICE(OLIVETTI_VENDOR_ID, OLIVETTI_PRODUCT_OLICARD200), | 1615 | { USB_DEVICE(OLIVETTI_VENDOR_ID, OLIVETTI_PRODUCT_OLICARD200), |
| 1546 | .driver_info = (kernel_ulong_t)&net_intf6_blacklist | 1616 | .driver_info = (kernel_ulong_t)&net_intf6_blacklist |
| 1547 | }, | 1617 | }, |
| 1618 | { USB_DEVICE(OLIVETTI_VENDOR_ID, OLIVETTI_PRODUCT_OLICARD500), | ||
| 1619 | .driver_info = (kernel_ulong_t)&net_intf4_blacklist | ||
| 1620 | }, | ||
| 1548 | { USB_DEVICE(CELOT_VENDOR_ID, CELOT_PRODUCT_CT680M) }, /* CT-650 CDMA 450 1xEVDO modem */ | 1621 | { USB_DEVICE(CELOT_VENDOR_ID, CELOT_PRODUCT_CT680M) }, /* CT-650 CDMA 450 1xEVDO modem */ |
| 1549 | { USB_DEVICE_AND_INTERFACE_INFO(SAMSUNG_VENDOR_ID, SAMSUNG_PRODUCT_GT_B3730, USB_CLASS_CDC_DATA, 0x00, 0x00) }, /* Samsung GT-B3730 LTE USB modem.*/ | 1622 | { USB_DEVICE_AND_INTERFACE_INFO(SAMSUNG_VENDOR_ID, SAMSUNG_PRODUCT_GT_B3730, USB_CLASS_CDC_DATA, 0x00, 0x00) }, /* Samsung GT-B3730 LTE USB modem.*/ |
| 1550 | { USB_DEVICE(YUGA_VENDOR_ID, YUGA_PRODUCT_CEM600) }, | 1623 | { USB_DEVICE(YUGA_VENDOR_ID, YUGA_PRODUCT_CEM600) }, |
diff --git a/drivers/usb/serial/qcserial.c b/drivers/usb/serial/qcserial.c index 968a40201e5f..7ed681a714a5 100644 --- a/drivers/usb/serial/qcserial.c +++ b/drivers/usb/serial/qcserial.c | |||
| @@ -136,9 +136,18 @@ static const struct usb_device_id id_table[] = { | |||
| 136 | {USB_DEVICE_INTERFACE_NUMBER(0x1199, 0x68a2, 0)}, /* Sierra Wireless MC7710 Device Management */ | 136 | {USB_DEVICE_INTERFACE_NUMBER(0x1199, 0x68a2, 0)}, /* Sierra Wireless MC7710 Device Management */ |
| 137 | {USB_DEVICE_INTERFACE_NUMBER(0x1199, 0x68a2, 2)}, /* Sierra Wireless MC7710 NMEA */ | 137 | {USB_DEVICE_INTERFACE_NUMBER(0x1199, 0x68a2, 2)}, /* Sierra Wireless MC7710 NMEA */ |
| 138 | {USB_DEVICE_INTERFACE_NUMBER(0x1199, 0x68a2, 3)}, /* Sierra Wireless MC7710 Modem */ | 138 | {USB_DEVICE_INTERFACE_NUMBER(0x1199, 0x68a2, 3)}, /* Sierra Wireless MC7710 Modem */ |
| 139 | {USB_DEVICE_INTERFACE_NUMBER(0x1199, 0x68c0, 0)}, /* Sierra Wireless MC73xx Device Management */ | ||
| 140 | {USB_DEVICE_INTERFACE_NUMBER(0x1199, 0x68c0, 2)}, /* Sierra Wireless MC73xx NMEA */ | ||
| 141 | {USB_DEVICE_INTERFACE_NUMBER(0x1199, 0x68c0, 3)}, /* Sierra Wireless MC73xx Modem */ | ||
| 139 | {USB_DEVICE_INTERFACE_NUMBER(0x1199, 0x901c, 0)}, /* Sierra Wireless EM7700 Device Management */ | 142 | {USB_DEVICE_INTERFACE_NUMBER(0x1199, 0x901c, 0)}, /* Sierra Wireless EM7700 Device Management */ |
| 140 | {USB_DEVICE_INTERFACE_NUMBER(0x1199, 0x901c, 2)}, /* Sierra Wireless EM7700 NMEA */ | 143 | {USB_DEVICE_INTERFACE_NUMBER(0x1199, 0x901c, 2)}, /* Sierra Wireless EM7700 NMEA */ |
| 141 | {USB_DEVICE_INTERFACE_NUMBER(0x1199, 0x901c, 3)}, /* Sierra Wireless EM7700 Modem */ | 144 | {USB_DEVICE_INTERFACE_NUMBER(0x1199, 0x901c, 3)}, /* Sierra Wireless EM7700 Modem */ |
| 145 | {USB_DEVICE_INTERFACE_NUMBER(0x1199, 0x901f, 0)}, /* Sierra Wireless EM7355 Device Management */ | ||
| 146 | {USB_DEVICE_INTERFACE_NUMBER(0x1199, 0x901f, 2)}, /* Sierra Wireless EM7355 NMEA */ | ||
| 147 | {USB_DEVICE_INTERFACE_NUMBER(0x1199, 0x901f, 3)}, /* Sierra Wireless EM7355 Modem */ | ||
| 148 | {USB_DEVICE_INTERFACE_NUMBER(0x1199, 0x9041, 0)}, /* Sierra Wireless MC7305/MC7355 Device Management */ | ||
| 149 | {USB_DEVICE_INTERFACE_NUMBER(0x1199, 0x9041, 2)}, /* Sierra Wireless MC7305/MC7355 NMEA */ | ||
| 150 | {USB_DEVICE_INTERFACE_NUMBER(0x1199, 0x9041, 3)}, /* Sierra Wireless MC7305/MC7355 Modem */ | ||
| 142 | {USB_DEVICE_INTERFACE_NUMBER(0x1199, 0x9051, 0)}, /* Netgear AirCard 340U Device Management */ | 151 | {USB_DEVICE_INTERFACE_NUMBER(0x1199, 0x9051, 0)}, /* Netgear AirCard 340U Device Management */ |
| 143 | {USB_DEVICE_INTERFACE_NUMBER(0x1199, 0x9051, 2)}, /* Netgear AirCard 340U NMEA */ | 152 | {USB_DEVICE_INTERFACE_NUMBER(0x1199, 0x9051, 2)}, /* Netgear AirCard 340U NMEA */ |
| 144 | {USB_DEVICE_INTERFACE_NUMBER(0x1199, 0x9051, 3)}, /* Netgear AirCard 340U Modem */ | 153 | {USB_DEVICE_INTERFACE_NUMBER(0x1199, 0x9051, 3)}, /* Netgear AirCard 340U Modem */ |
diff --git a/drivers/usb/serial/usb-serial.c b/drivers/usb/serial/usb-serial.c index 81fc0dfcfdcf..6d40d56378d7 100644 --- a/drivers/usb/serial/usb-serial.c +++ b/drivers/usb/serial/usb-serial.c | |||
| @@ -1347,10 +1347,12 @@ static int usb_serial_register(struct usb_serial_driver *driver) | |||
| 1347 | static void usb_serial_deregister(struct usb_serial_driver *device) | 1347 | static void usb_serial_deregister(struct usb_serial_driver *device) |
| 1348 | { | 1348 | { |
| 1349 | pr_info("USB Serial deregistering driver %s\n", device->description); | 1349 | pr_info("USB Serial deregistering driver %s\n", device->description); |
| 1350 | |||
| 1350 | mutex_lock(&table_lock); | 1351 | mutex_lock(&table_lock); |
| 1351 | list_del(&device->driver_list); | 1352 | list_del(&device->driver_list); |
| 1352 | usb_serial_bus_deregister(device); | ||
| 1353 | mutex_unlock(&table_lock); | 1353 | mutex_unlock(&table_lock); |
| 1354 | |||
| 1355 | usb_serial_bus_deregister(device); | ||
| 1354 | } | 1356 | } |
| 1355 | 1357 | ||
| 1356 | /** | 1358 | /** |
diff --git a/drivers/usb/wusbcore/mmc.c b/drivers/usb/wusbcore/mmc.c index 44741267c917..3f485df96226 100644 --- a/drivers/usb/wusbcore/mmc.c +++ b/drivers/usb/wusbcore/mmc.c | |||
| @@ -301,7 +301,7 @@ int wusbhc_chid_set(struct wusbhc *wusbhc, const struct wusb_ckhdid *chid) | |||
| 301 | 301 | ||
| 302 | if (chid) | 302 | if (chid) |
| 303 | result = uwb_radio_start(&wusbhc->pal); | 303 | result = uwb_radio_start(&wusbhc->pal); |
| 304 | else | 304 | else if (wusbhc->uwb_rc) |
| 305 | uwb_radio_stop(&wusbhc->pal); | 305 | uwb_radio_stop(&wusbhc->pal); |
| 306 | 306 | ||
| 307 | return result; | 307 | return result; |
diff --git a/drivers/usb/wusbcore/wa-xfer.c b/drivers/usb/wusbcore/wa-xfer.c index c8e2a47d62a7..3e2e4ed20157 100644 --- a/drivers/usb/wusbcore/wa-xfer.c +++ b/drivers/usb/wusbcore/wa-xfer.c | |||
| @@ -2390,10 +2390,10 @@ error_complete: | |||
| 2390 | done) { | 2390 | done) { |
| 2391 | 2391 | ||
| 2392 | dev_info(dev, "Control EP stall. Queue delayed work.\n"); | 2392 | dev_info(dev, "Control EP stall. Queue delayed work.\n"); |
| 2393 | spin_lock_irq(&wa->xfer_list_lock); | 2393 | spin_lock(&wa->xfer_list_lock); |
| 2394 | /* move xfer from xfer_list to xfer_errored_list. */ | 2394 | /* move xfer from xfer_list to xfer_errored_list. */ |
| 2395 | list_move_tail(&xfer->list_node, &wa->xfer_errored_list); | 2395 | list_move_tail(&xfer->list_node, &wa->xfer_errored_list); |
| 2396 | spin_unlock_irq(&wa->xfer_list_lock); | 2396 | spin_unlock(&wa->xfer_list_lock); |
| 2397 | spin_unlock_irqrestore(&xfer->lock, flags); | 2397 | spin_unlock_irqrestore(&xfer->lock, flags); |
| 2398 | queue_work(wusbd, &wa->xfer_error_work); | 2398 | queue_work(wusbd, &wa->xfer_error_work); |
| 2399 | } else { | 2399 | } else { |
diff --git a/drivers/uwb/drp.c b/drivers/uwb/drp.c index 1a2fd9795367..468c89fb6a16 100644 --- a/drivers/uwb/drp.c +++ b/drivers/uwb/drp.c | |||
| @@ -59,6 +59,7 @@ static void uwb_rc_set_drp_cmd_done(struct uwb_rc *rc, void *arg, | |||
| 59 | struct uwb_rceb *reply, ssize_t reply_size) | 59 | struct uwb_rceb *reply, ssize_t reply_size) |
| 60 | { | 60 | { |
| 61 | struct uwb_rc_evt_set_drp_ie *r = (struct uwb_rc_evt_set_drp_ie *)reply; | 61 | struct uwb_rc_evt_set_drp_ie *r = (struct uwb_rc_evt_set_drp_ie *)reply; |
| 62 | unsigned long flags; | ||
| 62 | 63 | ||
| 63 | if (r != NULL) { | 64 | if (r != NULL) { |
| 64 | if (r->bResultCode != UWB_RC_RES_SUCCESS) | 65 | if (r->bResultCode != UWB_RC_RES_SUCCESS) |
| @@ -67,14 +68,14 @@ static void uwb_rc_set_drp_cmd_done(struct uwb_rc *rc, void *arg, | |||
| 67 | } else | 68 | } else |
| 68 | dev_err(&rc->uwb_dev.dev, "SET-DRP-IE: timeout\n"); | 69 | dev_err(&rc->uwb_dev.dev, "SET-DRP-IE: timeout\n"); |
| 69 | 70 | ||
| 70 | spin_lock_irq(&rc->rsvs_lock); | 71 | spin_lock_irqsave(&rc->rsvs_lock, flags); |
| 71 | if (rc->set_drp_ie_pending > 1) { | 72 | if (rc->set_drp_ie_pending > 1) { |
| 72 | rc->set_drp_ie_pending = 0; | 73 | rc->set_drp_ie_pending = 0; |
| 73 | uwb_rsv_queue_update(rc); | 74 | uwb_rsv_queue_update(rc); |
| 74 | } else { | 75 | } else { |
| 75 | rc->set_drp_ie_pending = 0; | 76 | rc->set_drp_ie_pending = 0; |
| 76 | } | 77 | } |
| 77 | spin_unlock_irq(&rc->rsvs_lock); | 78 | spin_unlock_irqrestore(&rc->rsvs_lock, flags); |
| 78 | } | 79 | } |
| 79 | 80 | ||
| 80 | /** | 81 | /** |
diff --git a/include/linux/phy/phy.h b/include/linux/phy/phy.h index e2f5ca96cddc..2760744cb2a7 100644 --- a/include/linux/phy/phy.h +++ b/include/linux/phy/phy.h | |||
| @@ -174,21 +174,29 @@ void devm_of_phy_provider_unregister(struct device *dev, | |||
| 174 | #else | 174 | #else |
| 175 | static inline int phy_pm_runtime_get(struct phy *phy) | 175 | static inline int phy_pm_runtime_get(struct phy *phy) |
| 176 | { | 176 | { |
| 177 | if (!phy) | ||
| 178 | return 0; | ||
| 177 | return -ENOSYS; | 179 | return -ENOSYS; |
| 178 | } | 180 | } |
| 179 | 181 | ||
| 180 | static inline int phy_pm_runtime_get_sync(struct phy *phy) | 182 | static inline int phy_pm_runtime_get_sync(struct phy *phy) |
| 181 | { | 183 | { |
| 184 | if (!phy) | ||
| 185 | return 0; | ||
| 182 | return -ENOSYS; | 186 | return -ENOSYS; |
| 183 | } | 187 | } |
| 184 | 188 | ||
| 185 | static inline int phy_pm_runtime_put(struct phy *phy) | 189 | static inline int phy_pm_runtime_put(struct phy *phy) |
| 186 | { | 190 | { |
| 191 | if (!phy) | ||
| 192 | return 0; | ||
| 187 | return -ENOSYS; | 193 | return -ENOSYS; |
| 188 | } | 194 | } |
| 189 | 195 | ||
| 190 | static inline int phy_pm_runtime_put_sync(struct phy *phy) | 196 | static inline int phy_pm_runtime_put_sync(struct phy *phy) |
| 191 | { | 197 | { |
| 198 | if (!phy) | ||
| 199 | return 0; | ||
| 192 | return -ENOSYS; | 200 | return -ENOSYS; |
| 193 | } | 201 | } |
| 194 | 202 | ||
| @@ -204,21 +212,29 @@ static inline void phy_pm_runtime_forbid(struct phy *phy) | |||
| 204 | 212 | ||
| 205 | static inline int phy_init(struct phy *phy) | 213 | static inline int phy_init(struct phy *phy) |
| 206 | { | 214 | { |
| 215 | if (!phy) | ||
| 216 | return 0; | ||
| 207 | return -ENOSYS; | 217 | return -ENOSYS; |
| 208 | } | 218 | } |
| 209 | 219 | ||
| 210 | static inline int phy_exit(struct phy *phy) | 220 | static inline int phy_exit(struct phy *phy) |
| 211 | { | 221 | { |
| 222 | if (!phy) | ||
| 223 | return 0; | ||
| 212 | return -ENOSYS; | 224 | return -ENOSYS; |
| 213 | } | 225 | } |
| 214 | 226 | ||
| 215 | static inline int phy_power_on(struct phy *phy) | 227 | static inline int phy_power_on(struct phy *phy) |
| 216 | { | 228 | { |
| 229 | if (!phy) | ||
| 230 | return 0; | ||
| 217 | return -ENOSYS; | 231 | return -ENOSYS; |
| 218 | } | 232 | } |
| 219 | 233 | ||
| 220 | static inline int phy_power_off(struct phy *phy) | 234 | static inline int phy_power_off(struct phy *phy) |
| 221 | { | 235 | { |
| 236 | if (!phy) | ||
| 237 | return 0; | ||
| 222 | return -ENOSYS; | 238 | return -ENOSYS; |
| 223 | } | 239 | } |
| 224 | 240 | ||
