From: Sasha Levin Date: Mon, 9 Mar 2020 14:51:45 +0000 (-0400) Subject: fixes for 4.4 X-Git-Tag: v4.4.216~57 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=5f83e4dc7894c9a886e19e7424bbf7d97c42931a;p=thirdparty%2Fkernel%2Fstable-queue.git fixes for 4.4 Signed-off-by: Sasha Levin --- diff --git a/queue-4.4/drm-msm-dsi-save-pll-state-before-dsi-host-is-powere.patch b/queue-4.4/drm-msm-dsi-save-pll-state-before-dsi-host-is-powere.patch new file mode 100644 index 00000000000..9a5804666ab --- /dev/null +++ b/queue-4.4/drm-msm-dsi-save-pll-state-before-dsi-host-is-powere.patch @@ -0,0 +1,45 @@ +From 36983c68c8aa82d62496c05a63f95d10bbbdcf74 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Thu, 6 Feb 2020 14:26:15 +0530 +Subject: drm/msm/dsi: save pll state before dsi host is powered off + +From: Harigovindan P + +[ Upstream commit a1028dcfd0dd97884072288d0c8ed7f30399b528 ] + +Save pll state before dsi host is powered off. Without this change +some register values gets resetted. + +Signed-off-by: Harigovindan P +Signed-off-by: Rob Clark +Signed-off-by: Sasha Levin +--- + drivers/gpu/drm/msm/dsi/dsi_manager.c | 5 +++++ + 1 file changed, 5 insertions(+) + +diff --git a/drivers/gpu/drm/msm/dsi/dsi_manager.c b/drivers/gpu/drm/msm/dsi/dsi_manager.c +index 439dfb69e2ef8..34220df1265f5 100644 +--- a/drivers/gpu/drm/msm/dsi/dsi_manager.c ++++ b/drivers/gpu/drm/msm/dsi/dsi_manager.c +@@ -434,6 +434,7 @@ static void dsi_mgr_bridge_post_disable(struct drm_bridge *bridge) + struct msm_dsi *msm_dsi1 = dsi_mgr_get_dsi(DSI_1); + struct mipi_dsi_host *host = msm_dsi->host; + struct drm_panel *panel = msm_dsi->panel; ++ struct msm_dsi_pll *src_pll; + bool is_dual_dsi = IS_DUAL_DSI(); + int ret; + +@@ -467,6 +468,10 @@ static void dsi_mgr_bridge_post_disable(struct drm_bridge *bridge) + id, ret); + } + ++ /* Save PLL status if it is a clock source */ ++ src_pll = msm_dsi_phy_get_pll(msm_dsi->phy); ++ msm_dsi_pll_save_state(src_pll); ++ + ret = msm_dsi_host_power_off(host); + if (ret) + pr_err("%s: host %d power off failed,%d\n", __func__, id, ret); +-- +2.20.1 + diff --git a/queue-4.4/drm-msm-fix-return-type-of-dsi_mgr_connector_mode_va.patch b/queue-4.4/drm-msm-fix-return-type-of-dsi_mgr_connector_mode_va.patch new file mode 100644 index 00000000000..645426a5ce8 --- /dev/null +++ b/queue-4.4/drm-msm-fix-return-type-of-dsi_mgr_connector_mode_va.patch @@ -0,0 +1,55 @@ +From 62e463c9aaeb358f141ec410cbc777588a1bcfb6 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Wed, 29 Jan 2020 20:12:44 +0000 +Subject: drm: msm: Fix return type of dsi_mgr_connector_mode_valid for kCFI + +From: John Stultz + +[ Upstream commit 7fd2dfc3694922eb7ace4801b7208cf9f62ebc7d ] + +I was hitting kCFI crashes when building with clang, and after +some digging finally narrowed it down to the +dsi_mgr_connector_mode_valid() function being implemented as +returning an int, instead of an enum drm_mode_status. + +This patch fixes it, and appeases the opaque word of the kCFI +gods (seriously, clang inlining everything makes the kCFI +backtraces only really rough estimates of where things went +wrong). + +Thanks as always to Sami for his help narrowing this down. + +Cc: Rob Clark +Cc: Sean Paul +Cc: Sami Tolvanen +Cc: Todd Kjos +Cc: Alistair Delva +Cc: Amit Pundir +Cc: Sumit Semwal +Cc: freedreno@lists.freedesktop.org +Cc: clang-built-linux@googlegroups.com +Signed-off-by: John Stultz +Reviewed-by: Nick Desaulniers +Tested-by: Amit Pundir +Signed-off-by: Rob Clark +Signed-off-by: Sasha Levin +--- + drivers/gpu/drm/msm/dsi/dsi_manager.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/drivers/gpu/drm/msm/dsi/dsi_manager.c b/drivers/gpu/drm/msm/dsi/dsi_manager.c +index 0455ff75074ad..439dfb69e2ef8 100644 +--- a/drivers/gpu/drm/msm/dsi/dsi_manager.c ++++ b/drivers/gpu/drm/msm/dsi/dsi_manager.c +@@ -302,7 +302,7 @@ static int dsi_mgr_connector_get_modes(struct drm_connector *connector) + return num; + } + +-static int dsi_mgr_connector_mode_valid(struct drm_connector *connector, ++static enum drm_mode_status dsi_mgr_connector_mode_valid(struct drm_connector *connector, + struct drm_display_mode *mode) + { + int id = dsi_mgr_connector_get_id(connector); +-- +2.20.1 + diff --git a/queue-4.4/net-ks8851-ml-fix-16-bit-data-access.patch b/queue-4.4/net-ks8851-ml-fix-16-bit-data-access.patch new file mode 100644 index 00000000000..9e3e0e012c5 --- /dev/null +++ b/queue-4.4/net-ks8851-ml-fix-16-bit-data-access.patch @@ -0,0 +1,48 @@ +From e744b0a40e1c2c4131df14394256f95b0716bfe1 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Sat, 15 Feb 2020 17:54:18 +0100 +Subject: net: ks8851-ml: Fix 16-bit data access + +From: Marek Vasut + +[ Upstream commit edacb098ea9c31589276152f09b4439052c0f2b1 ] + +The packet data written to and read from Micrel KSZ8851-16MLLI must be +byte-swapped in 16-bit mode, add this byte-swapping. + +Signed-off-by: Marek Vasut +Cc: David S. Miller +Cc: Lukas Wunner +Cc: Petr Stetiar +Cc: YueHaibing +Signed-off-by: David S. Miller +Signed-off-by: Sasha Levin +--- + drivers/net/ethernet/micrel/ks8851_mll.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/drivers/net/ethernet/micrel/ks8851_mll.c b/drivers/net/ethernet/micrel/ks8851_mll.c +index 721f851674531..20356976b9772 100644 +--- a/drivers/net/ethernet/micrel/ks8851_mll.c ++++ b/drivers/net/ethernet/micrel/ks8851_mll.c +@@ -515,7 +515,7 @@ static inline void ks_inblk(struct ks_net *ks, u16 *wptr, u32 len) + { + len >>= 1; + while (len--) +- *wptr++ = (u16)ioread16(ks->hw_addr); ++ *wptr++ = be16_to_cpu(ioread16(ks->hw_addr)); + } + + /** +@@ -529,7 +529,7 @@ static inline void ks_outblk(struct ks_net *ks, u16 *wptr, u32 len) + { + len >>= 1; + while (len--) +- iowrite16(*wptr++, ks->hw_addr); ++ iowrite16(cpu_to_be16(*wptr++), ks->hw_addr); + } + + static void ks_disable_int(struct ks_net *ks) +-- +2.20.1 + diff --git a/queue-4.4/net-ks8851-ml-fix-16-bit-io-operation.patch b/queue-4.4/net-ks8851-ml-fix-16-bit-io-operation.patch new file mode 100644 index 00000000000..b527954ed6d --- /dev/null +++ b/queue-4.4/net-ks8851-ml-fix-16-bit-io-operation.patch @@ -0,0 +1,51 @@ +From c8ed3c6d8c9e95cb737bbe0cee4e25cea369e215 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Sat, 15 Feb 2020 17:54:19 +0100 +Subject: net: ks8851-ml: Fix 16-bit IO operation + +From: Marek Vasut + +[ Upstream commit 58292104832fef6cb4a89f736012c0e0724c3442 ] + +The Micrel KSZ8851-16MLLI datasheet DS00002357B page 12 states that +BE[3:0] signals are active high. This contradicts the measurements +of the behavior of the actual chip, where these signals behave as +active low. For example, to read the CIDER register, the bus must +expose 0xc0c0 during the address phase, which means BE[3:0]=4'b1100. + +Signed-off-by: Marek Vasut +Cc: David S. Miller +Cc: Lukas Wunner +Cc: Petr Stetiar +Cc: YueHaibing +Signed-off-by: David S. Miller +Signed-off-by: Sasha Levin +--- + drivers/net/ethernet/micrel/ks8851_mll.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/drivers/net/ethernet/micrel/ks8851_mll.c b/drivers/net/ethernet/micrel/ks8851_mll.c +index 20356976b9772..d94e151cff12b 100644 +--- a/drivers/net/ethernet/micrel/ks8851_mll.c ++++ b/drivers/net/ethernet/micrel/ks8851_mll.c +@@ -484,7 +484,7 @@ static int msg_enable; + + static u16 ks_rdreg16(struct ks_net *ks, int offset) + { +- ks->cmd_reg_cache = (u16)offset | ((BE1 | BE0) << (offset & 0x02)); ++ ks->cmd_reg_cache = (u16)offset | ((BE3 | BE2) >> (offset & 0x02)); + iowrite16(ks->cmd_reg_cache, ks->hw_addr_cmd); + return ioread16(ks->hw_addr); + } +@@ -499,7 +499,7 @@ static u16 ks_rdreg16(struct ks_net *ks, int offset) + + static void ks_wrreg16(struct ks_net *ks, int offset, u16 value) + { +- ks->cmd_reg_cache = (u16)offset | ((BE1 | BE0) << (offset & 0x02)); ++ ks->cmd_reg_cache = (u16)offset | ((BE3 | BE2) >> (offset & 0x02)); + iowrite16(ks->cmd_reg_cache, ks->hw_addr_cmd); + iowrite16(value, ks->hw_addr); + } +-- +2.20.1 + diff --git a/queue-4.4/net-ks8851-ml-remove-8-bit-bus-accessors.patch b/queue-4.4/net-ks8851-ml-remove-8-bit-bus-accessors.patch new file mode 100644 index 00000000000..5f43bb18a3b --- /dev/null +++ b/queue-4.4/net-ks8851-ml-remove-8-bit-bus-accessors.patch @@ -0,0 +1,138 @@ +From 19ad40a08be0886c470b75fd45ec78c17627d4fb Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Sat, 15 Feb 2020 17:54:17 +0100 +Subject: net: ks8851-ml: Remove 8-bit bus accessors + +From: Marek Vasut + +[ Upstream commit 69233bba6543a37755158ca3382765387b8078df ] + +This driver is mixing 8-bit and 16-bit bus accessors for reasons unknown, +however the speculation is that this was some sort of attempt to support +the 8-bit bus mode. + +As per the KS8851-16MLL documentation, all two registers accessed via the +8-bit accessors are internally 16-bit registers, so reading them using +16-bit accessors is fine. The KS_CCR read can be converted to 16-bit read +outright, as it is already a concatenation of two 8-bit reads of that +register. The KS_RXQCR accesses are 8-bit only, however writing the top +8 bits of the register is OK as well, since the driver caches the entire +16-bit register value anyway. + +Finally, the driver is not used by any hardware in the kernel right now. +The only hardware available to me is one with 16-bit bus, so I have no +way to test the 8-bit bus mode, however it is unlikely this ever really +worked anyway. If the 8-bit bus mode is ever required, it can be easily +added by adjusting the 16-bit accessors to do 2 consecutive accesses, +which is how this should have been done from the beginning. + +Signed-off-by: Marek Vasut +Cc: David S. Miller +Cc: Lukas Wunner +Cc: Petr Stetiar +Cc: YueHaibing +Signed-off-by: David S. Miller +Signed-off-by: Sasha Levin +--- + drivers/net/ethernet/micrel/ks8851_mll.c | 45 +++--------------------- + 1 file changed, 5 insertions(+), 40 deletions(-) + +diff --git a/drivers/net/ethernet/micrel/ks8851_mll.c b/drivers/net/ethernet/micrel/ks8851_mll.c +index 8dc1f0277117d..721f851674531 100644 +--- a/drivers/net/ethernet/micrel/ks8851_mll.c ++++ b/drivers/net/ethernet/micrel/ks8851_mll.c +@@ -474,24 +474,6 @@ static int msg_enable; + * chip is busy transferring packet data (RX/TX FIFO accesses). + */ + +-/** +- * ks_rdreg8 - read 8 bit register from device +- * @ks : The chip information +- * @offset: The register address +- * +- * Read a 8bit register from the chip, returning the result +- */ +-static u8 ks_rdreg8(struct ks_net *ks, int offset) +-{ +- u16 data; +- u8 shift_bit = offset & 0x03; +- u8 shift_data = (offset & 1) << 3; +- ks->cmd_reg_cache = (u16) offset | (u16)(BE0 << shift_bit); +- iowrite16(ks->cmd_reg_cache, ks->hw_addr_cmd); +- data = ioread16(ks->hw_addr); +- return (u8)(data >> shift_data); +-} +- + /** + * ks_rdreg16 - read 16 bit register from device + * @ks : The chip information +@@ -507,22 +489,6 @@ static u16 ks_rdreg16(struct ks_net *ks, int offset) + return ioread16(ks->hw_addr); + } + +-/** +- * ks_wrreg8 - write 8bit register value to chip +- * @ks: The chip information +- * @offset: The register address +- * @value: The value to write +- * +- */ +-static void ks_wrreg8(struct ks_net *ks, int offset, u8 value) +-{ +- u8 shift_bit = (offset & 0x03); +- u16 value_write = (u16)(value << ((offset & 1) << 3)); +- ks->cmd_reg_cache = (u16)offset | (BE0 << shift_bit); +- iowrite16(ks->cmd_reg_cache, ks->hw_addr_cmd); +- iowrite16(value_write, ks->hw_addr); +-} +- + /** + * ks_wrreg16 - write 16bit register value to chip + * @ks: The chip information +@@ -642,8 +608,7 @@ static void ks_read_config(struct ks_net *ks) + u16 reg_data = 0; + + /* Regardless of bus width, 8 bit read should always work.*/ +- reg_data = ks_rdreg8(ks, KS_CCR) & 0x00FF; +- reg_data |= ks_rdreg8(ks, KS_CCR+1) << 8; ++ reg_data = ks_rdreg16(ks, KS_CCR); + + /* addr/data bus are multiplexed */ + ks->sharedbus = (reg_data & CCR_SHARED) == CCR_SHARED; +@@ -747,7 +712,7 @@ static inline void ks_read_qmu(struct ks_net *ks, u16 *buf, u32 len) + + /* 1. set sudo DMA mode */ + ks_wrreg16(ks, KS_RXFDPR, RXFDPR_RXFPAI); +- ks_wrreg8(ks, KS_RXQCR, (ks->rc_rxqcr | RXQCR_SDA) & 0xff); ++ ks_wrreg16(ks, KS_RXQCR, ks->rc_rxqcr | RXQCR_SDA); + + /* 2. read prepend data */ + /** +@@ -764,7 +729,7 @@ static inline void ks_read_qmu(struct ks_net *ks, u16 *buf, u32 len) + ks_inblk(ks, buf, ALIGN(len, 4)); + + /* 4. reset sudo DMA Mode */ +- ks_wrreg8(ks, KS_RXQCR, ks->rc_rxqcr); ++ ks_wrreg16(ks, KS_RXQCR, ks->rc_rxqcr); + } + + /** +@@ -997,13 +962,13 @@ static void ks_write_qmu(struct ks_net *ks, u8 *pdata, u16 len) + ks->txh.txw[1] = cpu_to_le16(len); + + /* 1. set sudo-DMA mode */ +- ks_wrreg8(ks, KS_RXQCR, (ks->rc_rxqcr | RXQCR_SDA) & 0xff); ++ ks_wrreg16(ks, KS_RXQCR, ks->rc_rxqcr | RXQCR_SDA); + /* 2. write status/lenth info */ + ks_outblk(ks, ks->txh.txw, 4); + /* 3. write pkt data */ + ks_outblk(ks, (u16 *)pdata, ALIGN(len, 4)); + /* 4. reset sudo-DMA mode */ +- ks_wrreg8(ks, KS_RXQCR, ks->rc_rxqcr); ++ ks_wrreg16(ks, KS_RXQCR, ks->rc_rxqcr); + /* 5. Enqueue Tx(move the pkt from TX buffer into TXQ) */ + ks_wrreg16(ks, KS_TXQCR, TXQCR_METFE); + /* 6. wait until TXQCR_METFE is auto-cleared */ +-- +2.20.1 + diff --git a/queue-4.4/s390-cio-cio_ignore_proc_seq_next-should-increase-po.patch b/queue-4.4/s390-cio-cio_ignore_proc_seq_next-should-increase-po.patch new file mode 100644 index 00000000000..1763a20ed3a --- /dev/null +++ b/queue-4.4/s390-cio-cio_ignore_proc_seq_next-should-increase-po.patch @@ -0,0 +1,50 @@ +From 2e1d467fabd6e9689ffbd684dad22eb20d2592ed Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Fri, 24 Jan 2020 08:48:55 +0300 +Subject: s390/cio: cio_ignore_proc_seq_next should increase position index + +From: Vasily Averin + +[ Upstream commit 8b101a5e14f2161869636ff9cb4907b7749dc0c2 ] + +if seq_file .next fuction does not change position index, +read after some lseek can generate unexpected output. + +Link: https://bugzilla.kernel.org/show_bug.cgi?id=206283 +Link: https://lore.kernel.org/r/d44c53a7-9bc1-15c7-6d4a-0c10cb9dffce@virtuozzo.com +Reviewed-by: Cornelia Huck +Signed-off-by: Christian Borntraeger +Signed-off-by: Vasily Averin +Signed-off-by: Vasily Gorbik +Signed-off-by: Sasha Levin +--- + drivers/s390/cio/blacklist.c | 5 +++-- + 1 file changed, 3 insertions(+), 2 deletions(-) + +diff --git a/drivers/s390/cio/blacklist.c b/drivers/s390/cio/blacklist.c +index 20314aad7ab7d..f329459cadf14 100644 +--- a/drivers/s390/cio/blacklist.c ++++ b/drivers/s390/cio/blacklist.c +@@ -303,8 +303,10 @@ static void * + cio_ignore_proc_seq_next(struct seq_file *s, void *it, loff_t *offset) + { + struct ccwdev_iter *iter; ++ loff_t p = *offset; + +- if (*offset >= (__MAX_SUBCHANNEL + 1) * (__MAX_SSID + 1)) ++ (*offset)++; ++ if (p >= (__MAX_SUBCHANNEL + 1) * (__MAX_SSID + 1)) + return NULL; + iter = it; + if (iter->devno == __MAX_SUBCHANNEL) { +@@ -314,7 +316,6 @@ cio_ignore_proc_seq_next(struct seq_file *s, void *it, loff_t *offset) + return NULL; + } else + iter->devno++; +- (*offset)++; + return iter; + } + +-- +2.20.1 + diff --git a/queue-4.4/serial-ar933x_uart-set-uart_cs_-rx-tx-_ready_oride.patch b/queue-4.4/serial-ar933x_uart-set-uart_cs_-rx-tx-_ready_oride.patch new file mode 100644 index 00000000000..b77696a3a40 --- /dev/null +++ b/queue-4.4/serial-ar933x_uart-set-uart_cs_-rx-tx-_ready_oride.patch @@ -0,0 +1,58 @@ +From 6e3daff059697bdc8ca1cf3f110afb3b5e013b1e Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Fri, 7 Feb 2020 11:53:35 +0200 +Subject: serial: ar933x_uart: set UART_CS_{RX,TX}_READY_ORIDE + +From: Daniel Golle + +[ Upstream commit 87c5cbf71ecbb9e289d60a2df22eb686c70bf196 ] + +On AR934x this UART is usually not initialized by the bootloader +as it is only used as a secondary serial port while the primary +UART is a newly introduced NS16550-compatible. +In order to make use of the ar933x-uart on AR934x without RTS/CTS +hardware flow control, one needs to set the +UART_CS_{RX,TX}_READY_ORIDE bits as other than on AR933x where this +UART is used as primary/console, the bootloader on AR934x typically +doesn't set those bits. +Setting them explicitely on AR933x should not do any harm, so just +set them unconditionally. + +Tested-by: Chuanhong Guo +Signed-off-by: Daniel Golle +Link: https://lore.kernel.org/r/20200207095335.GA179836@makrotopia.org +Signed-off-by: Greg Kroah-Hartman +Signed-off-by: Sasha Levin +--- + drivers/tty/serial/ar933x_uart.c | 8 ++++++++ + 1 file changed, 8 insertions(+) + +diff --git a/drivers/tty/serial/ar933x_uart.c b/drivers/tty/serial/ar933x_uart.c +index 1519d2ca7705f..40194791cde0b 100644 +--- a/drivers/tty/serial/ar933x_uart.c ++++ b/drivers/tty/serial/ar933x_uart.c +@@ -294,6 +294,10 @@ static void ar933x_uart_set_termios(struct uart_port *port, + ar933x_uart_rmw_set(up, AR933X_UART_CS_REG, + AR933X_UART_CS_HOST_INT_EN); + ++ /* enable RX and TX ready overide */ ++ ar933x_uart_rmw_set(up, AR933X_UART_CS_REG, ++ AR933X_UART_CS_TX_READY_ORIDE | AR933X_UART_CS_RX_READY_ORIDE); ++ + /* reenable the UART */ + ar933x_uart_rmw(up, AR933X_UART_CS_REG, + AR933X_UART_CS_IF_MODE_M << AR933X_UART_CS_IF_MODE_S, +@@ -426,6 +430,10 @@ static int ar933x_uart_startup(struct uart_port *port) + ar933x_uart_rmw_set(up, AR933X_UART_CS_REG, + AR933X_UART_CS_HOST_INT_EN); + ++ /* enable RX and TX ready overide */ ++ ar933x_uart_rmw_set(up, AR933X_UART_CS_REG, ++ AR933X_UART_CS_TX_READY_ORIDE | AR933X_UART_CS_RX_READY_ORIDE); ++ + /* Enable RX interrupts */ + up->ier = AR933X_UART_INT_RX_VALID; + ar933x_uart_write(up, AR933X_UART_INT_EN_REG, up->ier); +-- +2.20.1 + diff --git a/queue-4.4/series b/queue-4.4/series index a92d443e59f..46e036b1134 100644 --- a/queue-4.4/series +++ b/queue-4.4/series @@ -37,3 +37,13 @@ mm-prevent-get_user_pages-from-overflowing-page-refcount.patch pipe-add-pipe_buf_get-helper.patch fs-prevent-page-refcount-overflow-in-pipe_buf_get.patch audit-always-check-the-netlink-payload-length-in-aud.patch +serial-ar933x_uart-set-uart_cs_-rx-tx-_ready_oride.patch +usb-gadget-ffs-ffs_aio_cancel-save-restore-irq-flags.patch +usb-gadget-serial-fix-tx-stall-after-buffer-overflow.patch +drm-msm-fix-return-type-of-dsi_mgr_connector_mode_va.patch +drm-msm-dsi-save-pll-state-before-dsi-host-is-powere.patch +net-ks8851-ml-remove-8-bit-bus-accessors.patch +net-ks8851-ml-fix-16-bit-data-access.patch +net-ks8851-ml-fix-16-bit-io-operation.patch +watchdog-da9062-do-not-ping-the-hw-during-stop.patch +s390-cio-cio_ignore_proc_seq_next-should-increase-po.patch diff --git a/queue-4.4/usb-gadget-ffs-ffs_aio_cancel-save-restore-irq-flags.patch b/queue-4.4/usb-gadget-ffs-ffs_aio_cancel-save-restore-irq-flags.patch new file mode 100644 index 00000000000..a339cd89645 --- /dev/null +++ b/queue-4.4/usb-gadget-ffs-ffs_aio_cancel-save-restore-irq-flags.patch @@ -0,0 +1,53 @@ +From 04e4b693798da3ac7b97a7681754c7c1d60352c2 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Thu, 16 Jan 2020 15:29:01 +0200 +Subject: usb: gadget: ffs: ffs_aio_cancel(): Save/restore IRQ flags + +From: Lars-Peter Clausen + +[ Upstream commit 43d565727a3a6fd24e37c7c2116475106af71806 ] + +ffs_aio_cancel() can be called from both interrupt and thread context. Make +sure that the current IRQ state is saved and restored by using +spin_{un,}lock_irq{save,restore}(). + +Otherwise undefined behavior might occur. + +Acked-by: Michal Nazarewicz +Signed-off-by: Lars-Peter Clausen +Signed-off-by: Alexandru Ardelean +Signed-off-by: Felipe Balbi +Signed-off-by: Sasha Levin +--- + drivers/usb/gadget/function/f_fs.c | 5 +++-- + 1 file changed, 3 insertions(+), 2 deletions(-) + +diff --git a/drivers/usb/gadget/function/f_fs.c b/drivers/usb/gadget/function/f_fs.c +index 4cb1355271ec4..9536c409a90d5 100644 +--- a/drivers/usb/gadget/function/f_fs.c ++++ b/drivers/usb/gadget/function/f_fs.c +@@ -888,18 +888,19 @@ static int ffs_aio_cancel(struct kiocb *kiocb) + { + struct ffs_io_data *io_data = kiocb->private; + struct ffs_epfile *epfile = kiocb->ki_filp->private_data; ++ unsigned long flags; + int value; + + ENTER(); + +- spin_lock_irq(&epfile->ffs->eps_lock); ++ spin_lock_irqsave(&epfile->ffs->eps_lock, flags); + + if (likely(io_data && io_data->ep && io_data->req)) + value = usb_ep_dequeue(io_data->ep, io_data->req); + else + value = -EINVAL; + +- spin_unlock_irq(&epfile->ffs->eps_lock); ++ spin_unlock_irqrestore(&epfile->ffs->eps_lock, flags); + + return value; + } +-- +2.20.1 + diff --git a/queue-4.4/usb-gadget-serial-fix-tx-stall-after-buffer-overflow.patch b/queue-4.4/usb-gadget-serial-fix-tx-stall-after-buffer-overflow.patch new file mode 100644 index 00000000000..be2706a8aa8 --- /dev/null +++ b/queue-4.4/usb-gadget-serial-fix-tx-stall-after-buffer-overflow.patch @@ -0,0 +1,50 @@ +From ae1793bdc2cb3b8451fc5bfa736e69a5cf5d7892 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Wed, 29 Jan 2020 14:21:46 +0300 +Subject: usb: gadget: serial: fix Tx stall after buffer overflow +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +From: Sergey Organov + +[ Upstream commit e4bfded56cf39b8d02733c1e6ef546b97961e18a ] + +Symptom: application opens /dev/ttyGS0 and starts sending (writing) to +it while either USB cable is not connected, or nobody listens on the +other side of the cable. If driver circular buffer overflows before +connection is established, no data will be written to the USB layer +until/unless /dev/ttyGS0 is closed and re-opened again by the +application (the latter besides having no means of being notified about +the event of establishing of the connection.) + +Fix: on open and/or connect, kick Tx to flush circular buffer data to +USB layer. + +Signed-off-by: Sergey Organov +Reviewed-by: Michał Mirosław +Signed-off-by: Felipe Balbi +Signed-off-by: Sasha Levin +--- + drivers/usb/gadget/function/u_serial.c | 4 +++- + 1 file changed, 3 insertions(+), 1 deletion(-) + +diff --git a/drivers/usb/gadget/function/u_serial.c b/drivers/usb/gadget/function/u_serial.c +index 31e08bb3cb41e..58a699cfa4582 100644 +--- a/drivers/usb/gadget/function/u_serial.c ++++ b/drivers/usb/gadget/function/u_serial.c +@@ -701,8 +701,10 @@ static int gs_start_io(struct gs_port *port) + port->n_read = 0; + started = gs_start_rx(port); + +- /* unblock any pending writes into our circular buffer */ + if (started) { ++ gs_start_tx(port); ++ /* Unblock any pending writes into our circular buffer, in case ++ * we didn't in gs_start_tx() */ + tty_wakeup(port->port.tty); + } else { + gs_free_requests(ep, head, &port->read_allocated); +-- +2.20.1 + diff --git a/queue-4.4/watchdog-da9062-do-not-ping-the-hw-during-stop.patch b/queue-4.4/watchdog-da9062-do-not-ping-the-hw-during-stop.patch new file mode 100644 index 00000000000..0ab493cea32 --- /dev/null +++ b/queue-4.4/watchdog-da9062-do-not-ping-the-hw-during-stop.patch @@ -0,0 +1,51 @@ +From 96c782be63b3efefc5a355c64f4cdf92180d8e09 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Mon, 20 Jan 2020 10:17:29 +0100 +Subject: watchdog: da9062: do not ping the hw during stop() + +From: Marco Felsch + +[ Upstream commit e9a0e65eda3f78d0b04ec6136c591c000cbc3b76 ] + +The da9062 hw has a minimum ping cool down phase of at least 200ms. The +driver takes that into account by setting the min_hw_heartbeat_ms to +300ms and the core guarantees that the hw limit is observed for the +ping() calls. But the core can't guarantee the required minimum ping +cool down phase if a stop() command is send immediately after the ping() +command. So it is not allowed to ping the watchdog within the stop() +command as the driver does. Remove the ping can be done without doubts +because the watchdog gets disabled anyway and a (re)start resets the +watchdog counter too. + +Signed-off-by: Marco Felsch +Reviewed-by: Guenter Roeck +Link: https://lore.kernel.org/r/20200120091729.16256-1-m.felsch@pengutronix.de +[groeck: Updated description] +Signed-off-by: Guenter Roeck +Signed-off-by: Wim Van Sebroeck +Signed-off-by: Sasha Levin +--- + drivers/watchdog/da9062_wdt.c | 7 ------- + 1 file changed, 7 deletions(-) + +diff --git a/drivers/watchdog/da9062_wdt.c b/drivers/watchdog/da9062_wdt.c +index 7386111220d58..daeb645fcea8a 100644 +--- a/drivers/watchdog/da9062_wdt.c ++++ b/drivers/watchdog/da9062_wdt.c +@@ -126,13 +126,6 @@ static int da9062_wdt_stop(struct watchdog_device *wdd) + struct da9062_watchdog *wdt = watchdog_get_drvdata(wdd); + int ret; + +- ret = da9062_reset_watchdog_timer(wdt); +- if (ret) { +- dev_err(wdt->hw->dev, "Failed to ping the watchdog (err = %d)\n", +- ret); +- return ret; +- } +- + ret = regmap_update_bits(wdt->hw->regmap, + DA9062AA_CONTROL_D, + DA9062AA_TWDSCALE_MASK, +-- +2.20.1 +