Skip to content

Commit

Permalink
Merge tag 'usb-3.15-rc3' of git://git.kernel.org/pub/scm/linux/kernel…
Browse files Browse the repository at this point in the history
…/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
  ...
  • Loading branch information
torvalds committed Apr 27, 2014
2 parents e9dba83 + 34f972d commit fefb827
Show file tree
Hide file tree
Showing 29 changed files with 304 additions and 162 deletions.
1 change: 1 addition & 0 deletions drivers/phy/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ config PHY_MVEBU_SATA

config OMAP_CONTROL_PHY
tristate "OMAP CONTROL PHY Driver"
depends on ARCH_OMAP2PLUS || COMPILE_TEST
help
Enable this to add support for the PHY part present in the control
module. This driver has API to power on the USB2 PHY and to write to
Expand Down
9 changes: 5 additions & 4 deletions drivers/phy/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,9 @@ obj-$(CONFIG_TI_PIPE3) += phy-ti-pipe3.o
obj-$(CONFIG_TWL4030_USB) += phy-twl4030-usb.o
obj-$(CONFIG_PHY_EXYNOS5250_SATA) += phy-exynos5250-sata.o
obj-$(CONFIG_PHY_SUN4I_USB) += phy-sun4i-usb.o
obj-$(CONFIG_PHY_SAMSUNG_USB2) += phy-samsung-usb2.o
obj-$(CONFIG_PHY_EXYNOS4210_USB2) += phy-exynos4210-usb2.o
obj-$(CONFIG_PHY_EXYNOS4X12_USB2) += phy-exynos4x12-usb2.o
obj-$(CONFIG_PHY_EXYNOS5250_USB2) += phy-exynos5250-usb2.o
obj-$(CONFIG_PHY_SAMSUNG_USB2) += phy-exynos-usb2.o
phy-exynos-usb2-y += phy-samsung-usb2.o
phy-exynos-usb2-$(CONFIG_PHY_EXYNOS4210_USB2) += phy-exynos4210-usb2.o
phy-exynos-usb2-$(CONFIG_PHY_EXYNOS4X12_USB2) += phy-exynos4x12-usb2.o
phy-exynos-usb2-$(CONFIG_PHY_EXYNOS5250_USB2) += phy-exynos5250-usb2.o
obj-$(CONFIG_PHY_XGENE) += phy-xgene.o
3 changes: 3 additions & 0 deletions drivers/phy/phy-core.c
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,9 @@ static struct phy *phy_lookup(struct device *device, const char *port)
class_dev_iter_init(&iter, phy_class, NULL, NULL);
while ((dev = class_dev_iter_next(&iter))) {
phy = to_phy(dev);

if (!phy->init_data)
continue;
count = phy->init_data->num_consumers;
consumers = phy->init_data->consumers;
while (count--) {
Expand Down
37 changes: 34 additions & 3 deletions drivers/usb/chipidea/core.c
Original file line number Diff line number Diff line change
Expand Up @@ -276,6 +276,39 @@ static void hw_phymode_configure(struct ci_hdrc *ci)
}
}

/**
* ci_usb_phy_init: initialize phy according to different phy type
* @ci: the controller
*
* This function returns an error code if usb_phy_init has failed
*/
static int ci_usb_phy_init(struct ci_hdrc *ci)
{
int ret;

switch (ci->platdata->phy_mode) {
case USBPHY_INTERFACE_MODE_UTMI:
case USBPHY_INTERFACE_MODE_UTMIW:
case USBPHY_INTERFACE_MODE_HSIC:
ret = usb_phy_init(ci->transceiver);
if (ret)
return ret;
hw_phymode_configure(ci);
break;
case USBPHY_INTERFACE_MODE_ULPI:
case USBPHY_INTERFACE_MODE_SERIAL:
hw_phymode_configure(ci);
ret = usb_phy_init(ci->transceiver);
if (ret)
return ret;
break;
default:
ret = usb_phy_init(ci->transceiver);
}

return ret;
}

/**
* hw_device_reset: resets chip (execute without interruption)
* @ci: the controller
Expand Down Expand Up @@ -543,8 +576,6 @@ static int ci_hdrc_probe(struct platform_device *pdev)
return -ENODEV;
}

hw_phymode_configure(ci);

if (ci->platdata->phy)
ci->transceiver = ci->platdata->phy;
else
Expand All @@ -564,7 +595,7 @@ static int ci_hdrc_probe(struct platform_device *pdev)
return -EPROBE_DEFER;
}

ret = usb_phy_init(ci->transceiver);
ret = ci_usb_phy_init(ci);
if (ret) {
dev_err(dev, "unable to init phy: %d\n", ret);
return ret;
Expand Down
2 changes: 1 addition & 1 deletion drivers/usb/dwc3/core.c
Original file line number Diff line number Diff line change
Expand Up @@ -821,14 +821,14 @@ static void dwc3_complete(struct device *dev)

spin_lock_irqsave(&dwc->lock, flags);

dwc3_event_buffers_setup(dwc);
switch (dwc->dr_mode) {
case USB_DR_MODE_PERIPHERAL:
case USB_DR_MODE_OTG:
dwc3_gadget_complete(dwc);
/* FALLTHROUGH */
case USB_DR_MODE_HOST:
default:
dwc3_event_buffers_setup(dwc);
break;
}

