]> git.ipfire.org Git - thirdparty/openwrt.git/commitdiff
kernel: backport ehci overcurrent patches
authorÁlvaro Fernández Rojas <noltari@gmail.com>
Wed, 24 Mar 2021 13:02:56 +0000 (14:02 +0100)
committerÁlvaro Fernández Rojas <noltari@gmail.com>
Wed, 24 Mar 2021 13:05:38 +0000 (14:05 +0100)
These patches have been accepted for v5.13.

Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
target/linux/bcm63xx/patches-5.10/110-MIPS-BCM63XX-EHCI-controller-does-not-support-overcu.patch
target/linux/bcm63xx/patches-5.4/110-MIPS-BCM63XX-EHCI-controller-does-not-support-overcu.patch
target/linux/bmips/patches-5.10/300-usb-host-generic-ehci-ignore-oc-device-tree.patch [deleted file]
target/linux/generic/backport-5.10/810-v5.13-usb-ehci-add-spurious-flag-to-disable-overcurrent-ch.patch [moved from target/linux/generic/pending-5.10/110-ehci_hcd_ignore_oc.patch with 69% similarity]
target/linux/generic/backport-5.10/811-v5.13-usb-host-ehci-platform-add-spurious_oc-DT-support.patch [new file with mode: 0644]
target/linux/generic/backport-5.4/850-v5.13-usb-ehci-add-spurious-flag-to-disable-overcurrent-ch.patch [moved from target/linux/generic/pending-5.4/110-ehci_hcd_ignore_oc.patch with 69% similarity]
target/linux/generic/backport-5.4/851-v5.13-usb-host-ehci-platform-add-spurious_oc-DT-support.patch [new file with mode: 0644]

index 6d91129932fe44f9240e5f67558f1df4ce0ea502..582216648572e5b5051f9075d1058cfe6f8f8d3c 100644 (file)
@@ -4,7 +4,7 @@ Date: Mon, 28 Jan 2013 20:06:30 +0100
 Subject: [PATCH 12/12] MIPS: BCM63XX: EHCI controller does not support
  overcurrent
 
-This patch sets the ignore_oc flag for the BCM63XX EHCI controller as it
+This patch sets the spurious_oc flag for the BCM63XX EHCI controller as it
 does not support proper overcurrent reporting.
 
 Signed-off-by: Florian Fainelli <florian@openwrt.org>
