View | Details | Raw Unified | Return to bug 1220569
Collapse All | Expand All

(-)a/drivers/usb/core/hub.c (-4 / +10 lines)
Lines 4830-4836 hub_port_init(struct usb_hub *hub, struct usb_device *udev, int port1, Link Here
4830
	const char		*driver_name;
4830
	const char		*driver_name;
4831
	bool			do_new_scheme;
4831
	bool			do_new_scheme;
4832
	const bool		initial = !dev_descr;
4832
	const bool		initial = !dev_descr;
4833
	int			maxp0;
4833
	int			maxp0, ep0_maxp;
4834
	struct usb_device_descriptor	*buf, *descr;
4834
	struct usb_device_descriptor	*buf, *descr;
4835
4835
4836
	buf = kmalloc(GET_DESCRIPTOR_BUFSIZE, GFP_NOIO);
4836
	buf = kmalloc(GET_DESCRIPTOR_BUFSIZE, GFP_NOIO);
Lines 5070-5076 hub_port_init(struct usb_hub *hub, struct usb_device *udev, int port1, Link Here
5070
		else
5070
		else
5071
			i = 0;		/* Invalid */
5071
			i = 0;		/* Invalid */
5072
	}
5072
	}
5073
	if (usb_endpoint_maxp(&udev->ep0.desc) == i) {
5073
	ep0_maxp = usb_endpoint_maxp(&udev->ep0.desc);
5074
	if (ep0_maxp == i) {
5074
		;	/* Initial ep0 maxpacket guess is right */
5075
		;	/* Initial ep0 maxpacket guess is right */
5075
	} else if ((udev->speed == USB_SPEED_FULL ||
5076
	} else if ((udev->speed == USB_SPEED_FULL ||
5076
				udev->speed == USB_SPEED_HIGH) &&
5077
				udev->speed == USB_SPEED_HIGH) &&
Lines 5082-5090 hub_port_init(struct usb_hub *hub, struct usb_device *udev, int port1, Link Here
5082
			dev_warn(&udev->dev, "Using ep0 maxpacket: %d\n", i);
5083
			dev_warn(&udev->dev, "Using ep0 maxpacket: %d\n", i);
5083
		udev->ep0.desc.wMaxPacketSize = cpu_to_le16(i);
5084
		udev->ep0.desc.wMaxPacketSize = cpu_to_le16(i);
5084
		usb_ep0_reinit(udev);
5085
		usb_ep0_reinit(udev);
5086
	} else if (udev->speed >= USB_SPEED_SUPER && initial) {
5087
		/* FIXME: should be more restrictive? */
5088
		/* Initial guess is wrong; use the descriptor's value */
5089
		dev_info(&udev->dev, "Using ep0 maxpacket: %d\n", i);
5090
		udev->ep0.desc.wMaxPacketSize = cpu_to_le16(maxp0);
5091
		usb_ep0_reinit(udev);
5085
	} else {
5092
	} else {
5086
		/* Initial guess is wrong and descriptor's value is invalid */
5093
		/* Initial guess is wrong and descriptor's value is invalid */
5087
		dev_err(&udev->dev, "Invalid ep0 maxpacket: %d\n", maxp0);
5094
		dev_err(&udev->dev, "Invalid ep0 maxpacket: %d, expected %d\n", maxp0, ep0_maxp);
5088
		retval = -EMSGSIZE;
5095
		retval = -EMSGSIZE;
5089
		goto fail;
5096
		goto fail;
5090
	}
5097
	}
5091
- 

Return to bug 1220569