From 0efa1aa85176b4129e059b41c22e937820a3bbf3 Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Tue, 16 Apr 2024 10:03:10 +0000 Subject: [PATCH] Revert "serial: max310x: fix IO data corruption in batched operations" This reverts commit 59b3583da128a0e3a7baa95c3a698c212b6b02ca which is commit 3f42b142ea1171967e40e10e4b0241c0d6d28d41 upstream. It breaks the Android kernel abi and can be brought back in the future in an abi-safe way if it is really needed. Bug: 161946584 Change-Id: I176b89e22005da00d9208b6e5ff2898e6b5ac9ee Signed-off-by: Greg Kroah-Hartman --- drivers/tty/serial/max310x.c | 17 ++--------------- 1 file changed, 2 insertions(+), 15 deletions(-) diff --git a/drivers/tty/serial/max310x.c b/drivers/tty/serial/max310x.c index 2f88eae8a55a..ed1aaa19854f 100644 --- a/drivers/tty/serial/max310x.c +++ b/drivers/tty/serial/max310x.c @@ -533,11 +533,6 @@ static bool max310x_reg_precious(struct device *dev, unsigned int reg) return false; } -static bool max310x_reg_noinc(struct device *dev, unsigned int reg) -{ - return reg == MAX310X_RHR_REG; -} - static int max310x_set_baud(struct uart_port *port, int baud) { unsigned int mode = 0, div = 0, frac = 0, c = 0, F = 0; @@ -672,14 +667,14 @@ static void max310x_batch_write(struct uart_port *port, u8 *txbuf, unsigned int { struct max310x_one *one = to_max310x_port(port); - regmap_noinc_write(one->regmap, MAX310X_THR_REG, txbuf, len); + regmap_raw_write(one->regmap, MAX310X_THR_REG, txbuf, len); } static void max310x_batch_read(struct uart_port *port, u8 *rxbuf, unsigned int len) { struct max310x_one *one = to_max310x_port(port); - regmap_noinc_read(one->regmap, MAX310X_RHR_REG, rxbuf, len); + regmap_raw_read(one->regmap, MAX310X_RHR_REG, rxbuf, len); } static void max310x_handle_rx(struct uart_port *port, unsigned int rxlen) @@ -1513,10 +1508,6 @@ static struct regmap_config regcfg = { .writeable_reg = max310x_reg_writeable, .volatile_reg = max310x_reg_volatile, .precious_reg = max310x_reg_precious, - .writeable_noinc_reg = max310x_reg_noinc, - .readable_noinc_reg = max310x_reg_noinc, - .max_raw_read = MAX310X_FIFO_SIZE, - .max_raw_write = MAX310X_FIFO_SIZE, }; #ifdef CONFIG_SPI_MASTER @@ -1602,10 +1593,6 @@ static struct regmap_config regcfg_i2c = { .volatile_reg = max310x_reg_volatile, .precious_reg = max310x_reg_precious, .max_register = MAX310X_I2C_REVID_EXTREG, - .writeable_noinc_reg = max310x_reg_noinc, - .readable_noinc_reg = max310x_reg_noinc, - .max_raw_read = MAX310X_FIFO_SIZE, - .max_raw_write = MAX310X_FIFO_SIZE, }; static const struct max310x_if_cfg max310x_i2c_if_cfg = {