Commit a0e3919a authored by Linus Torvalds's avatar Linus Torvalds
Browse files
Pull USB driver fixes from Greg KH:
 "Here are some small USB driver fixes for some reported issues.
  Included in here are:

   - typec driver bugfixes

   - u_serial gadget driver bugfix for much reported and discussed issue

   - dwc2 bugfixes

   - midi gadget driver bugfix

   - ehci-hcd driver bugfix

   - other small bugfixes

  All of these have been in linux-next for over a week with no reported
  issues"

* tag 'usb-6.13-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb:
  usb: typec: ucsi: Fix connector status writing past buffer size
  usb: typec: ucsi: Fix completion notifications
  usb: dwc2: Fix HCD port connection race
  usb: dwc2: hcd: Fix GetPortStatus & SetPortFeature
  usb: dwc2: Fix HCD resume
  usb: gadget: u_serial: Fix the issue that gs_start_io crashed due to accessing null pointer
  usb: misc: onboard_usb_dev: skip suspend/resume sequence for USB5744 SMBus support
  usb: dwc3: xilinx: make sure pipe clock is deselected in usb2 only mode
  usb: core: hcd: only check primary hcd skip_phy_initialization
  usb: gadget: midi2: Fix interpretation of is_midi1 bits
  usb: dwc3: imx8mp: fix software node kernel dump
  usb: typec: anx7411: fix OF node reference leaks in anx7411_typec_switch_probe()
  usb: typec: anx7411: fix fwnode_handle reference leak
  usb: host: max3421-hcd: Correctly abort a USB request.
  dt-bindings: phy: imx8mq-usb: correct reference to usb-switch.yaml
  usb: ehci-hcd: fix call balance of clocks handling routines
parents 636110be 33ead7e5
Loading
Loading
Loading
Loading
+2 −5
Original line number Diff line number Diff line
@@ -113,11 +113,8 @@ allOf:
          maxItems: 1

  - if:
      properties:
        compatible:
          contains:
            enum:
              - fsl,imx95-usb-phy
      required:
        - orientation-switch
    then:
      $ref: /schemas/usb/usb-switch.yaml#

