Commit 034a0f6b authored by Linus Torvalds's avatar Linus Torvalds

Merge tag 'usb-3.16-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb

Pull USB bugfixes from Greg KH:
 "Here's a round of USB bugfixes, quirk additions, and new device ids
  for 3.16-rc4.  Nothing major in here at all, just a bunch of tiny
  changes.  All have been in linux-next with no reported issues"

* tag 'usb-3.16-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb: (33 commits)
  usb: chipidea: udc: delete td from req's td list at ep_dequeue
  usb: Kconfig: make EHCI_MSM selectable for QCOM SOCs
  usb-storage/SCSI: Add broken_fua blacklist flag
  usb: musb: dsps: fix the base address for accessing the mode register
  tools: ffs-test: fix header values endianess
  usb: phy: msm: Do not do runtime pm if the phy is not idle
  usb: musb: Ensure that cppi41 timer gets armed on premature DMA TX irq
  usb: gadget: gr_udc: Fix check for invalid number of microframes
  usb: musb: Fix panic upon musb_am335x module removal
  usb: gadget: f_fs: resurect usb_functionfs_descs_head structure
  Revert "tools: ffs-test: convert to new descriptor format fixing compilation error"
  xhci: Fix runtime suspended xhci from blocking system suspend.
  xhci: clear root port wake on bits if controller isn't wake-up capable
  xhci: correct burst count field for isoc transfers on 1.0 xhci hosts
  xhci: Use correct SLOT ID when handling a reset device command
  MAINTAINERS: update e-mail address
  usb: option: add/modify Olivetti Olicard modems
  USB: ftdi_sio: fix null deref at port probe
  MAINTAINERS: drop two usb-serial subdriver entries
  USB: option: add device ID for SpeedUp SU9800 usb 3g modem
  ...
