Unverified Commit 78bb52b9 authored by openeuler-ci-bot's avatar openeuler-ci-bot Committed by Gitee
Browse files

!12041 [sync] PR-12032: serial: sc16is7xx: fix invalid FIFO access with special register set

parents faeaa790 dc459041
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -537,6 +537,8 @@ static int sc16is7xx_set_baud(struct uart_port *port, int baud)
			      SC16IS7XX_MCR_CLKSEL_BIT,
			      prescaler);

	mutex_lock(&s->efr_lock);

	/* Open the LCR divisors for configuration */
	sc16is7xx_port_write(port, SC16IS7XX_LCR_REG,
			     SC16IS7XX_LCR_CONF_MODE_A);
@@ -550,6 +552,8 @@ static int sc16is7xx_set_baud(struct uart_port *port, int baud)
	/* Put LCR back to the normal mode */
	sc16is7xx_port_write(port, SC16IS7XX_LCR_REG, lcr);

	mutex_unlock(&s->efr_lock);

	return DIV_ROUND_CLOSEST(clk / 16, div);
}