From cf0c647da4c4b467fb9a84d87ede83ee70dee074 Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Mon, 21 Sep 2020 14:27:50 +0200 Subject: [PATCH] 4.14-stable patches added patches: serial-8250_pci-add-realtek-816a-and-816b.patch thunderbolt-retry-drom-read-once-if-parsing-fails.patch --- ...l-8250_pci-add-realtek-816a-and-816b.patch | 118 ++++++++++++++++++ queue-4.14/series | 2 + ...etry-drom-read-once-if-parsing-fails.patch | 77 ++++++++++++ 3 files changed, 197 insertions(+) create mode 100644 queue-4.14/serial-8250_pci-add-realtek-816a-and-816b.patch create mode 100644 queue-4.14/thunderbolt-retry-drom-read-once-if-parsing-fails.patch diff --git a/queue-4.14/serial-8250_pci-add-realtek-816a-and-816b.patch b/queue-4.14/serial-8250_pci-add-realtek-816a-and-816b.patch new file mode 100644 index 00000000000..052c14b7159 --- /dev/null +++ b/queue-4.14/serial-8250_pci-add-realtek-816a-and-816b.patch @@ -0,0 +1,118 @@ +From 3c5a87be170aba8ac40982182f812dcff6ed1ad1 Mon Sep 17 00:00:00 2001 +From: Tobias Diedrich +Date: Mon, 14 Sep 2020 19:36:28 +0200 +Subject: serial: 8250_pci: Add Realtek 816a and 816b + +From: Tobias Diedrich + +commit 3c5a87be170aba8ac40982182f812dcff6ed1ad1 upstream. + +These serial ports are exposed by the OOB-management-engine on +RealManage-enabled network cards (e.g. AMD DASH enabled systems using +Realtek cards). + +Because these have 3 BARs, they fail the "num_iomem <= 1" check in +serial_pci_guess_board. + +I've manually checked the two IOMEM regions and BAR 2 doesn't seem to +respond to reads, but BAR 4 seems to be an MMIO version of the IO ports +(untested). + +With this change, the ports are detected: +0000:02:00.1: ttyS0 at I/O 0x2200 (irq = 82, base_baud = 115200) is a 16550A +0000:02:00.2: ttyS1 at I/O 0x2100 (irq = 55, base_baud = 115200) is a 16550A + +lspci output: +02:00.1 0700: 10ec:816a (rev 0e) (prog-if 02 [16550]) + Subsystem: 17aa:5082 + Control: I/O+ Mem+ BusMaster- SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR- FastB2B- DisINTx- + Status: Cap+ 66MHz- UDF- FastB2B- ParErr- DEVSEL=fast >TAbort+ SERR- +Cc: stable +Link: https://lore.kernel.org/r/20200914173628.GA22508@yamamaya.is-a-geek.org +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/tty/serial/8250/8250_pci.c | 11 +++++++++++ + 1 file changed, 11 insertions(+) + +--- a/drivers/tty/serial/8250/8250_pci.c ++++ b/drivers/tty/serial/8250/8250_pci.c +@@ -5247,6 +5247,17 @@ static const struct pci_device_id serial + PCI_ANY_ID, PCI_ANY_ID, + 0, 0, pbn_wch384_4 }, + ++ /* ++ * Realtek RealManage ++ */ ++ { PCI_VENDOR_ID_REALTEK, 0x816a, ++ PCI_ANY_ID, PCI_ANY_ID, ++ 0, 0, pbn_b0_1_115200 }, ++ ++ { PCI_VENDOR_ID_REALTEK, 0x816b, ++ PCI_ANY_ID, PCI_ANY_ID, ++ 0, 0, pbn_b0_1_115200 }, ++ + /* Fintek PCI serial cards */ + { PCI_DEVICE(0x1c29, 0x1104), .driver_data = pbn_fintek_4 }, + { PCI_DEVICE(0x1c29, 0x1108), .driver_data = pbn_fintek_8 }, diff --git a/queue-4.14/series b/queue-4.14/series index f88cc69ed99..e8a997fbd41 100644 --- a/queue-4.14/series +++ b/queue-4.14/series @@ -88,3 +88,5 @@ i2c-i801-fix-resume-bug.patch percpu-fix-first-chunk-size-calculation-for-populated-bitmap.patch input-trackpoint-add-new-trackpoint-variant-ids.patch input-i8042-add-entroware-proteus-el07r4-to-nomux-and-reset-lists.patch +thunderbolt-retry-drom-read-once-if-parsing-fails.patch +serial-8250_pci-add-realtek-816a-and-816b.patch diff --git a/queue-4.14/thunderbolt-retry-drom-read-once-if-parsing-fails.patch b/queue-4.14/thunderbolt-retry-drom-read-once-if-parsing-fails.patch new file mode 100644 index 00000000000..1db8340beab --- /dev/null +++ b/queue-4.14/thunderbolt-retry-drom-read-once-if-parsing-fails.patch @@ -0,0 +1,77 @@ +From f022ff7bf377ca94367be05de61277934d42ea74 Mon Sep 17 00:00:00 2001 +From: Mika Westerberg +Date: Mon, 7 Sep 2020 12:20:36 +0300 +Subject: thunderbolt: Retry DROM read once if parsing fails + +From: Mika Westerberg + +commit f022ff7bf377ca94367be05de61277934d42ea74 upstream. + +Kai-Heng reported that sometimes DROM parsing of ASUS PA27AC Thunderbolt 3 +monitor fails. This makes the driver to fail to add the device so only +DisplayPort tunneling is functional. + +It is not clear what exactly happens but waiting for 100 ms and retrying +the read seems to work this around so we do that here. + +Link: https://bugzilla.kernel.org/show_bug.cgi?id=206493 +Reported-by: Kai-Heng Feng +Tested-by: Kai-Heng Feng +Cc: stable@vger.kernel.org +Signed-off-by: Mika Westerberg +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/thunderbolt/eeprom.c | 20 ++++++++++++++++---- + 1 file changed, 16 insertions(+), 4 deletions(-) + +--- a/drivers/thunderbolt/eeprom.c ++++ b/drivers/thunderbolt/eeprom.c +@@ -6,6 +6,7 @@ + */ + + #include ++#include + #include + #include + #include "tb.h" +@@ -385,8 +386,8 @@ static int tb_drom_parse_entries(struct + struct tb_drom_entry_header *entry = (void *) (sw->drom + pos); + if (pos + 1 == drom_size || pos + entry->len > drom_size + || !entry->len) { +- tb_sw_warn(sw, "drom buffer overrun, aborting\n"); +- return -EIO; ++ tb_sw_warn(sw, "DROM buffer overrun\n"); ++ return -EILSEQ; + } + + switch (entry->type) { +@@ -492,7 +493,8 @@ int tb_drom_read(struct tb_switch *sw) + u16 size; + u32 crc; + struct tb_drom_header *header; +- int res; ++ int res, retries = 1; ++ + if (sw->drom) + return 0; + +@@ -584,7 +586,17 @@ parse: + tb_sw_warn(sw, "drom device_rom_revision %#x unknown\n", + header->device_rom_revision); + +- return tb_drom_parse_entries(sw); ++ res = tb_drom_parse_entries(sw); ++ /* If the DROM parsing fails, wait a moment and retry once */ ++ if (res == -EILSEQ && retries--) { ++ tb_sw_warn(sw, "parsing DROM failed, retrying\n"); ++ msleep(100); ++ res = tb_drom_read_n(sw, 0, sw->drom, size); ++ if (!res) ++ goto parse; ++ } ++ ++ return res; + err: + kfree(sw->drom); + sw->drom = NULL; -- 2.47.3