]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
5.10-stable patches
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 1 May 2022 16:36:56 +0000 (18:36 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 1 May 2022 16:36:56 +0000 (18:36 +0200)
added patches:
arch_topology-do-not-set-llc_sibling-if-llc_id-is-invalid.patch
iio-dac-ad5446-fix-read_raw-not-returning-set-value.patch
iio-dac-ad5592r-fix-the-missing-return-value.patch
iio-imu-inv_icm42600-fix-i2c-init-possible-nack.patch
iio-magnetometer-ak8975-fix-the-error-handling-in-ak8975_power_on.patch
serial-8250-also-set-sticky-mcr-bits-in-console-restoration.patch
serial-8250-correct-the-clock-for-endrun-ptp-1588-pcie-device.patch
serial-imx-fix-overrun-interrupts-in-dma-mode.patch
usb-cdns3-fix-issue-for-clear-halt-endpoint.patch
usb-dwc3-core-fix-tx-rx-threshold-settings.patch
usb-dwc3-core-only-handle-soft-reset-in-dctl.patch
usb-dwc3-gadget-return-proper-request-status.patch
usb-dwc3-try-usb-role-switch-first-in-dwc3_drd_init.patch
usb-gadget-configfs-clear-deactivation-flag-in-configfs_composite_unbind.patch
usb-gadget-uvc-fix-crash-when-encoding-data-for-usb-request.patch
usb-misc-fix-improper-handling-of-refcount-in-uss720_probe.patch
usb-phy-generic-get-the-vbus-supply.patch
usb-typec-ucsi-fix-reuse-of-completion-structure.patch
usb-typec-ucsi-fix-role-swapping.patch

20 files changed:
queue-5.10/arch_topology-do-not-set-llc_sibling-if-llc_id-is-invalid.patch [new file with mode: 0644]
queue-5.10/iio-dac-ad5446-fix-read_raw-not-returning-set-value.patch [new file with mode: 0644]
queue-5.10/iio-dac-ad5592r-fix-the-missing-return-value.patch [new file with mode: 0644]
queue-5.10/iio-imu-inv_icm42600-fix-i2c-init-possible-nack.patch [new file with mode: 0644]
queue-5.10/iio-magnetometer-ak8975-fix-the-error-handling-in-ak8975_power_on.patch [new file with mode: 0644]
queue-5.10/serial-8250-also-set-sticky-mcr-bits-in-console-restoration.patch [new file with mode: 0644]
queue-5.10/serial-8250-correct-the-clock-for-endrun-ptp-1588-pcie-device.patch [new file with mode: 0644]
queue-5.10/serial-imx-fix-overrun-interrupts-in-dma-mode.patch [new file with mode: 0644]
queue-5.10/series
queue-5.10/usb-cdns3-fix-issue-for-clear-halt-endpoint.patch [new file with mode: 0644]
queue-5.10/usb-dwc3-core-fix-tx-rx-threshold-settings.patch [new file with mode: 0644]
queue-5.10/usb-dwc3-core-only-handle-soft-reset-in-dctl.patch [new file with mode: 0644]
queue-5.10/usb-dwc3-gadget-return-proper-request-status.patch [new file with mode: 0644]
queue-5.10/usb-dwc3-try-usb-role-switch-first-in-dwc3_drd_init.patch [new file with mode: 0644]
queue-5.10/usb-gadget-configfs-clear-deactivation-flag-in-configfs_composite_unbind.patch [new file with mode: 0644]
queue-5.10/usb-gadget-uvc-fix-crash-when-encoding-data-for-usb-request.patch [new file with mode: 0644]
queue-5.10/usb-misc-fix-improper-handling-of-refcount-in-uss720_probe.patch [new file with mode: 0644]
queue-5.10/usb-phy-generic-get-the-vbus-supply.patch [new file with mode: 0644]
queue-5.10/usb-typec-ucsi-fix-reuse-of-completion-structure.patch [new file with mode: 0644]
queue-5.10/usb-typec-ucsi-fix-role-swapping.patch [new file with mode: 0644]

diff --git a/queue-5.10/arch_topology-do-not-set-llc_sibling-if-llc_id-is-invalid.patch b/queue-5.10/arch_topology-do-not-set-llc_sibling-if-llc_id-is-invalid.patch
new file mode 100644 (file)
index 0000000..726298f
--- /dev/null
@@ -0,0 +1,35 @@
+From 1dc9f1a66e1718479e1c4f95514e1750602a3cb9 Mon Sep 17 00:00:00 2001
+From: Wang Qing <wangqing@vivo.com>
+Date: Sun, 10 Apr 2022 19:36:19 -0700
+Subject: arch_topology: Do not set llc_sibling if llc_id is invalid
+
+From: Wang Qing <wangqing@vivo.com>
+
+commit 1dc9f1a66e1718479e1c4f95514e1750602a3cb9 upstream.
+
+When ACPI is not enabled, cpuid_topo->llc_id = cpu_topo->llc_id = -1, which
+will set llc_sibling 0xff(...), this is misleading.
+
+Don't set llc_sibling(default 0) if we don't know the cache topology.
+
+Reviewed-by: Sudeep Holla <sudeep.holla@arm.com>
+Signed-off-by: Wang Qing <wangqing@vivo.com>
+Fixes: 37c3ec2d810f ("arm64: topology: divorce MC scheduling domain from core_siblings")
+Cc: stable <stable@vger.kernel.org>
+Link: https://lore.kernel.org/r/1649644580-54626-1-git-send-email-wangqing@vivo.com
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ drivers/base/arch_topology.c |    2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/drivers/base/arch_topology.c
++++ b/drivers/base/arch_topology.c
+@@ -515,7 +515,7 @@ void update_siblings_masks(unsigned int
+       for_each_online_cpu(cpu) {
+               cpu_topo = &cpu_topology[cpu];
+-              if (cpuid_topo->llc_id == cpu_topo->llc_id) {
++              if (cpu_topo->llc_id != -1 && cpuid_topo->llc_id == cpu_topo->llc_id) {
+                       cpumask_set_cpu(cpu, &cpuid_topo->llc_sibling);
+                       cpumask_set_cpu(cpuid, &cpu_topo->llc_sibling);
+               }
diff --git a/queue-5.10/iio-dac-ad5446-fix-read_raw-not-returning-set-value.patch b/queue-5.10/iio-dac-ad5446-fix-read_raw-not-returning-set-value.patch
new file mode 100644 (file)
index 0000000..f65bc9d
--- /dev/null
@@ -0,0 +1,36 @@
+From 89a01cd688d3c0ac983ef0b0e5f40018ab768317 Mon Sep 17 00:00:00 2001
+From: Michael Hennerich <michael.hennerich@analog.com>
+Date: Wed, 6 Apr 2022 12:56:20 +0200
+Subject: iio: dac: ad5446: Fix read_raw not returning set value
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+From: Michael Hennerich <michael.hennerich@analog.com>
+
+commit 89a01cd688d3c0ac983ef0b0e5f40018ab768317 upstream.
+
+read_raw should return the un-scaled value.
+
+Fixes: 5e06bdfb46e8b ("staging:iio:dac:ad5446: Return cached value for 'raw' attribute")
+Signed-off-by: Michael Hennerich <michael.hennerich@analog.com>
+Reviewed-by: Nuno Sá <nuno.sa@analog.com>
+Link: https://lore.kernel.org/r/20220406105620.1171340-1-michael.hennerich@analog.com
+Cc: <Stable@vger.kernel.org>
+Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ drivers/iio/dac/ad5446.c |    2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/drivers/iio/dac/ad5446.c
++++ b/drivers/iio/dac/ad5446.c
+@@ -178,7 +178,7 @@ static int ad5446_read_raw(struct iio_de
+       switch (m) {
+       case IIO_CHAN_INFO_RAW:
+-              *val = st->cached_val;
++              *val = st->cached_val >> chan->scan_type.shift;
+               return IIO_VAL_INT;
+       case IIO_CHAN_INFO_SCALE:
+               *val = st->vref_mv;
diff --git a/queue-5.10/iio-dac-ad5592r-fix-the-missing-return-value.patch b/queue-5.10/iio-dac-ad5592r-fix-the-missing-return-value.patch
new file mode 100644 (file)
index 0000000..bbb2d2a
--- /dev/null
@@ -0,0 +1,34 @@
+From b55b38f7cc12da3b9ef36e7a3b7f8f96737df4d5 Mon Sep 17 00:00:00 2001
+From: Zizhuang Deng <sunsetdzz@gmail.com>
+Date: Thu, 10 Mar 2022 20:54:50 +0800
+Subject: iio: dac: ad5592r: Fix the missing return value.
+
+From: Zizhuang Deng <sunsetdzz@gmail.com>
+
+commit b55b38f7cc12da3b9ef36e7a3b7f8f96737df4d5 upstream.
+
+The third call to `fwnode_property_read_u32` did not record
+the return value, resulting in `channel_offstate` possibly
+being assigned the wrong value.
+
+Fixes: 56ca9db862bf ("iio: dac: Add support for the AD5592R/AD5593R ADCs/DACs")
+Signed-off-by: Zizhuang Deng <sunsetdzz@gmail.com>
+Link: https://lore.kernel.org/r/20220310125450.4164164-1-sunsetdzz@gmail.com
+Cc: <Stable@vger.kernel.org>
+Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ drivers/iio/dac/ad5592r-base.c |    2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/drivers/iio/dac/ad5592r-base.c
++++ b/drivers/iio/dac/ad5592r-base.c
+@@ -523,7 +523,7 @@ static int ad5592r_alloc_channels(struct
+               if (!ret)
+                       st->channel_modes[reg] = tmp;
+-              fwnode_property_read_u32(child, "adi,off-state", &tmp);
++              ret = fwnode_property_read_u32(child, "adi,off-state", &tmp);
+               if (!ret)
+                       st->channel_offstate[reg] = tmp;
+       }
diff --git a/queue-5.10/iio-imu-inv_icm42600-fix-i2c-init-possible-nack.patch b/queue-5.10/iio-imu-inv_icm42600-fix-i2c-init-possible-nack.patch
new file mode 100644 (file)
index 0000000..6c39bfd
--- /dev/null
@@ -0,0 +1,48 @@
+From b5d6ba09b10d2ccb865ed9bc45941db0a41c6756 Mon Sep 17 00:00:00 2001
+From: Fawzi Khaber <fawzi.khaber@tdk.com>
+Date: Mon, 11 Apr 2022 13:15:33 +0200
+Subject: iio: imu: inv_icm42600: Fix I2C init possible nack
+
+From: Fawzi Khaber <fawzi.khaber@tdk.com>
+
+commit b5d6ba09b10d2ccb865ed9bc45941db0a41c6756 upstream.
+
+This register write to REG_INTF_CONFIG6 enables a spike filter that
+is impacting the line and can prevent the I2C ACK to be seen by the
+controller. So we don't test the return value.
+
+Fixes: 7297ef1e261672b8 ("iio: imu: inv_icm42600: add I2C driver")
+Signed-off-by: Fawzi Khaber <fawzi.khaber@tdk.com>
+Signed-off-by: Jean-Baptiste Maneyrol <jean-baptiste.maneyrol@tdk.com>
+Link: https://lore.kernel.org/r/20220411111533.5826-1-jmaneyrol@invensense.com
+Cc: <Stable@vger.kernel.org>
+Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ drivers/iio/imu/inv_icm42600/inv_icm42600_i2c.c |   15 +++++++++------
+ 1 file changed, 9 insertions(+), 6 deletions(-)
+
+--- a/drivers/iio/imu/inv_icm42600/inv_icm42600_i2c.c
++++ b/drivers/iio/imu/inv_icm42600/inv_icm42600_i2c.c
+@@ -18,12 +18,15 @@ static int inv_icm42600_i2c_bus_setup(st
+       unsigned int mask, val;
+       int ret;
+-      /* setup interface registers */
+-      ret = regmap_update_bits(st->map, INV_ICM42600_REG_INTF_CONFIG6,
+-                               INV_ICM42600_INTF_CONFIG6_MASK,
+-                               INV_ICM42600_INTF_CONFIG6_I3C_EN);
+-      if (ret)
+-              return ret;
++      /*
++       * setup interface registers
++       * This register write to REG_INTF_CONFIG6 enables a spike filter that
++       * is impacting the line and can prevent the I2C ACK to be seen by the
++       * controller. So we don't test the return value.
++       */
++      regmap_update_bits(st->map, INV_ICM42600_REG_INTF_CONFIG6,
++                         INV_ICM42600_INTF_CONFIG6_MASK,
++                         INV_ICM42600_INTF_CONFIG6_I3C_EN);
+       ret = regmap_update_bits(st->map, INV_ICM42600_REG_INTF_CONFIG4,
+                                INV_ICM42600_INTF_CONFIG4_I3C_BUS_ONLY, 0);
diff --git a/queue-5.10/iio-magnetometer-ak8975-fix-the-error-handling-in-ak8975_power_on.patch b/queue-5.10/iio-magnetometer-ak8975-fix-the-error-handling-in-ak8975_power_on.patch
new file mode 100644 (file)
index 0000000..d1914a5
--- /dev/null
@@ -0,0 +1,42 @@
+From 3a26787dacf04257a68b16315c984eb2c340bc5e Mon Sep 17 00:00:00 2001
+From: Zheyu Ma <zheyuma97@gmail.com>
+Date: Sat, 9 Apr 2022 11:48:49 +0800
+Subject: iio: magnetometer: ak8975: Fix the error handling in ak8975_power_on()
+
+From: Zheyu Ma <zheyuma97@gmail.com>
+
+commit 3a26787dacf04257a68b16315c984eb2c340bc5e upstream.
+
+When the driver fails to enable the regulator 'vid', we will get the
+following splat:
+
+[   79.955610] WARNING: CPU: 5 PID: 441 at drivers/regulator/core.c:2257 _regulator_put+0x3ec/0x4e0
+[   79.959641] RIP: 0010:_regulator_put+0x3ec/0x4e0
+[   79.967570] Call Trace:
+[   79.967773]  <TASK>
+[   79.967951]  regulator_put+0x1f/0x30
+[   79.968254]  devres_release_group+0x319/0x3d0
+[   79.968608]  i2c_device_probe+0x766/0x940
+
+Fix this by disabling the 'vdd' regulator when failing to enable 'vid'
+regulator.
+
+Signed-off-by: Zheyu Ma <zheyuma97@gmail.com>
+Link: https://lore.kernel.org/r/20220409034849.3717231-2-zheyuma97@gmail.com
+Cc: <Stable@vger.kernel.org>
+Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ drivers/iio/magnetometer/ak8975.c |    1 +
+ 1 file changed, 1 insertion(+)
+
+--- a/drivers/iio/magnetometer/ak8975.c
++++ b/drivers/iio/magnetometer/ak8975.c
+@@ -389,6 +389,7 @@ static int ak8975_power_on(const struct
+       if (ret) {
+               dev_warn(&data->client->dev,
+                        "Failed to enable specified Vid supply\n");
++              regulator_disable(data->vdd);
+               return ret;
+       }
diff --git a/queue-5.10/serial-8250-also-set-sticky-mcr-bits-in-console-restoration.patch b/queue-5.10/serial-8250-also-set-sticky-mcr-bits-in-console-restoration.patch
new file mode 100644 (file)
index 0000000..9372ffc
--- /dev/null
@@ -0,0 +1,36 @@
+From 6e6eebdf5e2455f089ccd000754a0deaeb79af82 Mon Sep 17 00:00:00 2001
+From: "Maciej W. Rozycki" <macro@orcam.me.uk>
+Date: Mon, 18 Apr 2022 16:27:10 +0100
+Subject: serial: 8250: Also set sticky MCR bits in console restoration
+
+From: Maciej W. Rozycki <macro@orcam.me.uk>
+
+commit 6e6eebdf5e2455f089ccd000754a0deaeb79af82 upstream.
+
+Sticky MCR bits are lost in console restoration if console suspending
+has been disabled.  This currently affects the AFE bit, which works in
+combination with RTS which we set, so we want to make sure the UART
+retains control of its FIFO where previously requested.  Also specific
+drivers may need other bits in the future.
+
+Signed-off-by: Maciej W. Rozycki <macro@orcam.me.uk>
+Fixes: 4516d50aabed ("serial: 8250: Use canary to restart console after suspend")
+Cc: stable@vger.kernel.org # v4.0+
+Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
+Link: https://lore.kernel.org/r/alpine.DEB.2.21.2204181518490.9383@angie.orcam.me.uk
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ drivers/tty/serial/8250/8250_port.c |    2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/drivers/tty/serial/8250/8250_port.c
++++ b/drivers/tty/serial/8250/8250_port.c
+@@ -3311,7 +3311,7 @@ static void serial8250_console_restore(s
+       serial8250_set_divisor(port, baud, quot, frac);
+       serial_port_out(port, UART_LCR, up->lcr);
+-      serial8250_out_MCR(up, UART_MCR_DTR | UART_MCR_RTS);
++      serial8250_out_MCR(up, up->mcr | UART_MCR_DTR | UART_MCR_RTS);
+ }
+ /*
diff --git a/queue-5.10/serial-8250-correct-the-clock-for-endrun-ptp-1588-pcie-device.patch b/queue-5.10/serial-8250-correct-the-clock-for-endrun-ptp-1588-pcie-device.patch
new file mode 100644 (file)
index 0000000..670d3fa
--- /dev/null
@@ -0,0 +1,63 @@
+From 637674fa40059cddcc3ad2212728965072f62ea3 Mon Sep 17 00:00:00 2001
+From: "Maciej W. Rozycki" <macro@orcam.me.uk>
+Date: Mon, 18 Apr 2022 16:27:16 +0100
+Subject: serial: 8250: Correct the clock for EndRun PTP/1588 PCIe device
+
+From: Maciej W. Rozycki <macro@orcam.me.uk>
+
+commit 637674fa40059cddcc3ad2212728965072f62ea3 upstream.
+
+The EndRun PTP/1588 dual serial port device is based on the Oxford
+Semiconductor OXPCIe952 UART device with the PCI vendor:device ID set
+for EndRun Technologies and is therefore driven by a fixed 62.5MHz clock
+input derived from the 100MHz PCI Express clock.  The clock rate is
+divided by the oversampling rate of 16 as it is supplied to the baud
+rate generator, yielding the baud base of 3906250.
+
+Replace the incorrect baud base of 4000000 with the right value of
+3906250 then, complementing commit 6cbe45d8ac93 ("serial: 8250: Correct
+the clock for OxSemi PCIe devices").
+
+Signed-off-by: Maciej W. Rozycki <macro@orcam.me.uk>
+Cc: stable <stable@kernel.org>
+Fixes: 1bc8cde46a159 ("8250_pci: Added driver for Endrun Technologies PTP PCIe card.")
+Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
+Link: https://lore.kernel.org/r/alpine.DEB.2.21.2204181515270.9383@angie.orcam.me.uk
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ drivers/tty/serial/8250/8250_pci.c |    8 ++++----
+ 1 file changed, 4 insertions(+), 4 deletions(-)
+
+--- a/drivers/tty/serial/8250/8250_pci.c
++++ b/drivers/tty/serial/8250/8250_pci.c
+@@ -2940,7 +2940,7 @@ enum pci_board_num_t {
+       pbn_panacom2,
+       pbn_panacom4,
+       pbn_plx_romulus,
+-      pbn_endrun_2_4000000,
++      pbn_endrun_2_3906250,
+       pbn_oxsemi,
+       pbn_oxsemi_1_4000000,
+       pbn_oxsemi_2_4000000,
+@@ -3468,10 +3468,10 @@ static struct pciserial_board pci_boards
+       * signal now many ports are available
+       * 2 port 952 Uart support
+       */
+-      [pbn_endrun_2_4000000] = {
++      [pbn_endrun_2_3906250] = {
+               .flags          = FL_BASE0,
+               .num_ports      = 2,
+-              .base_baud      = 4000000,
++              .base_baud      = 3906250,
+               .uart_offset    = 0x200,
+               .first_offset   = 0x1000,
+       },
+@@ -4386,7 +4386,7 @@ static const struct pci_device_id serial
+       */
+       {       PCI_VENDOR_ID_ENDRUN, PCI_DEVICE_ID_ENDRUN_1588,
+               PCI_ANY_ID, PCI_ANY_ID, 0, 0,
+-              pbn_endrun_2_4000000 },
++              pbn_endrun_2_3906250 },
+       /*
+        * Quatech cards. These actually have configurable clocks but for
+        * now we just use the default.
diff --git a/queue-5.10/serial-imx-fix-overrun-interrupts-in-dma-mode.patch b/queue-5.10/serial-imx-fix-overrun-interrupts-in-dma-mode.patch
new file mode 100644 (file)
index 0000000..4bfe835
--- /dev/null
@@ -0,0 +1,45 @@
+From 3ee82c6e41f3d2212647ce0bc5a05a0f69097824 Mon Sep 17 00:00:00 2001
+From: Johan Hovold <johan@kernel.org>
+Date: Mon, 11 Apr 2022 10:19:57 +0200
+Subject: serial: imx: fix overrun interrupts in DMA mode
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+From: Johan Hovold <johan@kernel.org>
+
+commit 3ee82c6e41f3d2212647ce0bc5a05a0f69097824 upstream.
+
+Commit 76821e222c18 ("serial: imx: ensure that RX irqs are off if RX is
+off") accidentally enabled overrun interrupts unconditionally when
+deferring DMA enable until after the receiver has been enabled during
+startup.
+
+Fix this by using the DMA-initialised instead of DMA-enabled flag to
+determine whether overrun interrupts should be enabled.
+
+Note that overrun interrupts are already accounted for in
+imx_uart_clear_rx_errors() when using DMA since commit 41d98b5da92f
+("serial: imx-serial - update RX error counters when DMA is used").
+
+Fixes: 76821e222c18 ("serial: imx: ensure that RX irqs are off if RX is off")
+Cc: stable@vger.kernel.org      # 4.17
+Cc: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
+Signed-off-by: Johan Hovold <johan@kernel.org>
+Link: https://lore.kernel.org/r/20220411081957.7846-1-johan@kernel.org
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ drivers/tty/serial/imx.c |    2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/drivers/tty/serial/imx.c
++++ b/drivers/tty/serial/imx.c
+@@ -1470,7 +1470,7 @@ static int imx_uart_startup(struct uart_
+       imx_uart_writel(sport, ucr1, UCR1);
+       ucr4 = imx_uart_readl(sport, UCR4) & ~(UCR4_OREN | UCR4_INVR);
+-      if (!sport->dma_is_enabled)
++      if (!dma_is_inited)
+               ucr4 |= UCR4_OREN;
+       if (sport->inverted_rx)
+               ucr4 |= UCR4_INVR;
index 495b3e1f16924456c575164e492679bc6337d0c8..9bc0802b91a9b2b0729c4699eb507a000652af79 100644 (file)
@@ -10,3 +10,22 @@ usb-serial-option-add-telit-0x1057-0x1058-0x1075-compositions.patch
 xhci-enable-runtime-pm-on-second-alderlake-controller.patch
 xhci-stop-polling-roothubs-after-shutdown.patch
 xhci-increase-usb-u3-u0-link-resume-timeout-from-100ms-to-500ms.patch
+iio-dac-ad5592r-fix-the-missing-return-value.patch
+iio-dac-ad5446-fix-read_raw-not-returning-set-value.patch
+iio-magnetometer-ak8975-fix-the-error-handling-in-ak8975_power_on.patch
+iio-imu-inv_icm42600-fix-i2c-init-possible-nack.patch
+usb-misc-fix-improper-handling-of-refcount-in-uss720_probe.patch
+usb-typec-ucsi-fix-reuse-of-completion-structure.patch
+usb-typec-ucsi-fix-role-swapping.patch
+usb-gadget-uvc-fix-crash-when-encoding-data-for-usb-request.patch
+usb-gadget-configfs-clear-deactivation-flag-in-configfs_composite_unbind.patch
+usb-dwc3-try-usb-role-switch-first-in-dwc3_drd_init.patch
+usb-dwc3-core-fix-tx-rx-threshold-settings.patch
+usb-dwc3-core-only-handle-soft-reset-in-dctl.patch
+usb-dwc3-gadget-return-proper-request-status.patch
+usb-cdns3-fix-issue-for-clear-halt-endpoint.patch
+usb-phy-generic-get-the-vbus-supply.patch
+serial-imx-fix-overrun-interrupts-in-dma-mode.patch
+serial-8250-also-set-sticky-mcr-bits-in-console-restoration.patch
+serial-8250-correct-the-clock-for-endrun-ptp-1588-pcie-device.patch
+arch_topology-do-not-set-llc_sibling-if-llc_id-is-invalid.patch
diff --git a/queue-5.10/usb-cdns3-fix-issue-for-clear-halt-endpoint.patch b/queue-5.10/usb-cdns3-fix-issue-for-clear-halt-endpoint.patch
new file mode 100644 (file)
index 0000000..df9391c
--- /dev/null
@@ -0,0 +1,57 @@
+From b3fa25de31fb7e9afebe9599b8ff32eda13d7c94 Mon Sep 17 00:00:00 2001
+From: Pawel Laszczak <pawell@cadence.com>
+Date: Tue, 29 Mar 2022 10:46:05 +0200
+Subject: usb: cdns3: Fix issue for clear halt endpoint
+
+From: Pawel Laszczak <pawell@cadence.com>
+
+commit b3fa25de31fb7e9afebe9599b8ff32eda13d7c94 upstream.
+
+Path fixes bug which occurs during resetting endpoint in
+__cdns3_gadget_ep_clear_halt function. During resetting endpoint
+controller will change HW/DMA owned TRB. It set Abort flag in
+trb->control and will change trb->length field. If driver want
+to use the aborted trb it must update the changed field in
+TRB.
+
+Fixes: 7733f6c32e36 ("usb: cdns3: Add Cadence USB3 DRD Driver")
+cc: <stable@vger.kernel.org>
+Acked-by: Peter Chen <peter.chen@kernel.org>
+Signed-off-by: Pawel Laszczak <pawell@cadence.com>
+Link: https://lore.kernel.org/r/20220329084605.4022-1-pawell@cadence.com
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ drivers/usb/cdns3/gadget.c |    7 +++++--
+ 1 file changed, 5 insertions(+), 2 deletions(-)
+
+--- a/drivers/usb/cdns3/gadget.c
++++ b/drivers/usb/cdns3/gadget.c
+@@ -2697,6 +2697,7 @@ int __cdns3_gadget_ep_clear_halt(struct
+       struct usb_request *request;
+       struct cdns3_request *priv_req;
+       struct cdns3_trb *trb = NULL;
++      struct cdns3_trb trb_tmp;
+       int ret;
+       int val;
+@@ -2706,8 +2707,10 @@ int __cdns3_gadget_ep_clear_halt(struct
+       if (request) {
+               priv_req = to_cdns3_request(request);
+               trb = priv_req->trb;
+-              if (trb)
++              if (trb) {
++                      trb_tmp = *trb;
+                       trb->control = trb->control ^ cpu_to_le32(TRB_CYCLE);
++              }
+       }
+       writel(EP_CMD_CSTALL | EP_CMD_EPRST, &priv_dev->regs->ep_cmd);
+@@ -2722,7 +2725,7 @@ int __cdns3_gadget_ep_clear_halt(struct
+       if (request) {
+               if (trb)
+-                      trb->control = trb->control ^ cpu_to_le32(TRB_CYCLE);
++                      *trb = trb_tmp;
+               cdns3_rearm_transfer(priv_ep, 1);
+       }
diff --git a/queue-5.10/usb-dwc3-core-fix-tx-rx-threshold-settings.patch b/queue-5.10/usb-dwc3-core-fix-tx-rx-threshold-settings.patch
new file mode 100644 (file)
index 0000000..7b27caf
--- /dev/null
@@ -0,0 +1,40 @@
+From f28ad9069363dec7deb88032b70612755eed9ee6 Mon Sep 17 00:00:00 2001
+From: Thinh Nguyen <Thinh.Nguyen@synopsys.com>
+Date: Mon, 11 Apr 2022 18:33:47 -0700
+Subject: usb: dwc3: core: Fix tx/rx threshold settings
+
+From: Thinh Nguyen <Thinh.Nguyen@synopsys.com>
+
+commit f28ad9069363dec7deb88032b70612755eed9ee6 upstream.
+
+The current driver logic checks against 0 to determine whether the
+periodic tx/rx threshold settings are set, but we may get bogus values
+from uninitialized variables if no device property is set. Properly
+default these variables to 0.
+
+Fixes: 938a5ad1d305 ("usb: dwc3: Check for ESS TX/RX threshold config")
+Cc: <stable@vger.kernel.org>
+Signed-off-by: Thinh Nguyen <Thinh.Nguyen@synopsys.com>
+Link: https://lore.kernel.org/r/cccfce990b11b730b0dae42f9d217dc6fb988c90.1649727139.git.Thinh.Nguyen@synopsys.com
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ drivers/usb/dwc3/core.c |    8 ++++----
+ 1 file changed, 4 insertions(+), 4 deletions(-)
+
+--- a/drivers/usb/dwc3/core.c
++++ b/drivers/usb/dwc3/core.c
+@@ -1277,10 +1277,10 @@ static void dwc3_get_properties(struct d
+       u8                      lpm_nyet_threshold;
+       u8                      tx_de_emphasis;
+       u8                      hird_threshold;
+-      u8                      rx_thr_num_pkt_prd;
+-      u8                      rx_max_burst_prd;
+-      u8                      tx_thr_num_pkt_prd;
+-      u8                      tx_max_burst_prd;
++      u8                      rx_thr_num_pkt_prd = 0;
++      u8                      rx_max_burst_prd = 0;
++      u8                      tx_thr_num_pkt_prd = 0;
++      u8                      tx_max_burst_prd = 0;
+       /* default to highest possible threshold */
+       lpm_nyet_threshold = 0xf;
diff --git a/queue-5.10/usb-dwc3-core-only-handle-soft-reset-in-dctl.patch b/queue-5.10/usb-dwc3-core-only-handle-soft-reset-in-dctl.patch
new file mode 100644 (file)
index 0000000..14a17a7
--- /dev/null
@@ -0,0 +1,35 @@
+From f4fd84ae0765a80494b28c43b756a95100351a94 Mon Sep 17 00:00:00 2001
+From: Thinh Nguyen <Thinh.Nguyen@synopsys.com>
+Date: Thu, 21 Apr 2022 19:33:56 -0700
+Subject: usb: dwc3: core: Only handle soft-reset in DCTL
+
+From: Thinh Nguyen <Thinh.Nguyen@synopsys.com>
+
+commit f4fd84ae0765a80494b28c43b756a95100351a94 upstream.
+
+Make sure not to set run_stop bit or link state change request while
+initiating soft-reset. Register read-modify-write operation may
+unintentionally start the controller before the initialization completes
+with its previous DCTL value, which can cause initialization failure.
+
+Fixes: f59dcab17629 ("usb: dwc3: core: improve reset sequence")
+Cc: <stable@vger.kernel.org>
+Signed-off-by: Thinh Nguyen <Thinh.Nguyen@synopsys.com>
+Link: https://lore.kernel.org/r/6aecbd78328f102003d40ccf18ceeebd411d3703.1650594792.git.Thinh.Nguyen@synopsys.com
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ drivers/usb/dwc3/core.c |    3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+--- a/drivers/usb/dwc3/core.c
++++ b/drivers/usb/dwc3/core.c
+@@ -275,7 +275,8 @@ static int dwc3_core_soft_reset(struct d
+       reg = dwc3_readl(dwc->regs, DWC3_DCTL);
+       reg |= DWC3_DCTL_CSFTRST;
+-      dwc3_writel(dwc->regs, DWC3_DCTL, reg);
++      reg &= ~DWC3_DCTL_RUN_STOP;
++      dwc3_gadget_dctl_write_safe(dwc, reg);
+       /*
+        * For DWC_usb31 controller 1.90a and later, the DCTL.CSFRST bit
diff --git a/queue-5.10/usb-dwc3-gadget-return-proper-request-status.patch b/queue-5.10/usb-dwc3-gadget-return-proper-request-status.patch
new file mode 100644 (file)
index 0000000..5ef4318
--- /dev/null
@@ -0,0 +1,74 @@
+From c7428dbddcf4ea1919e1c8e15f715b94ca359268 Mon Sep 17 00:00:00 2001
+From: Thinh Nguyen <Thinh.Nguyen@synopsys.com>
+Date: Fri, 22 Apr 2022 17:36:28 -0700
+Subject: usb: dwc3: gadget: Return proper request status
+
+From: Thinh Nguyen <Thinh.Nguyen@synopsys.com>
+
+commit c7428dbddcf4ea1919e1c8e15f715b94ca359268 upstream.
+
+If the user sets the usb_request's no_interrupt, then there will be no
+completion event for the request. Currently the driver incorrectly uses
+the event status of a different request to report the status for a
+request with no_interrupt. The dwc3 driver needs to check the TRB status
+associated with the request when reporting its status.
+
+Note: this is only applicable to missed_isoc TRB completion status, but
+the other status are also listed for completeness/documentation.
+
+Fixes: 6d8a019614f3 ("usb: dwc3: gadget: check for Missed Isoc from event status")
+Cc: <stable@vger.kernel.org>
+Signed-off-by: Thinh Nguyen <Thinh.Nguyen@synopsys.com>
+Link: https://lore.kernel.org/r/db2c80108286cfd108adb05bad52138b78d7c3a7.1650673655.git.Thinh.Nguyen@synopsys.com
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ drivers/usb/dwc3/gadget.c |   31 ++++++++++++++++++++++++++++++-
+ 1 file changed, 30 insertions(+), 1 deletion(-)
+
+--- a/drivers/usb/dwc3/gadget.c
++++ b/drivers/usb/dwc3/gadget.c
+@@ -2859,6 +2859,7 @@ static int dwc3_gadget_ep_cleanup_comple
+               const struct dwc3_event_depevt *event,
+               struct dwc3_request *req, int status)
+ {
++      int request_status;
+       int ret;
+       if (req->request.num_mapped_sgs)
+@@ -2879,7 +2880,35 @@ static int dwc3_gadget_ep_cleanup_comple
+               req->needs_extra_trb = false;
+       }
+-      dwc3_gadget_giveback(dep, req, status);
++      /*
++       * The event status only reflects the status of the TRB with IOC set.
++       * For the requests that don't set interrupt on completion, the driver
++       * needs to check and return the status of the completed TRBs associated
++       * with the request. Use the status of the last TRB of the request.
++       */
++      if (req->request.no_interrupt) {
++              struct dwc3_trb *trb;
++
++              trb = dwc3_ep_prev_trb(dep, dep->trb_dequeue);
++              switch (DWC3_TRB_SIZE_TRBSTS(trb->size)) {
++              case DWC3_TRBSTS_MISSED_ISOC:
++                      /* Isoc endpoint only */
++                      request_status = -EXDEV;
++                      break;
++              case DWC3_TRB_STS_XFER_IN_PROG:
++                      /* Applicable when End Transfer with ForceRM=0 */
++              case DWC3_TRBSTS_SETUP_PENDING:
++                      /* Control endpoint only */
++              case DWC3_TRBSTS_OK:
++              default:
++                      request_status = 0;
++                      break;
++              }
++      } else {
++              request_status = status;
++      }
++
++      dwc3_gadget_giveback(dep, req, request_status);
+ out:
+       return ret;
diff --git a/queue-5.10/usb-dwc3-try-usb-role-switch-first-in-dwc3_drd_init.patch b/queue-5.10/usb-dwc3-try-usb-role-switch-first-in-dwc3_drd_init.patch
new file mode 100644 (file)
index 0000000..97f0c9d
--- /dev/null
@@ -0,0 +1,55 @@
+From ab7aa2866d295438dc60522f85c5421c6b4f1507 Mon Sep 17 00:00:00 2001
+From: Sven Peter <sven@svenpeter.dev>
+Date: Mon, 11 Apr 2022 17:53:00 +0200
+Subject: usb: dwc3: Try usb-role-switch first in dwc3_drd_init
+
+From: Sven Peter <sven@svenpeter.dev>
+
+commit ab7aa2866d295438dc60522f85c5421c6b4f1507 upstream.
+
+If the PHY controller node has a "port" dwc3 tries to find an
+extcon device even when "usb-role-switch" is present. This happens
+because dwc3_get_extcon() sees that "port" node and then calls
+extcon_find_edev_by_node() which will always return EPROBE_DEFER
+in that case.
+
+On the other hand, even if an extcon was present and dwc3_get_extcon()
+was successful it would still be ignored in favor of "usb-role-switch".
+
+Let's just first check if "usb-role-switch" is configured in the device
+tree and directly use it instead and only try to look for an extcon
+device otherwise.
+
+Fixes: 8a0a13799744 ("usb: dwc3: Registering a role switch in the DRD code.")
+Cc: stable <stable@kernel.org>
+Signed-off-by: Sven Peter <sven@svenpeter.dev>
+Link: https://lore.kernel.org/r/20220411155300.9766-1-sven@svenpeter.dev
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ drivers/usb/dwc3/drd.c |   11 +++++------
+ 1 file changed, 5 insertions(+), 6 deletions(-)
+
+--- a/drivers/usb/dwc3/drd.c
++++ b/drivers/usb/dwc3/drd.c
+@@ -568,16 +568,15 @@ int dwc3_drd_init(struct dwc3 *dwc)
+ {
+       int ret, irq;
++      if (ROLE_SWITCH &&
++          device_property_read_bool(dwc->dev, "usb-role-switch"))
++              return dwc3_setup_role_switch(dwc);
++
+       dwc->edev = dwc3_get_extcon(dwc);
+       if (IS_ERR(dwc->edev))
+               return PTR_ERR(dwc->edev);
+-      if (ROLE_SWITCH &&
+-          device_property_read_bool(dwc->dev, "usb-role-switch")) {
+-              ret = dwc3_setup_role_switch(dwc);
+-              if (ret < 0)
+-                      return ret;
+-      } else if (dwc->edev) {
++      if (dwc->edev) {
+               dwc->edev_nb.notifier_call = dwc3_drd_notifier;
+               ret = extcon_register_notifier(dwc->edev, EXTCON_USB_HOST,
+                                              &dwc->edev_nb);
diff --git a/queue-5.10/usb-gadget-configfs-clear-deactivation-flag-in-configfs_composite_unbind.patch b/queue-5.10/usb-gadget-configfs-clear-deactivation-flag-in-configfs_composite_unbind.patch
new file mode 100644 (file)
index 0000000..0c0ea3d
--- /dev/null
@@ -0,0 +1,37 @@
+From bf95c4d4630c7a2c16e7b424fdea5177d9ce0864 Mon Sep 17 00:00:00 2001
+From: Vijayavardhan Vennapusa <vvreddy@codeaurora.org>
+Date: Wed, 13 Apr 2022 16:10:38 -0500
+Subject: usb: gadget: configfs: clear deactivation flag in configfs_composite_unbind()
+
+From: Vijayavardhan Vennapusa <vvreddy@codeaurora.org>
+
+commit bf95c4d4630c7a2c16e7b424fdea5177d9ce0864 upstream.
+
+If any function like UVC is deactivating gadget as part of composition
+switch which results in not calling pullup enablement, it is not getting
+enabled after switch to new composition due to this deactivation flag
+not cleared. This results in USB enumeration not happening after switch
+to new USB composition. Hence clear deactivation flag inside gadget
+structure in configfs_composite_unbind() before switch to new USB
+composition.
+
+Signed-off-by: Vijayavardhan Vennapusa <vvreddy@codeaurora.org>
+Signed-off-by: Dan Vacura <w36195@motorola.com>
+Cc: stable <stable@kernel.org>
+Link: https://lore.kernel.org/r/20220413211038.72797-1-w36195@motorola.com
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ drivers/usb/gadget/configfs.c |    2 ++
+ 1 file changed, 2 insertions(+)
+
+--- a/drivers/usb/gadget/configfs.c
++++ b/drivers/usb/gadget/configfs.c
+@@ -1443,6 +1443,8 @@ static void configfs_composite_unbind(st
+       usb_ep_autoconfig_reset(cdev->gadget);
+       spin_lock_irqsave(&gi->spinlock, flags);
+       cdev->gadget = NULL;
++      cdev->deactivations = 0;
++      gadget->deactivated = false;
+       set_gadget_data(gadget, NULL);
+       spin_unlock_irqrestore(&gi->spinlock, flags);
+ }
diff --git a/queue-5.10/usb-gadget-uvc-fix-crash-when-encoding-data-for-usb-request.patch b/queue-5.10/usb-gadget-uvc-fix-crash-when-encoding-data-for-usb-request.patch
new file mode 100644 (file)
index 0000000..0e8d1a8
--- /dev/null
@@ -0,0 +1,58 @@
+From 71d471e3faf90c9674cadc7605ac719e82cb7fac Mon Sep 17 00:00:00 2001
+From: Dan Vacura <w36195@motorola.com>
+Date: Thu, 31 Mar 2022 13:40:23 -0500
+Subject: usb: gadget: uvc: Fix crash when encoding data for usb request
+
+From: Dan Vacura <w36195@motorola.com>
+
+commit 71d471e3faf90c9674cadc7605ac719e82cb7fac upstream.
+
+During the uvcg_video_pump() process, if an error occurs and
+uvcg_queue_cancel() is called, the buffer queue will be cleared out, but
+the current marker (queue->buf_used) of the active buffer (no longer
+active) is not reset. On the next iteration of uvcg_video_pump() the
+stale buf_used count will be used and the logic of min((unsigned
+int)len, buf->bytesused - queue->buf_used) may incorrectly calculate a
+nbytes size, causing an invalid memory access.
+
+[80802.185460][  T315] configfs-gadget gadget: uvc: VS request completed
+with status -18.
+[80802.185519][  T315] configfs-gadget gadget: uvc: VS request completed
+with status -18.
+...
+uvcg_queue_cancel() is called and the queue is cleared out, but the
+marker queue->buf_used is not reset.
+...
+[80802.262328][ T8682] Unable to handle kernel paging request at virtual
+address ffffffc03af9f000
+...
+...
+[80802.263138][ T8682] Call trace:
+[80802.263146][ T8682]  __memcpy+0x12c/0x180
+[80802.263155][ T8682]  uvcg_video_pump+0xcc/0x1e0
+[80802.263165][ T8682]  process_one_work+0x2cc/0x568
+[80802.263173][ T8682]  worker_thread+0x28c/0x518
+[80802.263181][ T8682]  kthread+0x160/0x170
+[80802.263188][ T8682]  ret_from_fork+0x10/0x18
+[80802.263198][ T8682] Code: a8c12829 a88130cb a8c130
+
+Fixes: d692522577c0 ("usb: gadget/uvc: Port UVC webcam gadget to use videobuf2 framework")
+Cc: <stable@vger.kernel.org>
+Signed-off-by: Dan Vacura <w36195@motorola.com>
+Link: https://lore.kernel.org/r/20220331184024.23918-1-w36195@motorola.com
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ drivers/usb/gadget/function/uvc_queue.c |    2 ++
+ 1 file changed, 2 insertions(+)
+
+--- a/drivers/usb/gadget/function/uvc_queue.c
++++ b/drivers/usb/gadget/function/uvc_queue.c
+@@ -242,6 +242,8 @@ void uvcg_queue_cancel(struct uvc_video_
+               buf->state = UVC_BUF_STATE_ERROR;
+               vb2_buffer_done(&buf->buf.vb2_buf, VB2_BUF_STATE_ERROR);
+       }
++      queue->buf_used = 0;
++
+       /* This must be protected by the irqlock spinlock to avoid race
+        * conditions between uvc_queue_buffer and the disconnection event that
+        * could result in an interruptible wait in uvc_dequeue_buffer. Do not
diff --git a/queue-5.10/usb-misc-fix-improper-handling-of-refcount-in-uss720_probe.patch b/queue-5.10/usb-misc-fix-improper-handling-of-refcount-in-uss720_probe.patch
new file mode 100644 (file)
index 0000000..814706f
--- /dev/null
@@ -0,0 +1,52 @@
+From 0a96fa640dc928da9eaa46a22c46521b037b78ad Mon Sep 17 00:00:00 2001
+From: Hangyu Hua <hbh25y@gmail.com>
+Date: Thu, 7 Apr 2022 10:40:01 +0800
+Subject: usb: misc: fix improper handling of refcount in uss720_probe()
+
+From: Hangyu Hua <hbh25y@gmail.com>
+
+commit 0a96fa640dc928da9eaa46a22c46521b037b78ad upstream.
+
+usb_put_dev shouldn't be called when uss720_probe succeeds because of
+priv->usbdev. At the same time, priv->usbdev shouldn't be set to NULL
+before destroy_priv in uss720_disconnect because usb_put_dev is in
+destroy_priv.
+
+Fix this by moving priv->usbdev = NULL after usb_put_dev.
+
+Fixes: dcb4b8ad6a44 ("misc/uss720: fix memory leak in uss720_probe")
+Cc: stable <stable@kernel.org>
+Reviewed-by: Dongliang Mu <mudongliangabcd@gmail.com>
+Signed-off-by: Hangyu Hua <hbh25y@gmail.com>
+Link: https://lore.kernel.org/r/20220407024001.11761-1-hbh25y@gmail.com
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ drivers/usb/misc/uss720.c |    3 +--
+ 1 file changed, 1 insertion(+), 2 deletions(-)
+
+--- a/drivers/usb/misc/uss720.c
++++ b/drivers/usb/misc/uss720.c
+@@ -71,6 +71,7 @@ static void destroy_priv(struct kref *kr
+       dev_dbg(&priv->usbdev->dev, "destroying priv datastructure\n");
+       usb_put_dev(priv->usbdev);
++      priv->usbdev = NULL;
+       kfree(priv);
+ }
+@@ -736,7 +737,6 @@ static int uss720_probe(struct usb_inter
+       parport_announce_port(pp);
+       usb_set_intfdata(intf, pp);
+-      usb_put_dev(usbdev);
+       return 0;
+ probe_abort:
+@@ -754,7 +754,6 @@ static void uss720_disconnect(struct usb
+       usb_set_intfdata(intf, NULL);
+       if (pp) {
+               priv = pp->private_data;
+-              priv->usbdev = NULL;
+               priv->pp = NULL;
+               dev_dbg(&intf->dev, "parport_remove_port\n");
+               parport_remove_port(pp);
diff --git a/queue-5.10/usb-phy-generic-get-the-vbus-supply.patch b/queue-5.10/usb-phy-generic-get-the-vbus-supply.patch
new file mode 100644 (file)
index 0000000..217e5e6
--- /dev/null
@@ -0,0 +1,38 @@
+From 03e607cbb2931374db1825f371e9c7f28526d3f4 Mon Sep 17 00:00:00 2001
+From: Sean Anderson <sean.anderson@seco.com>
+Date: Mon, 25 Apr 2022 13:14:09 -0400
+Subject: usb: phy: generic: Get the vbus supply
+
+From: Sean Anderson <sean.anderson@seco.com>
+
+commit 03e607cbb2931374db1825f371e9c7f28526d3f4 upstream.
+
+While support for working with a vbus was added, the regulator was never
+actually gotten (despite what was documented). Fix this by actually
+getting the supply from the device tree.
+
+Fixes: 7acc9973e3c4 ("usb: phy: generic: add vbus support")
+Cc: stable <stable@kernel.org>
+Signed-off-by: Sean Anderson <sean.anderson@seco.com>
+Link: https://lore.kernel.org/r/20220425171412.1188485-3-sean.anderson@seco.com
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ drivers/usb/phy/phy-generic.c |    7 +++++++
+ 1 file changed, 7 insertions(+)
+
+--- a/drivers/usb/phy/phy-generic.c
++++ b/drivers/usb/phy/phy-generic.c
+@@ -268,6 +268,13 @@ int usb_phy_gen_create_phy(struct device
+                       return -EPROBE_DEFER;
+       }
++      nop->vbus_draw = devm_regulator_get_exclusive(dev, "vbus");
++      if (PTR_ERR(nop->vbus_draw) == -ENODEV)
++              nop->vbus_draw = NULL;
++      if (IS_ERR(nop->vbus_draw))
++              return dev_err_probe(dev, PTR_ERR(nop->vbus_draw),
++                                   "could not get vbus regulator\n");
++
+       nop->dev                = dev;
+       nop->phy.dev            = nop->dev;
+       nop->phy.label          = "nop-xceiv";
diff --git a/queue-5.10/usb-typec-ucsi-fix-reuse-of-completion-structure.patch b/queue-5.10/usb-typec-ucsi-fix-reuse-of-completion-structure.patch
new file mode 100644 (file)
index 0000000..fe6352f
--- /dev/null
@@ -0,0 +1,45 @@
+From e25adcca917d7e4cdc1dc6444d0692ffda7594bf Mon Sep 17 00:00:00 2001
+From: Heikki Krogerus <heikki.krogerus@linux.intel.com>
+Date: Tue, 5 Apr 2022 16:48:23 +0300
+Subject: usb: typec: ucsi: Fix reuse of completion structure
+
+From: Heikki Krogerus <heikki.krogerus@linux.intel.com>
+
+commit e25adcca917d7e4cdc1dc6444d0692ffda7594bf upstream.
+
+The role swapping completion variable is reused, so it needs
+to be reinitialised every time. Otherwise it will be marked
+as done after the first time it's used and completing
+immediately.
+
+Link: https://lore.kernel.org/linux-usb/20220325203959.GA19752@jackp-linux.qualcomm.com/
+Fixes: 6df475f804e6 ("usb: typec: ucsi: Start using struct typec_operations")
+Cc: stable@vger.kernel.org
+Reported-and-suggested-by: Jack Pham <quic_jackp@quicinc.com>
+Signed-off-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
+Link: https://lore.kernel.org/r/20220405134824.68067-2-heikki.krogerus@linux.intel.com
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ drivers/usb/typec/ucsi/ucsi.c |    4 ++++
+ 1 file changed, 4 insertions(+)
+
+--- a/drivers/usb/typec/ucsi/ucsi.c
++++ b/drivers/usb/typec/ucsi/ucsi.c
+@@ -928,6 +928,8 @@ static int ucsi_dr_swap(struct typec_por
+            role == TYPEC_HOST))
+               goto out_unlock;
++      reinit_completion(&con->complete);
++
+       command = UCSI_SET_UOR | UCSI_CONNECTOR_NUMBER(con->num);
+       command |= UCSI_SET_UOR_ROLE(role);
+       command |= UCSI_SET_UOR_ACCEPT_ROLE_SWAPS;
+@@ -964,6 +966,8 @@ static int ucsi_pr_swap(struct typec_por
+       if (cur_role == role)
+               goto out_unlock;
++      reinit_completion(&con->complete);
++
+       command = UCSI_SET_PDR | UCSI_CONNECTOR_NUMBER(con->num);
+       command |= UCSI_SET_PDR_ROLE(role);
+       command |= UCSI_SET_PDR_ACCEPT_ROLE_SWAPS;
diff --git a/queue-5.10/usb-typec-ucsi-fix-role-swapping.patch b/queue-5.10/usb-typec-ucsi-fix-role-swapping.patch
new file mode 100644 (file)
index 0000000..b0588f8
--- /dev/null
@@ -0,0 +1,67 @@
+From eb5d7ff3cf0d55093c619b5ad107cd5c05ce8134 Mon Sep 17 00:00:00 2001
+From: Heikki Krogerus <heikki.krogerus@linux.intel.com>
+Date: Tue, 5 Apr 2022 16:48:24 +0300
+Subject: usb: typec: ucsi: Fix role swapping
+
+From: Heikki Krogerus <heikki.krogerus@linux.intel.com>
+
+commit eb5d7ff3cf0d55093c619b5ad107cd5c05ce8134 upstream.
+
+All attempts to swap the roles timed out because the
+completion was done without releasing the port lock. Fixing
+that by releasing the lock before starting to wait for the
+completion.
+
+Link: https://lore.kernel.org/linux-usb/037de7ac-e210-bdf5-ec7a-8c0c88a0be20@gmail.com/
+Fixes: ad74b8649bea ("usb: typec: ucsi: Preliminary support for alternate modes")
+Cc: stable@vger.kernel.org
+Reported-and-tested-by: Jia-Ju Bai <baijiaju1990@gmail.com>
+Signed-off-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
+Link: https://lore.kernel.org/r/20220405134824.68067-3-heikki.krogerus@linux.intel.com
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ drivers/usb/typec/ucsi/ucsi.c |   20 +++++++++++++-------
+ 1 file changed, 13 insertions(+), 7 deletions(-)
+
+--- a/drivers/usb/typec/ucsi/ucsi.c
++++ b/drivers/usb/typec/ucsi/ucsi.c
+@@ -937,14 +937,18 @@ static int ucsi_dr_swap(struct typec_por
+       if (ret < 0)
+               goto out_unlock;
++      mutex_unlock(&con->lock);
++
+       if (!wait_for_completion_timeout(&con->complete,
+-                                      msecs_to_jiffies(UCSI_SWAP_TIMEOUT_MS)))
+-              ret = -ETIMEDOUT;
++                                       msecs_to_jiffies(UCSI_SWAP_TIMEOUT_MS)))
++              return -ETIMEDOUT;
++
++      return 0;
+ out_unlock:
+       mutex_unlock(&con->lock);
+-      return ret < 0 ? ret : 0;
++      return ret;
+ }
+ static int ucsi_pr_swap(struct typec_port *port, enum typec_role role)
+@@ -975,11 +979,13 @@ static int ucsi_pr_swap(struct typec_por
+       if (ret < 0)
+               goto out_unlock;
++      mutex_unlock(&con->lock);
++
+       if (!wait_for_completion_timeout(&con->complete,
+-                              msecs_to_jiffies(UCSI_SWAP_TIMEOUT_MS))) {
+-              ret = -ETIMEDOUT;
+-              goto out_unlock;
+-      }
++                                       msecs_to_jiffies(UCSI_SWAP_TIMEOUT_MS)))
++              return -ETIMEDOUT;
++
++      mutex_lock(&con->lock);
+       /* Something has gone wrong while swapping the role */
+       if (UCSI_CONSTAT_PWR_OPMODE(con->status.flags) !=