1. 10 2月, 2017 1 次提交
    • D
      serial: 8250_dw: Avoid "too much work" from bogus rx timeout interrupt · 424d7918
      Douglas Anderson 提交于
      On a Rockchip rk3399-based board during suspend/resume testing, we
      found that we could get the console UART into a state where it would
      print this to the console a lot:
        serial8250: too much work for irq42
      
      Followed eventually by:
        NMI watchdog: BUG: soft lockup - CPU#0 stuck for 11s!
      
      Upon debugging I found that we're in this state:
        iir = 0x000000cc
        lsr = 0x00000060
      
      It appears that somehow we have a RX Timeout interrupt but there is no
      actual data present to receive.  When we're in this state the UART
      driver claims that it handled the interrupt but it actually doesn't
      really do anything.  This means that we keep getting the interrupt
      over and over again.
      
      Normally we don't actually need to do anything special to handle a RX
      Timeout interrupt.  We'll notice that there is some data ready and
      we'll read it, which will end up clearing the RX Timeout.  In this
      case we have a problem specifically because we got the RX TImeout
      without any data.  Reading a bogus byte is confirmed to get us out of
      this state.
      
      It's unclear how exactly the UART got into this state, but it is known
      that the UART lines are essentially undriven and unpowered during
      suspend, so possibly during resume some garbage / half transmitted
      bits are seen on the line and put the UART into this state.
      
      The UART on the rk3399 is a DesignWare based 8250 UART.  From mailing
      list posts, it appears that other people have run into similar
      problems with DesignWare based IP.  Presumably this problem is unique
      to that IP, so I have placed the workaround there to avoid possibly of
      accidentally triggering bad behavior on other IP.  Also note the RX
      Timeout behaves very differently in the DMA case, for for now the
      workaround is only applied to the non-DMA case.
      Signed-off-by: NDouglas Anderson <dianders@chromium.org>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      424d7918
  2. 09 2月, 2017 1 次提交
  3. 06 2月, 2017 9 次提交
  4. 03 2月, 2017 8 次提交
  5. 31 1月, 2017 2 次提交
    • F
      serial: imx: Fix the CTS_B polarity in RS485 mode · bc2be239
      Fabio Estevam 提交于
      When userspace passes the SER_RS485_RTS_ON_SEND flag it means that the
      CTS_B pin should go to logic level high before the transmission begins.
      
      CTS_B goes to logic level high when both CTSC and CTS bits are cleared.
      
      When userspace passes the SER_RS485_RTS_AFTER_SEND flag it means that the
      CTS_B pin should go to logic level low after the transmission finishes.
      
      CTS_B goes to logic level low when CTSC bit is cleared and CTS bit is set.
      
      So fix the CTS_B polarity logic.
      Signed-off-by: NFabio Estevam <fabio.estevam@nxp.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      bc2be239
    • F
      serial: imx: Fix the RTS GPIO polarity in RS485 mode · 1a613626
      Fabio Estevam 提交于
      On a board that needs to drive RTS GPIO high in order to enable the
      transmission of a RS485 transceiver the following description is
      passed in the devide tree:
      
      &uart4 {
              pinctrl-names = "default";
              pinctrl-0 = <&pinctrl_uart4>;
              rts-gpios = <&gpio6 2 GPIO_ACTIVE_HIGH>;
              status = "okay";
      };
      
      and userspace configures the uart port as follows:
      
      /* enable RS485 mode: */
      rs485conf.flags |= SER_RS485_ENABLED;
      
      /* set logical level for RTS pin equal to 1 when sending: */
      rs485conf.flags |= SER_RS485_RTS_ON_SEND;
      
      /* set logical level for RTS pin equal to 0 after sending: */
      rs485conf.flags &= ~(SER_RS485_RTS_AFTER_SEND);
      
      However the RTS GPIO polarity observed in the oscilloscope is inverted.
      
      When the SER_RS485_RTS_ON_SEND flag is set the imx_port_rts_active()
      function should be called and following the same logic when
      SER_RS485_RTS_AFTER_SEND flag is cleared the imx_port_rts_inactive()
      should be called.
      
      Do such logic change so that RS485 communication in half duplex can
      work successfully when the RTS GPIO pin is passed via device tree.
      Signed-off-by: NFabio Estevam <fabio.estevam@nxp.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      1a613626
  6. 27 1月, 2017 3 次提交
    • A
      8250: of: remove remnants of generic of_serial driver · aa42db44
      Arnd Bergmann 提交于
      During build testing, I ran into a warning in a driver that I
      had written myself at some point:
      
      drivers/tty/serial/8250/8250_of.c: In function 'of_platform_serial_probe':
      drivers/tty/serial/8250/8250_of.c:233:1: error: the frame size of 1200 bytes is larger than 1152 bytes [-Werror=frame-larger-than=]
      
      This is harmless by itself, but it shows two other problems in
      the driver:
      
      - It still tries to be generic enough to handle all kinds of serial
        ports, where in reality the driver has been 8250-only for a while,
        and every other uart has its own DT support
      
      - As a result of that generalization, we keep two copies of
        'struct uart_port' on the stack during probe(). This is completely
        unnessary.
      
      Removing the last code dealing with unsupported port_type values
      solves both problems nicely, and reduces the stack size.
      Signed-off-by: NArnd Bergmann <arnd@arndb.de>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      aa42db44
    • G
      serial: sh-sci: Reformat sci_parse_dt() for git diff · 54b12c48
      Geert Uytterhoeven 提交于
      As the function header of sci_parse_dt() is split in an unusual way,
      "git diff" gets confused when changes to the body of the function are
      made, and attributes them to the wrong function.
      
      Reformat the function header to fix this.
      Signed-off-by: NGeert Uytterhoeven <geert+renesas@glider.be>
      Reviewed-by: NSimon Horman <horms+renesas@verge.net.au>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      54b12c48
    • B
      tty: serial: constify uart_ops structures · 2331e068
      Bhumika Goyal 提交于
      Declare uart_ops structures as const as they are only stored in the ops
      field of an uart_port structure. This field is of type const, so
      uart_ops structures having this property can be made const too.
      
      File size details before and after patching.
      First line of every .o file shows the file size before patching
      and second line shows the size after patching.
      
         text	   data	    bss	    dec	    hex	filename
      
         2977	    456	     64	   3497	    da9	drivers/tty/serial/amba-pl010.o
         3169	    272	     64	   3505	    db1	drivers/tty/serial/amba-pl010.o
      
         3109	    456	      0	   3565	    ded	drivers/tty/serial/efm32-uart.o
         3301	    272	      0	   3573	    df5	drivers/tty/serial/efm32-uart.o
      
        10668	    753	      1	  11422	   2c9e	drivers/tty/serial/icom.o
        10860	    561	      1	  11422	   2c9e	drivers/tty/serial/icom.o
      
        23904	    408	      8	  24320	   5f00	drivers/tty/serial/ioc3_serial.o
        24088	    224	      8	  24320	   5f00	drivers/tty/serial/ioc3_serial.o
      
        10516	    560	      4	  11080	   2b48	drivers/tty/serial/ioc4_serial.o
        10709	    368	      4	  11081	   2b49	drivers/tty/serial/ioc4_serial.o
      
         7853	    648	   1216	   9717	   25f5	drivers/tty/serial/mpsc.o
         8037	    456	   1216	   9709	   25ed	drivers/tty/serial/mpsc.o
      
        10248	    456	      0	  10704	   29d0	drivers/tty/serial/omap-serial.o
        10440	    272	      0	  10712	   29d8	drivers/tty/serial/omap-serial.o
      
         8122	    532	   1984	  10638	   298e	drivers/tty/serial/pmac_zilog.o
         8306	    340	   1984	  10630	   2986	drivers/tty/serial/pmac_zilog.o
      
         3808	    456	      0	   4264	   10a8	drivers/tty/serial/pxa.o
         4000	    264	      0	   4264	   10a8	drivers/tty/serial/pxa.o
      
        21781	   3864	      0	  25645	   642d	drivers/tty/serial/serial-tegra.o
        22037	   3608	      0	  25645	   642d	drivers/tty/serial/serial-tegra.o
      
         2481	    456	     96	   3033	    bd9	drivers/tty/serial/sprd_serial.o
         2673	    272	     96	   3041	    be1	drivers/tty/serial/sprd_serial.o
      
         5534	    300	    512	   6346	   18ca	drivers/tty/serial/vr41xx_siu.o
         5630	    204	    512	   6346	   18ca	drivers/tty/serial/vr41xx_siu.o
      
         6730	   1576	    128	   8434	   20f2	drivers/tty/serial/vt8500_serial.o
         6986	   1320	    128	   8434	   20f2	drivers/tty/serial/vt8500_serial.o
      
      Cross compiled for mips architecture.
      
         3005	    488	      0	   3493	    da5	drivers/tty/serial/pnx8xxx_uart.o
         3189	    304	      0	   3493	    da5	drivers/tty/serial/pnx8xxx_uart.o
      
         4272	    196	   1056	   5524	   1594	drivers/tty/serial/dz.o
         4368	    100	   1056	   5524	   1594	drivers/tty/serial/dz.o
      
         6551	    144	     16	   6711	   1a37	drivers/tty/serial/ip22zilog.o
         6647	     48	     16	   6711	   1a37	drivers/tty/serial/ip22zilog.o
      
         9612	    428	   1520	  11560	   2d28	drivers/tty/serial/serial_txx9.o
         9708	    332	   1520	  11560	   2d28	drivers/tty/serial/serial_txx9.o
      
         4156	    296	     16	   4468	   1174	drivers/tty/serial/ar933x_uart.o
         4252	    200	     16	   4468	   1174	drivers/tty/serial/ar933x_uart.o
      
      Cross compiled for arm archiecture.
      
        11716	   1780	     44	  13540	   34e4	drivers/tty/serial/sirfsoc_uart.o
        11808	   1688	     44	  13540	   34e4	drivers/tty/serial/sirfsoc_uart.o
      
        13352	    596	     56	  14004	   36b4	drivers/tty/serial/amba-pl011.o
        13444	    504	     56	  14004	   36b4	drivers/tty/serial/amba-pl011.o
      
      Cross compiled for sparc architecture.
      
         4664	    528	     32	   5224	   1468	drivers/tty/serial/sunhv.o
         4848	    344	     32	   5224	   1468	drivers/tty/serial/sunhv.o
      
         8080	    332	     28	   8440	   20f8	drivers/tty/serial/sunzilog.o
         8184	    228	     28	   8440	   20f8	drivers/tty/serial/sunzilog.o
      
      Cross compiled for ia64 architecture.
      
        10226	    549	    472	  11247	   2bef	drivers/tty/serial/sn_console.o
        10414	    365	    472	  11251	   2bf3	drivers/tty/serial/sn_console.o
      
      The files drivers/tty/serial/zs.o, drivers/tty/serial/lpc32xx_hs.o and
      drivers/tty/serial/lantiq.o did not compile.
      Signed-off-by: NBhumika Goyal <bhumirks@gmail.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      2331e068
  7. 25 1月, 2017 3 次提交
  8. 20 1月, 2017 3 次提交
  9. 19 1月, 2017 10 次提交