Commit c875a6c3 authored by Linus Torvalds's avatar Linus Torvalds
Browse files
Pull USB fixes from Greg KH:
 "Here are some small USB fixes, and bunch of reverts for 6.19-rc3.
  Included in here are:

   - reverts of some typec ucsi driver changes that had a lot of
     regression reports after -rc1. Let's just revert it all for now and
     it will come back in a way that is better tested.

   - other typec bugfixes

   - usb-storage quirk fixups

   - dwc3 driver fix

   - other minor USB fixes for reported problems.

  All of these have passed 0-day testing and individual testing"

* tag 'usb-6.19-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb: (22 commits)
  Revert "usb: typec: ucsi: Update UCSI structure to have message in and message out fields"
  Revert "usb: typec: ucsi: Add support for message out data structure"
  Revert "usb: typec: ucsi: Enable debugfs for message_out data structure"
  Revert "usb: typec: ucsi: Add support for SET_PDOS command"
  Revert "usb: typec: ucsi: Fix null pointer dereference in ucsi_sync_control_common"
  Revert "usb: typec: ucsi: Get connector status after enable notifications"
  usb: ohci-nxp: clean up probe error labels
  usb: gadget: lpc32xx_udc: clean up probe error labels
  usb: ohci-nxp: fix device leak on probe failure
  usb: phy: isp1301: fix non-OF device reference imbalance
  usb: gadget: lpc32xx_udc: fix clock imbalance in error path
  usb: typec: ucsi: Get connector status after enable notifications
  usb: usb-storage: Maintain minimal modifications to the bcdDevice range.
  usb: dwc3: of-simple: fix clock resource leak in dwc3_of_simple_probe
  usb: typec: ucsi: Fix null pointer dereference in ucsi_sync_control_common
  USB: lpc32xx_udc: Fix error handling in probe
  usb: typec: altmodes/displayport: Drop the device reference in dp_altmode_probe()
  usb: phy: fsl-usb: Fix use-after-free in delayed work during device removal
  usb: renesas_usbhs: Fix a resource leak in usbhs_pipe_malloc()
  usb: typec: ucsi: huawei-gaokin: add DRM dependency
  ...
parents 15225b91 22201800
Loading
Loading
Loading
Loading
+4 −3
Original line number Diff line number Diff line
@@ -70,11 +70,11 @@ static int dwc3_of_simple_probe(struct platform_device *pdev)
	simple->num_clocks = ret;
	ret = clk_bulk_prepare_enable(simple->num_clocks, simple->clks);
	if (ret)
		goto err_resetc_assert;
		goto err_clk_put_all;

	ret = of_platform_populate(np, NULL, NULL, dev);
	if (ret)
		goto err_clk_put;
		goto err_clk_disable;

	pm_runtime_set_active(dev);
	pm_runtime_enable(dev);
@@ -82,8 +82,9 @@ static int dwc3_of_simple_probe(struct platform_device *pdev)

	return 0;

err_clk_put:
err_clk_disable:
	clk_bulk_disable_unprepare(simple->num_clocks, simple->clks);
err_clk_put_all:
	clk_bulk_put_all(simple->num_clocks, simple->clks);

err_resetc_assert:
+1 −1
Original line number Diff line number Diff line
@@ -4826,7 +4826,7 @@ void dwc3_gadget_exit(struct dwc3 *dwc)
	if (!dwc->gadget)
		return;

	dwc3_enable_susphy(dwc, false);
	dwc3_enable_susphy(dwc, true);
	usb_del_gadget(dwc->gadget);
	dwc3_gadget_free_endpoints(dwc);
	usb_put_gadget(dwc->gadget);
+1 −1
Original line number Diff line number Diff line
@@ -227,7 +227,7 @@ void dwc3_host_exit(struct dwc3 *dwc)
	if (dwc->sys_wakeup)
		device_init_wakeup(&dwc->xhci->dev, false);

	dwc3_enable_susphy(dwc, false);
	dwc3_enable_susphy(dwc, true);
	platform_device_unregister(dwc->xhci);
	dwc->xhci = NULL;
}
+25 −17
Original line number Diff line number Diff line
@@ -3020,7 +3020,7 @@ static int lpc32xx_udc_probe(struct platform_device *pdev)
	pdev->dev.dma_mask = &lpc32xx_usbd_dmamask;
	retval = dma_set_coherent_mask(&pdev->dev, DMA_BIT_MASK(32));
	if (retval)
		return retval;
		goto err_put_client;

	udc->board = &lpc32xx_usbddata;

