]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commit - drivers/tty/serial/sh-sci.c
serial: sh-sci: Use the correct register for overrun checks
authorGeert Uytterhoeven <geert+renesas@glider.be>
Thu, 30 Apr 2015 16:21:32 +0000 (18:21 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 10 May 2015 17:06:39 +0000 (19:06 +0200)
commit2e0842a154f63ae222ececd6b6b1db4c75426516
treee30d6bfe0604dd71c39f9fa04b53c12ad5f8474d
parent75c249fd7cb9097c58e44bc82f61b1f72ef79b3a
serial: sh-sci: Use the correct register for overrun checks

The various SCI implementations use 3 different methods to signal
overrun errors:
  - Bit SCI_ORER in register SCxSR on SCI,
  - Bit SCIFA_ORER in register SCxSR on SCIFA and SCIFB, and SCIF on
    SH7705/SH7720/SH7721,
  - Bit SCLSR_ORER in (optional!) register SCLSR on (H)SCIF.

However:
  1. sci_handle_fifo_overrun()
       a. handles (H)SCIF and SCIFA/SCIFB only,
       b. treats SCIF on SH7705/SH7720/SH7721 incorrectly,
  2. sci_mpxed_interrupt()
       a. treats SCIF on SH7705/SH7720/SH7721 incorrectly,
       b. ignores that not all SCIFs have the SCLSR register, causing
  "Invalid register access" WARN()ings.

To fix the above:
  1. Determine and store the correct register enum during
     initialization,
  2. Replace the duplicated buggy switch statements by using the stored
     register enum,
  3. Add the missing existence check to  sci_mpxed_interrupt().

Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/tty/serial/sh-sci.c