parents 9911f2e1 e4adcff0
...@@ -9406,12 +9406,6 @@ S: Maintained ...@@ -9406,12 +9406,6 @@ S: Maintained
F: drivers/usb/host/isp116x* F: drivers/usb/host/isp116x*
F: include/linux/usb/isp116x.h F: include/linux/usb/isp116x.h
USB KAWASAKI LSI DRIVER
M: Oliver Neukum <oliver@neukum.org>
L: linux-usb@vger.kernel.org
S: Maintained
F: drivers/usb/serial/kl5kusb105.*
USB MASS STORAGE DRIVER USB MASS STORAGE DRIVER
M: Matthew Dharm <mdharm-usb@one-eyed-alien.net> M: Matthew Dharm <mdharm-usb@one-eyed-alien.net>
L: linux-usb@vger.kernel.org L: linux-usb@vger.kernel.org
...@@ -9439,12 +9433,6 @@ S: Maintained ...@@ -9439,12 +9433,6 @@ S: Maintained
F: Documentation/usb/ohci.txt F: Documentation/usb/ohci.txt
F: drivers/usb/host/ohci* F: drivers/usb/host/ohci*
USB OPTION-CARD DRIVER
M: Matthias Urlichs <smurf@smurf.noris.de>
L: linux-usb@vger.kernel.org
S: Maintained
F: drivers/usb/serial/option.c
USB PEGASUS DRIVER USB PEGASUS DRIVER
M: Petko Manolov <petkan@nucleusys.com> M: Petko Manolov <petkan@nucleusys.com>
L: linux-usb@vger.kernel.org L: linux-usb@vger.kernel.org
...@@ -9477,7 +9465,7 @@ S: Maintained ...@@ -9477,7 +9465,7 @@ S: Maintained
F: drivers/net/usb/rtl8150.c F: drivers/net/usb/rtl8150.c
USB SERIAL SUBSYSTEM USB SERIAL SUBSYSTEM
M: Johan Hovold <jhovold@gmail.com> M: Johan Hovold <johan@kernel.org>
L: linux-usb@vger.kernel.org L: linux-usb@vger.kernel.org
S: Maintained S: Maintained
F: Documentation/usb/usb-serial.txt F: Documentation/usb/usb-serial.txt
......
...@@ -2441,7 +2441,10 @@ sd_read_cache_type(struct scsi_disk *sdkp, unsigned char *buffer) ...@@ -2441,7 +2441,10 @@ sd_read_cache_type(struct scsi_disk *sdkp, unsigned char *buffer)
} }
sdkp->DPOFUA = (data.device_specific & 0x10) != 0; sdkp->DPOFUA = (data.device_specific & 0x10) != 0;
if (sdkp->DPOFUA && !sdkp->device->use_10_for_rw) { if (sdp->broken_fua) {
sd_first_printk(KERN_NOTICE, sdkp, "Disabling FUA\n");
sdkp->DPOFUA = 0;
} else if (sdkp->DPOFUA && !sdkp->device->use_10_for_rw) {
sd_first_printk(KERN_NOTICE, sdkp, sd_first_printk(KERN_NOTICE, sdkp,
"Uses READ/WRITE(6), disabling FUA\n"); "Uses READ/WRITE(6), disabling FUA\n");
sdkp->DPOFUA = 0; sdkp->DPOFUA = 0;
......
...@@ -1321,6 +1321,7 @@ static int ep_dequeue(struct usb_ep *ep, struct usb_request *req) ...@@ -1321,6 +1321,7 @@ static int ep_dequeue(struct usb_ep *ep, struct usb_request *req)
struct ci_hw_ep *hwep = container_of(ep, struct ci_hw_ep, ep); struct ci_hw_ep *hwep = container_of(ep, struct ci_hw_ep, ep);
struct ci_hw_req *hwreq = container_of(req, struct ci_hw_req, req); struct ci_hw_req *hwreq = container_of(req, struct ci_hw_req, req);
unsigned long flags; unsigned long flags;
struct td_node *node, *tmpnode;
if (ep == NULL || req == NULL || hwreq->req.status != -EALREADY || if (ep == NULL || req == NULL || hwreq->req.status != -EALREADY ||
hwep->ep.desc == NULL || list_empty(&hwreq->queue) || hwep->ep.desc == NULL || list_empty(&hwreq->queue) ||
...@@ -1331,6 +1332,12 @@ static int ep_dequeue(struct usb_ep *ep, struct usb_request *req) ...@@ -1331,6 +1332,12 @@ static int ep_dequeue(struct usb_ep *ep, struct usb_request *req)
hw_ep_flush(hwep->ci, hwep->num, hwep->dir); hw_ep_flush(hwep->ci, hwep->num, hwep->dir);
list_for_each_entry_safe(node, tmpnode, &hwreq->tds, td) {
dma_pool_free(hwep->td_pool, node->ptr, node->dma);
list_del(&node->td);
kfree(node);
}
/* pop request */ /* pop request */
list_del_init(&hwreq->queue); list_del_init(&hwreq->queue);
......
...@@ -45,6 +45,7 @@ comment "Platform Glue Driver Support" ...@@ -45,6 +45,7 @@ comment "Platform Glue Driver Support"
config USB_DWC3_OMAP config USB_DWC3_OMAP
tristate "Texas Instruments OMAP5 and similar Platforms" tristate "Texas Instruments OMAP5 and similar Platforms"
depends on EXTCON && (ARCH_OMAP2PLUS || COMPILE_TEST) depends on EXTCON && (ARCH_OMAP2PLUS || COMPILE_TEST)
depends on OF
default USB_DWC3 default USB_DWC3
help help
Some platforms from Texas Instruments like OMAP5, DRA7xxx and Some platforms from Texas Instruments like OMAP5, DRA7xxx and
......
...@@ -322,7 +322,7 @@ static int dwc3_omap_remove_core(struct device *dev, void *c) ...@@ -322,7 +322,7 @@ static int dwc3_omap_remove_core(struct device *dev, void *c)
{ {
struct platform_device *pdev = to_platform_device(dev); struct platform_device *pdev = to_platform_device(dev);
platform_device_unregister(pdev); of_device_unregister(pdev);
return 0; return 0;
} }
...@@ -599,7 +599,7 @@ static int dwc3_omap_prepare(struct device *dev) ...@@ -599,7 +599,7 @@ static int dwc3_omap_prepare(struct device *dev)
{ {
struct dwc3_omap *omap = dev_get_drvdata(dev); struct dwc3_omap *omap = dev_get_drvdata(dev);
dwc3_omap_disable_irqs(omap); dwc3_omap_write_irqmisc_set(omap, 0x00);
return 0; return 0;
} }
...@@ -607,8 +607,19 @@ static int dwc3_omap_prepare(struct device *dev) ...@@ -607,8 +607,19 @@ static int dwc3_omap_prepare(struct device *dev)
static void dwc3_omap_complete(struct device *dev) static void dwc3_omap_complete(struct device *dev)
{ {
struct dwc3_omap *omap = dev_get_drvdata(dev); struct dwc3_omap *omap = dev_get_drvdata(dev);
u32 reg;
dwc3_omap_enable_irqs(omap); reg = (USBOTGSS_IRQMISC_OEVT |
USBOTGSS_IRQMISC_DRVVBUS_RISE |
USBOTGSS_IRQMISC_CHRGVBUS_RISE |
USBOTGSS_IRQMISC_DISCHRGVBUS_RISE |
USBOTGSS_IRQMISC_IDPULLUP_RISE |
USBOTGSS_IRQMISC_DRVVBUS_FALL |
USBOTGSS_IRQMISC_CHRGVBUS_FALL |
USBOTGSS_IRQMISC_DISCHRGVBUS_FALL |
USBOTGSS_IRQMISC_IDPULLUP_FALL);
dwc3_omap_write_irqmisc_set(omap, reg);
} }
static int dwc3_omap_suspend(struct device *dev) static int dwc3_omap_suspend(struct device *dev)
......
...@@ -828,10 +828,6 @@ static void dwc3_prepare_one_trb(struct dwc3_ep *dep, ...@@ -828,10 +828,6 @@ static void dwc3_prepare_one_trb(struct dwc3_ep *dep,
length, last ? " last" : "", length, last ? " last" : "",
chain ? " chain" : ""); chain ? " chain" : "");
/* Skip the LINK-TRB on ISOC */
if (((dep->free_slot & DWC3_TRB_MASK) == DWC3_TRB_NUM - 1) &&
usb_endpoint_xfer_isoc(dep->endpoint.desc))
dep->free_slot++;
trb = &dep->trb_pool[dep->free_slot & DWC3_TRB_MASK]; trb = &dep->trb_pool[dep->free_slot & DWC3_TRB_MASK];
...@@ -843,6 +839,10 @@ static void dwc3_prepare_one_trb(struct dwc3_ep *dep, ...@@ -843,6 +839,10 @@ static void dwc3_prepare_one_trb(struct dwc3_ep *dep,
} }
dep->free_slot++; dep->free_slot++;
/* Skip the LINK-TRB on ISOC */
if (((dep->free_slot & DWC3_TRB_MASK) == DWC3_TRB_NUM - 1) &&
usb_endpoint_xfer_isoc(dep->endpoint.desc))
dep->free_slot++;
trb->size = DWC3_TRB_SIZE_LENGTH(length); trb->size = DWC3_TRB_SIZE_LENGTH(length);
trb->bpl = lower_32_bits(dma); trb->bpl = lower_32_bits(dma);
......
...@@ -1145,15 +1145,15 @@ static struct configfs_item_operations interf_item_ops = { ...@@ -1145,15 +1145,15 @@ static struct configfs_item_operations interf_item_ops = {
.store_attribute = usb_os_desc_attr_store, .store_attribute = usb_os_desc_attr_store,
}; };
static ssize_t rndis_grp_compatible_id_show(struct usb_os_desc *desc, static ssize_t interf_grp_compatible_id_show(struct usb_os_desc *desc,
char *page) char *page)
{ {
memcpy(page, desc->ext_compat_id, 8); memcpy(page, desc->ext_compat_id, 8);
return 8; return 8;
} }
static ssize_t rndis_grp_compatible_id_store(struct usb_os_desc *desc, static ssize_t interf_grp_compatible_id_store(struct usb_os_desc *desc,
const char *page, size_t len) const char *page, size_t len)
{ {
int l; int l;
...@@ -1171,20 +1171,20 @@ static ssize_t rndis_grp_compatible_id_store(struct usb_os_desc *desc, ...@@ -1171,20 +1171,20 @@ static ssize_t rndis_grp_compatible_id_store(struct usb_os_desc *desc,
return len; return len;
} }
static struct usb_os_desc_attribute rndis_grp_attr_compatible_id = static struct usb_os_desc_attribute interf_grp_attr_compatible_id =
__CONFIGFS_ATTR(compatible_id, S_IRUGO | S_IWUSR, __CONFIGFS_ATTR(compatible_id, S_IRUGO | S_IWUSR,
rndis_grp_compatible_id_show, interf_grp_compatible_id_show,
rndis_grp_compatible_id_store); interf_grp_compatible_id_store);
static ssize_t rndis_grp_sub_compatible_id_show(struct usb_os_desc *desc, static ssize_t interf_grp_sub_compatible_id_show(struct usb_os_desc *desc,
char *page) char *page)
{ {
memcpy(page, desc->ext_compat_id + 8, 8); memcpy(page, desc->ext_compat_id + 8, 8);
return 8; return 8;
} }
static ssize_t rndis_grp_sub_compatible_id_store(struct usb_os_desc *desc, static ssize_t interf_grp_sub_compatible_id_store(struct usb_os_desc *desc,
const char *page, size_t len) const char *page, size_t len)
{ {
int l; int l;
...@@ -1202,20 +1202,21 @@ static ssize_t rndis_grp_sub_compatible_id_store(struct usb_os_desc *desc, ...@@ -1202,20 +1202,21 @@ static ssize_t rndis_grp_sub_compatible_id_store(struct usb_os_desc *desc,
return len; return len;
} }
static struct usb_os_desc_attribute rndis_grp_attr_sub_compatible_id = static struct usb_os_desc_attribute interf_grp_attr_sub_compatible_id =
__CONFIGFS_ATTR(sub_compatible_id, S_IRUGO | S_IWUSR, __CONFIGFS_ATTR(sub_compatible_id, S_IRUGO | S_IWUSR,
rndis_grp_sub_compatible_id_show, interf_grp_sub_compatible_id_show,
rndis_grp_sub_compatible_id_store); interf_grp_sub_compatible_id_store);
static struct configfs_attribute *interf_grp_attrs[] = { static struct configfs_attribute *interf_grp_attrs[] = {
&rndis_grp_attr_compatible_id.attr, &interf_grp_attr_compatible_id.attr,
&rndis_grp_attr_sub_compatible_id.attr, &interf_grp_attr_sub_compatible_id.attr,
NULL NULL
}; };
int usb_os_desc_prepare_interf_dir(struct config_group *parent, int usb_os_desc_prepare_interf_dir(struct config_group *parent,
int n_interf, int n_interf,
struct usb_os_desc **desc, struct usb_os_desc **desc,
char **names,
struct module *owner) struct module *owner)
{ {
struct config_group **f_default_groups, *os_desc_group, struct config_group **f_default_groups, *os_desc_group,
...@@ -1257,8 +1258,8 @@ int usb_os_desc_prepare_interf_dir(struct config_group *parent, ...@@ -1257,8 +1258,8 @@ int usb_os_desc_prepare_interf_dir(struct config_group *parent,
d = desc[n_interf]; d = desc[n_interf];
d->owner = owner; d->owner = owner;
config_group_init_type_name(&d->group, "", interface_type); config_group_init_type_name(&d->group, "", interface_type);
config_item_set_name(&d->group.cg_item, "interface.%d", config_item_set_name(&d->group.cg_item, "interface.%s",
n_interf); names[n_interf]);
interface_groups[n_interf] = &d->group; interface_groups[n_interf] = &d->group;
} }
......
...@@ -8,6 +8,7 @@ void unregister_gadget_item(struct config_item *item); ...@@ -8,6 +8,7 @@ void unregister_gadget_item(struct config_item *item);
int usb_os_desc_prepare_interf_dir(struct config_group *parent, int usb_os_desc_prepare_interf_dir(struct config_group *parent,
int n_interf, int n_interf,
struct usb_os_desc **desc, struct usb_os_desc **desc,
char **names,
struct module *owner); struct module *owner);
static inline struct usb_os_desc *to_usb_os_desc(struct config_item *item) static inline struct usb_os_desc *to_usb_os_desc(struct config_item *item)
......
...@@ -1483,11 +1483,13 @@ static int functionfs_bind(struct ffs_data *ffs, struct usb_composite_dev *cdev) ...@@ -1483,11 +1483,13 @@ static int functionfs_bind(struct ffs_data *ffs, struct usb_composite_dev *cdev)
ffs->ep0req->context = ffs; ffs->ep0req->context = ffs;
lang = ffs->stringtabs; lang = ffs->stringtabs;
for (lang = ffs->stringtabs; *lang; ++lang) { if (lang) {
struct usb_string *str = (*lang)->strings; for (; *lang; ++lang) {
int id = first_id; struct usb_string *str = (*lang)->strings;
for (; str->s; ++id, ++str) int id = first_id;
str->id = id; for (; str->s; ++id, ++str)
str->id = id;
}
} }
ffs->gadget = cdev->gadget; ffs->gadget = cdev->gadget;
......
...@@ -687,7 +687,7 @@ rndis_bind(struct usb_configuration *c, struct usb_function *f) ...@@ -687,7 +687,7 @@ rndis_bind(struct usb_configuration *c, struct usb_function *f)
f->os_desc_table = kzalloc(sizeof(*f->os_desc_table), f->os_desc_table = kzalloc(sizeof(*f->os_desc_table),
GFP_KERNEL); GFP_KERNEL);
if (!f->os_desc_table) if (!f->os_desc_table)
return PTR_ERR(f->os_desc_table); return -ENOMEM;
f->os_desc_n = 1; f->os_desc_n = 1;
f->os_desc_table[0].os_desc = &rndis_opts->rndis_os_desc; f->os_desc_table[0].os_desc = &rndis_opts->rndis_os_desc;
} }
...@@ -905,6 +905,7 @@ static struct usb_function_instance *rndis_alloc_inst(void) ...@@ -905,6 +905,7 @@ static struct usb_function_instance *rndis_alloc_inst(void)
{ {
struct f_rndis_opts *opts; struct f_rndis_opts *opts;
struct usb_os_desc *descs[1]; struct usb_os_desc *descs[1];
char *names[1];
opts = kzalloc(sizeof(*opts), GFP_KERNEL); opts = kzalloc(sizeof(*opts), GFP_KERNEL);
if (!opts) if (!opts)
...@@ -922,8 +923,9 @@ static struct usb_function_instance *rndis_alloc_inst(void) ...@@ -922,8 +923,9 @@ static struct usb_function_instance *rndis_alloc_inst(void)
INIT_LIST_HEAD(&opts->rndis_os_desc.ext_prop); INIT_LIST_HEAD(&opts->rndis_os_desc.ext_prop);
descs[0] = &opts->rndis_os_desc; descs[0] = &opts->rndis_os_desc;
names[0] = "rndis";
usb_os_desc_prepare_interf_dir(&opts->func_inst.group, 1, descs, usb_os_desc_prepare_interf_dir(&opts->func_inst.group, 1, descs,
THIS_MODULE); names, THIS_MODULE);
config_group_init_type_name(&opts->func_inst.group, "", config_group_init_type_name(&opts->func_inst.group, "",
&rndis_func_type); &rndis_func_type);
......
...@@ -1532,8 +1532,9 @@ static int gr_ep_enable(struct usb_ep *_ep, ...@@ -1532,8 +1532,9 @@ static int gr_ep_enable(struct usb_ep *_ep,
"%s mode: multiple trans./microframe not valid\n", "%s mode: multiple trans./microframe not valid\n",
(mode == 2 ? "Bulk" : "Control")); (mode == 2 ? "Bulk" : "Control"));
return -EINVAL; return -EINVAL;
} else if (nt == 0x11) { } else if (nt == 0x3) {
dev_err(dev->dev, "Invalid value for trans./microframe\n"); dev_err(dev->dev,
"Invalid value 0x3 for additional trans./microframe\n");
return -EINVAL; return -EINVAL;
} else if ((nt + 1) * max > buffer_size) { } else if ((nt + 1) * max > buffer_size) {
dev_err(dev->dev, "Hw buffer size %d < max payload %d * %d\n", dev_err(dev->dev, "Hw buffer size %d < max payload %d * %d\n",
......
...@@ -1264,8 +1264,13 @@ dev_release (struct inode *inode, struct file *fd) ...@@ -1264,8 +1264,13 @@ dev_release (struct inode *inode, struct file *fd)
kfree (dev->buf); kfree (dev->buf);
dev->buf = NULL; dev->buf = NULL;
put_dev (dev);
/* other endpoints were all decoupled from this device */
spin_lock_irq(&dev->lock);
dev->state = STATE_DEV_DISABLED;
spin_unlock_irq(&dev->lock);
put_dev (dev);
return 0; return 0;
} }
......
...@@ -1120,7 +1120,10 @@ void gether_disconnect(struct gether *link) ...@@ -1120,7 +1120,10 @@ void gether_disconnect(struct gether *link)
DBG(dev, "%s\n", __func__); DBG(dev, "%s\n", __func__);
netif_tx_lock(dev->net);
netif_stop_queue(dev->net); netif_stop_queue(dev->net);
netif_tx_unlock(dev->net);
netif_carrier_off(dev->net); netif_carrier_off(dev->net);
/* disable endpoints, forcing (synchronous) completion /* disable endpoints, forcing (synchronous) completion
......
...@@ -176,7 +176,7 @@ config USB_EHCI_HCD_AT91 ...@@ -176,7 +176,7 @@ config USB_EHCI_HCD_AT91
config USB_EHCI_MSM config USB_EHCI_MSM
tristate "Support for Qualcomm QSD/MSM on-chip EHCI USB controller" tristate "Support for Qualcomm QSD/MSM on-chip EHCI USB controller"
depends on ARCH_MSM depends on ARCH_MSM || ARCH_QCOM
select USB_EHCI_ROOT_HUB_TT select USB_EHCI_ROOT_HUB_TT
---help--- ---help---
Enables support for the USB Host controller present on the Enables support for the USB Host controller present on the
......
...@@ -22,6 +22,7 @@ ...@@ -22,6 +22,7 @@
#include <linux/slab.h> #include <linux/slab.h>
#include <linux/device.h>
#include <asm/unaligned.h> #include <asm/unaligned.h>
#include "xhci.h" #include "xhci.h"
...@@ -1139,7 +1140,9 @@ int xhci_bus_suspend(struct usb_hcd *hcd) ...@@ -1139,7 +1140,9 @@ int xhci_bus_suspend(struct usb_hcd *hcd)
* including the USB 3.0 roothub, but only if CONFIG_PM_RUNTIME * including the USB 3.0 roothub, but only if CONFIG_PM_RUNTIME
* is enabled, so also enable remote wake here. * is enabled, so also enable remote wake here.
*/ */
if (hcd->self.root_hub->do_remote_wakeup) { if (hcd->self.root_hub->do_remote_wakeup
&& device_may_wakeup(hcd->self.controller)) {
if (t1 & PORT_CONNECT) { if (t1 & PORT_CONNECT) {
t2 |= PORT_WKOC_E | PORT_WKDISC_E; t2 |= PORT_WKOC_E | PORT_WKDISC_E;
t2 &= ~PORT_WKCONN_E; t2 &= ~PORT_WKCONN_E;
......
...@@ -1433,8 +1433,11 @@ static void handle_cmd_completion(struct xhci_hcd *xhci, ...@@ -1433,8 +1433,11 @@ static void handle_cmd_completion(struct xhci_hcd *xhci,
xhci_handle_cmd_reset_ep(xhci, slot_id, cmd_trb, cmd_comp_code); xhci_handle_cmd_reset_ep(xhci, slot_id, cmd_trb, cmd_comp_code);
break; break;
case TRB_RESET_DEV: case TRB_RESET_DEV:
WARN_ON(slot_id != TRB_TO_SLOT_ID( /* SLOT_ID field in reset device cmd completion event TRB is 0.
le32_to_cpu(cmd_trb->generic.field[3]))); * Use the SLOT_ID from the command TRB instead (xhci 4.6.11)
*/
slot_id = TRB_TO_SLOT_ID(
le32_to_cpu(cmd_trb->generic.field[3]));
xhci_handle_cmd_reset_dev(xhci, slot_id, event); xhci_handle_cmd_reset_dev(xhci, slot_id, event);
break; break;
case TRB_NEC_GET_FW: case TRB_NEC_GET_FW:
...@@ -3534,7 +3537,7 @@ static unsigned int xhci_get_burst_count(struct xhci_hcd *xhci, ...@@ -3534,7 +3537,7 @@ static unsigned int xhci_get_burst_count(struct xhci_hcd *xhci,
return 0; return 0;
max_burst = urb->ep->ss_ep_comp.bMaxBurst; max_burst = urb->ep->ss_ep_comp.bMaxBurst;
return roundup(total_packet_count, max_burst + 1) - 1; return DIV_ROUND_UP(total_packet_count, max_burst + 1) - 1;
} }
/* /*
......
...@@ -936,7 +936,7 @@ int xhci_suspend(struct xhci_hcd *xhci) ...@@ -936,7 +936,7 @@ int xhci_suspend(struct xhci_hcd *xhci)
*/ */
int xhci_resume(struct xhci_hcd *xhci, bool hibernated) int xhci_resume(struct xhci_hcd *xhci, bool hibernated)
{ {
u32 command, temp = 0; u32 command, temp = 0, status;
struct usb_hcd *hcd = xhci_to_hcd(xhci); struct usb_hcd *hcd = xhci_to_hcd(xhci);
struct usb_hcd *secondary_hcd; struct usb_hcd *secondary_hcd;
int retval = 0; int retval = 0;
...@@ -1054,8 +1054,12 @@ int xhci_resume(struct xhci_hcd *xhci, bool hibernated) ...@@ -1054,8 +1054,12 @@ int xhci_resume(struct xhci_hcd *xhci, bool hibernated)
done: done:
if (retval == 0) { if (retval == 0) {
usb_hcd_resume_root_hub(hcd); /* Resume root hubs only when have pending events. */
usb_hcd_resume_root_hub(xhci->shared_hcd); status = readl(&xhci->op_regs->status);
if (status & STS_EINT) {
usb_hcd_resume_root_hub(hcd);
usb_hcd_resume_root_hub(xhci->shared_hcd);
}
} }
/* /*
......
...@@ -19,21 +19,6 @@ static int am335x_child_probe(struct platform_device *pdev) ...@@ -19,21 +19,6 @@ static int am335x_child_probe(struct platform_device *pdev)
return ret; return ret;
} }
static int of_remove_populated_child(struct device *dev, void *d)
{
struct platform_device *pdev = to_platform_device(dev);
of_device_unregister(pdev);
return 0;
}
static int am335x_child_remove(struct platform_device *pdev)
{
device_for_each_child(&pdev->dev, NULL, of_remove_populated_child);
pm_runtime_disable(&pdev->dev);
return 0;
}
static const struct of_device_id am335x_child_of_match[] = { static const struct of_device_id am335x_child_of_match[] = {
{ .compatible = "ti,am33xx-usb" }, { .compatible = "ti,am33xx-usb" },
{ }, { },
...@@ -42,13 +27,17 @@ MODULE_DEVICE_TABLE(of, am335x_child_of_match); ...@@ -42,13 +27,17 @@ MODULE_DEVICE_TABLE(of, am335x_child_of_match);
static struct platform_driver am335x_child_driver = { static struct platform_driver am335x_child_driver = {
.probe = am335x_child_probe, .probe = am335x_child_probe,
.remove = am335x_child_remove,
.driver = { .driver = {
.name = "am335x-usb-childs", .name = "am335x-usb-childs",
.of_match_table = am335x_child_of_match, .of_match_table = am335x_child_of_match,
}, },
}; };
module_platform_driver(am335x_child_driver); static int __init am335x_child_init(void)
{
return platform_driver_register(&am335x_child_driver);
}
module_init(am335x_child_init);
MODULE_DESCRIPTION("AM33xx child devices"); MODULE_DESCRIPTION("AM33xx child devices");
MODULE_LICENSE("GPL v2"); MODULE_LICENSE("GPL v2");
...@@ -849,7 +849,7 @@ static irqreturn_t musb_stage0_irq(struct musb *musb, u8 int_usb, ...@@ -849,7 +849,7 @@ static irqreturn_t musb_stage0_irq(struct musb *musb, u8 int_usb,
} }
/* handle babble condition */ /* handle babble condition */
if (int_usb & MUSB_INTR_BABBLE) if (int_usb & MUSB_INTR_BABBLE && is_host_active(musb))
schedule_work(&musb->recover_work); schedule_work(&musb->recover_work);
#if 0 #if 0
......
...@@ -318,7 +318,7 @@ static void cppi41_dma_callback(void *private_data) ...@@ -318,7 +318,7 @@ static void cppi41_dma_callback(void *private_data)
} }
list_add_tail(&cppi41_channel->tx_check, list_add_tail(&cppi41_channel->tx_check,
&controller->early_tx_list); &controller->early_tx_list);
if (!hrtimer_active(&controller->early_tx)) { if (!hrtimer_is_queued(&controller->early_tx)) {
hrtimer_start_range_ns(&controller->early_tx, hrtimer_start_range_ns(&controller->early_tx,
ktime_set(0, 140 * NSEC_PER_USEC), ktime_set(0, 140 * NSEC_PER_USEC),
40 * NSEC_PER_USEC, 40 * NSEC_PER_USEC,
......
...@@ -494,10 +494,9 @@ static int dsps_musb_set_mode(struct musb *musb, u8 mode) ...@@ -494,10 +494,9 @@ static int dsps_musb_set_mode(struct musb *musb, u8 mode)
struct dsps_glue *glue = dev_get_drvdata(dev->parent); struct dsps_glue *glue = dev_get_drvdata(dev->parent);
const struct dsps_musb_wrapper *wrp = glue->wrp; const struct dsps_musb_wrapper *wrp = glue->wrp;
void __iomem *ctrl_base = musb->ctrl_base; void __iomem *ctrl_base = musb->ctrl_base;
void __iomem *base = musb->mregs;
u32 reg; u32 reg;
reg = dsps_readl(base, wrp->mode); reg = dsps_readl(ctrl_base, wrp->mode);
switch (mode) { switch (mode) {
case MUSB_HOST: case MUSB_HOST:
...@@ -510,7 +509,7 @@ static int dsps_musb_set_mode(struct musb *musb, u8 mode) ...@@ -510,7 +509,7 @@ static int dsps_musb_set_mode(struct musb *musb, u8 mode)
*/ */
reg |= (1 << wrp->iddig_mux); reg |= (1 << wrp->iddig_mux);
dsps_writel(base, wrp->mode, reg); dsps_writel(ctrl_base, wrp->mode, reg);
dsps_writel(ctrl_base, wrp->phy_utmi, 0x02); dsps_writel(ctrl_base, wrp->phy_utmi, 0x02);
break; break;
case MUSB_PERIPHERAL: case MUSB_PERIPHERAL:
...@@ -523,10 +522,10 @@ static int dsps_musb_set_mode(struct musb *musb, u8 mode) ...@@ -523,10 +522,10 @@ static int dsps_musb_set_mode(struct musb *musb, u8 mode)
*/ */
reg |= (1 << wrp->iddig_mux); reg |= (1 << wrp->iddig_mux);
dsps_writel(base, wrp->mode, reg); dsps_writel(ctrl_base, wrp->mode, reg);
break; break;
case MUSB_OTG: case MUSB_OTG:
dsps_writel(base, wrp->phy_utmi, 0x02); dsps_writel(ctrl_base, wrp->phy_utmi, 0x02);
break; break;
default: default:
dev_err(glue->dev, "unsupported mode %d\n", mode); dev_err(glue->dev, "unsupported mode %d\n", mode);
......
...@@ -274,7 +274,6 @@ static int ux500_probe(struct platform_device *pdev) ...@@ -274,7 +274,6 @@ static int ux500_probe(struct platform_device *pdev)
musb->dev.parent = &pdev->dev; musb->dev.parent = &pdev->dev;
musb->dev.dma_mask = &pdev->dev.coherent_dma_mask; musb->dev.dma_mask = &pdev->dev.coherent_dma_mask;
musb->dev.coherent_dma_mask = pdev->dev.coherent_dma_mask; musb->dev.coherent_dma_mask = pdev->dev.coherent_dma_mask;
musb->dev.of_node = pdev->dev.of_node;
glue->dev = &pdev->dev; glue->dev = &pdev->dev;
glue->musb = musb; glue->musb = musb;
......
...@@ -1229,7 +1229,9 @@ static void msm_otg_sm_work(struct work_struct *w) ...@@ -1229,7 +1229,9 @@ static void msm_otg_sm_work(struct work_struct *w)
motg->chg_state = USB_CHG_STATE_UNDEFINED; motg->chg_state = USB_CHG_STATE_UNDEFINED;
motg->chg_type = USB_INVALID_CHARGER; motg->chg_type = USB_INVALID_CHARGER;
} }
pm_runtime_put_sync(otg->phy->dev);
if (otg->phy->state == OTG_STATE_B_IDLE)
pm_runtime_put_sync(otg->phy->dev);
break; break;
case OTG_STATE_B_PERIPHERAL: case OTG_STATE_B_PERIPHERAL:
dev_dbg(otg->phy->dev, "OTG_STATE_B_PERIPHERAL state\n"); dev_dbg(otg->phy->dev, "OTG_STATE_B_PERIPHERAL state\n");
......
...@@ -681,6 +681,14 @@ static int usbhsf_pio_try_pop(struct usbhs_pkt *pkt, int *is_done) ...@@ -681,6 +681,14 @@ static int usbhsf_pio_try_pop(struct usbhs_pkt *pkt, int *is_done)
usbhs_pipe_number(pipe), usbhs_pipe_number(pipe),
pkt->length, pkt->actual, *is_done, pkt->zero); pkt->length, pkt->actual, *is_done, pkt->zero);
/*
* Transmission end
*/
if (*is_done) {
if (usbhs_pipe_is_dcp(pipe))
usbhs_dcp_control_transfer_done(pipe);
}
usbhs_fifo_read_busy: usbhs_fifo_read_busy:
usbhsf_fifo_unselect(pipe, fifo); usbhsf_fifo_unselect(pipe, fifo);
......
...@@ -1566,14 +1566,17 @@ static void ftdi_set_max_packet_size(struct usb_serial_port *port) ...@@ -1566,14 +1566,17 @@ static void ftdi_set_max_packet_size(struct usb_serial_port *port)
struct usb_device *udev = serial->dev; struct usb_device *udev = serial->dev;
struct usb_interface *interface = serial->interface; struct usb_interface *interface = serial->interface;
struct usb_endpoint_descriptor *ep_desc = &interface->cur_altsetting->endpoint[1].desc; struct usb_endpoint_descriptor *ep_desc;
unsigned num_endpoints; unsigned num_endpoints;
int i; unsigned i;
num_endpoints = interface->cur_altsetting->desc.bNumEndpoints; num_endpoints = interface->cur_altsetting->desc.bNumEndpoints;
dev_info(&udev->dev, "Number of endpoints %d\n", num_endpoints); dev_info(&udev->dev, "Number of endpoints %d\n", num_endpoints);
if (!num_endpoints)
return;
/* NOTE: some customers have programmed FT232R/FT245R devices /* NOTE: some customers have programmed FT232R/FT245R devices
* with an endpoint size of 0 - not good. In this case, we * with an endpoint size of 0 - not good. In this case, we
* want to override the endpoint descriptor setting and use a * want to override the endpoint descriptor setting and use a
......
...@@ -352,6 +352,9 @@ static void option_instat_callback(struct urb *urb); ...@@ -352,6 +352,9 @@ static void option_instat_callback(struct urb *urb);
/* Zoom */ /* Zoom */
#define ZOOM_PRODUCT_4597 0x9607 #define ZOOM_PRODUCT_4597 0x9607
/* SpeedUp SU9800 usb 3g modem */
#define SPEEDUP_PRODUCT_SU9800 0x9800
/* Haier products */ /* Haier products */
#define HAIER_VENDOR_ID 0x201e #define HAIER_VENDOR_ID 0x201e
#define HAIER_PRODUCT_CE100 0x2009 #define HAIER_PRODUCT_CE100 0x2009
...@@ -372,8 +375,12 @@ static void option_instat_callback(struct urb *urb); ...@@ -372,8 +375,12 @@ static void option_instat_callback(struct urb *urb);
/* Olivetti products */ /* Olivetti products */
#define OLIVETTI_VENDOR_ID 0x0b3c #define OLIVETTI_VENDOR_ID 0x0b3c
#define OLIVETTI_PRODUCT_OLICARD100 0xc000 #define OLIVETTI_PRODUCT_OLICARD100 0xc000
#define OLIVETTI_PRODUCT_OLICARD120 0xc001
#define OLIVETTI_PRODUCT_OLICARD140 0xc002
#define OLIVETTI_PRODUCT_OLICARD145 0xc003 #define OLIVETTI_PRODUCT_OLICARD145 0xc003
#define OLIVETTI_PRODUCT_OLICARD155 0xc004
#define OLIVETTI_PRODUCT_OLICARD200 0xc005 #define OLIVETTI_PRODUCT_OLICARD200 0xc005
#define OLIVETTI_PRODUCT_OLICARD160 0xc00a
#define OLIVETTI_PRODUCT_OLICARD500 0xc00b #define OLIVETTI_PRODUCT_OLICARD500 0xc00b
/* Celot products */ /* Celot products */
...@@ -1577,6 +1584,7 @@ static const struct usb_device_id option_ids[] = { ...@@ -1577,6 +1584,7 @@ static const struct usb_device_id option_ids[] = {
{ USB_DEVICE(LONGCHEER_VENDOR_ID, FOUR_G_SYSTEMS_PRODUCT_W14), { USB_DEVICE(LONGCHEER_VENDOR_ID, FOUR_G_SYSTEMS_PRODUCT_W14),
.driver_info = (kernel_ulong_t)&four_g_w14_blacklist .driver_info = (kernel_ulong_t)&four_g_w14_blacklist
}, },
{ USB_DEVICE_INTERFACE_CLASS(LONGCHEER_VENDOR_ID, SPEEDUP_PRODUCT_SU9800, 0xff) },
{ USB_DEVICE(LONGCHEER_VENDOR_ID, ZOOM_PRODUCT_4597) }, { USB_DEVICE(LONGCHEER_VENDOR_ID, ZOOM_PRODUCT_4597) },
{ USB_DEVICE(LONGCHEER_VENDOR_ID, IBALL_3_5G_CONNECT) }, { USB_DEVICE(LONGCHEER_VENDOR_ID, IBALL_3_5G_CONNECT) },
{ USB_DEVICE(HAIER_VENDOR_ID, HAIER_PRODUCT_CE100) }, { USB_DEVICE(HAIER_VENDOR_ID, HAIER_PRODUCT_CE100) },
...@@ -1611,15 +1619,21 @@ static const struct usb_device_id option_ids[] = { ...@@ -1611,15 +1619,21 @@ static const struct usb_device_id option_ids[] = {
{ USB_DEVICE(SIEMENS_VENDOR_ID, CINTERION_PRODUCT_HC25_MDMNET) }, { USB_DEVICE(SIEMENS_VENDOR_ID, CINTERION_PRODUCT_HC25_MDMNET) },
{ USB_DEVICE(SIEMENS_VENDOR_ID, CINTERION_PRODUCT_HC28_MDM) }, /* HC28 enumerates with Siemens or Cinterion VID depending on FW revision */ { USB_DEVICE(SIEMENS_VENDOR_ID, CINTERION_PRODUCT_HC28_MDM) }, /* HC28 enumerates with Siemens or Cinterion VID depending on FW revision */
{ USB_DEVICE(SIEMENS_VENDOR_ID, CINTERION_PRODUCT_HC28_MDMNET) }, { USB_DEVICE(SIEMENS_VENDOR_ID, CINTERION_PRODUCT_HC28_MDMNET) },
{ USB_DEVICE(OLIVETTI_VENDOR_ID, OLIVETTI_PRODUCT_OLICARD100),
{ USB_DEVICE(OLIVETTI_VENDOR_ID, OLIVETTI_PRODUCT_OLICARD100) }, .driver_info = (kernel_ulong_t)&net_intf4_blacklist },
{ USB_DEVICE(OLIVETTI_VENDOR_ID, OLIVETTI_PRODUCT_OLICARD120),
.driver_info = (kernel_ulong_t)&net_intf4_blacklist },
{ USB_DEVICE(OLIVETTI_VENDOR_ID, OLIVETTI_PRODUCT_OLICARD140),
.driver_info = (kernel_ulong_t)&net_intf4_blacklist },
{ USB_DEVICE(OLIVETTI_VENDOR_ID, OLIVETTI_PRODUCT_OLICARD145) }, { USB_DEVICE(OLIVETTI_VENDOR_ID, OLIVETTI_PRODUCT_OLICARD145) },
{ USB_DEVICE(OLIVETTI_VENDOR_ID, OLIVETTI_PRODUCT_OLICARD155),
.driver_info = (kernel_ulong_t)&net_intf6_blacklist },
{ USB_DEVICE(OLIVETTI_VENDOR_ID, OLIVETTI_PRODUCT_OLICARD200), { USB_DEVICE(OLIVETTI_VENDOR_ID, OLIVETTI_PRODUCT_OLICARD200),
.driver_info = (kernel_ulong_t)&net_intf6_blacklist .driver_info = (kernel_ulong_t)&net_intf6_blacklist },
}, { USB_DEVICE(OLIVETTI_VENDOR_ID, OLIVETTI_PRODUCT_OLICARD160),
.driver_info = (kernel_ulong_t)&net_intf6_blacklist },
{ USB_DEVICE(OLIVETTI_VENDOR_ID, OLIVETTI_PRODUCT_OLICARD500), { USB_DEVICE(OLIVETTI_VENDOR_ID, OLIVETTI_PRODUCT_OLICARD500),
.driver_info = (kernel_ulong_t)&net_intf4_blacklist .driver_info = (kernel_ulong_t)&net_intf4_blacklist },
},
{ USB_DEVICE(CELOT_VENDOR_ID, CELOT_PRODUCT_CT680M) }, /* CT-650 CDMA 450 1xEVDO modem */ { USB_DEVICE(CELOT_VENDOR_ID, CELOT_PRODUCT_CT680M) }, /* CT-650 CDMA 450 1xEVDO modem */
{ USB_DEVICE_AND_INTERFACE_INFO(SAMSUNG_VENDOR_ID, SAMSUNG_PRODUCT_GT_B3730, USB_CLASS_CDC_DATA, 0x00, 0x00) }, /* Samsung GT-B3730 LTE USB modem.*/ { USB_DEVICE_AND_INTERFACE_INFO(SAMSUNG_VENDOR_ID, SAMSUNG_PRODUCT_GT_B3730, USB_CLASS_CDC_DATA, 0x00, 0x00) }, /* Samsung GT-B3730 LTE USB modem.*/
{ USB_DEVICE(YUGA_VENDOR_ID, YUGA_PRODUCT_CEM600) }, { USB_DEVICE(YUGA_VENDOR_ID, YUGA_PRODUCT_CEM600) },
......
...@@ -256,6 +256,10 @@ static int slave_configure(struct scsi_device *sdev) ...@@ -256,6 +256,10 @@ static int slave_configure(struct scsi_device *sdev)
if (us->fflags & US_FL_WRITE_CACHE) if (us->fflags & US_FL_WRITE_CACHE)
sdev->wce_default_on = 1; sdev->wce_default_on = 1;
/* A few buggy USB-ATA bridges don't understand FUA */
if (us->fflags & US_FL_BROKEN_FUA)
sdev->broken_fua = 1;
} else { } else {
/* Non-disk-type devices don't need to blacklist any pages /* Non-disk-type devices don't need to blacklist any pages
......
...@@ -1936,6 +1936,13 @@ UNUSUAL_DEV( 0x14cd, 0x6600, 0x0201, 0x0201, ...@@ -1936,6 +1936,13 @@ UNUSUAL_DEV( 0x14cd, 0x6600, 0x0201, 0x0201,
USB_SC_DEVICE, USB_PR_DEVICE, NULL, USB_SC_DEVICE, USB_PR_DEVICE, NULL,
US_FL_IGNORE_RESIDUE ), US_FL_IGNORE_RESIDUE ),
/* Reported by Michael Büsch <m@bues.ch> */
UNUSUAL_DEV( 0x152d, 0x0567, 0x0114, 0x0114,
"JMicron",
"USB to ATA/ATAPI Bridge",
USB_SC_DEVICE, USB_PR_DEVICE, NULL,
US_FL_BROKEN_FUA ),
/* Reported by Alexandre Oliva <oliva@lsd.ic.unicamp.br> /* Reported by Alexandre Oliva <oliva@lsd.ic.unicamp.br>
* JMicron responds to USN and several other SCSI ioctls with a * JMicron responds to USN and several other SCSI ioctls with a
* residue that causes subsequent I/O requests to fail. */ * residue that causes subsequent I/O requests to fail. */
......
...@@ -70,7 +70,9 @@ ...@@ -70,7 +70,9 @@
US_FLAG(NEEDS_CAP16, 0x00400000) \ US_FLAG(NEEDS_CAP16, 0x00400000) \
/* cannot handle READ_CAPACITY_10 */ \ /* cannot handle READ_CAPACITY_10 */ \
US_FLAG(IGNORE_UAS, 0x00800000) \ US_FLAG(IGNORE_UAS, 0x00800000) \
/* Device advertises UAS but it is broken */ /* Device advertises UAS but it is broken */ \
US_FLAG(BROKEN_FUA, 0x01000000) \
/* Cannot handle FUA in WRITE or READ CDBs */ \
#define US_FLAG(name, value) US_FL_##name = value , #define US_FLAG(name, value) US_FL_##name = value ,
enum { US_DO_ALL_FLAGS }; enum { US_DO_ALL_FLAGS };
......
...@@ -173,6 +173,7 @@ struct scsi_device { ...@@ -173,6 +173,7 @@ struct scsi_device {
unsigned is_visible:1; /* is the device visible in sysfs */ unsigned is_visible:1; /* is the device visible in sysfs */
unsigned wce_default_on:1; /* Cache is ON by default */ unsigned wce_default_on:1; /* Cache is ON by default */
unsigned no_dif:1; /* T10 PI (DIF) should be disabled */ unsigned no_dif:1; /* T10 PI (DIF) should be disabled */
unsigned broken_fua:1; /* Don't set FUA bit */
atomic_t disk_events_disable_depth; /* disable depth for disk events */ atomic_t disk_events_disable_depth; /* disable depth for disk events */
......
...@@ -33,6 +33,13 @@ struct usb_endpoint_descriptor_no_audio { ...@@ -33,6 +33,13 @@ struct usb_endpoint_descriptor_no_audio {
__u8 bInterval; __u8 bInterval;
} __attribute__((packed)); } __attribute__((packed));
/* Legacy format, deprecated as of 3.14. */
struct usb_functionfs_descs_head {
__le32 magic;
__le32 length;
__le32 fs_count;
__le32 hs_count;
} __attribute__((packed, deprecated));
/* /*
* Descriptors format: * Descriptors format:
......
...@@ -116,8 +116,8 @@ static const struct { ...@@ -116,8 +116,8 @@ static const struct {
.header = { .header = {
.magic = cpu_to_le32(FUNCTIONFS_DESCRIPTORS_MAGIC), .magic = cpu_to_le32(FUNCTIONFS_DESCRIPTORS_MAGIC),
.length = cpu_to_le32(sizeof descriptors), .length = cpu_to_le32(sizeof descriptors),
.fs_count = 3, .fs_count = cpu_to_le32(3),
.hs_count = 3, .hs_count = cpu_to_le32(3),
}, },
.fs_descs = { .fs_descs = {
.intf = { .intf = {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment