1. 16 Dec, 2010 4 commits
  2. 10 Dec, 2010 8 commits
    • Ondrej Puzman's avatar
      8250: fix uninitialized FIFOs · e4f05af1
      Ondrej Puzman authored
      I have found a bug in 8250.c driver which causes that 16550A uart FIFOs
      are not turned on during initialization if they are manually configured
      by setserial. UART is then working only as plain 16450 without FIFOs. On
      systems with higher interrupt latency this causes buffer overruns and
      loss of received data when using higher communication speeds.
      
      I'm working for a company which produces industrial computers. These
      devices typically contain high number (8 or more) of traditional 16550A
      uarts - we use TL16C554A chips, but that is not much relevant. UARTs are
      connected to the CPU by ISA bus (Celeron based devices) or LPC bus (Atom
      based devices).
      
      In the Linux the UARTs are using standard 8250.c driver and are
      initialized using setserial command:
      setserial /dev/ttyS4 uart 16550A port 0x3E0 irq 10 baud_base 115200
      
      This executes the UART initialization through serial8250_startup()
      function. At the beginning of the function up->capabilities is
      initialized from uart_config:
       up->capabilities = uart_config[up->port.type].flags;
      Please note that neither up->port.fifosize nor up->tx_loadsz is
      initialized here!!
      
      Later in the same function serial8250_clear_fifos() is called and
      disables FIFOs. The above comment says that they will be reenabled in
      set_termios (they won't ...)
      
      After serial8250_startup() the serial8250_set_termios() is called. In
      this function the following check fails because up->port.fifosize is
      zero because it is not initialized correctly.
      
              if (up->capabilities & UART_CAP_FIFO && up->port.fifosize > 1) {
                      if (baud < 2400)
                              fcr = UART_FCR_ENABLE_FIFO | UART_FCR_TRIGGER_1;
                      else
                              fcr = uart_config[up->port.type].fcr;
              }
      
      fcr variable remains zero and in the end the FCR register is set to zero
      which results in disabled FIFOs even if the UART type is 16550A. This is
      also true for other types of UARTs with FIFOs.
      
      If the UART is autoconfigured via 'setserial /dev/ttySx autoconfig' then
      port.fifosize and tx_loadsz are initialized correctly in the
      autoconfig() function and the UART is working correctly then.
      
      I checked the source codes and I can say that this bug is present in
      2.6.x series of kernels for a couple of years. Namely I can confirm its
      presence in 2.6.16.57, 2.6.32.24 and 2.6.36.1 (tested all of them on our
      hardware).
      
      I think it was not noticed before because not many people use manually
      configured non PNP UARTs on ISA/LPC bus these days. Also the data loss
      caused by buffer overruns occures only if  IRQ latency is higher then
      time needed to receive one character on given communication speed.
      For example our hardware looses received characters only if the UARTs
      are connected throught LPC bus with SERIRQ (serial IRQ transport) and
      not if they are connected to ISA bus because LPC SERIRQ has higher
      interrupt latency then parallel ISA interupt lines.
      
      Here is the patch to correct the bug created against 2.6.36.1:
      Signed-off-by: default avatarOndrej Puzman <puzman@gmail.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
      e4f05af1
    • Namhyung Kim's avatar
      ip2: fix compiler warning on ip2main_pci_tbl · 53139e36
      Namhyung Kim authored
      Annotate ip2main_pci_tbl as '__used' to fix following warning:
      
        CC      drivers/char/ip2/ip2main.o
      drivers/char/ip2/ip2main.c:3227: warning: ‘ip2main_pci_tbl’ defined but not used
      Signed-off-by: default avatarNamhyung Kim <namhyung@gmail.com>
      Cc: "Michael H. Warfield" <mhw@wittsend.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
      53139e36
    • Namhyung Kim's avatar
      specialix: fix compiler warning on specialix_pci_tbl · fd0f5c54
      Namhyung Kim authored
      Annotate specialx_pci_tbl as '__used' to fix following warning:
      
        CC      drivers/char/specialix.o
      drivers/char/specialix.c:2358: warning: ‘specialx_pci_tbl’ defined but not used
      Signed-off-by: default avatarNamhyung Kim <namhyung@gmail.com>
      Cc: Roger Wolff <R.E.Wolff@BitWizard.nl>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
      fd0f5c54
    • Namhyung Kim's avatar
      rocket: fix compiler warning on rocket_pci_ids · 6835a209
      Namhyung Kim authored
      Annotate rocket_pci_ids as '__used' to fix following warning:
      
        CC      drivers/char/rocket.o
      drivers/char/rocket.c:1767: warning: ‘rocket_pci_ids’ defined but not used
      Signed-off-by: default avatarNamhyung Kim <namhyung@gmail.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
      6835a209
    • Jamie Iles's avatar
      8250: add a UPIO_DWAPB32 for 32 bit accesses · a3ae0fc3
      Jamie Iles authored
      Some platforms contain a Synopsys DesignWare APB UART that is attached
      to a 32-bit APB bus where sub-word accesses are not allowed. Add a new
      IO type (UPIO_DWAPB32) that performs 32 bit acccesses to the UART.
      
      v2:
      	- don't test for 32 bit in the output fast path, provide a
      	  separate dwabp32_serial_out() function. Refactor
      	  dwabp_serial_out() so that we can reuse the LCR saving
      	  code.
      v3:
      	- rebased on top of "8250: use container_of() instead of
      	  casting"
      Signed-off-by: default avatarJamie Iles <jamie@jamieiles.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
      a3ae0fc3
    • Jamie Iles's avatar
      8250: use container_of() instead of casting · 49d5741b
      Jamie Iles authored
      The 8250 driver structure uart_8250_port took advantage of the fact
      that the struct uart_port was the first member of its structure and
      used an explicit cast to convert to the derived class. Replace the
      explicit casts with container_of() for safety and clarity.
      Signed-off-by: default avatarJamie Iles <jamie@jamieiles.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
      49d5741b
    • Cosmin Cojocar's avatar
      serial: omap-serial: Add support for kernel debugger · 1b41dbc1
      Cosmin Cojocar authored
      The kgdb invokes the poll_put_char and poll_get_char when communicating
      with the host. This patch also changes the initialization order because the
      kgdb will check at the very beginning, if there is a valid serial
      driver.
      Signed-off-by: default avatarCosmin Cojocar <cosmin.cojocar@gmail.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
      1b41dbc1
    • Randy Dunlap's avatar
      serial: fix pch_uart kconfig & build · 5ac387d9
      Randy Dunlap authored
      The dma_request_channel/dma_release_channel interfaces are not
      built when DMADEVICES is not enabled, so make the driver depend on
      DMADEVICES.  Also, the help text says that the driver enables & uses
      PCH_DMA, which is not enabled, so select that.
      
      ERROR: "__dma_request_channel" [drivers/serial/pch_uart.ko] undefined!
      ERROR: "dma_release_channel" [drivers/serial/pch_uart.ko] undefined!
      Signed-off-by: default avatarRandy Dunlap <randy.dunlap@oracle.com>
      Cc: Tomoya MORINAGA <tomoya-linux@dsn.okisemi.com>
      Reported-by: default avatarZimny Lech <napohybelskurwysynom2010@gmail.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
      5ac387d9
  3. 01 Dec, 2010 6 commits
  4. 16 Nov, 2010 8 commits
  5. 11 Nov, 2010 7 commits
  6. 08 Nov, 2010 7 commits
    • Linus Torvalds's avatar
      Merge branch 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tytso/ext4 · a7bcf21e
      Linus Torvalds authored
      * 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tytso/ext4:
        ext4: Add new ext4 inode tracepoints
        ext4: Don't call sb_issue_discard() in ext4_free_blocks()
        ext4: do not try to grab the s_umount semaphore in ext4_quota_off
        ext4: fix potential race when freeing ext4_io_page structures
        ext4: handle writeback of inodes which are being freed
        ext4: initialize the percpu counters before replaying the journal
        ext4: "ret" may be used uninitialized in ext4_lazyinit_thread()
        ext4: fix lazyinit hang after removing request
      a7bcf21e
    • Linus Torvalds's avatar
      Merge git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty-2.6 · 5398a64c
      Linus Torvalds authored
      * git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty-2.6:
        TTY: move .gitignore from drivers/char/ to drivers/tty/vt/
        TTY: create drivers/tty/vt and move the vt code there
        TTY: create drivers/tty and move the tty core files there
      5398a64c
    • Linus Torvalds's avatar
      Merge branch 'staging-linus' of... · 764e028e
      Linus Torvalds authored
      Merge branch 'staging-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging-next-2.6
      
      * 'staging-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging-next-2.6:
        Staging: ath6kl: remove empty files that mess with 'distclean'
        staging: ath6kl: Fixing the driver to use modified mmc_host structure
        Staging: solo6x10: fix build problem
      764e028e
    • Linus Torvalds's avatar
      Merge branch 'rmobile-fixes-for-linus' of... · 934648f0
      Linus Torvalds authored
      Merge branch 'rmobile-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/lethal/sh-2.6
      
      * 'rmobile-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/lethal/sh-2.6:
        mmc: sh_mmcif: Convert extern inline to static inline.
        ARM: mach-shmobile: Allow GPIO chips to register IRQ mappings.
        ARM: mach-shmobile: fix sh7372 after a recent clock framework rework
        ARM: mach-shmobile: include drivers/sh/Kconfig
        ARM: mach-shmobile: ap4evb: Add HDMI sound support
        ARM: mach-shmobile: clock-sh7372: Add FSIDIV clock support
        ARM: shmobile: remove sh_timer_config clk member
      934648f0
    • Linus Torvalds's avatar
      Merge branch 'sh-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/lethal/sh-2.6 · 8be5814c
      Linus Torvalds authored
      * 'sh-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/lethal/sh-2.6:
        sh: clkfwk: Fix up checkpatch warnings.
        sh: make some needlessly global sh7724 clocks static
        sh: add clk_round_parent() to optimize parent clock rate
        sh: Simplify phys_addr_mask()/PTE_PHYS_MASK for 29/32-bit.
        sh: nommu: Support building without an uncached mapping.
        sh: nommu: use 32-bit phys mode.
        sh: mach-se: Fix up SE7206 no ioport build.
        sh: intc: Update for single IRQ reservation helper.
        sh: clkfwk: Fix up rate rounding error handling.
        sh: mach-se: Rip out superfluous 7751 PIO routines.
        sh: mach-se: Rip out superfluous 770x PIO routines.
        sh: mach-edosk7705: Kill off machtype, consolidate board def.
        sh: mach-edosk7705: update for this century, kill off PIO trapping.
        sh: mach-se: Rip out superfluous 7206 PIO routines.
        sh: mach-systemh: Kill off dead board.
        sh: mach-snapgear: Kill off machtype, consolidate board def.
        sh: mach-snapgear: Rip out superfluous PIO routines.
        sh: mach-microdev: SuperIO-relative ioport mapping.
      8be5814c
    • Theodore Ts'o's avatar
      ext4: Add new ext4 inode tracepoints · 7ff9c073
      Theodore Ts'o authored
      Add ext4_evict_inode, ext4_drop_inode, ext4_mark_inode_dirty, and
      ext4_begin_ordered_truncate()
      Signed-off-by: default avatar"Theodore Ts'o" <tytso@mit.edu>
      7ff9c073
    • Theodore Ts'o's avatar
      ext4: Don't call sb_issue_discard() in ext4_free_blocks() · b56ff9d3
      Theodore Ts'o authored
      Commit 5c521830 (ext4: Support discard requests when running in
      no-journal mode) attempts to add sb_issue_discard() for data blocks
      (in data=writeback mode) and in no-journal mode.  Unfortunately, this
      no longer works, because in commit dd3932ed (block: remove
      BLKDEV_IFL_WAIT), sb_issue_discard() only presents a synchronous
      interface, and there are times when we call ext4_free_blocks() when we
      are are holding a spinlock, or are otherwise in an atomic context.
      
      For now, I've removed the call to sb_issue_discard() to prevent a
      deadlock or (if spinlock debugging is enabled) failures like this:
      
      BUG: scheduling while atomic: rc.sysinit/1376/0x00000002
      Pid: 1376, comm: rc.sysinit Not tainted 2.6.36-ARCH #1
      Call Trace:
      [<ffffffff810397ce>] __schedule_bug+0x5e/0x70
      [<ffffffff81403110>] schedule+0x950/0xa70
      [<ffffffff81060bad>] ? insert_work+0x7d/0x90
      [<ffffffff81060fbd>] ? queue_work_on+0x1d/0x30
      [<ffffffff81061127>] ? queue_work+0x37/0x60
      [<ffffffff8140377d>] schedule_timeout+0x21d/0x360
      [<ffffffff812031c3>] ? generic_make_request+0x2c3/0x540
      [<ffffffff81402680>] wait_for_common+0xc0/0x150
      [<ffffffff81041490>] ? default_wake_function+0x0/0x10
      [<ffffffff812034bc>] ? submit_bio+0x7c/0x100
      [<ffffffff810680a0>] ? wake_bit_function+0x0/0x40
      [<ffffffff814027b8>] wait_for_completion+0x18/0x20
      [<ffffffff8120a969>] blkdev_issue_discard+0x1b9/0x210
      [<ffffffff811ba03e>] ext4_free_blocks+0x68e/0xb60
      [<ffffffff811b1650>] ? __ext4_handle_dirty_metadata+0x110/0x120
      [<ffffffff811b098c>] ext4_ext_truncate+0x8cc/0xa70
      [<ffffffff810d713e>] ? pagevec_lookup+0x1e/0x30
      [<ffffffff81191618>] ext4_truncate+0x178/0x5d0
      [<ffffffff810eacbb>] ? unmap_mapping_range+0xab/0x280
      [<ffffffff810d8976>] vmtruncate+0x56/0x70
      [<ffffffff811925cb>] ext4_setattr+0x14b/0x460
      [<ffffffff811319e4>] notify_change+0x194/0x380
      [<ffffffff81117f80>] do_truncate+0x60/0x90
      [<ffffffff811e08fa>] ? security_inode_permission+0x1a/0x20
      [<ffffffff811eaec1>] ? tomoyo_path_truncate+0x11/0x20
      [<ffffffff81127539>] do_last+0x5d9/0x770
      [<ffffffff811278bd>] do_filp_open+0x1ed/0x680
      [<ffffffff8140644f>] ? page_fault+0x1f/0x30
      [<ffffffff81132bfc>] ? alloc_fd+0xec/0x140
      [<ffffffff81118db1>] do_sys_open+0x61/0x120
      [<ffffffff81118e8b>] sys_open+0x1b/0x20
      [<ffffffff81002e6b>] system_call_fastpath+0x16/0x1b
      
      https://bugzilla.kernel.org/show_bug.cgi?id=22302Reported-by: default avatarMathias Burén <mathias.buren@gmail.com>
      Signed-off-by: default avatar"Theodore Ts'o" <tytso@mit.edu>
      Cc: jiayingz@google.com
      b56ff9d3