Skip to content

Commit

Permalink
Merge tag 'usb-3.16-rc4' 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 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
  ...
  • Loading branch information
Linus Torvalds committed Jul 4, 2014
2 parents 9911f2e + e4adcff commit 034a0f6
Show file tree
Hide file tree
Showing 32 changed files with 164 additions and 94 deletions.
14 changes: 1 addition & 13 deletions MAINTAINERS
Original file line number Diff line number Diff line change
Expand Up @@ -9406,12 +9406,6 @@ S: Maintained
F: drivers/usb/host/isp116x*
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
M: Matthew Dharm <mdharm-usb@one-eyed-alien.net>
L: linux-usb@vger.kernel.org
Expand Down Expand Up @@ -9439,12 +9433,6 @@ S: Maintained
F: Documentation/usb/ohci.txt
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
M: Petko Manolov <petkan@nucleusys.com>
L: linux-usb@vger.kernel.org
Expand Down Expand Up @@ -9477,7 +9465,7 @@ S: Maintained
F: drivers/net/usb/rtl8150.c

USB SERIAL SUBSYSTEM
M: Johan Hovold <jhovold@gmail.com>
M: Johan Hovold <johan@kernel.org>
L: linux-usb@vger.kernel.org
S: Maintained
F: Documentation/usb/usb-serial.txt
Expand Down
5 changes: 4 additions & 1 deletion drivers/scsi/sd.c
Original file line number Diff line number Diff line change
Expand Up @@ -2441,7 +2441,10 @@ sd_read_cache_type(struct scsi_disk *sdkp, unsigned char *buffer)
}

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,
"Uses READ/WRITE(6), disabling FUA\n");
sdkp->DPOFUA = 0;
Expand Down
7 changes: 7 additions & 0 deletions drivers/usb/chipidea/udc.c
Original file line number Diff line number Diff line change
Expand Up @@ -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_req *hwreq = container_of(req, struct ci_hw_req, req);
unsigned long flags;
struct td_node *node, *tmpnode;

if (ep == NULL || req == NULL || hwreq->req.status != -EALREADY ||
hwep->ep.desc == NULL || list_empty(&hwreq->queue) ||
Expand All @@ -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);

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 */
list_del_init(&hwreq->queue);

Expand Down
1 change: 1 addition & 0 deletions drivers/usb/dwc3/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ comment "Platform Glue Driver Support"
config USB_DWC3_OMAP
tristate "Texas Instruments OMAP5 and similar Platforms"
depends on EXTCON && (ARCH_OMAP2PLUS || COMPILE_TEST)
depends on OF
default USB_DWC3
help
Some platforms from Texas Instruments like OMAP5, DRA7xxx and
Expand Down
17 changes: 14 additions & 3 deletions drivers/usb/dwc3/dwc3-omap.c
Original file line number Diff line number Diff line change
Expand Up @@ -322,7 +322,7 @@ static int dwc3_omap_remove_core(struct device *dev, void *c)
{
struct platform_device *pdev = to_platform_device(dev);

platform_device_unregister(pdev);
of_device_unregister(pdev);

return 0;
}
Expand Down Expand Up @@ -599,16 +599,27 @@ static int dwc3_omap_prepare(struct device *dev)
{
struct dwc3_omap *omap = dev_get_drvdata(dev);

dwc3_omap_disable_irqs(omap);
dwc3_omap_write_irqmisc_set(omap, 0x00);

return 0;
}

static void dwc3_omap_complete(struct device *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)
Expand Down
8 changes: 4 additions & 4 deletions drivers/usb/dwc3/gadget.c
Original file line number Diff line number Diff line change
Expand Up @@ -828,10 +828,6 @@ static void dwc3_prepare_one_trb(struct dwc3_ep *dep,
length, last ? " last" : "",
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];

Expand All @@ -843,6 +839,10 @@ static void dwc3_prepare_one_trb(struct dwc3_ep *dep,
}

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->bpl = lower_32_bits(dma);
Expand Down
37 changes: 19 additions & 18 deletions drivers/usb/gadget/configfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -1145,15 +1145,15 @@ static struct configfs_item_operations interf_item_ops = {
.store_attribute = usb_os_desc_attr_store,
};

static ssize_t rndis_grp_compatible_id_show(struct usb_os_desc *desc,
char *page)
static ssize_t interf_grp_compatible_id_show(struct usb_os_desc *desc,
char *page)
{
memcpy(page, desc->ext_compat_id, 8);
return 8;
}

