Merge tag 'usb-6.2-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb
authorLinus Torvalds <torvalds@linux-foundation.org>
Sat, 7 Jan 2023 18:12:42 +0000 (10:12 -0800)
committerLinus Torvalds <torvalds@linux-foundation.org>
Sat, 7 Jan 2023 18:12:42 +0000 (10:12 -0800)
Pull USB fixes from Greg KH:
 "Here are some small USB driver fixes for 6.2-rc3 that resolve some
  reported issues. They include:

   - of-reported ulpi problem, so the offending commit is reverted

   - dwc3 driver bugfixes for recent changes

   - fotg210 fixes

  Most of these have been in linux-next for a while, the last few were
  on the mailing list for a long time and passed all the 0-day bot
  testing so all should be fine with them as well"

* tag 'usb-6.2-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb:
  usb: dwc3: gadget: Ignore End Transfer delay on teardown
  usb: dwc3: xilinx: include linux/gpio/consumer.h
  usb: fotg210-udc: fix error return code in fotg210_udc_probe()
  usb: fotg210: fix OTG-only build
  Revert "usb: ulpi: defer ulpi_register on ulpi_read_id timeout"

drivers/usb/common/ulpi.c
drivers/usb/dwc3/dwc3-xilinx.c
drivers/usb/dwc3/gadget.c
drivers/usb/fotg210/fotg210-core.c
drivers/usb/fotg210/fotg210-udc.c

index 60e8174..d7c8461 100644 (file)
@@ -207,7 +207,7 @@ static int ulpi_read_id(struct ulpi *ulpi)
        /* Test the interface */
        ret = ulpi_write(ulpi, ULPI_SCRATCH, 0xaa);
        if (ret < 0)
-               return ret;
+               goto err;
 
        ret = ulpi_read(ulpi, ULPI_SCRATCH);
        if (ret < 0)
index 8607d4c..0745e9f 100644 (file)
@@ -13,6 +13,7 @@
 #include <linux/of.h>
 #include <linux/platform_device.h>
 #include <linux/dma-mapping.h>
+#include <linux/gpio/consumer.h>
 #include <linux/of_gpio.h>
 #include <linux/of_platform.h>
 #include <linux/pm_runtime.h>
index 7899765..89dcfac 100644 (file)
@@ -1727,6 +1727,7 @@ static int __dwc3_stop_active_transfer(struct dwc3_ep *dep, bool force, bool int
        else if (!ret)
                dep->flags |= DWC3_EP_END_TRANSFER_PENDING;
 
+       dep->flags &= ~DWC3_EP_DELAY_STOP;
        return ret;
 }
 
@@ -3732,8 +3733,10 @@ void dwc3_stop_active_transfer(struct dwc3_ep *dep, bool force,
        if (dep->number <= 1 && dwc->ep0state != EP0_DATA_PHASE)
                return;
 
+       if (interrupt && (dep->flags & DWC3_EP_DELAY_STOP))
+               return;
+
        if (!(dep->flags & DWC3_EP_TRANSFER_STARTED) ||
-           (dep->flags & DWC3_EP_DELAY_STOP) ||
            (dep->flags & DWC3_EP_END_TRANSFER_PENDING))
                return;
 
index 8a54edf..ee740a6 100644 (file)
@@ -144,10 +144,7 @@ static struct platform_driver fotg210_driver = {
 
 static int __init fotg210_init(void)
 {
-       if (usb_disabled())
-               return -ENODEV;
-
-       if (IS_ENABLED(CONFIG_USB_FOTG210_HCD))
+       if (IS_ENABLED(CONFIG_USB_FOTG210_HCD) && !usb_disabled())
                fotg210_hcd_init();
        return platform_driver_register(&fotg210_driver);
 }
index 66e1b7e..87cca81 100644 (file)
@@ -1201,6 +1201,8 @@ int fotg210_udc_probe(struct platform_device *pdev)
                dev_info(dev, "found and initialized PHY\n");
        }
 
+       ret = -ENOMEM;
+
        for (i = 0; i < FOTG210_MAX_NUM_EP; i++) {
                fotg210->ep[i] = kzalloc(sizeof(struct fotg210_ep), GFP_KERNEL);
                if (!fotg210->ep[i])