Expand Down
12 changes: 4 additions & 8 deletions drivers/usb/dwc3/gadget.c
Original file line number Diff line number Diff line change
Expand Up @@ -187,15 +187,12 @@ int dwc3_gadget_resize_tx_fifos(struct dwc3 *dwc)
* improve this algorithm so that we better use the internal
* FIFO space
*/
for (num = 0; num < DWC3_ENDPOINTS_NUM; num++) {
struct dwc3_ep *dep = dwc->eps[num];
int fifo_number = dep->number >> 1;
for (num = 0; num < dwc->num_in_eps; num++) {
/* bit0 indicates direction; 1 means IN ep */
struct dwc3_ep *dep = dwc->eps[(num << 1) | 1];
int mult = 1;
int tmp;

if (!(dep->number & 1))
continue;

if (!(dep->flags & DWC3_EP_ENABLED))
continue;

Expand Down Expand Up @@ -224,8 +221,7 @@ int dwc3_gadget_resize_tx_fifos(struct dwc3 *dwc)
dev_vdbg(dwc->dev, "%s: Fifo Addr %04x Size %d\n",
dep->name, last_fifo_depth, fifo_size & 0xffff);

dwc3_writel(dwc->regs, DWC3_GTXFIFOSIZ(fifo_number),
fifo_size);
dwc3_writel(dwc->regs, DWC3_GTXFIFOSIZ(num), fifo_size);

last_fifo_depth += (fifo_size & 0xffff);
}
Expand Down
7 changes: 7 additions & 0 deletions drivers/usb/gadget/f_fs.c
Original file line number Diff line number Diff line change
Expand Up @@ -745,13 +745,20 @@ static ssize_t ffs_epfile_io(struct file *file, struct ffs_io_data *io_data)
*/
struct usb_gadget *gadget = epfile->ffs->gadget;

spin_lock_irq(&epfile->ffs->eps_lock);
/* In the meantime, endpoint got disabled or changed. */
if (epfile->ep != ep) {
spin_unlock_irq(&epfile->ffs->eps_lock);
return -ESHUTDOWN;
}
/*
* Controller may require buffer size to be aligned to
* maxpacketsize of an out endpoint.
*/
data_len = io_data->read ?
usb_ep_align_maybe(gadget, ep->ep, io_data->len) :
io_data->len;
spin_unlock_irq(&epfile->ffs->eps_lock);

data = kmalloc(data_len, GFP_KERNEL);
if (unlikely(!data))
Expand Down
2 changes: 1 addition & 1 deletion drivers/usb/gadget/f_rndis.c
Original file line number Diff line number Diff line change
Expand Up @@ -377,7 +377,7 @@ static struct sk_buff *rndis_add_header(struct gether *port,
if (skb2)
rndis_add_hdr(skb2);

dev_kfree_skb_any(skb);
dev_kfree_skb(skb);
return skb2;
}

Expand Down
6 changes: 5 additions & 1 deletion drivers/usb/gadget/fsl_udc_core.c
Original file line number Diff line number Diff line change
Expand Up @@ -1219,6 +1219,10 @@ static int fsl_pullup(struct usb_gadget *gadget, int is_on)
struct fsl_udc *udc;

udc = container_of(gadget, struct fsl_udc, gadget);

if (!udc->vbus_active)
return -EOPNOTSUPP;

udc->softconnect = (is_on != 0);
if (can_pullup(udc))
fsl_writel((fsl_readl(&dr_regs->usbcmd) | USB_CMD_RUN_STOP),
Expand Down Expand Up @@ -2532,8 +2536,8 @@ static int __exit fsl_udc_remove(struct platform_device *pdev)
if (!udc_controller)
return -ENODEV;

usb_del_gadget_udc(&udc_controller->gadget);
udc_controller->done = &done;
usb_del_gadget_udc(&udc_controller->gadget);

fsl_udc_clk_release();

Expand Down
1 change: 1 addition & 0 deletions drivers/usb/gadget/inode.c
Original file line number Diff line number Diff line change
Expand Up @@ -2043,6 +2043,7 @@ gadgetfs_fill_super (struct super_block *sb, void *opts, int silent)
return -ESRCH;

/* fake probe to determine $CHIP */
CHIP = NULL;
usb_gadget_probe_driver(&probe_driver);
if (!CHIP)
return -ENODEV;
Expand Down
1 change: 1 addition & 0 deletions drivers/usb/gadget/rndis.c
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
#include <asm/byteorder.h>
#include <asm/unaligned.h>

#include "u_rndis.h"

#undef VERBOSE_DEBUG

Expand Down
Loading

0 comments on commit fefb827

Please sign in to comment.