@@ -18,7 +18,7 @@ Signed-off-by: Florian Fainelli <florian@openwrt.org>
  static struct usb_ehci_pdata bcm63xx_ehci_pdata = {
        .big_endian_desc        = 1,
        .big_endian_mmio        = 1,
-+      .ignore_oc              = 1,
++      .spurious_oc            = 1,
        .power_on               = bcm63xx_ehci_power_on,
        .power_off              = bcm63xx_ehci_power_off,
        .power_suspend          = bcm63xx_ehci_power_off,
index 6d91129932fe44f9240e5f67558f1df4ce0ea502..582216648572e5b5051f9075d1058cfe6f8f8d3c 100644 (file)
@@ -4,7 +4,7 @@ Date: Mon, 28 Jan 2013 20:06:30 +0100
 Subject: [PATCH 12/12] MIPS: BCM63XX: EHCI controller does not support
  overcurrent
 
-This patch sets the ignore_oc flag for the BCM63XX EHCI controller as it
+This patch sets the spurious_oc flag for the BCM63XX EHCI controller as it
 does not support proper overcurrent reporting.
 
 Signed-off-by: Florian Fainelli <florian@openwrt.org>
@@ -18,7 +18,7 @@ Signed-off-by: Florian Fainelli <florian@openwrt.org>
  static struct usb_ehci_pdata bcm63xx_ehci_pdata = {
        .big_endian_desc        = 1,
        .big_endian_mmio        = 1,
-+      .ignore_oc              = 1,
++      .spurious_oc            = 1,
        .power_on               = bcm63xx_ehci_power_on,
        .power_off              = bcm63xx_ehci_power_off,
        .power_suspend          = bcm63xx_ehci_power_off,
diff --git a/target/linux/bmips/patches-5.10/300-usb-host-generic-ehci-ignore-oc-device-tree.patch b/target/linux/bmips/patches-5.10/300-usb-host-generic-ehci-ignore-oc-device-tree.patch
deleted file mode 100644 (file)
index e65dbd9..0000000
+++ /dev/null
@@ -1,12 +0,0 @@
---- a/drivers/usb/host/ehci-platform.c
-+++ b/drivers/usb/host/ehci-platform.c
-@@ -286,6 +286,9 @@ static int ehci_platform_probe(struct pl
-               if (of_property_read_bool(dev->dev.of_node, "big-endian"))
-                       ehci->big_endian_mmio = ehci->big_endian_desc = 1;
-+              if (of_property_read_bool(dev->dev.of_node, "ignore-oc"))
-+                      ehci->ignore_oc = 1;
-+
-               if (of_property_read_bool(dev->dev.of_node,
-                                         "needs-reset-on-resume"))
-                       priv->reset_on_resume = true;
similarity index 69%
rename from target/linux/generic/pending-5.10/110-ehci_hcd_ignore_oc.patch
rename to target/linux/generic/backport-5.10/810-v5.13-usb-ehci-add-spurious-flag-to-disable-overcurrent-ch.patch
index 138d4fa1c5283f891ad4891f45a377d0d57c7cf1..8f2021a0fcbdfeafb33edaccc1612ba329003e48 100644 (file)
@@ -1,5 +1,11 @@
+From 2d5ba37461013253d2ff0a3641b727fd32ea97a9 Mon Sep 17 00:00:00 2001
 From: Florian Fainelli <florian@openwrt.org>
-Subject: USB: EHCI: add ignore_oc flag to disable overcurrent checking
+Date: Tue, 23 Feb 2021 18:44:53 +0100
+Subject: [PATCH 1/3] usb: ehci: add spurious flag to disable overcurrent
+ checking
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
 
 This patch adds an ignore_oc flag which can be set by EHCI controller
 not supporting or wanting to disable overcurrent checking. The EHCI
@@ -7,13 +13,16 @@ platform data in include/linux/usb/ehci_pdriver.h is also augmented to
 take advantage of this new flag.
 
 Signed-off-by: Florian Fainelli <florian@openwrt.org>
+Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
+Link: https://lore.kernel.org/r/20210223174455.1378-2-noltari@gmail.com
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
 ---
- drivers/usb/host/ehci-hcd.c      |    2 +-
- drivers/usb/host/ehci-hub.c      |    4 ++--
- drivers/usb/host/ehci-platform.c |    1 +
- drivers/usb/host/ehci.h          |    1 +
- include/linux/usb/ehci_pdriver.h |    1 +
- 5 files changed, 6 insertions(+), 3 deletions(-)
+ drivers/usb/host/ehci-hcd.c      | 2 +-
+ drivers/usb/host/ehci-hub.c      | 4 ++--
+ drivers/usb/host/ehci-platform.c | 2 ++
+ drivers/usb/host/ehci.h          | 1 +
+ include/linux/usb/ehci_pdriver.h | 1 +
+ 5 files changed, 7 insertions(+), 3 deletions(-)
 
 --- a/drivers/usb/host/ehci-hcd.c
 +++ b/drivers/usb/host/ehci-hcd.c
@@ -22,7 +31,7 @@ Signed-off-by: Florian Fainelli <florian@openwrt.org>
                ((ehci->sbrn & 0xf0)>>4), (ehci->sbrn & 0x0f),
                temp >> 8, temp & 0xff,
 -              ignore_oc ? ", overcurrent ignored" : "");
-+              (ignore_oc || ehci->ignore_oc) ? ", overcurrent ignored" : "");
++              (ignore_oc || ehci->spurious_oc) ? ", overcurrent ignored" : "");
  
        ehci_writel(ehci, INTR_MASK,
                    &ehci->regs->intr_enable); /* Turn On Interrupts */