static ssize_t rndis_grp_compatible_id_store(struct usb_os_desc *desc,
const char *page, size_t len)
static ssize_t interf_grp_compatible_id_store(struct usb_os_desc *desc,
const char *page, size_t len)
{
int l;

Expand All @@ -1171,20 +1171,20 @@ static ssize_t rndis_grp_compatible_id_store(struct usb_os_desc *desc,
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,
rndis_grp_compatible_id_show,
rndis_grp_compatible_id_store);
interf_grp_compatible_id_show,
interf_grp_compatible_id_store);

static ssize_t rndis_grp_sub_compatible_id_show(struct usb_os_desc *desc,
char *page)
static ssize_t interf_grp_sub_compatible_id_show(struct usb_os_desc *desc,
char *page)
{
memcpy(page, desc->ext_compat_id + 8, 8);
return 8;
}

static ssize_t rndis_grp_sub_compatible_id_store(struct usb_os_desc *desc,
const char *page, size_t len)
static ssize_t interf_grp_sub_compatible_id_store(struct usb_os_desc *desc,
const char *page, size_t len)
{
int l;

Expand All @@ -1202,20 +1202,21 @@ static ssize_t rndis_grp_sub_compatible_id_store(struct usb_os_desc *desc,
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,
rndis_grp_sub_compatible_id_show,
rndis_grp_sub_compatible_id_store);
interf_grp_sub_compatible_id_show,
interf_grp_sub_compatible_id_store);

static struct configfs_attribute *interf_grp_attrs[] = {
&rndis_grp_attr_compatible_id.attr,
&rndis_grp_attr_sub_compatible_id.attr,
&interf_grp_attr_compatible_id.attr,
&interf_grp_attr_sub_compatible_id.attr,
NULL
};

