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

Commit 833674a4 authored by Greg Kroah-Hartman's avatar Greg Kroah-Hartman
Browse files

Merge tag 'fixes-for-v4.10-rc5' of...

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

Felipe writes:

usb: fixes for v4.10-rc5

One memory leak fix on the atmel UDC. Several fixes for dwc2. A fix on
composite.c to use usb_ep_free_request() when freeing struct
usb_request.
parents 49def185 efe357f4
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -513,8 +513,8 @@ struct dwc2_core_params {
	/* Gadget parameters */
	bool g_dma;
	bool g_dma_desc;
	u16 g_rx_fifo_size;
	u16 g_np_tx_fifo_size;
	u32 g_rx_fifo_size;
	u32 g_np_tx_fifo_size;
	u32 g_tx_fifo_size[MAX_EPS_CHANNELS];
};

+5 −13
Original line number Diff line number Diff line
@@ -3169,7 +3169,7 @@ void dwc2_hsotg_core_init_disconnected(struct dwc2_hsotg *hsotg,
	/* keep other bits untouched (so e.g. forced modes are not lost) */
	usbcfg = dwc2_readl(hsotg->regs + GUSBCFG);
	usbcfg &= ~(GUSBCFG_TOUTCAL_MASK | GUSBCFG_PHYIF16 | GUSBCFG_SRPCAP |
		GUSBCFG_HNPCAP);
		GUSBCFG_HNPCAP | GUSBCFG_USBTRDTIM_MASK);

	if (hsotg->params.phy_type == DWC2_PHY_TYPE_PARAM_FS &&
	    (hsotg->params.speed == DWC2_SPEED_PARAM_FULL ||
@@ -3749,8 +3749,8 @@ static int dwc2_hsotg_ep_enable(struct usb_ep *ep,
		__func__, epctrl, epctrl_reg);

	/* Allocate DMA descriptor chain for non-ctrl endpoints */
	if (using_desc_dma(hsotg)) {
		hs_ep->desc_list = dma_alloc_coherent(hsotg->dev,
	if (using_desc_dma(hsotg) && !hs_ep->desc_list) {
		hs_ep->desc_list = dmam_alloc_coherent(hsotg->dev,
			MAX_DMA_DESC_NUM_GENERIC *
			sizeof(struct dwc2_dma_desc),
			&hs_ep->desc_list_dma, GFP_ATOMIC);
@@ -3872,7 +3872,7 @@ static int dwc2_hsotg_ep_enable(struct usb_ep *ep,

error2:
	if (ret && using_desc_dma(hsotg) && hs_ep->desc_list) {
		dma_free_coherent(hsotg->dev, MAX_DMA_DESC_NUM_GENERIC *
		dmam_free_coherent(hsotg->dev, MAX_DMA_DESC_NUM_GENERIC *
			sizeof(struct dwc2_dma_desc),
			hs_ep->desc_list, hs_ep->desc_list_dma);
		hs_ep->desc_list = NULL;
@@ -3902,14 +3902,6 @@ static int dwc2_hsotg_ep_disable(struct usb_ep *ep)
		return -EINVAL;
	}

	/* Remove DMA memory allocated for non-control Endpoints */
	if (using_desc_dma(hsotg)) {
		dma_free_coherent(hsotg->dev, MAX_DMA_DESC_NUM_GENERIC *
				  sizeof(struct dwc2_dma_desc),
				  hs_ep->desc_list, hs_ep->desc_list_dma);
		hs_ep->desc_list = NULL;
	}

	epctrl_reg = dir_in ? DIEPCTL(index) : DOEPCTL(index);

	spin_lock_irqsave(&hsotg->lock, flags);
@@ -4131,7 +4123,7 @@ static void dwc2_hsotg_init(struct dwc2_hsotg *hsotg)
	/* keep other bits untouched (so e.g. forced modes are not lost) */
	usbcfg = dwc2_readl(hsotg->regs + GUSBCFG);
	usbcfg &= ~(GUSBCFG_TOUTCAL_MASK | GUSBCFG_PHYIF16 | GUSBCFG_SRPCAP |
		GUSBCFG_HNPCAP);
		GUSBCFG_HNPCAP | GUSBCFG_USBTRDTIM_MASK);

	/* set the PLL on, remove the HNP/SRP and set the PHY */
	trdtim = (hsotg->phyif == GUSBCFG_PHYIF8) ? 9 : 5;
+5 −2
Original line number Diff line number Diff line
@@ -4367,6 +4367,9 @@ static int _dwc2_hcd_suspend(struct usb_hcd *hcd)
	if (!HCD_HW_ACCESSIBLE(hcd))
		goto unlock;

	if (hsotg->op_state == OTG_STATE_B_PERIPHERAL)
		goto unlock;

	if (!hsotg->params.hibernation)
		goto skip_power_saving;

@@ -4489,8 +4492,8 @@ static void dwc2_dump_urb_info(struct usb_hcd *hcd, struct urb *urb,
{
#ifdef VERBOSE_DEBUG
	struct dwc2_hsotg *hsotg = dwc2_hcd_to_hsotg(hcd);
	char *pipetype;
	char *speed;
	char *pipetype = NULL;
	char *speed = NULL;

	dev_vdbg(hsotg->dev, "%s, urb %p\n", fn_name, urb);
	dev_vdbg(hsotg->dev, "  Device address: %d\n",
+5 −5
Original line number Diff line number Diff line
@@ -385,16 +385,16 @@ static void dwc2_set_param(struct dwc2_hsotg *hsotg, void *param,
}

/**
 * dwc2_set_param_u16() - Set a u16 parameter
 * dwc2_set_param_u32() - Set a u32 parameter
 *
 * See dwc2_set_param().
 */
static void dwc2_set_param_u16(struct dwc2_hsotg *hsotg, u16 *param,
static void dwc2_set_param_u32(struct dwc2_hsotg *hsotg, u32 *param,
			       bool lookup, char *property, u16 legacy,
			       u16 def, u16 min, u16 max)
{
	dwc2_set_param(hsotg, param, lookup, property,
		       legacy, def, min, max, 2);
		       legacy, def, min, max, 4);
}

/**
@@ -1178,12 +1178,12 @@ static void dwc2_set_parameters(struct dwc2_hsotg *hsotg,
		 * auto-detect if the hardware does not support the
		 * default.
		 */
		dwc2_set_param_u16(hsotg, &p->g_rx_fifo_size,
		dwc2_set_param_u32(hsotg, &p->g_rx_fifo_size,
				   true, "g-rx-fifo-size", 2048,
				   hw->rx_fifo_size,
				   16, hw->rx_fifo_size);

		dwc2_set_param_u16(hsotg, &p->g_np_tx_fifo_size,
		dwc2_set_param_u32(hsotg, &p->g_np_tx_fifo_size,
				   true, "g-np-tx-fifo-size", 1024,
				   hw->dev_nperio_tx_fifo_size,
				   16, hw->dev_nperio_tx_fifo_size);
+3 −1
Original line number Diff line number Diff line
@@ -138,7 +138,8 @@ static int dwc3_exynos_probe(struct platform_device *pdev)
		exynos->axius_clk = devm_clk_get(dev, "usbdrd30_axius_clk");
		if (IS_ERR(exynos->axius_clk)) {
			dev_err(dev, "no AXI UpScaler clk specified\n");
			return -ENODEV;
			ret = -ENODEV;
			goto axius_clk_err;
		}
		clk_prepare_enable(exynos->axius_clk);
	} else {
@@ -196,6 +197,7 @@ static int dwc3_exynos_probe(struct platform_device *pdev)
	regulator_disable(exynos->vdd33);
err2:
	clk_disable_unprepare(exynos->axius_clk);
axius_clk_err:
	clk_disable_unprepare(exynos->susp_clk);
	clk_disable_unprepare(exynos->clk);
	return ret;
Loading