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

Commit 05bccceb authored by Greg Kroah-Hartman's avatar Greg Kroah-Hartman
Browse files

Merge tag 'fixes-for-v4.15-rc2' of...

Merge tag 'fixes-for-v4.15-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/balbi/usb into usb-linus

Felipe writes:

usb: fixes for v4.15-rc2

After a long time, we finally have a good solution for how to handle
OS descriptor on FFS. From now on we will force the Reserved field to
be 1 as mandated by the specification.

Apart from that, we have a couple other smaller fixes:

- FFS learned to not sleep in atomic context.
- UDC-core has a fix for the way we set a UDC's operating speed.
- Renesas USB3 has a fix for the maximum number of pipes supported
- Allow legacy drivers to be compiled without USB_ETH
- Fix some coccinelle warnings
parents 7a38b2d1 a3acc696
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -508,8 +508,8 @@ choice
	  controller, and the relevant drivers for each function declared
	  by the device.

source "drivers/usb/gadget/legacy/Kconfig"

endchoice

source "drivers/usb/gadget/legacy/Kconfig"

endif # USB_GADGET
+5 −2
Original line number Diff line number Diff line
@@ -146,7 +146,6 @@ int config_ep_by_speed(struct usb_gadget *g,
			struct usb_function *f,
			struct usb_ep *_ep)
{
	struct usb_composite_dev	*cdev = get_gadget_data(g);
	struct usb_endpoint_descriptor *chosen_desc = NULL;
	struct usb_descriptor_header **speed_desc = NULL;

@@ -226,8 +225,12 @@ int config_ep_by_speed(struct usb_gadget *g,
			_ep->maxburst = comp_desc->bMaxBurst + 1;
			break;
		default:
			if (comp_desc->bMaxBurst != 0)
			if (comp_desc->bMaxBurst != 0) {
				struct usb_composite_dev *cdev;

				cdev = get_gadget_data(g);
				ERROR(cdev, "ep0 bMaxBurst must be 0\n");
			}
			_ep->maxburst = 1;
			break;
		}
+12 −3
Original line number Diff line number Diff line
@@ -1012,7 +1012,7 @@ static ssize_t ffs_epfile_io(struct file *file, struct ffs_io_data *io_data)
		else
			ret = ep->status;
		goto error_mutex;
	} else if (!(req = usb_ep_alloc_request(ep->ep, GFP_KERNEL))) {
	} else if (!(req = usb_ep_alloc_request(ep->ep, GFP_ATOMIC))) {
		ret = -ENOMEM;
	} else {
		req->buf      = data;
@@ -2282,9 +2282,18 @@ static int __ffs_data_do_os_desc(enum ffs_os_desc_type type,
		int i;

		if (len < sizeof(*d) ||
		    d->bFirstInterfaceNumber >= ffs->interfaces_count ||
		    !d->Reserved1)
		    d->bFirstInterfaceNumber >= ffs->interfaces_count)
			return -EINVAL;
		if (d->Reserved1 != 1) {
			/*
			 * According to the spec, Reserved1 must be set to 1
			 * but older kernels incorrectly rejected non-zero
			 * values.  We fix it here to avoid returning EINVAL
			 * in response to values we used to accept.
			 */
			pr_debug("usb_ext_compat_desc::Reserved1 forced to 1\n");
			d->Reserved1 = 1;
		}
		for (i = 0; i < ARRAY_SIZE(d->Reserved2); ++i)
			if (d->Reserved2[i])
				return -EINVAL;
+10 −0
Original line number Diff line number Diff line
@@ -13,6 +13,14 @@
# both kinds of controller can also support "USB On-the-Go" (CONFIG_USB_OTG).
#

menuconfig USB_GADGET_LEGACY
	bool "Legacy USB Gadget Support"
	help
	   Legacy USB gadgets are USB gadgets that do not use the USB gadget
	   configfs interface.

if USB_GADGET_LEGACY

config USB_ZERO
	tristate "Gadget Zero (DEVELOPMENT)"
	select USB_LIBCOMPOSITE
@@ -490,3 +498,5 @@ config USB_G_WEBCAM

	  Say "y" to link the driver statically, or "m" to build a
	  dynamically linked module called "g_webcam".

endif
+0 −1
Original line number Diff line number Diff line
@@ -642,7 +642,6 @@ static const struct of_device_id bdc_of_match[] = {
static struct platform_driver bdc_driver = {
	.driver		= {
		.name	= BRCM_BDC_NAME,
		.owner	= THIS_MODULE,
		.pm = &bdc_pm_ops,
		.of_match_table	= bdc_of_match,
	},
Loading