]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
6.4-stable patches
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 3 Sep 2023 13:03:29 +0000 (15:03 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 3 Sep 2023 13:03:29 +0000 (15:03 +0200)
added patches:
dt-bindings-sc16is7xx-add-property-to-change-gpio-function.patch
firmware-stratix10-svc-fix-an-null-vs-is_err-bug-in-probe.patch
fsi-master-ast-cf-add-module_firmware-macro.patch
nilfs2-fix-warning-in-mark_buffer_dirty-due-to-discarded-buffer-reuse.patch
serial-qcom-geni-fix-opp-vote-on-shutdown.patch
serial-sc16is7xx-fix-broken-port-0-uart-init.patch
serial-sc16is7xx-fix-bug-when-first-setting-gpio-direction.patch
tcpm-avoid-soft-reset-when-partner-does-not-support-get_status.patch

queue-6.4/dt-bindings-sc16is7xx-add-property-to-change-gpio-function.patch [new file with mode: 0644]
queue-6.4/firmware-stratix10-svc-fix-an-null-vs-is_err-bug-in-probe.patch [new file with mode: 0644]
queue-6.4/fsi-master-ast-cf-add-module_firmware-macro.patch [new file with mode: 0644]
queue-6.4/nilfs2-fix-warning-in-mark_buffer_dirty-due-to-discarded-buffer-reuse.patch [new file with mode: 0644]
queue-6.4/serial-qcom-geni-fix-opp-vote-on-shutdown.patch [new file with mode: 0644]
queue-6.4/serial-sc16is7xx-fix-broken-port-0-uart-init.patch [new file with mode: 0644]
queue-6.4/serial-sc16is7xx-fix-bug-when-first-setting-gpio-direction.patch [new file with mode: 0644]
queue-6.4/series
queue-6.4/tcpm-avoid-soft-reset-when-partner-does-not-support-get_status.patch [new file with mode: 0644]

diff --git a/queue-6.4/dt-bindings-sc16is7xx-add-property-to-change-gpio-function.patch b/queue-6.4/dt-bindings-sc16is7xx-add-property-to-change-gpio-function.patch
new file mode 100644 (file)
index 0000000..187a1a2
--- /dev/null
@@ -0,0 +1,102 @@
+From 4cf478dc5d707e56aefa258c049872eff054a353 Mon Sep 17 00:00:00 2001
+From: Hugo Villeneuve <hvilleneuve@dimonoff.com>
+Date: Mon, 7 Aug 2023 17:45:53 -0400
+Subject: dt-bindings: sc16is7xx: Add property to change GPIO function
+
+From: Hugo Villeneuve <hvilleneuve@dimonoff.com>
+
+commit 4cf478dc5d707e56aefa258c049872eff054a353 upstream.
+
+Some variants in this series of UART controllers have GPIO pins that
+are shared between GPIO and modem control lines.
+
+The pin mux mode (GPIO or modem control lines) can be set for each
+ports (channels) supported by the variant.
+
+This adds a property to the device tree to set the GPIO pin mux to
+modem control lines on selected ports if needed.
+
+Cc: stable@vger.kernel.org # 6.1.x
+Signed-off-by: Hugo Villeneuve <hvilleneuve@dimonoff.com>
+Acked-by: Conor Dooley <conor.dooley@microchip.com>
+Reviewed-by: Lech Perczak <lech.perczak@camlingroup.com>
+Acked-by: Rob Herring <robh@kernel.org>
+Link: https://lore.kernel.org/r/20230807214556.540627-4-hugo@hugovil.com
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ Documentation/devicetree/bindings/serial/nxp,sc16is7xx.txt |   46 +++++++++++++
+ 1 file changed, 46 insertions(+)
+
+--- a/Documentation/devicetree/bindings/serial/nxp,sc16is7xx.txt
++++ b/Documentation/devicetree/bindings/serial/nxp,sc16is7xx.txt
+@@ -23,6 +23,9 @@ Optional properties:
+     1 = active low.
+ - irda-mode-ports: An array that lists the indices of the port that
+                  should operate in IrDA mode.
++- nxp,modem-control-line-ports: An array that lists the indices of the port that
++                              should have shared GPIO lines configured as
++                              modem control lines.
+ Example:
+         sc16is750: sc16is750@51 {
+@@ -35,6 +38,26 @@ Example:
+                 #gpio-cells = <2>;
+         };
++      sc16is752: sc16is752@53 {
++              compatible = "nxp,sc16is752";
++              reg = <0x53>;
++              clocks = <&clk20m>;
++              interrupt-parent = <&gpio3>;
++              interrupts = <7 IRQ_TYPE_EDGE_FALLING>;
++              nxp,modem-control-line-ports = <1>; /* Port 1 as modem control lines */
++              gpio-controller; /* Port 0 as GPIOs */
++              #gpio-cells = <2>;
++      };
++
++      sc16is752: sc16is752@54 {
++              compatible = "nxp,sc16is752";
++              reg = <0x54>;
++              clocks = <&clk20m>;
++              interrupt-parent = <&gpio3>;
++              interrupts = <7 IRQ_TYPE_EDGE_FALLING>;
++              nxp,modem-control-line-ports = <0 1>; /* Ports 0 and 1 as modem control lines */
++      };
++
+ * spi as bus
+ Required properties:
+@@ -59,6 +82,9 @@ Optional properties:
+     1 = active low.
+ - irda-mode-ports: An array that lists the indices of the port that
+                  should operate in IrDA mode.
++- nxp,modem-control-line-ports: An array that lists the indices of the port that
++                              should have shared GPIO lines configured as
++                              modem control lines.
+ Example:
+       sc16is750: sc16is750@0 {
+@@ -70,3 +96,23 @@ Example:
+               gpio-controller;
+               #gpio-cells = <2>;
+       };
++
++      sc16is752: sc16is752@1 {
++              compatible = "nxp,sc16is752";
++              reg = <1>;
++              clocks = <&clk20m>;
++              interrupt-parent = <&gpio3>;
++              interrupts = <7 IRQ_TYPE_EDGE_FALLING>;
++              nxp,modem-control-line-ports = <1>; /* Port 1 as modem control lines */
++              gpio-controller; /* Port 0 as GPIOs */
++              #gpio-cells = <2>;
++      };
++
++      sc16is752: sc16is752@2 {
++              compatible = "nxp,sc16is752";
++              reg = <2>;
++              clocks = <&clk20m>;
++              interrupt-parent = <&gpio3>;
++              interrupts = <7 IRQ_TYPE_EDGE_FALLING>;
++              nxp,modem-control-line-ports = <0 1>; /* Ports 0 and 1 as modem control lines */
++      };
diff --git a/queue-6.4/firmware-stratix10-svc-fix-an-null-vs-is_err-bug-in-probe.patch b/queue-6.4/firmware-stratix10-svc-fix-an-null-vs-is_err-bug-in-probe.patch
new file mode 100644 (file)
index 0000000..dccde5e
--- /dev/null
@@ -0,0 +1,33 @@
+From dd218433f2b635d97e8fda3eed047151fd528ce4 Mon Sep 17 00:00:00 2001
+From: Wang Ming <machel@vivo.com>
+Date: Thu, 27 Jul 2023 14:37:50 -0500
+Subject: firmware: stratix10-svc: Fix an NULL vs IS_ERR() bug in probe
+
+From: Wang Ming <machel@vivo.com>
+
+commit dd218433f2b635d97e8fda3eed047151fd528ce4 upstream.
+
+The devm_memremap() function returns error pointers.
+It never returns NULL. Fix the check.
+
+Fixes: 7ca5ce896524 ("firmware: add Intel Stratix10 service layer driver")
+Cc: stable@vger.kernel.org
+Signed-off-by: Wang Ming <machel@vivo.com>
+Signed-off-by: Dinh Nguyen <dinguyen@kernel.org>
+Link: https://lore.kernel.org/r/20230727193750.983795-1-dinguyen@kernel.org
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ drivers/firmware/stratix10-svc.c |    2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/drivers/firmware/stratix10-svc.c
++++ b/drivers/firmware/stratix10-svc.c
+@@ -756,7 +756,7 @@ svc_create_memory_pool(struct platform_d
+       paddr = begin;
+       size = end - begin;
+       va = devm_memremap(dev, paddr, size, MEMREMAP_WC);
+-      if (!va) {
++      if (IS_ERR(va)) {
+               dev_err(dev, "fail to remap shared memory\n");
+               return ERR_PTR(-EINVAL);
+       }
diff --git a/queue-6.4/fsi-master-ast-cf-add-module_firmware-macro.patch b/queue-6.4/fsi-master-ast-cf-add-module_firmware-macro.patch
new file mode 100644 (file)
index 0000000..f01a3b9
--- /dev/null
@@ -0,0 +1,29 @@
+From 3a1d7aff6e65ad6e285e28abe55abbfd484997ee Mon Sep 17 00:00:00 2001
+From: Juerg Haefliger <juerg.haefliger@canonical.com>
+Date: Wed, 28 Jun 2023 11:50:39 +0200
+Subject: fsi: master-ast-cf: Add MODULE_FIRMWARE macro
+
+From: Juerg Haefliger <juerg.haefliger@canonical.com>
+
+commit 3a1d7aff6e65ad6e285e28abe55abbfd484997ee upstream.
+
+The module loads firmware so add a MODULE_FIRMWARE macro to provide that
+information via modinfo.
+
+Fixes: 6a794a27daca ("fsi: master-ast-cf: Add new FSI master using Aspeed ColdFire")
+Cc: stable@vger.kernel.org # 4.19+
+Signed-off-by: Juerg Haefliger <juerg.haefliger@canonical.com>
+Link: https://lore.kernel.org/r/20230628095039.26218-1-juerg.haefliger@canonical.com
+Signed-off-by: Joel Stanley <joel@jms.id.au>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ drivers/fsi/fsi-master-ast-cf.c |    1 +
+ 1 file changed, 1 insertion(+)
+
+--- a/drivers/fsi/fsi-master-ast-cf.c
++++ b/drivers/fsi/fsi-master-ast-cf.c
+@@ -1441,3 +1441,4 @@ static struct platform_driver fsi_master
+ module_platform_driver(fsi_master_acf);
+ MODULE_LICENSE("GPL");
++MODULE_FIRMWARE(FW_FILE_NAME);
diff --git a/queue-6.4/nilfs2-fix-warning-in-mark_buffer_dirty-due-to-discarded-buffer-reuse.patch b/queue-6.4/nilfs2-fix-warning-in-mark_buffer_dirty-due-to-discarded-buffer-reuse.patch
new file mode 100644 (file)
index 0000000..0059cde
--- /dev/null
@@ -0,0 +1,75 @@
+From cdaac8e7e5a059f9b5e816cda257f08d0abffacd Mon Sep 17 00:00:00 2001
+From: Ryusuke Konishi <konishi.ryusuke@gmail.com>
+Date: Fri, 18 Aug 2023 22:18:04 +0900
+Subject: nilfs2: fix WARNING in mark_buffer_dirty due to discarded buffer reuse
+
+From: Ryusuke Konishi <konishi.ryusuke@gmail.com>
+
+commit cdaac8e7e5a059f9b5e816cda257f08d0abffacd upstream.
+
+A syzbot stress test using a corrupted disk image reported that
+mark_buffer_dirty() called from __nilfs_mark_inode_dirty() or
+nilfs_palloc_commit_alloc_entry() may output a kernel warning, and can
+panic if the kernel is booted with panic_on_warn.
+
+This is because nilfs2 keeps buffer pointers in local structures for some
+metadata and reuses them, but such buffers may be forcibly discarded by
+nilfs_clear_dirty_page() in some critical situations.
+
+This issue is reported to appear after commit 28a65b49eb53 ("nilfs2: do
+not write dirty data after degenerating to read-only"), but the issue has
+potentially existed before.
+
+Fix this issue by checking the uptodate flag when attempting to reuse an
+internally held buffer, and reloading the metadata instead of reusing the
+buffer if the flag was lost.
+
+Link: https://lkml.kernel.org/r/20230818131804.7758-1-konishi.ryusuke@gmail.com
+Signed-off-by: Ryusuke Konishi <konishi.ryusuke@gmail.com>
+Reported-by: syzbot+cdfcae656bac88ba0e2d@syzkaller.appspotmail.com
+Closes: https://lkml.kernel.org/r/0000000000003da75f05fdeffd12@google.com
+Fixes: 8c26c4e2694a ("nilfs2: fix issue with flush kernel thread after remount in RO mode because of driver's internal error or metadata corruption")
+Tested-by: Ryusuke Konishi <konishi.ryusuke@gmail.com>
+Cc: <stable@vger.kernel.org> # 3.10+
+Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ fs/nilfs2/alloc.c |    3 ++-
+ fs/nilfs2/inode.c |    7 +++++--
+ 2 files changed, 7 insertions(+), 3 deletions(-)
+
+--- a/fs/nilfs2/alloc.c
++++ b/fs/nilfs2/alloc.c
+@@ -205,7 +205,8 @@ static int nilfs_palloc_get_block(struct
+       int ret;
+       spin_lock(lock);
+-      if (prev->bh && blkoff == prev->blkoff) {
++      if (prev->bh && blkoff == prev->blkoff &&
++          likely(buffer_uptodate(prev->bh))) {
+               get_bh(prev->bh);
+               *bhp = prev->bh;
+               spin_unlock(lock);
+--- a/fs/nilfs2/inode.c
++++ b/fs/nilfs2/inode.c
+@@ -1025,7 +1025,7 @@ int nilfs_load_inode_block(struct inode
+       int err;
+       spin_lock(&nilfs->ns_inode_lock);
+-      if (ii->i_bh == NULL) {
++      if (ii->i_bh == NULL || unlikely(!buffer_uptodate(ii->i_bh))) {
+               spin_unlock(&nilfs->ns_inode_lock);
+               err = nilfs_ifile_get_inode_block(ii->i_root->ifile,
+                                                 inode->i_ino, pbh);
+@@ -1034,7 +1034,10 @@ int nilfs_load_inode_block(struct inode
+               spin_lock(&nilfs->ns_inode_lock);
+               if (ii->i_bh == NULL)
+                       ii->i_bh = *pbh;
+-              else {
++              else if (unlikely(!buffer_uptodate(ii->i_bh))) {
++                      __brelse(ii->i_bh);
++                      ii->i_bh = *pbh;
++              } else {
+                       brelse(*pbh);
+                       *pbh = ii->i_bh;
+               }
diff --git a/queue-6.4/serial-qcom-geni-fix-opp-vote-on-shutdown.patch b/queue-6.4/serial-qcom-geni-fix-opp-vote-on-shutdown.patch
new file mode 100644 (file)
index 0000000..c6f3d95
--- /dev/null
@@ -0,0 +1,58 @@
+From 8ece7b754bc34ffd7fcc8269ccb9128e72ca76d8 Mon Sep 17 00:00:00 2001
+From: Johan Hovold <johan+linaro@kernel.org>
+Date: Fri, 14 Jul 2023 15:02:13 +0200
+Subject: serial: qcom-geni: fix opp vote on shutdown
+
+From: Johan Hovold <johan+linaro@kernel.org>
+
+commit 8ece7b754bc34ffd7fcc8269ccb9128e72ca76d8 upstream.
+
+The operating-performance-point vote needs to be dropped when shutting
+down the port to avoid wasting power by keeping resources like power
+domains in an unnecessarily high performance state (e.g. when a UART
+connected Bluetooth controller is not in use).
+
+Fixes: a5819b548af0 ("tty: serial: qcom_geni_serial: Use OPP API to set clk/perf state")
+Cc: stable@vger.kernel.org      # 5.9
+Cc: Rajendra Nayak <quic_rjendra@quicinc.com>
+Cc: Matthias Kaehlcke <mka@chromium.org>
+Signed-off-by: Johan Hovold <johan+linaro@kernel.org>
+Acked-by: Konrad Dybcio <konrad.dybcio@linaro.org>
+Link: https://lore.kernel.org/r/20230714130214.14552-2-johan+linaro@kernel.org
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ drivers/tty/serial/qcom_geni_serial.c |    5 +++++
+ 1 file changed, 5 insertions(+)
+
+--- a/drivers/tty/serial/qcom_geni_serial.c
++++ b/drivers/tty/serial/qcom_geni_serial.c
+@@ -126,6 +126,7 @@ struct qcom_geni_serial_port {
+       dma_addr_t rx_dma_addr;
+       bool setup;
+       unsigned int baud;
++      unsigned long clk_rate;
+       void *rx_buf;
+       u32 loopback;
+       bool brk;
+@@ -1244,6 +1245,7 @@ static void qcom_geni_serial_set_termios
+                       baud * sampling_rate, clk_rate, clk_div);
+       uport->uartclk = clk_rate;
++      port->clk_rate = clk_rate;
+       dev_pm_opp_set_rate(uport->dev, clk_rate);
+       ser_clk_cfg = SER_CLK_EN;
+       ser_clk_cfg |= clk_div << CLK_DIV_SHFT;
+@@ -1508,10 +1510,13 @@ static void qcom_geni_serial_pm(struct u
+       if (new_state == UART_PM_STATE_ON && old_state == UART_PM_STATE_OFF) {
+               geni_icc_enable(&port->se);
++              if (port->clk_rate)
++                      dev_pm_opp_set_rate(uport->dev, port->clk_rate);
+               geni_se_resources_on(&port->se);
+       } else if (new_state == UART_PM_STATE_OFF &&
+                       old_state == UART_PM_STATE_ON) {
+               geni_se_resources_off(&port->se);
++              dev_pm_opp_set_rate(uport->dev, 0);
+               geni_icc_disable(&port->se);
+       }
+ }
diff --git a/queue-6.4/serial-sc16is7xx-fix-broken-port-0-uart-init.patch b/queue-6.4/serial-sc16is7xx-fix-broken-port-0-uart-init.patch
new file mode 100644 (file)
index 0000000..168fc05
--- /dev/null
@@ -0,0 +1,67 @@
+From 2861ed4d6e6d1a2c9de9bf5b0abd996c2dc673d0 Mon Sep 17 00:00:00 2001
+From: Hugo Villeneuve <hvilleneuve@dimonoff.com>
+Date: Mon, 7 Aug 2023 17:45:51 -0400
+Subject: serial: sc16is7xx: fix broken port 0 uart init
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+From: Hugo Villeneuve <hvilleneuve@dimonoff.com>
+
+commit 2861ed4d6e6d1a2c9de9bf5b0abd996c2dc673d0 upstream.
+
+The sc16is7xx_config_rs485() function is called only for the second
+port (index 1, channel B), causing initialization problems for the
+first port.
+
+For the sc16is7xx driver, port->membase and port->mapbase are not set,
+and their default values are 0. And we set port->iobase to the device
+index. This means that when the first device is registered using the
+uart_add_one_port() function, the following values will be in the port
+structure:
+    port->membase = 0
+    port->mapbase = 0
+    port->iobase  = 0
+
+Therefore, the function uart_configure_port() in serial_core.c will
+exit early because of the following check:
+       /*
+        * If there isn't a port here, don't do anything further.
+        */
+       if (!port->iobase && !port->mapbase && !port->membase)
+               return;
+
+Typically, I2C and SPI drivers do not set port->membase and
+port->mapbase.
+
+The max310x driver sets port->membase to ~0 (all ones). By
+implementing the same change in this driver, uart_configure_port() is
+now correctly executed for all ports.
+
+Fixes: dfeae619d781 ("serial: sc16is7xx")
+Cc: stable@vger.kernel.org
+Signed-off-by: Hugo Villeneuve <hvilleneuve@dimonoff.com>
+Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
+Reviewed-by: Lech Perczak <lech.perczak@camlingroup.com>
+Tested-by: Lech Perczak <lech.perczak@camlingroup.com>
+Link: https://lore.kernel.org/r/20230807214556.540627-2-hugo@hugovil.com
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ drivers/tty/serial/sc16is7xx.c |    6 ++++++
+ 1 file changed, 6 insertions(+)
+
+--- a/drivers/tty/serial/sc16is7xx.c
++++ b/drivers/tty/serial/sc16is7xx.c
+@@ -1436,6 +1436,12 @@ static int sc16is7xx_probe(struct device
+               s->p[i].port.fifosize   = SC16IS7XX_FIFO_SIZE;
+               s->p[i].port.flags      = UPF_FIXED_TYPE | UPF_LOW_LATENCY;
+               s->p[i].port.iobase     = i;
++              /*
++               * Use all ones as membase to make sure uart_configure_port() in
++               * serial_core.c does not abort for SPI/I2C devices where the
++               * membase address is not applicable.
++               */
++              s->p[i].port.membase    = (void __iomem *)~0;
+               s->p[i].port.iotype     = UPIO_PORT;
+               s->p[i].port.uartclk    = freq;
+               s->p[i].port.rs485_config = sc16is7xx_config_rs485;
diff --git a/queue-6.4/serial-sc16is7xx-fix-bug-when-first-setting-gpio-direction.patch b/queue-6.4/serial-sc16is7xx-fix-bug-when-first-setting-gpio-direction.patch
new file mode 100644 (file)
index 0000000..94c98c6
--- /dev/null
@@ -0,0 +1,59 @@
+From 9baeea723c0fb9c3ba9a336369f758ed9bc6831d Mon Sep 17 00:00:00 2001
+From: Hugo Villeneuve <hvilleneuve@dimonoff.com>
+Date: Mon, 7 Aug 2023 17:45:55 -0400
+Subject: serial: sc16is7xx: fix bug when first setting GPIO direction
+
+From: Hugo Villeneuve <hvilleneuve@dimonoff.com>
+
+commit 9baeea723c0fb9c3ba9a336369f758ed9bc6831d upstream.
+
+When configuring a pin as an output pin with a value of logic 0, we
+end up as having a value of logic 1 on the output pin. Setting a
+logic 0 a second time (or more) after that will correctly output a
+logic 0 on the output pin.
+
+By default, all GPIO pins are configured as inputs. When we enter
+sc16is7xx_gpio_direction_output() for the first time, we first set the
+desired value in IOSTATE, and then we configure the pin as an output.
+The datasheet states that writing to IOSTATE register will trigger a
+transfer of the value to the I/O pin configured as output, so if the
+pin is configured as an input, nothing will be transferred.
+
+Therefore, set the direction first in IODIR, and then set the desired
+value in IOSTATE.
+
+This is what is done in NXP application note AN10587.
+
+Fixes: dfeae619d781 ("serial: sc16is7xx")
+Cc: stable@vger.kernel.org
+Signed-off-by: Hugo Villeneuve <hvilleneuve@dimonoff.com>
+Reviewed-by: Lech Perczak <lech.perczak@camlingroup.com>
+Tested-by: Lech Perczak <lech.perczak@camlingroup.com>
+Link: https://lore.kernel.org/r/20230807214556.540627-6-hugo@hugovil.com
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ drivers/tty/serial/sc16is7xx.c |   11 ++++++++++-
+ 1 file changed, 10 insertions(+), 1 deletion(-)
+
+--- a/drivers/tty/serial/sc16is7xx.c
++++ b/drivers/tty/serial/sc16is7xx.c
+@@ -1342,9 +1342,18 @@ static int sc16is7xx_gpio_direction_outp
+               state |= BIT(offset);
+       else
+               state &= ~BIT(offset);
+-      sc16is7xx_port_write(port, SC16IS7XX_IOSTATE_REG, state);
++
++      /*
++       * If we write IOSTATE first, and then IODIR, the output value is not
++       * transferred to the corresponding I/O pin.
++       * The datasheet states that each register bit will be transferred to
++       * the corresponding I/O pin programmed as output when writing to
++       * IOSTATE. Therefore, configure direction first with IODIR, and then
++       * set value after with IOSTATE.
++       */
+       sc16is7xx_port_update(port, SC16IS7XX_IODIR_REG, BIT(offset),
+                             BIT(offset));
++      sc16is7xx_port_write(port, SC16IS7XX_IOSTATE_REG, state);
+       return 0;
+ }
index b17cd3842eb6be2e4dfaa3e674731f21326ba586..430417ef78c652180472792a9c9c2c642c2b2158 100644 (file)
@@ -20,3 +20,11 @@ wifi-mt76-mt7921-fix-skb-leak-by-txs-missing-in-amsdu.patch
 wifi-rtw88-usb-kill-and-free-rx-urbs-on-probe-failure.patch
 wifi-ath11k-don-t-drop-tx_status-when-peer-cannot-be-found.patch
 wifi-ath11k-cleanup-mac80211-references-on-failure-during-tx_complete.patch
+serial-qcom-geni-fix-opp-vote-on-shutdown.patch
+serial-sc16is7xx-fix-broken-port-0-uart-init.patch
+serial-sc16is7xx-fix-bug-when-first-setting-gpio-direction.patch
+firmware-stratix10-svc-fix-an-null-vs-is_err-bug-in-probe.patch
+fsi-master-ast-cf-add-module_firmware-macro.patch
+tcpm-avoid-soft-reset-when-partner-does-not-support-get_status.patch
+dt-bindings-sc16is7xx-add-property-to-change-gpio-function.patch
+nilfs2-fix-warning-in-mark_buffer_dirty-due-to-discarded-buffer-reuse.patch
diff --git a/queue-6.4/tcpm-avoid-soft-reset-when-partner-does-not-support-get_status.patch b/queue-6.4/tcpm-avoid-soft-reset-when-partner-does-not-support-get_status.patch
new file mode 100644 (file)
index 0000000..a846fab
--- /dev/null
@@ -0,0 +1,62 @@
+From 78e0ea4277546debf7e96797ac3b768539cc44f6 Mon Sep 17 00:00:00 2001
+From: Badhri Jagan Sridharan <badhri@google.com>
+Date: Sun, 20 Aug 2023 04:44:48 +0000
+Subject: tcpm: Avoid soft reset when partner does not support get_status
+
+From: Badhri Jagan Sridharan <badhri@google.com>
+
+commit 78e0ea4277546debf7e96797ac3b768539cc44f6 upstream.
+
+When partner does not support get_status message, tcpm right now
+responds with soft reset message. This causes PD renegotiation to
+happen and resets PPS link. Avoid soft resetting the link when
+partner does not support get_status message to mitigate PPS resets.
+
+[  208.926752] Setting voltage/current limit 9500 mV 2450 mA
+[  208.930407] set_auto_vbus_discharge_threshold mode:3 pps_active:y vbus:9500 ret:0
+[  208.930418] state change SNK_TRANSITION_SINK -> SNK_READY [rev3 POWER_NEGOTIATION]
+[  208.930455] AMS POWER_NEGOTIATION finished
+
+// ALERT message from the Source
+[  213.948442] PD RX, header: 0x19a6 [1]
+[  213.948451] state change SNK_READY -> GET_STATUS_SEND [rev3 GETTING_SOURCE_SINK_STATUS]
+[  213.948457] PD TX, header: 0x492
+[  213.950402] PD TX complete, status: 0
+[  213.950427] pending state change GET_STATUS_SEND -> GET_STATUS_SEND_TIMEOUT @ 60 ms [rev3 GETTING_SOURCE_SINK_STATUS]
+
+// NOT_SUPPORTED from the Source
+[  213.959954] PD RX, header: 0xbb0 [1]
+
+// sink sends SOFT_RESET
+[  213.959958] state change GET_STATUS_SEND -> SNK_SOFT_RESET [rev3 GETTING_SOURCE_SINK_STATUS]
+[  213.959962] AMS GETTING_SOURCE_SINK_STATUS finished
+[  213.959964] AMS SOFT_RESET_AMS start
+[  213.959966] state change SNK_SOFT_RESET -> AMS_START [rev3 SOFT_RESET_AMS]
+[  213.959969] state change AMS_START -> SOFT_RESET_SEND [rev3 SOFT_RESET_AMS]
+
+Cc: stable@vger.kernel.org
+Fixes: 8dea75e11380 ("usb: typec: tcpm: Protocol Error handling")
+Signed-off-by: Badhri Jagan Sridharan <badhri@google.com>
+Acked-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
+Link: https://lore.kernel.org/r/20230820044449.1005889-1-badhri@google.com
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ drivers/usb/typec/tcpm/tcpm.c |    7 +++++++
+ 1 file changed, 7 insertions(+)
+
+--- a/drivers/usb/typec/tcpm/tcpm.c
++++ b/drivers/usb/typec/tcpm/tcpm.c
+@@ -2753,6 +2753,13 @@ static void tcpm_pd_ctrl_request(struct
+                       port->sink_cap_done = true;
+                       tcpm_set_state(port, ready_state(port), 0);
+                       break;
++              /*
++               * Some port partners do not support GET_STATUS, avoid soft reset the link to
++               * prevent redundant power re-negotiation
++               */
++              case GET_STATUS_SEND:
++                      tcpm_set_state(port, ready_state(port), 0);
++                      break;
+               case SRC_READY:
+               case SNK_READY:
+                       if (port->vdm_state > VDM_STATE_READY) {