Skip to content

Commit 034a0f6

Browse files
committed
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 ...
2 parents 9911f2e + e4adcff commit 034a0f6

File tree

32 files changed

+164
-94
lines changed

32 files changed

+164
-94
lines changed

MAINTAINERS

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -9406,12 +9406,6 @@ S: Maintained
94069406
F: drivers/usb/host/isp116x*
94079407
F: include/linux/usb/isp116x.h
94089408

9409-
USB KAWASAKI LSI DRIVER
9410-
M: Oliver Neukum <[email protected]>
9411-
9412-
S: Maintained
9413-
F: drivers/usb/serial/kl5kusb105.*
9414-
94159409
USB MASS STORAGE DRIVER
94169410
M: Matthew Dharm <[email protected]>
94179411
@@ -9439,12 +9433,6 @@ S: Maintained
94399433
F: Documentation/usb/ohci.txt
94409434
F: drivers/usb/host/ohci*
94419435

9442-
USB OPTION-CARD DRIVER
9443-
M: Matthias Urlichs <[email protected]>
9444-
9445-
S: Maintained
9446-
F: drivers/usb/serial/option.c
9447-
94489436
USB PEGASUS DRIVER
94499437
M: Petko Manolov <[email protected]>
94509438
@@ -9477,7 +9465,7 @@ S: Maintained
94779465
F: drivers/net/usb/rtl8150.c
94789466

94799467
USB SERIAL SUBSYSTEM
9480-
M: Johan Hovold <[email protected]>
9468+
M: Johan Hovold <[email protected]>
94819469
94829470
S: Maintained
94839471
F: Documentation/usb/usb-serial.txt

drivers/scsi/sd.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2441,7 +2441,10 @@ sd_read_cache_type(struct scsi_disk *sdkp, unsigned char *buffer)
24412441
}
24422442