@@ -3038,28 +3038,32 @@ static int lpc32xx_udc_probe(struct platform_device *pdev)
	/* Get IRQs */
	for (i = 0; i < 4; i++) {
		udc->udp_irq[i] = platform_get_irq(pdev, i);
		if (udc->udp_irq[i] < 0)
			return udc->udp_irq[i];
		if (udc->udp_irq[i] < 0) {
			retval = udc->udp_irq[i];
			goto err_put_client;
		}
	}

	udc->udp_baseaddr = devm_platform_ioremap_resource(pdev, 0);
	if (IS_ERR(udc->udp_baseaddr)) {
		dev_err(udc->dev, "IO map failure\n");
		return PTR_ERR(udc->udp_baseaddr);
		retval = PTR_ERR(udc->udp_baseaddr);
		goto err_put_client;
	}

	/* Get USB device clock */
	udc->usb_slv_clk = devm_clk_get(&pdev->dev, NULL);
	if (IS_ERR(udc->usb_slv_clk)) {
		dev_err(udc->dev, "failed to acquire USB device clock\n");
		return PTR_ERR(udc->usb_slv_clk);
		retval = PTR_ERR(udc->usb_slv_clk);
		goto err_put_client;
	}

	/* Enable USB device clock */
	retval = clk_prepare_enable(udc->usb_slv_clk);
	if (retval < 0) {
		dev_err(udc->dev, "failed to start USB device clock\n");
		return retval;
		goto err_put_client;
	}

	/* Setup deferred workqueue data */
@@ -3080,7 +3084,7 @@ static int lpc32xx_udc_probe(struct platform_device *pdev)
	if (!udc->udca_v_base) {
		dev_err(udc->dev, "error getting UDCA region\n");
		retval = -ENOMEM;
		goto i2c_fail;
		goto err_disable_clk;
	}
	udc->udca_p_base = dma_handle;
	dev_dbg(udc->dev, "DMA buffer(0x%x bytes), P:0x%08x, V:0x%p\n",
@@ -3093,7 +3097,7 @@ static int lpc32xx_udc_probe(struct platform_device *pdev)
	if (!udc->dd_cache) {
		dev_err(udc->dev, "error getting DD DMA region\n");
		retval = -ENOMEM;
		goto dma_alloc_fail;
		goto err_free_dma;
	}

	/* Clear USB peripheral and initialize gadget endpoints */
@@ -3107,14 +3111,14 @@ static int lpc32xx_udc_probe(struct platform_device *pdev)
	if (retval < 0) {
		dev_err(udc->dev, "LP request irq %d failed\n",
			udc->udp_irq[IRQ_USB_LP]);
		goto irq_req_fail;
		goto err_destroy_pool;
	}
	retval = devm_request_irq(dev, udc->udp_irq[IRQ_USB_HP],
				  lpc32xx_usb_hp_irq, 0, "udc_hp", udc);
	if (retval < 0) {
		dev_err(udc->dev, "HP request irq %d failed\n",
			udc->udp_irq[IRQ_USB_HP]);
		goto irq_req_fail;
		goto err_destroy_pool;
	}

	retval = devm_request_irq(dev, udc->udp_irq[IRQ_USB_DEVDMA],
@@ -3122,7 +3126,7 @@ static int lpc32xx_udc_probe(struct platform_device *pdev)
	if (retval < 0) {
		dev_err(udc->dev, "DEV request irq %d failed\n",
			udc->udp_irq[IRQ_USB_DEVDMA]);
		goto irq_req_fail;
		goto err_destroy_pool;
	}

	/* The transceiver interrupt is used for VBUS detection and will
@@ -3133,7 +3137,7 @@ static int lpc32xx_udc_probe(struct platform_device *pdev)
	if (retval < 0) {
		dev_err(udc->dev, "VBUS request irq %d failed\n",
			udc->udp_irq[IRQ_USB_ATX]);
		goto irq_req_fail;
		goto err_destroy_pool;
	}

	/* Initialize wait queue */
@@ -3142,7 +3146,7 @@ static int lpc32xx_udc_probe(struct platform_device *pdev)

	retval = usb_add_gadget_udc(dev, &udc->gadget);
	if (retval < 0)
		goto add_gadget_fail;
		goto err_destroy_pool;

	dev_set_drvdata(dev, udc);
	device_init_wakeup(dev, 1);
@@ -3154,14 +3158,16 @@ static int lpc32xx_udc_probe(struct platform_device *pdev)
	dev_info(udc->dev, "%s version %s\n", driver_name, DRIVER_VERSION);
	return 0;

add_gadget_fail:
irq_req_fail:
err_destroy_pool:
	dma_pool_destroy(udc->dd_cache);
dma_alloc_fail:
err_free_dma:
	dma_free_coherent(&pdev->dev, UDCA_BUFF_SIZE,
			  udc->udca_v_base, udc->udca_p_base);
i2c_fail:
err_disable_clk:
	clk_disable_unprepare(udc->usb_slv_clk);
err_put_client:
	put_device(&udc->isp1301_i2c_client->dev);

	dev_err(udc->dev, "%s probe failed, %d\n", driver_name, retval);

	return retval;
@@ -3190,6 +3196,8 @@ static void lpc32xx_udc_remove(struct platform_device *pdev)
			  udc->udca_v_base, udc->udca_p_base);

	clk_disable_unprepare(udc->usb_slv_clk);

	put_device(&udc->isp1301_i2c_client->dev);
}

