提交 63f7ad11 编写于 作者: T Takashi Yoshii 提交者: Greg Kroah-Hartman

serial: sh-sci: mask SCTFDR/RFDR according to fifosize

Current mask 0xff to SCTFDR/RFDR damages SCIFB, because the
registers on SCIFB have 9-bit data (0 to 256).

This patch changes the mask according to port->fifosize.
Though I'm not sure if the mask is really needed (I don't know if
there are variants which have non-zero upper bits), it is safer.
Signed-off-by: NTakashi Yoshii <takashi.yoshii.zj@renesas.com>
Signed-off-by: NShinya Kuribayashi <shinya.kuribayashi.px@renesas.com>
Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
上级 9d482cc3
...@@ -485,7 +485,7 @@ static int sci_txfill(struct uart_port *port) ...@@ -485,7 +485,7 @@ static int sci_txfill(struct uart_port *port)
reg = sci_getreg(port, SCTFDR); reg = sci_getreg(port, SCTFDR);
if (reg->size) if (reg->size)
return serial_port_in(port, SCTFDR) & 0xff; return serial_port_in(port, SCTFDR) & ((port->fifosize << 1) - 1);
reg = sci_getreg(port, SCFDR); reg = sci_getreg(port, SCFDR);
if (reg->size) if (reg->size)
...@@ -505,7 +505,7 @@ static int sci_rxfill(struct uart_port *port) ...@@ -505,7 +505,7 @@ static int sci_rxfill(struct uart_port *port)
reg = sci_getreg(port, SCRFDR); reg = sci_getreg(port, SCRFDR);
if (reg->size) if (reg->size)
return serial_port_in(port, SCRFDR) & 0xff; return serial_port_in(port, SCRFDR) & ((port->fifosize << 1) - 1);
reg = sci_getreg(port, SCFDR); reg = sci_getreg(port, SCFDR);
if (reg->size) if (reg->size)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册