Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit ad8395e1 authored by Linus Torvalds's avatar Linus Torvalds
Browse files
Pull USB fixes from Greg Kroah-Hartman:
 "Here are a number of tiny USB fixes and new USB device ids for your
  3.9 tree.

  The "largest" one here is a revert of a usb-storage patch that turned
  out to be incorrect, breaking existing users, which is never a good
  thing.  Everything else is pretty simple and small"

* tag 'usb-3.9-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb: (43 commits)
  USB: quatech2: only write to the tty if the port is open.
  qcserial: bind to DM/DIAG port on Gobi 1K devices
  USB: cdc-wdm: fix buffer overflow
  usb: serial: Add Rigblaster Advantage to device table
  qcaux: add Franklin U600
  usb: musb: core: fix possible build error with randconfig
  usb: cp210x new Vendor/Device IDs
  usb: gadget: pxa25x: fix disconnect reporting
  usb: dwc3: ep0: fix sparc64 build
  usb: c67x00 RetryCnt value in c67x00 TD should be 3
  usb: Correction to c67x00 TD data length mask
  usb: Makefile: fix drivers/usb/phy/ Makefile entry
  USB: added support for Cinterion's products AH6 and PLS8
  usb: gadget: fix omap_udc build errors
  USB: storage: fix Huawei mode switching regression
  USB: storage: in-kernel modeswitching is deprecated
  tools: usb: ffs-test: Fix build failure
  USB: option: add Huawei E5331
  usb: musb: omap2430: fix sparse warning
  usb: musb: omap2430: fix omap_musb_mailbox glue check again
  ...
parents cad9d566 27b351c5
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -46,7 +46,7 @@ obj-$(CONFIG_USB_MICROTEK) += image/
obj-$(CONFIG_USB_SERIAL)	+= serial/

obj-$(CONFIG_USB)		+= misc/
obj-$(CONFIG_USB_COMMON)	+= phy/
obj-$(CONFIG_USB_OTG_UTILS)	+= phy/
obj-$(CONFIG_EARLY_PRINTK_DBGP)	+= early/

obj-$(CONFIG_USB_ATM)		+= atm/
+2 −2
Original line number Diff line number Diff line
@@ -100,7 +100,7 @@ struct c67x00_urb_priv {
#define TD_PIDEP_OFFSET		0x04
#define TD_PIDEPMASK_PID	0xF0
#define TD_PIDEPMASK_EP		0x0F
#define TD_PORTLENMASK_DL	0x02FF
#define TD_PORTLENMASK_DL	0x03FF
#define TD_PORTLENMASK_PN	0xC000

#define TD_STATUS_OFFSET	0x07
@@ -590,7 +590,7 @@ static int c67x00_create_td(struct c67x00_hcd *c67x00, struct urb *urb,
{
	struct c67x00_td *td;
	struct c67x00_urb_priv *urbp = urb->hcpriv;
	const __u8 active_flag = 1, retry_cnt = 1;
	const __u8 active_flag = 1, retry_cnt = 3;
	__u8 cmd = 0;
	int tt = 0;

+3 −3
Original line number Diff line number Diff line
@@ -1767,7 +1767,7 @@ static int udc_start(struct ci13xxx *ci)
		goto put_transceiver;
	}

	retval = dbg_create_files(&ci->gadget.dev);
	retval = dbg_create_files(ci->dev);
	if (retval)
		goto unreg_device;

@@ -1796,7 +1796,7 @@ remove_trans:

	dev_err(dev, "error = %i\n", retval);
remove_dbg:
	dbg_remove_files(&ci->gadget.dev);
	dbg_remove_files(ci->dev);
unreg_device:
	device_unregister(&ci->gadget.dev);
put_transceiver:
@@ -1836,7 +1836,7 @@ static void udc_stop(struct ci13xxx *ci)
		if (ci->global_phy)
			usb_put_phy(ci->transceiver);
	}
	dbg_remove_files(&ci->gadget.dev);
	dbg_remove_files(ci->dev);
	device_unregister(&ci->gadget.dev);
	/* my kobject is dynamic, I swear! */
	memset(&ci->gadget, 0, sizeof(ci->gadget));
+20 −3
Original line number Diff line number Diff line
@@ -56,6 +56,7 @@ MODULE_DEVICE_TABLE (usb, wdm_ids);
#define WDM_RESPONDING		7
#define WDM_SUSPENDING		8
#define WDM_RESETTING		9
#define WDM_OVERFLOW		10

#define WDM_MAX			16

@@ -155,6 +156,7 @@ static void wdm_in_callback(struct urb *urb)
{
	struct wdm_device *desc = urb->context;
	int status = urb->status;
	int length = urb->actual_length;

	spin_lock(&desc->iuspin);
	clear_bit(WDM_RESPONDING, &desc->flags);
@@ -185,9 +187,17 @@ static void wdm_in_callback(struct urb *urb)
	}

	desc->rerr = status;
	desc->reslength = urb->actual_length;
	memmove(desc->ubuf + desc->length, desc->inbuf, desc->reslength);
	desc->length += desc->reslength;
	if (length + desc->length > desc->wMaxCommand) {
		/* The buffer would overflow */
		set_bit(WDM_OVERFLOW, &desc->flags);
	} else {
		/* we may already be in overflow */
		if (!test_bit(WDM_OVERFLOW, &desc->flags)) {
			memmove(desc->ubuf + desc->length, desc->inbuf, length);
			desc->length += length;
			desc->reslength = length;
		}
	}
skip_error:
	wake_up(&desc->wait);

@@ -435,6 +445,11 @@ retry:
			rv = -ENODEV;
			goto err;
		}
		if (test_bit(WDM_OVERFLOW, &desc->flags)) {
			clear_bit(WDM_OVERFLOW, &desc->flags);
			rv = -ENOBUFS;
			goto err;
		}
		i++;
		if (file->f_flags & O_NONBLOCK) {
			if (!test_bit(WDM_READ, &desc->flags)) {
@@ -478,6 +493,7 @@ retry:
			spin_unlock_irq(&desc->iuspin);
			goto retry;
		}

		if (!desc->reslength) { /* zero length read */
			dev_dbg(&desc->intf->dev, "%s: zero length - clearing WDM_READ\n", __func__);
			clear_bit(WDM_READ, &desc->flags);
@@ -1004,6 +1020,7 @@ static int wdm_post_reset(struct usb_interface *intf)
	struct wdm_device *desc = wdm_find_device(intf);
	int rv;

	clear_bit(WDM_OVERFLOW, &desc->flags);
	clear_bit(WDM_RESETTING, &desc->flags);
	rv = recover_from_urb_loss(desc);
	mutex_unlock(&desc->wlock);
+1 −0
Original line number Diff line number Diff line
@@ -583,6 +583,7 @@ static int dwc3_remove(struct platform_device *pdev)
		break;
	}

	dwc3_free_event_buffers(dwc);
	dwc3_core_exit(dwc);

	return 0;
Loading