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

Commit 6399232f authored by Greg Kroah-Hartman's avatar Greg Kroah-Hartman
Browse files

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

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

Felipe writes:

Here's the first set of fixes for v4.7-rc
cycle. Nothing extra fancy this time around.

Patches range from MS OS Descriptor usage fixes, to
Clear Stall EP command fix on dwc3, to some f_fs
fixes and out of bounds accesses on renesas driver.
parents 1a695a90 50c763f8
Loading
Loading
Loading
Loading
+29 −29
Original line number Diff line number Diff line
What:		/config/usb-gadget/gadget/functions/uvc.name
Date:		Dec 2014
KernelVersion:	3.20
KernelVersion:	4.0
Description:	UVC function directory

		streaming_maxburst	- 0..15 (ss only)
@@ -9,37 +9,37 @@ Description: UVC function directory

What:		/config/usb-gadget/gadget/functions/uvc.name/control
Date:		Dec 2014
KernelVersion:	3.20
KernelVersion:	4.0
Description:	Control descriptors

What:		/config/usb-gadget/gadget/functions/uvc.name/control/class
Date:		Dec 2014
KernelVersion:	3.20
KernelVersion:	4.0
Description:	Class descriptors

What:		/config/usb-gadget/gadget/functions/uvc.name/control/class/ss
Date:		Dec 2014
KernelVersion:	3.20
KernelVersion:	4.0
Description:	Super speed control class descriptors

What:		/config/usb-gadget/gadget/functions/uvc.name/control/class/fs
Date:		Dec 2014
KernelVersion:	3.20
KernelVersion:	4.0
Description:	Full speed control class descriptors

What:		/config/usb-gadget/gadget/functions/uvc.name/control/terminal
Date:		Dec 2014
KernelVersion:	3.20
KernelVersion:	4.0
Description:	Terminal descriptors

What:		/config/usb-gadget/gadget/functions/uvc.name/control/terminal/output
Date:		Dec 2014
KernelVersion:	3.20
KernelVersion:	4.0
Description:	Output terminal descriptors

What:		/config/usb-gadget/gadget/functions/uvc.name/control/terminal/output/default
Date:		Dec 2014
KernelVersion:	3.20
KernelVersion:	4.0
Description:	Default output terminal descriptors

		All attributes read only:
@@ -53,12 +53,12 @@ Description: Default output terminal descriptors

What:		/config/usb-gadget/gadget/functions/uvc.name/control/terminal/camera
Date:		Dec 2014
KernelVersion:	3.20
KernelVersion:	4.0
Description:	Camera terminal descriptors

What:		/config/usb-gadget/gadget/functions/uvc.name/control/terminal/camera/default
Date:		Dec 2014
KernelVersion:	3.20
KernelVersion:	4.0
Description:	Default camera terminal descriptors

		All attributes read only:
@@ -75,12 +75,12 @@ Description: Default camera terminal descriptors

What:		/config/usb-gadget/gadget/functions/uvc.name/control/processing
Date:		Dec 2014
KernelVersion:	3.20
KernelVersion:	4.0
Description:	Processing unit descriptors

What:		/config/usb-gadget/gadget/functions/uvc.name/control/processing/default
Date:		Dec 2014
KernelVersion:	3.20
KernelVersion:	4.0
Description:	Default processing unit descriptors

		All attributes read only:
@@ -94,49 +94,49 @@ Description: Default processing unit descriptors

What:		/config/usb-gadget/gadget/functions/uvc.name/control/header
Date:		Dec 2014
KernelVersion:	3.20
KernelVersion:	4.0
Description:	Control header descriptors

What:		/config/usb-gadget/gadget/functions/uvc.name/control/header/name
Date:		Dec 2014
KernelVersion:	3.20
KernelVersion:	4.0
Description:	Specific control header descriptors

dwClockFrequency
bcdUVC
What:		/config/usb-gadget/gadget/functions/uvc.name/streaming
Date:		Dec 2014
KernelVersion:	3.20
KernelVersion:	4.0
Description:	Streaming descriptors

What:		/config/usb-gadget/gadget/functions/uvc.name/streaming/class
Date:		Dec 2014
KernelVersion:	3.20
KernelVersion:	4.0
Description:	Streaming class descriptors

What:		/config/usb-gadget/gadget/functions/uvc.name/streaming/class/ss
Date:		Dec 2014
KernelVersion:	3.20
KernelVersion:	4.0
Description:	Super speed streaming class descriptors

What:		/config/usb-gadget/gadget/functions/uvc.name/streaming/class/hs
Date:		Dec 2014
KernelVersion:	3.20
KernelVersion:	4.0
Description:	High speed streaming class descriptors