24432443
sdkp->DPOFUA = (data.device_specific & 0x10) != 0;
2444-
if (sdkp->DPOFUA && !sdkp->device->use_10_for_rw) {
2444+
if (sdp->broken_fua) {
2445+
sd_first_printk(KERN_NOTICE, sdkp, "Disabling FUA\n");
2446+
sdkp->DPOFUA = 0;
2447+
} else if (sdkp->DPOFUA && !sdkp->device->use_10_for_rw) {
24452448
sd_first_printk(KERN_NOTICE, sdkp,
24462449
"Uses READ/WRITE(6), disabling FUA\n");
24472450
sdkp->DPOFUA = 0;

drivers/usb/chipidea/udc.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1321,6 +1321,7 @@ static int ep_dequeue(struct usb_ep *ep, struct usb_request *req)
13211321
struct ci_hw_ep *hwep = container_of(ep, struct ci_hw_ep, ep);
13221322
struct ci_hw_req *hwreq = container_of(req, struct ci_hw_req, req);
13231323
unsigned long flags;
1324+
struct td_node *node, *tmpnode;
13241325

13251326
if (ep == NULL || req == NULL || hwreq->req.status != -EALREADY ||
13261327
hwep->ep.desc == NULL || list_empty(&hwreq->queue) ||
@@ -1331,6 +1332,12 @@ static int ep_dequeue(struct usb_ep *ep, struct usb_request *req)
13311332

13321333
hw_ep_flush(hwep->ci, hwep->num, hwep->dir);
13331334

1335+
list_for_each_entry_safe(node, tmpnode, &hwreq->tds, td) {
1336+
dma_pool_free(hwep->td_pool, node->ptr, node->dma);
1337+
list_del(&node->td);
1338+
kfree(node);
1339+
}
1340+
13341341
/* pop request */
13351342
list_del_init(&hwreq->queue);
13361343

drivers/usb/dwc3/Kconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ comment "Platform Glue Driver Support"
4545
config USB_DWC3_OMAP
4646
tristate "Texas Instruments OMAP5 and similar Platforms"
4747
depends on EXTCON && (ARCH_OMAP2PLUS || COMPILE_TEST)
48+
depends on OF
4849
default USB_DWC3
4950
help
5051
Some platforms from Texas Instruments like OMAP5, DRA7xxx and

drivers/usb/dwc3/dwc3-omap.c

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -322,7 +322,7 @@ static int dwc3_omap_remove_core(struct device *dev, void *c)
322322
{
323323
struct platform_device *pdev = to_platform_device(dev);
324324

325-
platform_device_unregister(pdev);
325+
of_device_unregister(pdev);
326326

327327
return 0;
328328
}
@@ -599,16 +599,27 @@ static int dwc3_omap_prepare(struct device *dev)
599599
{
600600
struct dwc3_omap *omap = dev_get_drvdata(dev);
601601

602-
dwc3_omap_disable_irqs(omap);
602+
dwc3_omap_write_irqmisc_set(omap, 0x00);
603603

604604
return 0;
605605
}
606606

607607
static void dwc3_omap_complete(struct device *dev)
608608
{
609609
struct dwc3_omap *omap = dev_get_drvdata(dev);
610+
u32 reg;
610611

611-
dwc3_omap_enable_irqs(omap);
612+
reg = (USBOTGSS_IRQMISC_OEVT |
613+
USBOTGSS_IRQMISC_DRVVBUS_RISE |
614+
USBOTGSS_IRQMISC_CHRGVBUS_RISE |
615+
USBOTGSS_IRQMISC_DISCHRGVBUS_RISE |
616+
USBOTGSS_IRQMISC_IDPULLUP_RISE |
617+
USBOTGSS_IRQMISC_DRVVBUS_FALL |
618+
USBOTGSS_IRQMISC_CHRGVBUS_FALL |
619+
USBOTGSS_IRQMISC_DISCHRGVBUS_FALL |
620+
USBOTGSS_IRQMISC_IDPULLUP_FALL);
621+
622+
dwc3_omap_write_irqmisc_set(omap, reg);
612623
}
613624

614625
static int dwc3_omap_suspend(struct device *dev)

drivers/usb/dwc3/gadget.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -828,10 +828,6 @@ static void dwc3_prepare_one_trb(struct dwc3_ep *dep,
828828
length, last ? " last" : "",
829829
chain ? " chain" : "");
830830

831-
/* Skip the LINK-TRB on ISOC */
832-
if (((dep->free_slot & DWC3_TRB_MASK) == DWC3_TRB_NUM - 1) &&
833-
usb_endpoint_xfer_isoc(dep->endpoint.desc))
834-
dep->free_slot++;
835831

836832
trb = &dep->trb_pool[dep->free_slot & DWC3_TRB_MASK];
837833

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

845841
dep->free_slot++;
842+
/* Skip the LINK-TRB on ISOC */
843+
if (((dep->free_slot & DWC3_TRB_MASK) == DWC3_TRB_NUM - 1) &&
844+
usb_endpoint_xfer_isoc(dep->endpoint.desc))
845+
dep->free_slot++;
846846

847847
trb->size = DWC3_TRB_SIZE_LENGTH(length);
848848
trb->bpl = lower_32_bits(dma);

drivers/usb/gadget/configfs.c

Lines changed: 19 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1145,15 +1145,15 @@ static struct configfs_item_operations interf_item_ops = {
11451145
.store_attribute = usb_os_desc_attr_store,
11461146
};
11471147

1148-
static ssize_t rndis_grp_compatible_id_show(struct usb_os_desc *desc,
1149-
char *page)
1148+
static ssize_t interf_grp_compatible_id_show(struct usb_os_desc *desc,
1149+
char *page)
11501150
{
11511151
memcpy(page, desc->ext_compat_id, 8);
11521152
return 8;
11531153
}
11541154

1155-
static ssize_t rndis_grp_compatible_id_store(struct usb_os_desc *desc,
1156-
const char *page, size_t len)
1155+
static ssize_t interf_grp_compatible_id_store(struct usb_os_desc *desc,
1156+
const char *page, size_t len)
11571157
{
11581158
int l;
11591159

@@ -1171,20 +1171,20 @@ static ssize_t rndis_grp_compatible_id_store(struct usb_os_desc *desc,
11711171
return len;
11721172
}
11731173

1174-
static struct usb_os_desc_attribute rndis_grp_attr_compatible_id =
1174+
static struct usb_os_desc_attribute interf_grp_attr_compatible_id =
11751175
__CONFIGFS_ATTR(compatible_id, S_IRUGO | S_IWUSR,
1176-
rndis_grp_compatible_id_show,
1177-
rndis_grp_compatible_id_store);
1176+
interf_grp_compatible_id_show,
1177+
interf_grp_compatible_id_store);
11781178

1179-
static ssize_t rndis_grp_sub_compatible_id_show(struct usb_os_desc *desc,
1180-
char *page)
1179+
static ssize_t interf_grp_sub_compatible_id_show(struct usb_os_desc *desc,
1180+
char *page)
11811181
{
11821182
memcpy(page, desc->ext_compat_id + 8, 8);
11831183
return 8;
11841184
}
11851185

1186-
static ssize_t rndis_grp_sub_compatible_id_store(struct usb_os_desc *desc,
1187-
const char *page, size_t len)
1186+
static ssize_t interf_grp_sub_compatible_id_store(struct usb_os_desc *desc,
1187+
const char *page, size_t len)
11881188
{
11891189
int l;
11901190

@@ -1202,20 +1202,21 @@ static ssize_t rndis_grp_sub_compatible_id_store(struct usb_os_desc *desc,
12021202
return len;
12031203
}
12041204

1205-
static struct usb_os_desc_attribute rndis_grp_attr_sub_compatible_id =
1205+
static struct usb_os_desc_attribute interf_grp_attr_sub_compatible_id =
12061206
__CONFIGFS_ATTR(sub_compatible_id, S_IRUGO | S_IWUSR,
1207-
rndis_grp_sub_compatible_id_show,
1208-
rndis_grp_sub_compatible_id_store);
1207+
interf_grp_sub_compatible_id_show,
1208+
interf_grp_sub_compatible_id_store);
12091209

12101210
static struct configfs_attribute *interf_grp_attrs[] = {
1211-
&rndis_grp_attr_compatible_id.attr,
1212-
&rndis_grp_attr_sub_compatible_id.attr,
1211+
&interf_grp_attr_compatible_id.attr,
1212+
&interf_grp_attr_sub_compatible_id.attr,
12131213
NULL
12141214
};
12151215

12161216
int usb_os_desc_prepare_interf_dir(struct config_group *parent,
12171217
int n_interf,
12181218
struct usb_os_desc **desc,
1219+
char **names,
12191220
struct module *owner)
12201221
{
12211222
struct config_group **f_default_groups, *os_desc_group,
@@ -1257,8 +1258,8 @@ int usb_os_desc_prepare_interf_dir(struct config_group *parent,
12571258
d = desc[n_interf];
12581259
d->owner = owner;
12591260
config_group_init_type_name(&d->group, "", interface_type);
1260-
config_item_set_name(&d->group.cg_item, "interface.%d",
1261-
n_interf);
1261+
config_item_set_name(&d->group.cg_item, "interface.%s",
1262+
names[n_interf]);
12621263
interface_groups[n_interf] = &d->group;
12631264
}
12641265

drivers/usb/gadget/configfs.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ void unregister_gadget_item(struct config_item *item);
88
int usb_os_desc_prepare_interf_dir(struct config_group *parent,
99
int n_interf,
1010
struct usb_os_desc **desc,
11+
char **names,
1112
struct module *owner);
1213

1314
static inline struct usb_os_desc *to_usb_os_desc(struct config_item *item)

drivers/usb/gadget/f_fs.c

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1483,11 +1483,13 @@ static int functionfs_bind(struct ffs_data *ffs, struct usb_composite_dev *cdev)
14831483
ffs->ep0req->context = ffs;
14841484

14851485
lang = ffs->stringtabs;
1486-
for (lang = ffs->stringtabs; *lang; ++lang) {
1487-
struct usb_string *str = (*lang)->strings;
1488-
int id = first_id;
1489-
for (; str->s; ++id, ++str)
1490-
str->id = id;
1486+
if (lang) {
1487+
for (; *lang; ++lang) {
1488+
struct usb_string *str = (*lang)->strings;
1489+
int id = first_id;
1490+
for (; str->s; ++id, ++str)
1491+
str->id = id;
1492+
}
14911493
}
14921494

14931495
ffs->gadget = cdev->gadget;

drivers/usb/gadget/f_rndis.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -687,7 +687,7 @@ rndis_bind(struct usb_configuration *c, struct usb_function *f)
687687
f->os_desc_table = kzalloc(sizeof(*f->os_desc_table),
688688
GFP_KERNEL);
689689
if (!f->os_desc_table)
690-
return PTR_ERR(f->os_desc_table);
690+
return -ENOMEM;
691691
f->os_desc_n = 1;
692692
f->os_desc_table[0].os_desc = &rndis_opts->rndis_os_desc;
693693
}
@@ -905,6 +905,7 @@ static struct usb_function_instance *rndis_alloc_inst(void)
905905
{
906906
struct f_rndis_opts *opts;
907907
struct usb_os_desc *descs[1];
908+
char *names[1];
908909

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

924925
descs[0] = &opts->rndis_os_desc;
926+
names[0] = "rndis";
925927
usb_os_desc_prepare_interf_dir(&opts->func_inst.group, 1, descs,
926-
THIS_MODULE);
928+
names, THIS_MODULE);
927929
config_group_init_type_name(&opts->func_inst.group, "",
928930
&rndis_func_type);
929931

drivers/usb/gadget/gr_udc.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1532,8 +1532,9 @@ static int gr_ep_enable(struct usb_ep *_ep,
15321532
"%s mode: multiple trans./microframe not valid\n",
15331533
(mode == 2 ? "Bulk" : "Control"));
15341534
return -EINVAL;
1535-
} else if (nt == 0x11) {
1536-
dev_err(dev->dev, "Invalid value for trans./microframe\n");
1535+
} else if (nt == 0x3) {
1536+
dev_err(dev->dev,
1537+
"Invalid value 0x3 for additional trans./microframe\n");
15371538
return -EINVAL;
15381539
} else if ((nt + 1) * max > buffer_size) {
15391540
dev_err(dev->dev, "Hw buffer size %d < max payload %d * %d\n",

drivers/usb/gadget/inode.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1264,8 +1264,13 @@ dev_release (struct inode *inode, struct file *fd)
12641264

12651265
kfree (dev->buf);
12661266
dev->buf = NULL;
1267-
put_dev (dev);
12681267

1268+
/* other endpoints were all decoupled from this device */
1269+
spin_lock_irq(&dev->lock);
1270+
dev->state = STATE_DEV_DISABLED;
1271+
spin_unlock_irq(&dev->lock);
1272+
1273+
put_dev (dev);
12691274
return 0;
12701275
}
12711276

drivers/usb/gadget/u_ether.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1120,7 +1120,10 @@ void gether_disconnect(struct gether *link)
11201120

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

1123+
netif_tx_lock(dev->net);
11231124
netif_stop_queue(dev->net);
1125+
netif_tx_unlock(dev->net);
1126+
11241127
netif_carrier_off(dev->net);
11251128

11261129
/* disable endpoints, forcing (synchronous) completion

drivers/usb/host/Kconfig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ config USB_EHCI_HCD_AT91
176176

177177
config USB_EHCI_MSM
178178
tristate "Support for Qualcomm QSD/MSM on-chip EHCI USB controller"
179-
depends on ARCH_MSM
179+
depends on ARCH_MSM || ARCH_QCOM
180180
select USB_EHCI_ROOT_HUB_TT
181181
---help---
182182
Enables support for the USB Host controller present on the

drivers/usb/host/xhci-hub.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222

2323

2424
#include <linux/slab.h>
25+
#include <linux/device.h>
2526
#include <asm/unaligned.h>
2627

2728
#include "xhci.h"
@@ -1139,7 +1140,9 @@ int xhci_bus_suspend(struct usb_hcd *hcd)
11391140
* including the USB 3.0 roothub, but only if CONFIG_PM_RUNTIME
11401141
* is enabled, so also enable remote wake here.
11411142
*/
1142-
if (hcd->self.root_hub->do_remote_wakeup) {
1143+
if (hcd->self.root_hub->do_remote_wakeup
1144+
&& device_may_wakeup(hcd->self.controller)) {
1145+
11431146
if (t1 & PORT_CONNECT) {
11441147
t2 |= PORT_WKOC_E | PORT_WKDISC_E;
11451148
t2 &= ~PORT_WKCONN_E;

drivers/usb/host/xhci-ring.c

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1433,8 +1433,11 @@ static void handle_cmd_completion(struct xhci_hcd *xhci,
14331433
xhci_handle_cmd_reset_ep(xhci, slot_id, cmd_trb, cmd_comp_code);
14341434
break;
14351435
case TRB_RESET_DEV:
1436-
WARN_ON(slot_id != TRB_TO_SLOT_ID(
1437-
le32_to_cpu(cmd_trb->generic.field[3])));
1436+
/* SLOT_ID field in reset device cmd completion event TRB is 0.
1437+
* Use the SLOT_ID from the command TRB instead (xhci 4.6.11)
1438+
*/
1439+
slot_id = TRB_TO_SLOT_ID(
1440+
le32_to_cpu(cmd_trb->generic.field[3]));
14381441
xhci_handle_cmd_reset_dev(xhci, slot_id, event);
14391442
break;
14401443
case TRB_NEC_GET_FW:
@@ -3534,7 +3537,7 @@ static unsigned int xhci_get_burst_count(struct xhci_hcd *xhci,
35343537
return 0;
35353538

35363539
max_burst = urb->ep->ss_ep_comp.bMaxBurst;
3537-
return roundup(total_packet_count, max_burst + 1) - 1;
3540+
return DIV_ROUND_UP(total_packet_count, max_burst + 1) - 1;
35383541
}
35393542

35403543
/*

drivers/usb/host/xhci.c

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -936,7 +936,7 @@ int xhci_suspend(struct xhci_hcd *xhci)
936936
*/
937937
int xhci_resume(struct xhci_hcd *xhci, bool hibernated)
938938
{
939-
u32 command, temp = 0;
939+
u32 command, temp = 0, status;
940940
struct usb_hcd *hcd = xhci_to_hcd(xhci);
941941
struct usb_hcd *secondary_hcd;
942942
int retval = 0;
@@ -1054,8 +1054,12 @@ int xhci_resume(struct xhci_hcd *xhci, bool hibernated)
10541054

10551055
done:
10561056
if (retval == 0) {
1057-
usb_hcd_resume_root_hub(hcd);
1058-
usb_hcd_resume_root_hub(xhci->shared_hcd);
1057+
/* Resume root hubs only when have pending events. */
1058+
status = readl(&xhci->op_regs->status);
1059+
if (status & STS_EINT) {
1060+
usb_hcd_resume_root_hub(hcd);
1061+
usb_hcd_resume_root_hub(xhci->shared_hcd);
1062+
}
10591063
}
10601064

10611065
/*

0 commit comments

Comments
 (0)