From e42b90b592a6f674c5e425a67fa66035e8d8435c Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Thu, 16 May 2024 13:20:02 +0000 Subject: [PATCH] Revert "serial: max310x: fix IO data corruption in batched operations" This reverts commit a1211bbf7814a962fc709b85636fbc52e64ab974 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: Ic6c304a74143ede4d51270d1d1617bea82284afd Signed-off-by: Greg Kroah-Hartman --- drivers/tty/serial/max310x.c | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/drivers/tty/serial/max310x.c b/drivers/tty/serial/max310x.c index c122e7e90fc8..4299211183a7 100644 --- a/drivers/tty/serial/max310x.c +++ b/drivers/tty/serial/max310x.c @@ -511,11 +511,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; @@ -650,14 +645,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) @@ -1486,10 +1481,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