1. 03 2月, 2012 1 次提交
  2. 26 4月, 2011 3 次提交
  3. 19 4月, 2011 1 次提交
  4. 31 3月, 2011 1 次提交
  5. 26 2月, 2011 1 次提交
    • T
      nozomi: don't use flush_scheduled_work() · 2c590f3c
      Tejun Heo 提交于
      flush_scheduled_work() in tty_exit() doesn't seem to target any
      specific work.  If it was to flush work items used in tty generic
      layer, they're already flushed properly during tty release.
      
      flush_scheduled_work() is going away.  Remove the seemingly redundant
      usage.
      Signed-off-by: NTejun Heo <tj@kernel.org>
      Cc: Jiri Slaby <jslaby@suse.cz>
      Cc: Alan Cox <alan@linux.intel.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      2c590f3c
  6. 23 2月, 2011 1 次提交
  7. 18 2月, 2011 3 次提交
  8. 10 11月, 2010 1 次提交
  9. 23 10月, 2010 1 次提交
  10. 11 8月, 2010 3 次提交
    • S
      kfifo: fix kfifo miss use of nozami.c · 4457d984
      Stefani Seibold 提交于
      There are different types of a fifo which can not handled in C without a
      lot of overhead.  So i decided to write the API as a set of macros, which
      is the only way to do a kind of template meta programming without C++.
      This macros handles the different types of fifos in a transparent way.
      
      There are a lot of benefits:
      
      - Compile time handling of the different fifo types
      - Better performance (a save put or get of an integer does only generate
        9 assembly instructions on a x86)
      - Type save
      - Cleaner interface, the additional kfifo_..._rec() functions are gone
      - Easier to use
      - Less error prone
      - Different types of fifos: it is now possible to define a int fifo or
        any other type. See below for an example.
      - Smaller footprint for none byte type fifos
      - No need of creating a second hidden variable, like in the old DEFINE_KFIFO
      
      The API was not changed.
      
      There are now real in place fifos where the data space is a part of the
      structure.  The fifo needs now 20 byte plus the fifo space.  Dynamic
      assigned or allocated create a little bit more code.
      
      Most of the macros code will be optimized away and simple generate a
      function call.  Only the really small one generates inline code.
      
      Additionally you can now create fifos for any data type, not only the
      "unsigned char" byte streamed fifos.
      
      There is also a new kfifo_put and kfifo_get function, to handle a single
      element in a fifo.  This macros generates inline code, which is lit bit
      larger but faster.
      
      I know that this kind of macros are very sophisticated and not easy to
      maintain.  But i have all tested and it works as expected.  I analyzed the
      output of the compiler and for the x86 the code is as good as hand written
      assembler code.  For the byte stream fifo the generate code is exact the
      same as with the current kfifo implementation.  For all other types of
      fifos the code is smaller before, because the interface is easier to use.
      
      The main goal was to provide an API which is very intuitive, save and easy
      to use.  So linux will get now a powerful fifo API which provides all what
      a developer needs.  This will save in the future a lot of kernel space,
      since there is no need to write an own implementation.  Most of the device
      driver developers need a fifo, and also deep kernel development will gain
      benefit from this API.
      
      Here are the results of the text section usage:
      
      Example 1:
                              kfifo_put/_get  kfifo_in/out    current kfifo
      dynamic allocated       0x000002a8      0x00000291      0x00000299
      in place                0x00000291      0x0000026e      0x00000273
      
      kfifo.c                 new             old
      text section size       0x00000be5      0x000008b2
      
      As you can see, kfifo_put/kfifo_get creates a little bit more code than
      kfifo_in/kfifo_out, but it is much faster (the code is inline).
      
      The code is complete hand crafted and optimized.  The text section size is
      as small as possible.  You get all the fifo handling in only 3 kb.  This
      includes type safe fix size records, dynamic records and DMA handling.
      
      This should be the final version. All requested features are implemented.
      
      Note: Most features of this API doesn't have any users.  All functions
      which are not used in the next 9 months will be removed.  So, please adapt
      your drivers and other sources as soon as possible to the new API and post
      it.
      
      This are the features which are currently not used in the kernel:
      
      kfifo_to_user()
      kfifo_from_user()
      kfifo_dma_....() macros
      kfifo_esize()
      kfifo_recsize()
      kfifo_put()
      kfifo_get()
      
      The fixed size record elements, exclude "unsigned char" fifo's and the
      variable size records fifo's
      
      This patch:
      
      User of the kernel fifo should never bypass the API and directly access
      the fifo structure.  Otherwise it will be very hard to maintain the API.
      Signed-off-by: NStefani Seibold <stefani@seibold.net>
      Cc: Greg KH <greg@kroah.com>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      4457d984
    • J
      Char: nozomi, set tty->driver_data appropriately · bf9c1fca
      Jiri Slaby 提交于
      Sorry, one more fix, this one depends on the other, so this is rather 2/2.
      --
      
      tty->driver_data is used all over the code, but never set. This
      results in oopses like:
      BUG: unable to handle kernel NULL pointer dereference at 0000000000000130
      IP: [<ffffffff814a0040>] mutex_lock+0x10/0x40
      ...
      Pid: 2157, comm: modem-manager Not tainted 2.6.34.1-0.1-desktop #1 2768DR7/2768DR7
      RIP: 0010:[<ffffffff814a0040>]  [<ffffffff814a0040>] mutex_lock+0x10/0x40
      RSP: 0018:ffff88007b16fa50  EFLAGS: 00010286
      RAX: 0000000000000000 RBX: 0000000000000130 RCX: 0000000000000003
      RDX: 0000000000000003 RSI: 0000000000000286 RDI: 0000000000000130
      RBP: 0000000000001000 R08: 0000000000000000 R09: 0000000000000000
      R10: 0000000000000001 R11: 0000000000000000 R12: 0000000000000130
      R13: 0000000000000001 R14: 0000000000000000 R15: ffff88007b16feb4
      ...
      Call Trace:
       [<ffffffffa077690d>] ntty_write_room+0x4d/0x90 [nozomi]
      ...
      
      Set tty->driver_data to the computed port in .install to not recompute it in
      every place where needed. Switch .open to use driver_data too.
      Signed-off-by: NJiri Slaby <jslaby@suse.cz>
      Cc: Alan Cox <alan@linux.intel.com>
      Cc: stable <stable@kernel.org> [.34, .35]
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      
      bf9c1fca
    • J
      Char: nozomi, fix tty->count counting · ee78bb95
      Jiri Slaby 提交于
      Currently ntty_install omits to increment tty count and we get the
      following warnings:
      Warning: dev (noz2) tty->count(0) != #fd's(1) in tty_open
      
      So to fix that, add one tty->count++ there.
      Signed-off-by: NJiri Slaby <jslaby@suse.cz>
      Cc: Alan Cox <alan@linux.intel.com>
      Cc: stable <stable@kernel.org> [.34, .35]
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      ee78bb95
  11. 30 3月, 2010 1 次提交
    • T
      include cleanup: Update gfp.h and slab.h includes to prepare for breaking... · 5a0e3ad6
      Tejun Heo 提交于
      include cleanup: Update gfp.h and slab.h includes to prepare for breaking implicit slab.h inclusion from percpu.h
      
      percpu.h is included by sched.h and module.h and thus ends up being
      included when building most .c files.  percpu.h includes slab.h which
      in turn includes gfp.h making everything defined by the two files
      universally available and complicating inclusion dependencies.
      
      percpu.h -> slab.h dependency is about to be removed.  Prepare for
      this change by updating users of gfp and slab facilities include those
      headers directly instead of assuming availability.  As this conversion
      needs to touch large number of source files, the following script is
      used as the basis of conversion.
      
        http://userweb.kernel.org/~tj/misc/slabh-sweep.py
      
      The script does the followings.
      
      * Scan files for gfp and slab usages and update includes such that
        only the necessary includes are there.  ie. if only gfp is used,
        gfp.h, if slab is used, slab.h.
      
      * When the script inserts a new include, it looks at the include
        blocks and try to put the new include such that its order conforms
        to its surrounding.  It's put in the include block which contains
        core kernel includes, in the same order that the rest are ordered -
        alphabetical, Christmas tree, rev-Xmas-tree or at the end if there
        doesn't seem to be any matching order.
      
      * If the script can't find a place to put a new include (mostly
        because the file doesn't have fitting include block), it prints out
        an error message indicating which .h file needs to be added to the
        file.
      
      The conversion was done in the following steps.
      
      1. The initial automatic conversion of all .c files updated slightly
         over 4000 files, deleting around 700 includes and adding ~480 gfp.h
         and ~3000 slab.h inclusions.  The script emitted errors for ~400
         files.
      
      2. Each error was manually checked.  Some didn't need the inclusion,
         some needed manual addition while adding it to implementation .h or
         embedding .c file was more appropriate for others.  This step added
         inclusions to around 150 files.
      
      3. The script was run again and the output was compared to the edits
         from #2 to make sure no file was left behind.
      
      4. Several build tests were done and a couple of problems were fixed.
         e.g. lib/decompress_*.c used malloc/free() wrappers around slab
         APIs requiring slab.h to be added manually.
      
      5. The script was run on all .h files but without automatically
         editing them as sprinkling gfp.h and slab.h inclusions around .h
         files could easily lead to inclusion dependency hell.  Most gfp.h
         inclusion directives were ignored as stuff from gfp.h was usually
         wildly available and often used in preprocessor macros.  Each
         slab.h inclusion directive was examined and added manually as
         necessary.
      
      6. percpu.h was updated not to include slab.h.
      
      7. Build test were done on the following configurations and failures
         were fixed.  CONFIG_GCOV_KERNEL was turned off for all tests (as my
         distributed build env didn't work with gcov compiles) and a few
         more options had to be turned off depending on archs to make things
         build (like ipr on powerpc/64 which failed due to missing writeq).
      
         * x86 and x86_64 UP and SMP allmodconfig and a custom test config.
         * powerpc and powerpc64 SMP allmodconfig
         * sparc and sparc64 SMP allmodconfig
         * ia64 SMP allmodconfig
         * s390 SMP allmodconfig
         * alpha SMP allmodconfig
         * um on x86_64 SMP allmodconfig
      
      8. percpu.h modifications were reverted so that it could be applied as
         a separate patch and serve as bisection point.
      
      Given the fact that I had only a couple of failures from tests on step
      6, I'm fairly confident about the coverage of this conversion patch.
      If there is a breakage, it's likely to be something in one of the arch
      headers which should be easily discoverable easily on most builds of
      the specific arch.
      Signed-off-by: NTejun Heo <tj@kernel.org>
      Guess-its-ok-by: NChristoph Lameter <cl@linux-foundation.org>
      Cc: Ingo Molnar <mingo@redhat.com>
      Cc: Lee Schermerhorn <Lee.Schermerhorn@hp.com>
      5a0e3ad6
  12. 03 3月, 2010 4 次提交
  13. 21 1月, 2010 1 次提交
    • A
      nozomi: quick fix for the close/close bug · eeec32a7
      Alan Cox 提交于
      Nozomi goes wrong if you get the sequence
      
      	open
      	open
      	close
      
      	[stuff]
      	close
      
      which turns out to occur on some ppp type setups.
      
      This is a quick patch up for the problem. It's not really fixing Nozomi
      which completely fails to implement tty open/close semantics and all the
      other needed stuff. Doing it right is a rather more invasive patch set and
      not one that will backport.
      Signed-off-by: NAlan Cox <alan@linux.intel.com>
      Cc: stable <stable@kernel.org>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      eeec32a7
  14. 23 12月, 2009 5 次提交
  15. 12 10月, 2009 1 次提交
  16. 21 7月, 2009 1 次提交
  17. 17 7月, 2009 1 次提交
  18. 25 6月, 2009 1 次提交
  19. 03 1月, 2009 1 次提交
  20. 14 10月, 2008 1 次提交
  21. 30 4月, 2008 3 次提交
  22. 31 3月, 2008 1 次提交
  23. 11 3月, 2008 1 次提交
  24. 03 2月, 2008 2 次提交