Skip to content

Commit 8fcdcc4

Browse files
committed
Merge tag 'usb-4.10-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb
Pull USB fixes from Greg KH: "Here are some small USB fixes for some reported issues, and the usual number of new device ids for 4.10-rc7. All of these, except the last new device id, have been in linux-next for a while with no reported issues" * tag 'usb-4.10-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb: USB: serial: pl2303: add ATEN device ID usb: gadget: f_fs: Assorted buffer overflow checks. USB: Add quirk for WORLDE easykey.25 MIDI keyboard usb: musb: Fix external abort on non-linefetch for musb_irq_work() usb: musb: Fix host mode error -71 regression USB: serial: option: add device ID for HP lt2523 (Novatel E371) USB: serial: qcserial: add Dell DW5570 QDL
2 parents a0a2864 + 4244149 commit 8fcdcc4

File tree

8 files changed

+33
-15
lines changed

8 files changed

+33
-15
lines changed

drivers/usb/core/quirks.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,10 @@ static const struct usb_device_id usb_quirk_list[] = {
3737
/* CBM - Flash disk */
3838
{ USB_DEVICE(0x0204, 0x6025), .driver_info = USB_QUIRK_RESET_RESUME },
3939

40+
/* WORLDE easy key (easykey.25) MIDI controller */
41+
{ USB_DEVICE(0x0218, 0x0401), .driver_info =
42+
USB_QUIRK_CONFIG_INTF_STRINGS },
43+
4044
/* HP 5300/5370C scanner */
4145
{ USB_DEVICE(0x03f0, 0x0701), .driver_info =
4246
USB_QUIRK_STRING_FETCH_255 },

drivers/usb/gadget/function/f_fs.c

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2269,6 +2269,8 @@ static int __ffs_data_do_os_desc(enum ffs_os_desc_type type,
22692269
if (len < sizeof(*d) || h->interface >= ffs->interfaces_count)
22702270
return -EINVAL;
22712271
length = le32_to_cpu(d->dwSize);
2272+
if (len < length)
2273+
return -EINVAL;
22722274
type = le32_to_cpu(d->dwPropertyDataType);
22732275
if (type < USB_EXT_PROP_UNICODE ||
22742276
type > USB_EXT_PROP_UNICODE_MULTI) {
@@ -2277,6 +2279,11 @@ static int __ffs_data_do_os_desc(enum ffs_os_desc_type type,
22772279
return -EINVAL;
22782280
}
22792281
pnl = le16_to_cpu(d->wPropertyNameLength);
2282+
if (length < 14 + pnl) {
2283+
pr_vdebug("invalid os descriptor length: %d pnl:%d (descriptor %d)\n",
2284+
length, pnl, type);
2285+
return -EINVAL;
2286+
}
22802287
pdl = le32_to_cpu(*(u32 *)((u8 *)data + 10 + pnl));
22812288
if (length != 14 + pnl + pdl) {
22822289
pr_vdebug("invalid os descriptor length: %d pnl:%d pdl:%d (descriptor %d)\n",
@@ -2363,6 +2370,9 @@ static int __ffs_data_got_descs(struct ffs_data *ffs,
23632370
}
23642371
}
23652372
if (flags & (1 << i)) {
2373+
if (len < 4) {
2374+
goto error;
2375+
}
23662376
os_descs_count = get_unaligned_le32(data);
23672377
data += 4;
23682378
len -= 4;
@@ -2435,7 +2445,8 @@ static int __ffs_data_got_strings(struct ffs_data *ffs,
24352445

24362446
ENTER();
24372447

2438-
if (unlikely(get_unaligned_le32(data) != FUNCTIONFS_STRINGS_MAGIC ||
2448+
if (unlikely(len < 16 ||
2449+
get_unaligned_le32(data) != FUNCTIONFS_STRINGS_MAGIC ||
24392450
get_unaligned_le32(data + 4) != len))
24402451
goto error;
24412452
str_count = get_unaligned_le32(data + 8);

drivers/usb/musb/musb_core.c

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -594,11 +594,11 @@ static irqreturn_t musb_stage0_irq(struct musb *musb, u8 int_usb,
594594
| MUSB_PORT_STAT_RESUME;
595595
musb->rh_timer = jiffies
596596
+ msecs_to_jiffies(USB_RESUME_TIMEOUT);
597-
musb->need_finish_resume = 1;
598-
599597
musb->xceiv->otg->state = OTG_STATE_A_HOST;
600598
musb->is_active = 1;
601599
musb_host_resume_root_hub(musb);
600+
schedule_delayed_work(&musb->finish_resume_work,
601+
msecs_to_jiffies(USB_RESUME_TIMEOUT));
602602
break;
603603
case OTG_STATE_B_WAIT_ACON:
604604
musb->xceiv->otg->state = OTG_STATE_B_PERIPHERAL;
@@ -1925,13 +1925,24 @@ static void musb_pm_runtime_check_session(struct musb *musb)
19251925
static void musb_irq_work(struct work_struct *data)
19261926
{
19271927
struct musb *musb = container_of(data, struct musb, irq_work.work);
1928+
int error;
1929+
1930+
error = pm_runtime_get_sync(musb->controller);
1931+
if (error < 0) {
1932+
dev_err(musb->controller, "Could not enable: %i\n", error);
1933+
1934+
return;
1935+
}
19281936

19291937
musb_pm_runtime_check_session(musb);
19301938

19311939
if (musb->xceiv->otg->state != musb->xceiv_old_state) {
19321940
musb->xceiv_old_state = musb->xceiv->otg->state;
19331941
sysfs_notify(&musb->controller->kobj, NULL, "mode");
19341942
}
1943+
1944+
pm_runtime_mark_last_busy(musb->controller);
1945+
pm_runtime_put_autosuspend(musb->controller);
19351946
}
19361947

19371948
static void musb_recover_from_babble(struct musb *musb)
@@ -2710,11 +2721,6 @@ static int musb_resume(struct device *dev)
27102721
mask = MUSB_DEVCTL_BDEVICE | MUSB_DEVCTL_FSDEV | MUSB_DEVCTL_LSDEV;
27112722
if ((devctl & mask) != (musb->context.devctl & mask))
27122723
musb->port1_status = 0;
2713-
if (musb->need_finish_resume) {
2714-
musb->need_finish_resume = 0;
2715-
schedule_delayed_work(&musb->finish_resume_work,
2716-
msecs_to_jiffies(USB_RESUME_TIMEOUT));
2717-
}
27182724

27192725
/*
27202726
* The USB HUB code expects the device to be in RPM_ACTIVE once it came
@@ -2766,12 +2772,6 @@ static int musb_runtime_resume(struct device *dev)
27662772

27672773
musb_restore_context(musb);
27682774

2769-
if (musb->need_finish_resume) {
2770-
musb->need_finish_resume = 0;
2771-
schedule_delayed_work(&musb->finish_resume_work,
2772-
msecs_to_jiffies(USB_RESUME_TIMEOUT));
2773-
}
2774-
27752775
spin_lock_irqsave(&musb->lock, flags);
27762776
error = musb_run_resume_work(musb);
27772777
if (error)

drivers/usb/musb/musb_core.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -410,7 +410,6 @@ struct musb {
410410

411411
/* is_suspended means USB B_PERIPHERAL suspend */
412412
unsigned is_suspended:1;
413-
unsigned need_finish_resume :1;
414413

415414
/* may_wakeup means remote wakeup is enabled */
416415
unsigned may_wakeup:1;

drivers/usb/serial/option.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2007,6 +2007,7 @@ static const struct usb_device_id option_ids[] = {
20072007
{ USB_DEVICE_AND_INTERFACE_INFO(WETELECOM_VENDOR_ID, WETELECOM_PRODUCT_WMD200, 0xff, 0xff, 0xff) },
20082008
{ USB_DEVICE_AND_INTERFACE_INFO(WETELECOM_VENDOR_ID, WETELECOM_PRODUCT_6802, 0xff, 0xff, 0xff) },
20092009
{ USB_DEVICE_AND_INTERFACE_INFO(WETELECOM_VENDOR_ID, WETELECOM_PRODUCT_WMD300, 0xff, 0xff, 0xff) },
2010+
{ USB_DEVICE_AND_INTERFACE_INFO(0x03f0, 0x421d, 0xff, 0xff, 0xff) }, /* HP lt2523 (Novatel E371) */
20102011
{ } /* Terminating entry */
20112012
};
20122013
MODULE_DEVICE_TABLE(usb, option_ids);

drivers/usb/serial/pl2303.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ static const struct usb_device_id id_table[] = {
4949
{ USB_DEVICE(IODATA_VENDOR_ID, IODATA_PRODUCT_ID) },
5050
{ USB_DEVICE(IODATA_VENDOR_ID, IODATA_PRODUCT_ID_RSAQ5) },
5151
{ USB_DEVICE(ATEN_VENDOR_ID, ATEN_PRODUCT_ID) },
52+
{ USB_DEVICE(ATEN_VENDOR_ID, ATEN_PRODUCT_ID2) },
5253
{ USB_DEVICE(ATEN_VENDOR_ID2, ATEN_PRODUCT_ID) },
5354
{ USB_DEVICE(ELCOM_VENDOR_ID, ELCOM_PRODUCT_ID) },
5455
{ USB_DEVICE(ELCOM_VENDOR_ID, ELCOM_PRODUCT_ID_UCSGT) },

drivers/usb/serial/pl2303.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
#define ATEN_VENDOR_ID 0x0557
2828
#define ATEN_VENDOR_ID2 0x0547
2929
#define ATEN_PRODUCT_ID 0x2008
30+
#define ATEN_PRODUCT_ID2 0x2118
3031

3132
#define IODATA_VENDOR_ID 0x04bb
3233
#define IODATA_PRODUCT_ID 0x0a03

drivers/usb/serial/qcserial.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,7 @@ static const struct usb_device_id id_table[] = {
124124
{USB_DEVICE(0x1410, 0xa021)}, /* Novatel Gobi 3000 Composite */
125125
{USB_DEVICE(0x413c, 0x8193)}, /* Dell Gobi 3000 QDL */
126126
{USB_DEVICE(0x413c, 0x8194)}, /* Dell Gobi 3000 Composite */
127+
{USB_DEVICE(0x413c, 0x81a6)}, /* Dell DW5570 QDL (MC8805) */
127128
{USB_DEVICE(0x1199, 0x68a4)}, /* Sierra Wireless QDL */
128129
{USB_DEVICE(0x1199, 0x68a5)}, /* Sierra Wireless Modem */
129130
{USB_DEVICE(0x1199, 0x68a8)}, /* Sierra Wireless QDL */

0 commit comments

Comments
 (0)