1. 12 8月, 2010 36 次提交
  2. 11 8月, 2010 4 次提交
    • 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
    • F
      parport_serial: use the PCI IRQ if offered · 832ccf6f
      Fr?d?ric Bri?re 提交于
      Commit 51dcdfec ("parport: Use the PCI IRQ if offered") added IRQ support
      for PCI parallel port devices handled by parport_pc, but turned it off for
      parport_serial, despite a printk() message to the contrary.
      Signed-off-by: NFr?d?ric Bri?re <fbriere@fbriere.net>
      Cc: Alan Cox <alan@lxorguk.ukuu.org.uk>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      832ccf6f
    • T
      panic: keep blinking in spite of long spin timer mode · c7ff0d9c
      TAMUKI Shoichi 提交于
      To keep panic_timeout accuracy when running under a hypervisor, the
      current implementation only spins on long time (1 second) calls to mdelay.
       That brings a good effect, but the problem is the keyboard LEDs don't
      blink at all on that situation.
      
      This patch changes to call to panic_blink_enter() between every mdelay and
      keeps blinking in spite of long spin timer mode.
      
      The time to call to mdelay is now 100ms.  Even this change will keep
      panic_timeout accuracy enough when running under a hypervisor.
      Signed-off-by: NTAMUKI Shoichi <tamuki@linet.gr.jp>
      Cc: Ben Dooks <ben-linux@fluff.org>
      Cc: Russell King <linux@arm.linux.org.uk>
      Acked-by: NDmitry Torokhov <dtor@mail.ru>
      Cc: Anton Blanchard <anton@samba.org>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      c7ff0d9c
    • F
      scsi: 53c700: remove dma_is_consistent usage · d80e0d96
      FUJITA Tomonori 提交于
      This driver is the only user of dma_is_consistent().  We plan to remove this
      API.
      
      The driver uses the API in the following way:
      
      BUG_ON(!dma_is_consistent(hostdata->dev, pScript) && L1_CACHE_BYTES < dma_get_cache_alignment());
      
      The above code tries to see if L1_CACHE_BYTES is greater than
      dma_get_cache_alignment() on sysmtes that can not allocate coherent memory
      (some old systems can't).
      
      James Bottomley exmplained that this is necesary because the driver packs the
      set of mailboxes into a single coherent area and separates the different
      usages by a L1 cache stride.  So it's fatal if the dma
      
      He also pointed out that we can kill this checking because we don't hit this
      BUG_ON on all architectures that actually use the driver.
      
      (akpm: stolen from the scsi tree because
      dma-mapping-remove-dma_is_consistent-api.patch needs it)
      Signed-off-by: NFUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
      Signed-off-by: NJames Bottomley <James.Bottomley@suse.de>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      d80e0d96