1. 16 3月, 2012 1 次提交
  2. 15 3月, 2012 1 次提交
  3. 14 3月, 2012 1 次提交
  4. 13 3月, 2012 2 次提交
  5. 10 3月, 2012 11 次提交
  6. 09 3月, 2012 24 次提交
    • F
      mpc5200b/uart: select more tolerant uart prescaler on low baudrates · e0955ace
      Frank Benkert 提交于
      In addition to the /32 prescaler, the MPC5200B supports a second
      baudrate prescaler /4 to reach higher baudrates.
      
      The current calculation (introduced with commit 0d1f22e4) in the kernel
      preferes this low prescaler as often as possible, but with some
      imprecise counterparts the communication on low baudrates fails.
      
      According a support-mail from freescale the low prescaler (/4) allows
      just 1% tolerance in bittiming in contrast to 4% of the high prescaler
      (/32).  The prescaler not only affects the baudrate-calculation, but
      also the sampling of the bits on the wire.
      
      With this patch, we use the slightly less precise, but higher tolerant
      prescaler calculation on low baudrates up to (and including) 115200 baud
      and the more precise calculation above.
      
      Tested on a custom MPC5200B board with "fsl,mpc5200b-psc-uart".
      
      Calculation Examples with prescaler (PS) 4 and 32 and divisor (DIV) on
      various baudrates. Real stands for the real baudrate generated and Diff
      for the differences between:
           50 Baud PS 32 DIV 0xa122 Real      50 Diff   0.00%
           75 Baud PS 32 DIV 0x6b6c Real      75 Diff   0.00%
          110 Baud PS 32 DIV 0x493e Real     110 Diff   0.00%
          134 Baud PS 32 DIV 0x3c20 Real     133 Diff   0.75%
          150 Baud PS 32 DIV 0x35b6 Real     150 Diff   0.00%
          200 Baud PS 32 DIV 0x2849 Real     199 Diff   0.50%
          300 Baud PS  4 DIV 0xd6d8 Real     300 Diff   0.00%
                   PS 32 DIV 0x1adb Real     300 Diff   0.00%
          600 Baud PS  4 DIV 0x6b6c Real     600 Diff   0.00%
                   PS 32 DIV 0x0d6e Real     599 Diff   0.17%
         1200 Baud PS  4 DIV 0x35b6 Real    1200 Diff   0.00%
                   PS 32 DIV 0x06b7 Real    1199 Diff   0.08%
         1800 Baud PS  4 DIV 0x23cf Real    1799 Diff   0.06%
                   PS 32 DIV 0x047a Real    1799 Diff   0.06%
         2400 Baud PS  4 DIV 0x1adb Real    2400 Diff   0.00%
                   PS 32 DIV 0x035b Real    2401 Diff - 0.04%
         4800 Baud PS  4 DIV 0x0d6e Real    4799 Diff   0.02%
                   PS 32 DIV 0x01ae Real    4796 Diff   0.08%
         9600 Baud PS  4 DIV 0x06b7 Real    9598 Diff   0.02%
                   PS 32 DIV 0x00d7 Real    9593 Diff   0.07%
        19200 Baud PS  4 DIV 0x035b Real   19208 Diff - 0.04%
                   PS 32 DIV 0x006b Real   19275 Diff - 0.39%
        38400 Baud PS  4 DIV 0x01ae Real   38372 Diff   0.07%
                   PS 32 DIV 0x0036 Real   38194 Diff   0.54%
        57600 Baud PS  4 DIV 0x011e Real   57692 Diff - 0.16%
                   PS 32 DIV 0x0024 Real   57291 Diff   0.54%
        76800 Baud PS  4 DIV 0x00d7 Real   76744 Diff   0.07%
                   PS 32 DIV 0x001b Real   76388 Diff   0.54%
       115200 Baud PS  4 DIV 0x008f Real  115384 Diff - 0.16%
                   PS 32 DIV 0x0012 Real  114583 Diff   0.54%
       153600 Baud PS  4 DIV 0x006b Real  154205 Diff - 0.39%
                   PS 32 DIV 0x000d Real  158653 Diff - 3.29%
       230400 Baud PS  4 DIV 0x0048 Real  229166 Diff   0.54%
                   PS 32 DIV 0x0009 Real  229166 Diff   0.54%
       307200 Baud PS  4 DIV 0x0036 Real  305555 Diff   0.54%
                   PS 32 DIV 0x0007 Real  294642 Diff   4.09%
       460800 Baud PS  4 DIV 0x0024 Real  458333 Diff   0.54%
                   PS 32 DIV 0x0005 Real  412500 Diff  10.48%
       500000 Baud PS  4 DIV 0x0021 Real  500000 Diff   0.00%
                   PS 32 DIV 0x0004 Real  515625 Diff - 3.13%
       576000 Baud PS  4 DIV 0x001d Real  568965 Diff   1.22%
                   PS 32 DIV 0x0004 Real  515625 Diff  10.48%
       614400 Baud PS  4 DIV 0x001b Real  611111 Diff   0.54%
                   PS 32 DIV 0x0003 Real  687500 Diff -11.90%
       921600 Baud PS  4 DIV 0x0012 Real  916666 Diff   0.54%
                   PS 32 DIV 0x0002 Real 1031250 Diff -11.90%
      1000000 Baud PS  4 DIV 0x0011 Real  970588 Diff   2.94%
                   PS 32 DIV 0x0002 Real 1031250 Diff - 3.13%
      1152000 Baud PS  4 DIV 0x000e Real 1178571 Diff - 2.31%
                   PS 32 DIV 0x0002 Real 1031250 Diff  10.48%
      1500000 Baud PS  4 DIV 0x000b Real 1500000 Diff   0.00%
                   PS 32 DIV 0x0001 Real 2062500 Diff -37.50%
      2000000 Baud PS  4 DIV 0x0008 Real 2062500 Diff - 3.13%
                   PS 32 DIV 0x0001 Real 2062500 Diff - 3.13%
      2500000 Baud PS  4 DIV 0x0007 Real 2357142 Diff   5.71%
                   PS 32 DIV 0x0001 Real 2062500 Diff  17.50%
      3000000 Baud PS  4 DIV 0x0006 Real 2750000 Diff   8.33%
                   PS 32 DIV 0x0001 Real 2062500 Diff  31.25%
      3500000 Baud PS  4 DIV 0x0005 Real 3300000 Diff   5.71%
                   PS 32 DIV 0x0001 Real 2062500 Diff  41.07%
      4000000 Baud PS  4 DIV 0x0004 Real 4125000 Diff - 3.13%
                   PS 32 DIV 0x0001 Real 2062500 Diff  48.44%
      Signed-off-by: NFrank Benkert <frank.benkert@avat.de>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      e0955ace
    • D
      tty: moxa: fix bit test in moxa_start() · 58112dfb
      Dan Carpenter 提交于
      This is supposed to be doing a shift before the comparison instead of
      just doing a bitwise AND directly.  The current code means the start()
      just returns without doing anything.
      Signed-off-by: NDan Carpenter <dan.carpenter@oracle.com>
      Acked-by: NJiri Slaby <jslaby@suse.cz>
      Cc: stable <stable@vger.kernel.org>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      58112dfb
    • J
      TTY: isdn/gigaset, use tty_port · 48a7466f
      Jiri Slaby 提交于
      Let us port the code to use tty_port. We now use open_count and tty
      from there. This allows us also to use tty_port_tty_set with tty
      refcounting instead of hand-written locking and logic.
      
      Note that tty and open_count are no longer protected by cs->lock. It is
      protected by tty_port->lock. But since all the places where they were
      used are now switched to the helpers, we are fine.
      Signed-off-by: NJiri Slaby <jslaby@suse.cz>
      Cc: Hansjoerg Lipp <hjlipp@web.de>
      Acked-by: NTilman Schmidt <tilman@imap.cc>
      Cc: <gigaset307x-common@lists.sourceforge.net>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      48a7466f
    • J
      TTY: isdn/gigaset, do not set tty->driver_data to NULL · fc258f89
      Jiri Slaby 提交于
      Close the window in open where driver_data is reset to NULL on each
      open. It could cause other processes to get invalid retval from the
      tty->ops operations because of the checks all over the code.
      
      With this change we may do other cleanups. Now, the only valid check
      for tty->driver_data != NULL is in close. This can happen only if open
      fails at gigaset_get_cs_by_tty or try_module_get. The rest of checks
      in various tty->ops->* are invalid as driver_data cannot be NULL
      there. The same holds for cs->open_count. So remove them.
      Signed-off-by: NJiri Slaby <jslaby@suse.cz>
      Cc: Hansjoerg Lipp <hjlipp@web.de>
      Cc: Tilman Schmidt <tilman@imap.cc>
      Cc: gigaset307x-common@lists.sourceforge.net
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      fc258f89
    • J
      TTY: amiserial, use tty_port_close_start · 9b937421
      Jiri Slaby 提交于
      Again, no need to duplicate the code. Let's use the helper.
      
      Amiserial changes are only free of compilation errors. I have no
      access to the hardware.
      Signed-off-by: NJiri Slaby <jslaby@suse.cz>
      Cc: Geert Uytterhoeven <geert@linux-m68k.org>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      9b937421
    • J
      TTY: amiserial, use tty_port_close_end · b8edebe4
      Jiri Slaby 提交于
      Hmm, the code was sleeping with interrupts disabled. This was not
      good. Fix this by turning interrupts at an appropriate place. (The
      race is protected by CLOSING flag.)
      
      After the move, the code is identical to tty_port_close_end, so use
      it!
      Signed-off-by: NJiri Slaby <jslaby@suse.cz>
      Cc: Geert Uytterhoeven <geert@linux-m68k.org>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      b8edebe4
    • J
      TTY: amiserial, use tty_port_block_til_ready · 6e1aeb03
      Jiri Slaby 提交于
      Hmm, 150 lines of duplicated stuff is gone now.
      Signed-off-by: NJiri Slaby <jslaby@suse.cz>
      Cc: Geert Uytterhoeven <geert@linux-m68k.org>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      6e1aeb03
    • J
      TTY: amiserial, provide carrier helpers · f1166604
      Jiri Slaby 提交于
      This is a preparation for a switch to tty_port_block_til_ready. We
      need amiga_carrier_raised and amiga_dtr_rts. The implementation is
      taken from startup, shutdown and current block_til_ready.
      Signed-off-by: NJiri Slaby <jslaby@suse.cz>
      Cc: Geert Uytterhoeven <geert@linux-m68k.org>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      f1166604
    • J
      TTY: amiserial no longer needs serialP · 6fe18d26
      Jiri Slaby 提交于
      amiserial is the last user of serialP.h. Let's move struct
      serial_state directly to amiserial and remove serialP crap from
      includes. Finally, remove the header from the tree completely.
      Signed-off-by: NJiri Slaby <jslaby@suse.cz>
      Cc: Geert Uytterhoeven <geert@linux-m68k.org>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      6fe18d26
    • J
      TTY: amiserial, stop using serial_state->{irq,type,line} · ff169e5c
      Jiri Slaby 提交于
      * instead of line, use tty->index or iterator...
      * irq and type are left unset. So get rid of them.
      Signed-off-by: NJiri Slaby <jslaby@suse.cz>
      Cc: Geert Uytterhoeven <geert@linux-m68k.org>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      ff169e5c
    • J
      TTY: amiserial, define local tty_port pointer · 7188dc20
      Jiri Slaby 提交于
      And use it to make the code more readable.
      Signed-off-by: NJiri Slaby <jslaby@suse.cz>
      Cc: Geert Uytterhoeven <geert@linux-m68k.org>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      7188dc20
    • J
      TTY: amiserial/simserial, use flags from tty_port · 01bd730d
      Jiri Slaby 提交于
      This changes flags' type to ulong which is appropriate for all the
      set/clear_bits performed in the drivers..
      Signed-off-by: NJiri Slaby <jslaby@suse.cz>
      Cc: Geert Uytterhoeven <geert@linux-m68k.org>
      Cc: Tony Luck <tony.luck@intel.com>
      Cc: Fenghua Yu <fenghua.yu@intel.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      01bd730d
    • J
      TTY: amiserial/simserial, use count from tty_port · 12c80354
      Jiri Slaby 提交于
      Nothing special. Just remove count from serial_state and change all
      users to use tty_port.
      Signed-off-by: NJiri Slaby <jslaby@suse.cz>
      Cc: Geert Uytterhoeven <geert@linux-m68k.org>
      Cc: Tony Luck <tony.luck@intel.com>
      Cc: Fenghua Yu <fenghua.yu@intel.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      12c80354
    • J
      TTY: amiserial/simserial, use close delays from tty_port · 799be6ff
      Jiri Slaby 提交于
      Note that previously simserial set the delay to 0. So we preserve
      that. BUT, is it correct?
      Signed-off-by: NJiri Slaby <jslaby@suse.cz>
      Cc: Geert Uytterhoeven <geert@linux-m68k.org>
      Cc: Tony Luck <tony.luck@intel.com>
      Cc: Fenghua Yu <fenghua.yu@intel.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      799be6ff
    • J
      TTY: amiserial/simserial, use tty_port · 87758791
      Jiri Slaby 提交于
      Add tty_port to serial_state and start using common tty port members
      from tty_port in amiserial and simserial. The rest will follow one by
      one.
      Signed-off-by: NJiri Slaby <jslaby@suse.cz>
      Cc: Geert Uytterhoeven <geert@linux-m68k.org>
      Cc: Tony Luck <tony.luck@intel.com>
      Cc: Fenghua Yu <fenghua.yu@intel.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      87758791
    • J
      TTY: amiserial, pass tty down to functions · 588993dd
      Jiri Slaby 提交于
      This avoids pain with tty refcounting and touching tty_port in the
      future. It allows us to remove some info->tty tests because the tty
      passed down to them can never be NULL.
      Signed-off-by: NJiri Slaby <jslaby@suse.cz>
      Cc: Geert Uytterhoeven <geert@linux-m68k.org>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      588993dd
    • J
      TTY: amiserial, simplify set_serial_info · 0f9b9684
      Jiri Slaby 提交于
      Do not copy whole serial_state. We only need to know whether the speed
      is to be changed. Hence store the info in advance and use it later.
      A simple bool is enough.
      
      Also remove reduntant assignments and move the tests directly to the
      'if'.
      Signed-off-by: NJiri Slaby <jslaby@suse.cz>
      Cc: Geert Uytterhoeven <geert@linux-m68k.org>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      0f9b9684
    • J
      TTY: serialP, merge serial_state and async_struct · 916b7656
      Jiri Slaby 提交于
      This is the final step to get rid of the one of the structures.  A
      further cleanup will follow. And I struct serial_state deserves cease
      to exist after a switch to tty_port too.
      
      While changing the lines, it removes also pointless tty->driver_data
      casts.
      Signed-off-by: NJiri Slaby <jslaby@suse.cz>
      Cc: Geert Uytterhoeven <geert@linux-m68k.org>
      Cc: Tony Luck <tony.luck@intel.com>
      Cc: Fenghua Yu <fenghua.yu@intel.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      916b7656
    • J
      TTY: amiserial, remove IRQ_ports · 13c90621
      Jiri Slaby 提交于
      They used to work as a storage for 'info' pointer used in ISRs.  They
      are not really needed. Just pass the pointer through request_irq to
      the handlers.
      
      It was set to NULL and tested in the ISRs, but we do not need the
      tests as we disable all the interrupts at the same places where NULL
      sets were.
      Signed-off-by: NJiri Slaby <jslaby@suse.cz>
      Cc: Geert Uytterhoeven <geert@linux-m68k.org>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      13c90621
    • J
      TTY: simserial/amiserial, use one instance of other members · d8522563
      Jiri Slaby 提交于
      This means:
      * close_delay
      * closing_wait
      * line
      * port
      * xmit_fifo_size
      
      This actually fixes a bug in amiserial. It initializes one and uses
      the other of the close delays. Yes, duplicating structure members is
      evil.
      Signed-off-by: NJiri Slaby <jslaby@suse.cz>
      Cc: Geert Uytterhoeven <geert@linux-m68k.org>
      Cc: Tony Luck <tony.luck@intel.com>
      Cc: Fenghua Yu <fenghua.yu@intel.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      d8522563
    • J
      TTY: amiserial, use only one copy of async flags · fef21073
      Jiri Slaby 提交于
      Huh, why would one want to store two copies of them? Get rid of the
      one from async_struct. That structure is going away as a whole soon.
      Signed-off-by: NJiri Slaby <jslaby@suse.cz>
      Cc: Geert Uytterhoeven <geert@linux-m68k.org>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      fef21073
    • J
      TTY: amiserial, remove tasklet for tty_wakeup · c5f0508b
      Jiri Slaby 提交于
      tty_wakeup is safe to be called from all contexts. No need to schedule
      a tasklet for that. Let's call it directly like in other drivers.
      
      This allows us to kill another member of async_struct structure. (If
      we remove the dummy uses in simserial.)
      Signed-off-by: NJiri Slaby <jslaby@suse.cz>
      Cc: Geert Uytterhoeven <geert@linux-m68k.org>
      Cc: Tony Luck <tony.luck@intel.com>
      Cc: Fenghua Yu <fenghua.yu@intel.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      c5f0508b
    • J
      TTY: serialP, remove unused material · 9c8efecc
      Jiri Slaby 提交于
      First, remove unused macro and rs_multiport_struct structure. Nobody
      uses them at all.
      
      Further, the 2 drivers (they are below) which use the rest of
      structures from serialP.h (async_struct and serial_state) do not use
      all the members. Remove the members:
      * which are unused or
      * which are only initialized and never used for something real.
      
      Everybody should avoid the structures with a looong distance.
      
      Finally, remove the ALPHA kludge MCR quirks. They are 1:1 copy from
      8250.h. No need to redefine them here.
      
      The 2 promised users of the structures:
      arch/ia64/hp/sim/simserial.c
      drivers/tty/amiserial.c
      Signed-off-by: NJiri Slaby <jslaby@suse.cz>
      Cc: Geert Uytterhoeven <geert@linux-m68k.org>
      Cc: Tony Luck <tony.luck@intel.com>
      Cc: Fenghua Yu <fenghua.yu@intel.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      9c8efecc
    • J
      TTY: speakup, do not use serialP · 3ee0017e
      Jiri Slaby 提交于
      The structures there are going away. And speakup has enough troubles
      already.
      
      So define a structure similar to what 8250 does: old_serial_port.
      There define an array of speed, port base and so on needed for
      configuration. Then use this structure instead of serial_state defined
      in serialP.h.
      Signed-off-by: NJiri Slaby <jslaby@suse.cz>
      Cc: William Hubbs <w.d.hubbs@gmail.com>
      Cc: Chris Brannon <chris@the-brannons.com>
      Cc: Kirk Reiser <kirk@braille.uwo.ca>
      Cc: Samuel Thibault <samuel.thibault@ens-lyon.org>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      3ee0017e