@@ -33,7 +42,7 @@ Signed-off-by: Florian Fainelli <florian@openwrt.org>
         * PORT_POWER; that's surprising, but maybe within-spec.
         */
 -      if (!ignore_oc)
-+      if (!ignore_oc && !ehci->ignore_oc)
++      if (!ignore_oc && !ehci->spurious_oc)
                mask = PORT_CSC | PORT_PEC | PORT_OCC;
        else
                mask = PORT_CSC | PORT_PEC;
@@ -42,7 +51,7 @@ Signed-off-by: Florian Fainelli <florian@openwrt.org>
                        status |= USB_PORT_STAT_C_ENABLE << 16;
  
 -              if ((temp & PORT_OCC) && !ignore_oc){
-+              if ((temp & PORT_OCC) && (!ignore_oc && !ehci->ignore_oc)){
++              if ((temp & PORT_OCC) && (!ignore_oc && !ehci->spurious_oc)){
                        status |= USB_PORT_STAT_C_OVERCURRENT << 16;
  
                        /*
@@ -52,8 +61,8 @@ Signed-off-by: Florian Fainelli <florian@openwrt.org>
                hcd->has_tt = 1;
        if (pdata->reset_on_resume)
                priv->reset_on_resume = true;
-+      if (pdata->ignore_oc)
-+              ehci->ignore_oc = 1;
++      if (pdata->spurious_oc)
++              ehci->spurious_oc = 1;
  
  #ifndef CONFIG_USB_EHCI_BIG_ENDIAN_MMIO
        if (ehci->big_endian_mmio) {
@@ -63,7 +72,7 @@ Signed-off-by: Florian Fainelli <florian@openwrt.org>
        unsigned                frame_index_bug:1; /* MosChip (AKA NetMos) */
        unsigned                need_oc_pp_cycle:1; /* MPC834X port power */
        unsigned                imx28_write_fix:1; /* For Freescale i.MX28 */
-+      unsigned                ignore_oc:1;
++      unsigned                spurious_oc:1;
  
        /* required for usb32 quirk */
        #define OHCI_CTRL_HCFS          (3 << 6)
@@ -73,7 +82,7 @@ Signed-off-by: Florian Fainelli <florian@openwrt.org>
        unsigned        no_io_watchdog:1;
        unsigned        reset_on_resume:1;
        unsigned        dma_mask_64:1;
-+      unsigned        ignore_oc:1;
++      unsigned        spurious_oc:1;
  
        /* Turn on all power and clocks */
        int (*power_on)(struct platform_device *pdev);
diff --git a/target/linux/generic/backport-5.10/811-v5.13-usb-host-ehci-platform-add-spurious_oc-DT-support.patch b/target/linux/generic/backport-5.10/811-v5.13-usb-host-ehci-platform-add-spurious_oc-DT-support.patch
new file mode 100644 (file)
index 0000000..0094d47
--- /dev/null
@@ -0,0 +1,31 @@
+From 4da57dbbffdfa7fe4e2b70b047fc5ff95ff25a3d Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?=C3=81lvaro=20Fern=C3=A1ndez=20Rojas?= <noltari@gmail.com>
+Date: Tue, 23 Feb 2021 18:44:55 +0100
+Subject: [PATCH 3/3] usb: host: ehci-platform: add spurious_oc DT support
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Over-current reporting isn't supported on some platforms such as bcm63xx.
+These devices will incorrectly report over-current if this flag isn't properly
+activated.
+
+Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
+Link: https://lore.kernel.org/r/20210223174455.1378-4-noltari@gmail.com
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ drivers/usb/host/ehci-platform.c | 3 +++
+ 1 file changed, 3 insertions(+)
+
+--- a/drivers/usb/host/ehci-platform.c
++++ b/drivers/usb/host/ehci-platform.c
+@@ -286,6 +286,9 @@ static int ehci_platform_probe(struct pl
+               if (of_property_read_bool(dev->dev.of_node, "big-endian"))
+                       ehci->big_endian_mmio = ehci->big_endian_desc = 1;
++              if (of_property_read_bool(dev->dev.of_node, "spurious-oc"))
++                      ehci->spurious_oc = 1;
++
+               if (of_property_read_bool(dev->dev.of_node,
+                                         "needs-reset-on-resume"))
+                       priv->reset_on_resume = true;
similarity index 69%
rename from target/linux/generic/pending-5.4/110-ehci_hcd_ignore_oc.patch
rename to target/linux/generic/backport-5.4/850-v5.13-usb-ehci-add-spurious-flag-to-disable-overcurrent-ch.patch
index ce583ceac58bd590bb0f4980bbae8d2a1f2967e9..bda1d1df36dca539d2083756b499215c344edb0b 100644 (file)
@@ -1,5 +1,11 @@
+From 2d5ba37461013253d2ff0a3641b727fd32ea97a9 Mon Sep 17 00:00:00 2001
 From: Florian Fainelli <florian@openwrt.org>
-Subject: USB: EHCI: add ignore_oc flag to disable overcurrent checking
+Date: Tue, 23 Feb 2021 18:44:53 +0100
+Subject: [PATCH 1/3] usb: ehci: add spurious flag to disable overcurrent
+ checking
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
 
 This patch adds an ignore_oc flag which can be set by EHCI controller
 not supporting or wanting to disable overcurrent checking. The EHCI
@@ -7,13 +13,16 @@ platform data in include/linux/usb/ehci_pdriver.h is also augmented to
 take advantage of this new flag.
 
 Signed-off-by: Florian Fainelli <florian@openwrt.org>
+Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
+Link: https://lore.kernel.org/r/20210223174455.1378-2-noltari@gmail.com
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
 ---
- drivers/usb/host/ehci-hcd.c      |    2 +-
- drivers/usb/host/ehci-hub.c      |    4 ++--
- drivers/usb/host/ehci-platform.c |    1 +
- drivers/usb/host/ehci.h          |    1 +
- include/linux/usb/ehci_pdriver.h |    1 +
- 5 files changed, 6 insertions(+), 3 deletions(-)
+ drivers/usb/host/ehci-hcd.c      | 2 +-
+ drivers/usb/host/ehci-hub.c      | 4 ++--
+ drivers/usb/host/ehci-platform.c | 2 ++
+ drivers/usb/host/ehci.h          | 1 +
+ include/linux/usb/ehci_pdriver.h | 1 +
+ 5 files changed, 7 insertions(+), 3 deletions(-)
 
 --- a/drivers/usb/host/ehci-hcd.c
 +++ b/drivers/usb/host/ehci-hcd.c
@@ -22,7 +31,7 @@ Signed-off-by: Florian Fainelli <florian@openwrt.org>
                ((ehci->sbrn & 0xf0)>>4), (ehci->sbrn & 0x0f),
                temp >> 8, temp & 0xff,
 -              ignore_oc ? ", overcurrent ignored" : "");
-+              (ignore_oc || ehci->ignore_oc) ? ", overcurrent ignored" : "");
++              (ignore_oc || ehci->spurious_oc) ? ", overcurrent ignored" : "");
  
        ehci_writel(ehci, INTR_MASK,
                    &ehci->regs->intr_enable); /* Turn On Interrupts */
@@ -33,7 +42,7 @@ Signed-off-by: Florian Fainelli <florian@openwrt.org>
         * PORT_POWER; that's surprising, but maybe within-spec.
         */
 -      if (!ignore_oc)
-+      if (!ignore_oc && !ehci->ignore_oc)
++      if (!ignore_oc && !ehci->spurious_oc)
                mask = PORT_CSC | PORT_PEC | PORT_OCC;
        else
                mask = PORT_CSC | PORT_PEC;
@@ -42,7 +51,7 @@ Signed-off-by: Florian Fainelli <florian@openwrt.org>
                        status |= USB_PORT_STAT_C_ENABLE << 16;
  
 -              if ((temp & PORT_OCC) && !ignore_oc){
-+              if ((temp & PORT_OCC) && (!ignore_oc && !ehci->ignore_oc)){
++              if ((temp & PORT_OCC) && (!ignore_oc && !ehci->spurious_oc)){
                        status |= USB_PORT_STAT_C_OVERCURRENT << 16;
  
                        /*
@@ -52,8 +61,8 @@ Signed-off-by: Florian Fainelli <florian@openwrt.org>
                hcd->has_tt = 1;
        if (pdata->reset_on_resume)
                priv->reset_on_resume = true;
-+      if (pdata->ignore_oc)
-+              ehci->ignore_oc = 1;
++      if (pdata->spurious_oc)
++              ehci->spurious_oc = 1;
  
  #ifndef CONFIG_USB_EHCI_BIG_ENDIAN_MMIO
        if (ehci->big_endian_mmio) {
@@ -63,7 +72,7 @@ Signed-off-by: Florian Fainelli <florian@openwrt.org>
        unsigned                frame_index_bug:1; /* MosChip (AKA NetMos) */
        unsigned                need_oc_pp_cycle:1; /* MPC834X port power */
        unsigned                imx28_write_fix:1; /* For Freescale i.MX28 */
-+      unsigned                ignore_oc:1;
++      unsigned                spurious_oc:1;
  
        /* required for usb32 quirk */
        #define OHCI_CTRL_HCFS          (3 << 6)
@@ -73,7 +82,7 @@ Signed-off-by: Florian Fainelli <florian@openwrt.org>
        unsigned        no_io_watchdog:1;
        unsigned        reset_on_resume:1;
        unsigned        dma_mask_64:1;
-+      unsigned        ignore_oc:1;
++      unsigned        spurious_oc:1;
  
        /* Turn on all power and clocks */
        int (*power_on)(struct platform_device *pdev);
diff --git a/target/linux/generic/backport-5.4/851-v5.13-usb-host-ehci-platform-add-spurious_oc-DT-support.patch b/target/linux/generic/backport-5.4/851-v5.13-usb-host-ehci-platform-add-spurious_oc-DT-support.patch
new file mode 100644 (file)
index 0000000..6faefeb
--- /dev/null
@@ -0,0 +1,31 @@
+From 4da57dbbffdfa7fe4e2b70b047fc5ff95ff25a3d Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?=C3=81lvaro=20Fern=C3=A1ndez=20Rojas?= <noltari@gmail.com>
+Date: Tue, 23 Feb 2021 18:44:55 +0100
+Subject: [PATCH 3/3] usb: host: ehci-platform: add spurious_oc DT support
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Over-current reporting isn't supported on some platforms such as bcm63xx.
+These devices will incorrectly report over-current if this flag isn't properly
+activated.
+
+Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
+Link: https://lore.kernel.org/r/20210223174455.1378-4-noltari@gmail.com
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ drivers/usb/host/ehci-platform.c | 3 +++
+ 1 file changed, 3 insertions(+)
+
+--- a/drivers/usb/host/ehci-platform.c
++++ b/drivers/usb/host/ehci-platform.c
+@@ -278,6 +278,9 @@ static int ehci_platform_probe(struct pl
+               if (of_property_read_bool(dev->dev.of_node, "big-endian"))
+                       ehci->big_endian_mmio = ehci->big_endian_desc = 1;
++              if (of_property_read_bool(dev->dev.of_node, "spurious-oc"))
++                      ehci->spurious_oc = 1;
++
+               if (of_property_read_bool(dev->dev.of_node,
+                                         "needs-reset-on-resume"))
+                       priv->reset_on_resume = true;