int usb_os_desc_prepare_interf_dir(struct config_group *parent,
int n_interf,
struct usb_os_desc **desc,
char **names,
struct module *owner)
{
struct config_group **f_default_groups, *os_desc_group,
Expand Down Expand Up @@ -1257,8 +1258,8 @@ int usb_os_desc_prepare_interf_dir(struct config_group *parent,
d = desc[n_interf];
d->owner = owner;
config_group_init_type_name(&d->group, "", interface_type);
config_item_set_name(&d->group.cg_item, "interface.%d",
n_interf);
config_item_set_name(&d->group.cg_item, "interface.%s",
names[n_interf]);
interface_groups[n_interf] = &d->group;
}

Expand Down
1 change: 1 addition & 0 deletions drivers/usb/gadget/configfs.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ void unregister_gadget_item(struct config_item *item);
int usb_os_desc_prepare_interf_dir(struct config_group *parent,
int n_interf,
struct usb_os_desc **desc,
char **names,
struct module *owner);

static inline struct usb_os_desc *to_usb_os_desc(struct config_item *item)
Expand Down
12 changes: 7 additions & 5 deletions drivers/usb/gadget/f_fs.c
Original file line number Diff line number Diff line change
Expand Up @@ -1483,11 +1483,13 @@ static int functionfs_bind(struct ffs_data *ffs, struct usb_composite_dev *cdev)
ffs->ep0req->context = ffs;

lang = ffs->stringtabs;
for (lang = ffs->stringtabs; *lang; ++lang) {
struct usb_string *str = (*lang)->strings;
int id = first_id;
for (; str->s; ++id, ++str)
str->id = id;
if (lang) {
for (; *lang; ++lang) {
struct usb_string *str = (*lang)->strings;
int id = first_id;
for (; str->s; ++id, ++str)
str->id = id;
}
}

ffs->gadget = cdev->gadget;
Expand Down
6 changes: 4 additions & 2 deletions drivers/usb/gadget/f_rndis.c
Original file line number Diff line number Diff line change
Expand Up @@ -687,7 +687,7 @@ rndis_bind(struct usb_configuration *c, struct usb_function *f)
f->os_desc_table = kzalloc(sizeof(*f->os_desc_table),
GFP_KERNEL);
if (!f->os_desc_table)
return PTR_ERR(f->os_desc_table);
return -ENOMEM;
f->os_desc_n = 1;
f->os_desc_table[0].os_desc = &rndis_opts->rndis_os_desc;
}
Expand Down Expand Up @@ -905,6 +905,7 @@ static struct usb_function_instance *rndis_alloc_inst(void)
{
struct f_rndis_opts *opts;
struct usb_os_desc *descs[1];
char *names[1];

opts = kzalloc(sizeof(*opts), GFP_KERNEL);
if (!opts)
Expand All @@ -922,8 +923,9 @@ static struct usb_function_instance *rndis_alloc_inst(void)
INIT_LIST_HEAD(&opts->rndis_os_desc.ext_prop);

descs[0] = &opts->rndis_os_desc;
names[0] = "rndis";
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, "",
&rndis_func_type);

Expand Down
5 changes: 3 additions & 2 deletions drivers/usb/gadget/gr_udc.c
Original file line number Diff line number Diff line change
Expand Up @@ -1532,8 +1532,9 @@ static int gr_ep_enable(struct usb_ep *_ep,
"%s mode: multiple trans./microframe not valid\n",
(mode == 2 ? "Bulk" : "Control"));
return -EINVAL;
} else if (nt == 0x11) {
dev_err(dev->dev, "Invalid value for trans./microframe\n");
} else if (nt == 0x3) {
dev_err(dev->dev,
"Invalid value 0x3 for additional trans./microframe\n");
return -EINVAL;
} else if ((nt + 1) * max > buffer_size) {
dev_err(dev->dev, "Hw buffer size %d < max payload %d * %d\n",
Expand Down
7 changes: 6 additions & 1 deletion drivers/usb/gadget/inode.c
Original file line number Diff line number Diff line change
Expand Up @@ -1264,8 +1264,13 @@ dev_release (struct inode *inode, struct file *fd)

kfree (dev->buf);
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;
}

Expand Down
3 changes: 3 additions & 0 deletions drivers/usb/gadget/u_ether.c
Original file line number Diff line number Diff line change
Expand Up @@ -1120,7 +1120,10 @@ void gether_disconnect(struct gether *link)

DBG(dev, "%s\n", __func__);

netif_tx_lock(dev->net);
netif_stop_queue(dev->net);
netif_tx_unlock(dev->net);

netif_carrier_off(dev->net);

/* disable endpoints, forcing (synchronous) completion
Expand Down
2 changes: 1 addition & 1 deletion drivers/usb/host/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ config USB_EHCI_HCD_AT91

config USB_EHCI_MSM
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
---help---
Enables support for the USB Host controller present on the
Expand Down
5 changes: 4 additions & 1 deletion drivers/usb/host/xhci-hub.c
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@


#include <linux/slab.h>
#include <linux/device.h>
#include <asm/unaligned.h>

#include "xhci.h"
Expand Down Expand Up @@ -1139,7 +1140,9 @@ int xhci_bus_suspend(struct usb_hcd *hcd)
* including the USB 3.0 roothub, but only if CONFIG_PM_RUNTIME
* 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) {
t2 |= PORT_WKOC_E | PORT_WKDISC_E;
t2 &= ~PORT_WKCONN_E;
Expand Down
9 changes: 6 additions & 3 deletions drivers/usb/host/xhci-ring.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
break;
case TRB_RESET_DEV:
WARN_ON(slot_id != TRB_TO_SLOT_ID(
le32_to_cpu(cmd_trb->generic.field[3])));
/* SLOT_ID field in reset device cmd completion event TRB is 0.
* 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);
break;
case TRB_NEC_GET_FW:
Expand Down Expand Up @@ -3534,7 +3537,7 @@ static unsigned int xhci_get_burst_count(struct xhci_hcd *xhci,
return 0;

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;
}

/*
Expand Down
10 changes: 7 additions & 3 deletions drivers/usb/host/xhci.c
Original file line number Diff line number Diff line change
Expand Up @@ -936,7 +936,7 @@ int xhci_suspend(struct xhci_hcd *xhci)
*/
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 *secondary_hcd;
int retval = 0;
Expand Down Expand Up @@ -1054,8 +1054,12 @@ int xhci_resume(struct xhci_hcd *xhci, bool hibernated)

done:
if (retval == 0) {
usb_hcd_resume_root_hub(hcd);
usb_hcd_resume_root_hub(xhci->shared_hcd);
/* Resume root hubs only when have pending events. */
status = readl(&xhci->op_regs->status);
if (status & STS_EINT) {
usb_hcd_resume_root_hub(hcd);
usb_hcd_resume_root_hub(xhci->shared_hcd);
}
}

/*
Expand Down
Loading

0 comments on commit 034a0f6

Please sign in to comment.