What:		/config/usb-gadget/gadget/functions/uvc.name/streaming/class/fs
Date:		Dec 2014
KernelVersion:	3.20
KernelVersion:	4.0
Description:	Full speed streaming class descriptors

What:		/config/usb-gadget/gadget/functions/uvc.name/streaming/color_matching
Date:		Dec 2014
KernelVersion:	3.20
KernelVersion:	4.0
Description:	Color matching descriptors

What:		/config/usb-gadget/gadget/functions/uvc.name/streaming/color_matching/default
Date:		Dec 2014
KernelVersion:	3.20
KernelVersion:	4.0
Description:	Default color matching descriptors

		All attributes read only:
@@ -150,12 +150,12 @@ Description: Default color matching descriptors

What:		/config/usb-gadget/gadget/functions/uvc.name/streaming/mjpeg
Date:		Dec 2014
KernelVersion:	3.20
KernelVersion:	4.0
Description:	MJPEG format descriptors

What:		/config/usb-gadget/gadget/functions/uvc.name/streaming/mjpeg/name
Date:		Dec 2014
KernelVersion:	3.20
KernelVersion:	4.0
Description:	Specific MJPEG format descriptors

		All attributes read only,
@@ -174,7 +174,7 @@ Description: Specific MJPEG format descriptors

What:		/config/usb-gadget/gadget/functions/uvc.name/streaming/mjpeg/name/name
Date:		Dec 2014
KernelVersion:	3.20
KernelVersion:	4.0
Description:	Specific MJPEG frame descriptors

		dwFrameInterval		- indicates how frame interval can be
@@ -196,12 +196,12 @@ Description: Specific MJPEG frame descriptors

What:		/config/usb-gadget/gadget/functions/uvc.name/streaming/uncompressed
Date:		Dec 2014
KernelVersion:	3.20
KernelVersion:	4.0
Description:	Uncompressed format descriptors

What:		/config/usb-gadget/gadget/functions/uvc.name/streaming/uncompressed/name
Date:		Dec 2014
KernelVersion:	3.20
KernelVersion:	4.0
Description:	Specific uncompressed format descriptors

		bmaControls		- this format's data for bmaControls in
@@ -221,7 +221,7 @@ Description: Specific uncompressed format descriptors

What:		/config/usb-gadget/gadget/functions/uvc.name/streaming/uncompressed/name/name
Date:		Dec 2014
KernelVersion:	3.20
KernelVersion:	4.0
Description:	Specific uncompressed frame descriptors

		dwFrameInterval		- indicates how frame interval can be
@@ -243,12 +243,12 @@ Description: Specific uncompressed frame descriptors

What:		/config/usb-gadget/gadget/functions/uvc.name/streaming/header
Date:		Dec 2014
KernelVersion:	3.20
KernelVersion:	4.0
Description:	Streaming header descriptors

What:		/config/usb-gadget/gadget/functions/uvc.name/streaming/header/name
Date:		Dec 2014
KernelVersion:	3.20
KernelVersion:	4.0
Description:	Specific streaming header descriptors

		All attributes read only:
+27 −0
Original line number Diff line number Diff line
@@ -64,6 +64,17 @@
	DWC2_TRACE_SCHEDULER_VB(pr_fmt("%s: SCH: " fmt),		\
				dev_name(hsotg->dev), ##__VA_ARGS__)

#ifdef CONFIG_MIPS
/*
 * There are some MIPS machines that can run in either big-endian
 * or little-endian mode and that use the dwc2 register without
 * a byteswap in both ways.
 * Unlike other architectures, MIPS apparently does not require a
 * barrier before the __raw_writel() to synchronize with DMA but does
 * require the barrier after the __raw_writel() to serialize a set of
 * writes. This set of operations was added specifically for MIPS and
 * should only be used there.
 */
static inline u32 dwc2_readl(const void __iomem *addr)
{
	u32 value = __raw_readl(addr);
@@ -90,6 +101,22 @@ static inline void dwc2_writel(u32 value, void __iomem *addr)
	pr_info("INFO:: wrote %08x to %p\n", value, addr);
#endif
}
#else
/* Normal architectures just use readl/write */
static inline u32 dwc2_readl(const void __iomem *addr)
{
	return readl(addr);
}

static inline void dwc2_writel(u32 value, void __iomem *addr)
{
	writel(value, addr);

#ifdef DWC2_LOG_WRITES
	pr_info("info:: wrote %08x to %p\n", value, addr);
#endif
}
#endif

/* Maximum number of Endpoints/HostChannels */
#define MAX_EPS_CHANNELS	16
+20 −4
Original line number Diff line number Diff line
@@ -1018,7 +1018,7 @@ static int dwc2_hsotg_process_req_status(struct dwc2_hsotg *hsotg,
	return 1;
}

static int dwc2_hsotg_ep_sethalt(struct usb_ep *ep, int value);
static int dwc2_hsotg_ep_sethalt(struct usb_ep *ep, int value, bool now);

/**
 * get_ep_head - return the first request on the endpoint
@@ -1094,7 +1094,7 @@ static int dwc2_hsotg_process_req_feature(struct dwc2_hsotg *hsotg,
		case USB_ENDPOINT_HALT:
			halted = ep->halted;

			dwc2_hsotg_ep_sethalt(&ep->ep, set);
			dwc2_hsotg_ep_sethalt(&ep->ep, set, true);

			ret = dwc2_hsotg_send_reply(hsotg, ep0, NULL, 0);
			if (ret) {
@@ -2948,8 +2948,13 @@ static int dwc2_hsotg_ep_dequeue(struct usb_ep *ep, struct usb_request *req)
 * dwc2_hsotg_ep_sethalt - set halt on a given endpoint
 * @ep: The endpoint to set halt.
 * @value: Set or unset the halt.
 * @now: If true, stall the endpoint now. Otherwise return -EAGAIN if
 *       the endpoint is busy processing requests.
 *
 * We need to stall the endpoint immediately if request comes from set_feature
 * protocol command handler.
 */
static int dwc2_hsotg_ep_sethalt(struct usb_ep *ep, int value)
static int dwc2_hsotg_ep_sethalt(struct usb_ep *ep, int value, bool now)
{
	struct dwc2_hsotg_ep *hs_ep = our_ep(ep);
	struct dwc2_hsotg *hs = hs_ep->parent;
@@ -2969,6 +2974,17 @@ static int dwc2_hsotg_ep_sethalt(struct usb_ep *ep, int value)
		return 0;
	}

	if (hs_ep->isochronous) {
		dev_err(hs->dev, "%s is Isochronous Endpoint\n", ep->name);
		return -EINVAL;
	}

	if (!now && value && !list_empty(&hs_ep->queue)) {
		dev_dbg(hs->dev, "%s request is pending, cannot halt\n",
			ep->name);
		return -EAGAIN;
	}

	if (hs_ep->dir_in) {
		epreg = DIEPCTL(index);
		epctl = dwc2_readl(hs->regs + epreg);
@@ -3020,7 +3036,7 @@ static int dwc2_hsotg_ep_sethalt_lock(struct usb_ep *ep, int value)
	int ret = 0;

	spin_lock_irqsave(&hs->lock, flags);
	ret = dwc2_hsotg_ep_sethalt(ep, value);
	ret = dwc2_hsotg_ep_sethalt(ep, value, false);
	spin_unlock_irqrestore(&hs->lock, flags);

	return ret;
+1 −0
Original line number Diff line number Diff line
@@ -402,6 +402,7 @@
#define DWC3_DEPCMD_GET_RSC_IDX(x)	(((x) >> DWC3_DEPCMD_PARAM_SHIFT) & 0x7f)
#define DWC3_DEPCMD_STATUS(x)		(((x) >> 12) & 0x0F)
#define DWC3_DEPCMD_HIPRI_FORCERM	(1 << 11)
#define DWC3_DEPCMD_CLEARPENDIN		(1 << 11)
#define DWC3_DEPCMD_CMDACT		(1 << 10)
#define DWC3_DEPCMD_CMDIOC		(1 << 8)

+11 −8
Original line number Diff line number Diff line
@@ -128,12 +128,6 @@ static int dwc3_exynos_probe(struct platform_device *pdev)

	platform_set_drvdata(pdev, exynos);

	ret = dwc3_exynos_register_phys(exynos);
	if (ret) {
		dev_err(dev, "couldn't register PHYs\n");
		return ret;
	}

	exynos->dev	= dev;

	exynos->clk = devm_clk_get(dev, "usbdrd30");
@@ -183,20 +177,29 @@ static int dwc3_exynos_probe(struct platform_device *pdev)
		goto err3;
	}

	ret = dwc3_exynos_register_phys(exynos);
	if (ret) {
		dev_err(dev, "couldn't register PHYs\n");
		goto err4;
	}

	if (node) {
		ret = of_platform_populate(node, NULL, NULL, dev);
		if (ret) {
			dev_err(dev, "failed to add dwc3 core\n");
			goto err4;
			goto err5;
		}
	} else {
		dev_err(dev, "no device node, failed to add dwc3 core\n");
		ret = -ENODEV;
		goto err4;
		goto err5;
	}

	return 0;

err5:
	platform_device_unregister(exynos->usb2_phy);
	platform_device_unregister(exynos->usb3_phy);
err4:
	regulator_disable(exynos->vdd10);
err3:
Loading