From 660db29aacefdded5e6649c6486442d78db9e425 Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Mon, 18 Jul 2022 17:37:37 +0200 Subject: [PATCH] 4.14-stable patches added patches: tty-serial-samsung_tty-set-dma-burst_size-to-1.patch usb-dwc3-gadget-fix-event-pending-check.patch usb-serial-ftdi_sio-add-belimo-device-ids.patch --- queue-4.14/series | 3 ++ ...-samsung_tty-set-dma-burst_size-to-1.patch | 45 ++++++++++++++++ ...-dwc3-gadget-fix-event-pending-check.patch | 51 +++++++++++++++++++ ...erial-ftdi_sio-add-belimo-device-ids.patch | 47 +++++++++++++++++ 4 files changed, 146 insertions(+) create mode 100644 queue-4.14/tty-serial-samsung_tty-set-dma-burst_size-to-1.patch create mode 100644 queue-4.14/usb-dwc3-gadget-fix-event-pending-check.patch create mode 100644 queue-4.14/usb-serial-ftdi_sio-add-belimo-device-ids.patch diff --git a/queue-4.14/series b/queue-4.14/series index dfc315327bc..4416bb05494 100644 --- a/queue-4.14/series +++ b/queue-4.14/series @@ -35,3 +35,6 @@ asoc-wm5110-fix-dre-control.patch irqchip-or1k-pic-undefine-mask_ack-for-level-trigger.patch x86-clear-.brk-area-at-early-boot.patch signal-handling-don-t-use-bug_on-for-debugging.patch +usb-serial-ftdi_sio-add-belimo-device-ids.patch +usb-dwc3-gadget-fix-event-pending-check.patch +tty-serial-samsung_tty-set-dma-burst_size-to-1.patch diff --git a/queue-4.14/tty-serial-samsung_tty-set-dma-burst_size-to-1.patch b/queue-4.14/tty-serial-samsung_tty-set-dma-burst_size-to-1.patch new file mode 100644 index 00000000000..8589df42a3e --- /dev/null +++ b/queue-4.14/tty-serial-samsung_tty-set-dma-burst_size-to-1.patch @@ -0,0 +1,45 @@ +From f7e35e4bf1e8dc2c8cbd5e0955dc1bd58558dae0 Mon Sep 17 00:00:00 2001 +From: Chanho Park +Date: Mon, 27 Jun 2022 15:51:13 +0900 +Subject: tty: serial: samsung_tty: set dma burst_size to 1 + +From: Chanho Park + +commit f7e35e4bf1e8dc2c8cbd5e0955dc1bd58558dae0 upstream. + +The src_maxburst and dst_maxburst have been changed to 1 but the settings +of the UCON register aren't changed yet. They should be changed as well +according to the dmaengine slave config. + +Fixes: aa2f80e752c7 ("serial: samsung: fix maxburst parameter for DMA transactions") +Cc: stable +Cc: Marek Szyprowski +Reviewed-by: Krzysztof Kozlowski +Signed-off-by: Chanho Park +Link: https://lore.kernel.org/r/20220627065113.139520-1-chanho61.park@samsung.com +Signed-off-by: Greg Kroah-Hartman +--- + drivers/tty/serial/samsung.c | 5 ++--- + 1 file changed, 2 insertions(+), 3 deletions(-) + +--- a/drivers/tty/serial/samsung.c ++++ b/drivers/tty/serial/samsung.c +@@ -241,8 +241,7 @@ static void enable_tx_dma(struct s3c24xx + /* Enable tx dma mode */ + ucon = rd_regl(port, S3C2410_UCON); + ucon &= ~(S3C64XX_UCON_TXBURST_MASK | S3C64XX_UCON_TXMODE_MASK); +- ucon |= (dma_get_cache_alignment() >= 16) ? +- S3C64XX_UCON_TXBURST_16 : S3C64XX_UCON_TXBURST_1; ++ ucon |= S3C64XX_UCON_TXBURST_1; + ucon |= S3C64XX_UCON_TXMODE_DMA; + wr_regl(port, S3C2410_UCON, ucon); + +@@ -515,7 +514,7 @@ static void enable_rx_dma(struct s3c24xx + S3C64XX_UCON_DMASUS_EN | + S3C64XX_UCON_TIMEOUT_EN | + S3C64XX_UCON_RXMODE_MASK); +- ucon |= S3C64XX_UCON_RXBURST_16 | ++ ucon |= S3C64XX_UCON_RXBURST_1 | + 0xf << S3C64XX_UCON_TIMEOUT_SHIFT | + S3C64XX_UCON_EMPTYINT_EN | + S3C64XX_UCON_TIMEOUT_EN | diff --git a/queue-4.14/usb-dwc3-gadget-fix-event-pending-check.patch b/queue-4.14/usb-dwc3-gadget-fix-event-pending-check.patch new file mode 100644 index 00000000000..ce21f5692fe --- /dev/null +++ b/queue-4.14/usb-dwc3-gadget-fix-event-pending-check.patch @@ -0,0 +1,51 @@ +From 7441b273388b9a59d8387a03ffbbca9d5af6348c Mon Sep 17 00:00:00 2001 +From: Thinh Nguyen +Date: Mon, 27 Jun 2022 18:41:19 -0700 +Subject: usb: dwc3: gadget: Fix event pending check + +From: Thinh Nguyen + +commit 7441b273388b9a59d8387a03ffbbca9d5af6348c upstream. + +The DWC3_EVENT_PENDING flag is used to protect against invalid call to +top-half interrupt handler, which can occur when there's a delay in +software detection of the interrupt line deassertion. + +However, the clearing of this flag was done prior to unmasking the +interrupt line, creating opportunity where the top-half handler can +come. This breaks the serialization and creates a race between the +top-half and bottom-half handler, resulting in losing synchronization +between the controller and the driver when processing events. + +To fix this, make sure the clearing of the DWC3_EVENT_PENDING is done at +the end of the bottom-half handler. + +Fixes: d325a1de49d6 ("usb: dwc3: gadget: Prevent losing events in event cache") +Cc: stable@vger.kernel.org +Signed-off-by: Thinh Nguyen +Link: https://lore.kernel.org/r/8670aaf1cf52e7d1e6df2a827af2d77263b93b75.1656380429.git.Thinh.Nguyen@synopsys.com +Signed-off-by: Greg Kroah-Hartman +--- + drivers/usb/dwc3/gadget.c | 4 +++- + 1 file changed, 3 insertions(+), 1 deletion(-) + +--- a/drivers/usb/dwc3/gadget.c ++++ b/drivers/usb/dwc3/gadget.c +@@ -3130,7 +3130,6 @@ static irqreturn_t dwc3_process_event_bu + } + + evt->count = 0; +- evt->flags &= ~DWC3_EVENT_PENDING; + ret = IRQ_HANDLED; + + /* Unmask interrupt */ +@@ -3143,6 +3142,9 @@ static irqreturn_t dwc3_process_event_bu + dwc3_writel(dwc->regs, DWC3_DEV_IMOD(0), dwc->imod_interval); + } + ++ /* Keep the clearing of DWC3_EVENT_PENDING at the end */ ++ evt->flags &= ~DWC3_EVENT_PENDING; ++ + return ret; + } + diff --git a/queue-4.14/usb-serial-ftdi_sio-add-belimo-device-ids.patch b/queue-4.14/usb-serial-ftdi_sio-add-belimo-device-ids.patch new file mode 100644 index 00000000000..edb8ace5727 --- /dev/null +++ b/queue-4.14/usb-serial-ftdi_sio-add-belimo-device-ids.patch @@ -0,0 +1,47 @@ +From 7c239a071d1f04b7137789810807b4108d475c72 Mon Sep 17 00:00:00 2001 +From: Lucien Buchmann +Date: Sat, 25 Jun 2022 02:17:44 +0200 +Subject: USB: serial: ftdi_sio: add Belimo device ids + +From: Lucien Buchmann + +commit 7c239a071d1f04b7137789810807b4108d475c72 upstream. + +Those two product ids are known. + +Signed-off-by: Lucien Buchmann +Cc: stable@vger.kernel.org +Signed-off-by: Johan Hovold +Signed-off-by: Greg Kroah-Hartman +--- + drivers/usb/serial/ftdi_sio.c | 3 +++ + drivers/usb/serial/ftdi_sio_ids.h | 6 ++++++ + 2 files changed, 9 insertions(+) + +--- a/drivers/usb/serial/ftdi_sio.c ++++ b/drivers/usb/serial/ftdi_sio.c +@@ -1018,6 +1018,9 @@ static const struct usb_device_id id_tab + { USB_DEVICE(FTDI_VID, CHETCO_SEASMART_DISPLAY_PID) }, + { USB_DEVICE(FTDI_VID, CHETCO_SEASMART_LITE_PID) }, + { USB_DEVICE(FTDI_VID, CHETCO_SEASMART_ANALOG_PID) }, ++ /* Belimo Automation devices */ ++ { USB_DEVICE(FTDI_VID, BELIMO_ZTH_PID) }, ++ { USB_DEVICE(FTDI_VID, BELIMO_ZIP_PID) }, + /* ICP DAS I-756xU devices */ + { USB_DEVICE(ICPDAS_VID, ICPDAS_I7560U_PID) }, + { USB_DEVICE(ICPDAS_VID, ICPDAS_I7561U_PID) }, +--- a/drivers/usb/serial/ftdi_sio_ids.h ++++ b/drivers/usb/serial/ftdi_sio_ids.h +@@ -1569,6 +1569,12 @@ + #define CHETCO_SEASMART_ANALOG_PID 0xA5AF /* SeaSmart Analog Adapter */ + + /* ++ * Belimo Automation ++ */ ++#define BELIMO_ZTH_PID 0x8050 ++#define BELIMO_ZIP_PID 0xC811 ++ ++/* + * Unjo AB + */ + #define UNJO_VID 0x22B7 -- 2.47.3