+7 −1
Original line number Diff line number Diff line
@@ -2794,8 +2794,14 @@ int usb_add_hcd(struct usb_hcd *hcd,
	int retval;
	struct usb_device *rhdev;
	struct usb_hcd *shared_hcd;
	int skip_phy_initialization;

	if (!hcd->skip_phy_initialization) {
	if (usb_hcd_is_primary_hcd(hcd))
		skip_phy_initialization = hcd->skip_phy_initialization;
	else
		skip_phy_initialization = hcd->primary_hcd->skip_phy_initialization;

	if (!skip_phy_initialization) {
		if (usb_hcd_is_primary_hcd(hcd)) {
			hcd->phy_roothub = usb_phy_roothub_alloc(hcd->self.sysdev);
			if (IS_ERR(hcd->phy_roothub))
+8 −11
Original line number Diff line number Diff line
@@ -3546,11 +3546,9 @@ static int dwc2_hcd_hub_control(struct dwc2_hsotg *hsotg, u16 typereq,
			port_status |= USB_PORT_STAT_C_OVERCURRENT << 16;
		}

		if (!hsotg->flags.b.port_connect_status) {
		if (dwc2_is_device_mode(hsotg)) {
			/*
			 * The port is disconnected, which means the core is
			 * either in device mode or it soon will be. Just
			 * return 0's for the remainder of the port status
			 * Just return 0's for the remainder of the port status
			 * since the port register can't be read if the core
			 * is in device mode.
			 */
@@ -3620,13 +3618,11 @@ static int dwc2_hcd_hub_control(struct dwc2_hsotg *hsotg, u16 typereq,
		if (wvalue != USB_PORT_FEAT_TEST && (!windex || windex > 1))
			goto error;

		if (!hsotg->flags.b.port_connect_status) {
		if (dwc2_is_device_mode(hsotg)) {
			/*
			 * The port is disconnected, which means the core is
			 * either in device mode or it soon will be. Just
			 * return without doing anything since the port
			 * register can't be written if the core is in device
			 * mode.
			 * Just return 0's for the remainder of the port status
			 * since the port register can't be read if the core
			 * is in device mode.
			 */
			break;
		}
@@ -4349,7 +4345,7 @@ static int _dwc2_hcd_suspend(struct usb_hcd *hcd)
	if (hsotg->bus_suspended)
		goto skip_power_saving;

	if (hsotg->flags.b.port_connect_status == 0)
	if (!(dwc2_read_hprt0(hsotg) & HPRT0_CONNSTS))
		goto skip_power_saving;

	switch (hsotg->params.power_down) {
@@ -4431,6 +4427,7 @@ static int _dwc2_hcd_resume(struct usb_hcd *hcd)
	 * Power Down mode.
	 */
	if (hprt0 & HPRT0_CONNSTS) {
		set_bit(HCD_FLAG_HW_ACCESSIBLE, &hcd->flags);
		hsotg->lx_state = DWC2_L0;
		goto unlock;
	}
+16 −14
Original line number Diff line number Diff line
@@ -129,6 +129,16 @@ static void dwc3_imx8mp_wakeup_disable(struct dwc3_imx8mp *dwc3_imx)
	writel(val, dwc3_imx->hsio_blk_base + USB_WAKEUP_CTRL);
}

static const struct property_entry dwc3_imx8mp_properties[] = {
	PROPERTY_ENTRY_BOOL("xhci-missing-cas-quirk"),
	PROPERTY_ENTRY_BOOL("xhci-skip-phy-init-quirk"),
	{},
};

static const struct software_node dwc3_imx8mp_swnode = {
	.properties = dwc3_imx8mp_properties,
};

static irqreturn_t dwc3_imx8mp_interrupt(int irq, void *_dwc3_imx)
{
	struct dwc3_imx8mp	*dwc3_imx = _dwc3_imx;
@@ -148,17 +158,6 @@ static irqreturn_t dwc3_imx8mp_interrupt(int irq, void *_dwc3_imx)
	return IRQ_HANDLED;
}

static int dwc3_imx8mp_set_software_node(struct device *dev)
{
	struct property_entry props[3] = { 0 };
	int prop_idx = 0;

	props[prop_idx++] = PROPERTY_ENTRY_BOOL("xhci-missing-cas-quirk");
	props[prop_idx++] = PROPERTY_ENTRY_BOOL("xhci-skip-phy-init-quirk");

	return device_create_managed_software_node(dev, props, NULL);
}

static int dwc3_imx8mp_probe(struct platform_device *pdev)
{
	struct device		*dev = &pdev->dev;
@@ -221,17 +220,17 @@ static int dwc3_imx8mp_probe(struct platform_device *pdev)
	if (err < 0)
		goto disable_rpm;

	err = dwc3_imx8mp_set_software_node(dev);
	err = device_add_software_node(dev, &dwc3_imx8mp_swnode);
	if (err) {
		err = -ENODEV;
		dev_err(dev, "failed to create software node\n");
		dev_err(dev, "failed to add software node\n");
		goto disable_rpm;
	}

	err = of_platform_populate(node, NULL, NULL, dev);
	if (err) {
		dev_err(&pdev->dev, "failed to create dwc3 core\n");
		goto disable_rpm;
		goto remove_swnode;
	}

	dwc3_imx->dwc3 = of_find_device_by_node(dwc3_np);
@@ -255,6 +254,8 @@ static int dwc3_imx8mp_probe(struct platform_device *pdev)

depopulate:
	of_platform_depopulate(dev);
remove_swnode:
	device_remove_software_node(dev);
disable_rpm:
	pm_runtime_disable(dev);
	pm_runtime_put_noidle(dev);
@@ -268,6 +269,7 @@ static void dwc3_imx8mp_remove(struct platform_device *pdev)

	pm_runtime_get_sync(dev);
	of_platform_depopulate(dev);
	device_remove_software_node(dev);

	pm_runtime_disable(dev);
	pm_runtime_put_noidle(dev);
+4 −1
Original line number Diff line number Diff line
@@ -121,8 +121,11 @@ static int dwc3_xlnx_init_zynqmp(struct dwc3_xlnx *priv_data)
	 * in use but the usb3-phy entry is missing from the device tree.
	 * Therefore, skip these operations in this case.
	 */
	if (!priv_data->usb3_phy)
	if (!priv_data->usb3_phy) {
		/* Deselect the PIPE Clock Select bit in FPD PIPE Clock register */
		writel(PIPE_CLK_DESELECT, priv_data->regs + XLNX_USB_FPD_PIPE_CLK);
		goto skip_usb3_phy;
	}

	crst = devm_reset_control_get_exclusive(dev, "usb_crst");
	if (IS_ERR(crst)) {
Loading