From: Greg Kroah-Hartman Date: Thu, 21 Mar 2019 08:18:10 +0000 (+0100) Subject: 4.9-stable patches X-Git-Tag: v3.18.137~36 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=c31e74a6d7906b72b40e5ef4647871a53769f6ae;p=thirdparty%2Fkernel%2Fstable-queue.git 4.9-stable patches added patches: 8250-fix-fourth-port-offset-of-pericom-pi7c9x7954-boards.patch dm-fix-to_sector-for-32bit.patch --- diff --git a/queue-4.9/8250-fix-fourth-port-offset-of-pericom-pi7c9x7954-boards.patch b/queue-4.9/8250-fix-fourth-port-offset-of-pericom-pi7c9x7954-boards.patch new file mode 100644 index 00000000000..16784222ed9 --- /dev/null +++ b/queue-4.9/8250-fix-fourth-port-offset-of-pericom-pi7c9x7954-boards.patch @@ -0,0 +1,86 @@ +From 5c31ef91c06db7800ad573174bd92be4df34ecb2 Mon Sep 17 00:00:00 2001 +From: Angelo Butti +Date: Mon, 7 Nov 2016 16:39:03 +0100 +Subject: 8250: FIX Fourth port offset of Pericom PI7C9X7954 boards + +From: Angelo Butti + +commit 5c31ef91c06db7800ad573174bd92be4df34ecb2 upstream. + +Hi, +below patch to fix Fourth port offset of Percom PI7C9X7954 boards. + +I had a problem using Fourth port on a pci express serial board based on Pericom +PI7C9X7954. Reading datasheet I notice a "special" offset assign to this port +when used in I/O mode. + +Offset 0x0 -> UART 0 +Offset 0x8 -> UART 1 +Offset 0x10 -> UART 2 +Offset 0x38 -> UART 3 <<---- This don't follow a logical sequence + +This patch add a different init to last port, to have right offset. + +I check also Pericom 7952 and 7958 but that devices follow logical sequence, +so they are ok. + +Regards, +Angelo + +Signed-off-by: Angelo Butti +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/tty/serial/8250/8250_pci.c | 34 ++++++++++++++++++++++++++++++++++ + 1 file changed, 34 insertions(+) + +--- a/drivers/tty/serial/8250/8250_pci.c ++++ b/drivers/tty/serial/8250/8250_pci.c +@@ -1330,6 +1330,30 @@ static int pci_default_setup(struct seri + return setup_port(priv, port, bar, offset, board->reg_shift); + } + ++static int pci_pericom_setup(struct serial_private *priv, ++ const struct pciserial_board *board, ++ struct uart_8250_port *port, int idx) ++{ ++ unsigned int bar, offset = board->first_offset, maxnr; ++ ++ bar = FL_GET_BASE(board->flags); ++ if (board->flags & FL_BASE_BARS) ++ bar += idx; ++ else ++ offset += idx * board->uart_offset; ++ ++ if (idx==3) ++ offset = 0x38; ++ ++ maxnr = (pci_resource_len(priv->dev, bar) - board->first_offset) >> ++ (board->reg_shift + 3); ++ ++ if (board->flags & FL_REGION_SZ_CAP && idx >= maxnr) ++ return 1; ++ ++ return setup_port(priv, port, bar, offset, board->reg_shift); ++} ++ + static int + ce4100_serial_setup(struct serial_private *priv, + const struct pciserial_board *board, +@@ -2097,6 +2121,16 @@ static struct pci_serial_quirk pci_seria + .exit = pci_plx9050_exit, + }, + /* ++ * Pericom (Only 7954 - It have a offset jump for port 4) ++ */ ++ { ++ .vendor = PCI_VENDOR_ID_PERICOM, ++ .device = PCI_DEVICE_ID_PERICOM_PI7C9X7954, ++ .subvendor = PCI_ANY_ID, ++ .subdevice = PCI_ANY_ID, ++ .setup = pci_pericom_setup, ++ }, ++ /* + * PLX + */ + { diff --git a/queue-4.9/dm-fix-to_sector-for-32bit.patch b/queue-4.9/dm-fix-to_sector-for-32bit.patch new file mode 100644 index 00000000000..a0ae8f75633 --- /dev/null +++ b/queue-4.9/dm-fix-to_sector-for-32bit.patch @@ -0,0 +1,43 @@ +From 0bdb50c531f7377a9da80d3ce2d61f389c84cb30 Mon Sep 17 00:00:00 2001 +From: NeilBrown +Date: Sun, 6 Jan 2019 21:06:25 +1100 +Subject: dm: fix to_sector() for 32bit +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +From: NeilBrown + +commit 0bdb50c531f7377a9da80d3ce2d61f389c84cb30 upstream. + +A dm-raid array with devices larger than 4GB won't assemble on +a 32 bit host since _check_data_dev_sectors() was added in 4.16. +This is because to_sector() treats its argument as an "unsigned long" +which is 32bits (4GB) on a 32bit host. Using "unsigned long long" +is more correct. + +Kernels as early as 4.2 can have other problems due to to_sector() +being used on the size of a device. + +Fixes: 0cf4503174c1 ("dm raid: add support for the MD RAID0 personality") +cc: stable@vger.kernel.org (v4.2+) +Reported-and-tested-by: Guillaume Perréal +Signed-off-by: NeilBrown +Signed-off-by: Mike Snitzer +Signed-off-by: Greg Kroah-Hartman + +--- + include/linux/device-mapper.h | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/include/linux/device-mapper.h ++++ b/include/linux/device-mapper.h +@@ -627,7 +627,7 @@ extern struct ratelimit_state dm_ratelim + */ + #define dm_target_offset(ti, sector) ((sector) - (ti)->begin) + +-static inline sector_t to_sector(unsigned long n) ++static inline sector_t to_sector(unsigned long long n) + { + return (n >> SECTOR_SHIFT); + } diff --git a/queue-4.9/serial-8250_pci-fix-number-of-ports-for-acces-serial-cards.patch b/queue-4.9/serial-8250_pci-fix-number-of-ports-for-acces-serial-cards.patch index 059dfaea4b7..2f34d5e4adb 100644 --- a/queue-4.9/serial-8250_pci-fix-number-of-ports-for-acces-serial-cards.patch +++ b/queue-4.9/serial-8250_pci-fix-number-of-ports-for-acces-serial-cards.patch @@ -21,7 +21,7 @@ Signed-off-by: Greg Kroah-Hartman --- a/drivers/tty/serial/8250/8250_pci.c +++ b/drivers/tty/serial/8250/8250_pci.c -@@ -4976,10 +4976,10 @@ static struct pci_device_id serial_pci_t +@@ -5010,10 +5010,10 @@ static struct pci_device_id serial_pci_t */ { PCI_VENDOR_ID_ACCESIO, PCI_DEVICE_ID_ACCESIO_PCIE_COM_2SDB, PCI_ANY_ID, PCI_ANY_ID, 0, 0, @@ -34,7 +34,7 @@ Signed-off-by: Greg Kroah-Hartman { PCI_VENDOR_ID_ACCESIO, PCI_DEVICE_ID_ACCESIO_PCIE_COM_4SDB, PCI_ANY_ID, PCI_ANY_ID, 0, 0, pbn_pericom_PI7C9X7954 }, -@@ -4988,10 +4988,10 @@ static struct pci_device_id serial_pci_t +@@ -5022,10 +5022,10 @@ static struct pci_device_id serial_pci_t pbn_pericom_PI7C9X7954 }, { PCI_VENDOR_ID_ACCESIO, PCI_DEVICE_ID_ACCESIO_PCIE_COM232_2DB, PCI_ANY_ID, PCI_ANY_ID, 0, 0, @@ -47,7 +47,7 @@ Signed-off-by: Greg Kroah-Hartman { PCI_VENDOR_ID_ACCESIO, PCI_DEVICE_ID_ACCESIO_PCIE_COM232_4DB, PCI_ANY_ID, PCI_ANY_ID, 0, 0, pbn_pericom_PI7C9X7954 }, -@@ -5000,10 +5000,10 @@ static struct pci_device_id serial_pci_t +@@ -5034,10 +5034,10 @@ static struct pci_device_id serial_pci_t pbn_pericom_PI7C9X7954 }, { PCI_VENDOR_ID_ACCESIO, PCI_DEVICE_ID_ACCESIO_PCIE_COM_2SMDB, PCI_ANY_ID, PCI_ANY_ID, 0, 0, @@ -60,7 +60,7 @@ Signed-off-by: Greg Kroah-Hartman { PCI_VENDOR_ID_ACCESIO, PCI_DEVICE_ID_ACCESIO_PCIE_COM_4SMDB, PCI_ANY_ID, PCI_ANY_ID, 0, 0, pbn_pericom_PI7C9X7954 }, -@@ -5012,13 +5012,13 @@ static struct pci_device_id serial_pci_t +@@ -5046,13 +5046,13 @@ static struct pci_device_id serial_pci_t pbn_pericom_PI7C9X7954 }, { PCI_VENDOR_ID_ACCESIO, PCI_DEVICE_ID_ACCESIO_MPCIE_ICM485_1, PCI_ANY_ID, PCI_ANY_ID, 0, 0, @@ -77,7 +77,7 @@ Signed-off-by: Greg Kroah-Hartman { PCI_VENDOR_ID_ACCESIO, PCI_DEVICE_ID_ACCESIO_MPCIE_ICM422_4, PCI_ANY_ID, PCI_ANY_ID, 0, 0, pbn_pericom_PI7C9X7954 }, -@@ -5027,16 +5027,16 @@ static struct pci_device_id serial_pci_t +@@ -5061,16 +5061,16 @@ static struct pci_device_id serial_pci_t pbn_pericom_PI7C9X7954 }, { PCI_VENDOR_ID_ACCESIO, PCI_DEVICE_ID_ACCESIO_PCIE_ICM_2S, PCI_ANY_ID, PCI_ANY_ID, 0, 0, @@ -97,7 +97,7 @@ Signed-off-by: Greg Kroah-Hartman { PCI_VENDOR_ID_ACCESIO, PCI_DEVICE_ID_ACCESIO_PCIE_ICM232_4, PCI_ANY_ID, PCI_ANY_ID, 0, 0, pbn_pericom_PI7C9X7954 }, -@@ -5045,13 +5045,13 @@ static struct pci_device_id serial_pci_t +@@ -5079,13 +5079,13 @@ static struct pci_device_id serial_pci_t pbn_pericom_PI7C9X7954 }, { PCI_VENDOR_ID_ACCESIO, PCI_DEVICE_ID_ACCESIO_PCIE_ICM_2SM, PCI_ANY_ID, PCI_ANY_ID, 0, 0, @@ -114,7 +114,7 @@ Signed-off-by: Greg Kroah-Hartman { PCI_VENDOR_ID_ACCESIO, PCI_DEVICE_ID_ACCESIO_PCIE_COM422_8, PCI_ANY_ID, PCI_ANY_ID, 0, 0, pbn_pericom_PI7C9X7958 }, -@@ -5060,19 +5060,19 @@ static struct pci_device_id serial_pci_t +@@ -5094,19 +5094,19 @@ static struct pci_device_id serial_pci_t pbn_pericom_PI7C9X7958 }, { PCI_VENDOR_ID_ACCESIO, PCI_DEVICE_ID_ACCESIO_PCIE_COM232_4, PCI_ANY_ID, PCI_ANY_ID, 0, 0, diff --git a/queue-4.9/serial-8250_pci-have-acces-cards-that-use-the-four-port-pericom-pi7c9x7954-chip-use-the-pci_pericom_setup.patch b/queue-4.9/serial-8250_pci-have-acces-cards-that-use-the-four-port-pericom-pi7c9x7954-chip-use-the-pci_pericom_setup.patch index 19b92dfa75e..3ec14166fb4 100644 --- a/queue-4.9/serial-8250_pci-have-acces-cards-that-use-the-four-port-pericom-pi7c9x7954-chip-use-the-pci_pericom_setup.patch +++ b/queue-4.9/serial-8250_pci-have-acces-cards-that-use-the-four-port-pericom-pi7c9x7954-chip-use-the-pci_pericom_setup.patch @@ -21,7 +21,7 @@ Signed-off-by: Greg Kroah-Hartman --- a/drivers/tty/serial/8250/8250_pci.c +++ b/drivers/tty/serial/8250/8250_pci.c -@@ -2126,6 +2126,111 @@ static struct pci_serial_quirk pci_seria +@@ -2160,6 +2160,111 @@ static struct pci_serial_quirk pci_seria .setup = pci_default_setup, .exit = pci_plx9050_exit, }, diff --git a/queue-4.9/series b/queue-4.9/series index d513ac5b57e..f0969ae4d1c 100644 --- a/queue-4.9/series +++ b/queue-4.9/series @@ -85,6 +85,7 @@ i2c-tegra-fix-maximum-transfer-size.patch drm-i915-relax-mmap-vma-check.patch serial-uartps-fix-stuck-isr-if-rx-disabled-with-non-empty-fifo.patch serial-8250_of-assume-reg-shift-of-2-for-mrvl-mmp-uart.patch +8250-fix-fourth-port-offset-of-pericom-pi7c9x7954-boards.patch serial-8250_pci-fix-number-of-ports-for-acces-serial-cards.patch serial-8250_pci-have-acces-cards-that-use-the-four-port-pericom-pi7c9x7954-chip-use-the-pci_pericom_setup.patch jbd2-clear-dirty-flag-when-revoking-a-buffer-from-an-older-transaction.patch @@ -96,3 +97,4 @@ powerpc-83xx-also-save-restore-sprg4-7-during-suspend.patch powerpc-fix-32-bit-kvm-pr-lockup-and-host-crash-with-macos-guest.patch powerpc-ptrace-simplify-vr_get-set-to-avoid-gcc-warning.patch arm-s3c24xx-fix-boolean-expressions-in-osiris_dvs_notify.patch +dm-fix-to_sector-for-32bit.patch