#ifdef CONFIG_PM
+10 −8
Original line number Diff line number Diff line
@@ -169,13 +169,13 @@ static int ohci_hcd_nxp_probe(struct platform_device *pdev)

	ret = dma_coerce_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(32));
	if (ret)
		goto fail_disable;
		goto err_put_client;

	dev_dbg(&pdev->dev, "%s: " DRIVER_DESC " (nxp)\n", hcd_name);
	if (usb_disabled()) {
		dev_err(&pdev->dev, "USB is disabled\n");
		ret = -ENODEV;
		goto fail_disable;
		goto err_put_client;
	}

	/* Enable USB host clock */
@@ -183,7 +183,7 @@ static int ohci_hcd_nxp_probe(struct platform_device *pdev)
	if (IS_ERR(usb_host_clk)) {
		dev_err(&pdev->dev, "failed to acquire and start USB OHCI clock\n");
		ret = PTR_ERR(usb_host_clk);
		goto fail_disable;
		goto err_put_client;
	}

	isp1301_configure();
@@ -192,13 +192,13 @@ static int ohci_hcd_nxp_probe(struct platform_device *pdev)
	if (!hcd) {
		dev_err(&pdev->dev, "Failed to allocate HC buffer\n");
		ret = -ENOMEM;
		goto fail_disable;
		goto err_put_client;
	}

	hcd->regs = devm_platform_get_and_ioremap_resource(pdev, 0, &res);
	if (IS_ERR(hcd->regs)) {
		ret = PTR_ERR(hcd->regs);
		goto fail_resource;
		goto err_put_hcd;
	}
	hcd->rsrc_start = res->start;
	hcd->rsrc_len = resource_size(res);
@@ -206,7 +206,7 @@ static int ohci_hcd_nxp_probe(struct platform_device *pdev)
	irq = platform_get_irq(pdev, 0);
	if (irq < 0) {
		ret = -ENXIO;
		goto fail_resource;
		goto err_put_hcd;
	}

	ohci_nxp_start_hc();
@@ -220,9 +220,10 @@ static int ohci_hcd_nxp_probe(struct platform_device *pdev)
	}

	ohci_nxp_stop_hc();
fail_resource:
err_put_hcd:
	usb_put_hcd(hcd);
fail_disable:
err_put_client:
	put_device(&isp1301_i2c_client->dev);
	isp1301_i2c_client = NULL;
	return ret;
}
@@ -234,6 +235,7 @@ static void ohci_hcd_nxp_remove(struct platform_device *pdev)
	usb_remove_hcd(hcd);
	ohci_nxp_stop_hc();
	usb_put_hcd(hcd);
	put_device(&isp1301_i2c_client->dev);
	isp1301_i2c_client = NULL;
}

Loading