1. 13 10月, 2007 1 次提交
    • K
      Driver core: change add_uevent_var to use a struct · 7eff2e7a
      Kay Sievers 提交于
      This changes the uevent buffer functions to use a struct instead of a
      long list of parameters. It does no longer require the caller to do the
      proper buffer termination and size accounting, which is currently wrong
      in some places. It fixes a known bug where parts of the uevent
      environment are overwritten because of wrong index calculations.
      
      Many thanks to Mathieu Desnoyers for finding bugs and improving the
      error handling.
      Signed-off-by: NKay Sievers <kay.sievers@vrfy.org>
      Cc: Mathieu Desnoyers <mathieu.desnoyers@polymtl.ca>
      Cc: Cornelia Huck <cornelia.huck@de.ibm.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      
      7eff2e7a
  2. 01 8月, 2007 1 次提交
    • D
      spi device setup gets better error checking · 082c8cb4
      David Brownell 提交于
      This updates some error reporting paths in SPI device setup:
      
       - Move validation logic for SPI chipselects to spi_new_device(),
         which is where it should always have been.
      
       - In spi_new_device(), emit error messages if the device can't
         be created.  This is LOTS better than a silent failure; though
         eventually, the calling convention should probably change to
         use the <linux/err.h> conventions.
      
       - Includes one previously-missing check:  SPI masters must always
         have at least one chipselect, even for dedicated busses which
         always keep it selected!
      
      It also adds a FIXME (IDR for dynamic ID allocation) so the issue doesn't live
      purely in my mailbox.
      Signed-off-by: NDavid Brownell <dbrownell@users.sourceforge.net>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      082c8cb4
  3. 22 7月, 2007 1 次提交
  4. 18 7月, 2007 1 次提交
  5. 05 6月, 2007 1 次提交
  6. 09 5月, 2007 1 次提交
  7. 28 3月, 2007 1 次提交
  8. 13 2月, 2007 1 次提交
  9. 08 2月, 2007 2 次提交
  10. 27 1月, 2007 1 次提交
    • A
      [PATCH] SPI: alternative fix for spi_busnum_to_master · 1e9a51dc
      Atsushi Nemoto 提交于
      If a SPI master device exists, udev (udevtrigger) causes kernel crash, due
      to wrong kobj pointer in kobject_uevent_env().  This problem was not in
      2.6.19.
      
      The backtrace (on MIPS) was:
      [<8024db6c>] kobject_uevent_env+0x54c/0x5e8
      [<802a8264>] store_uevent+0x1c/0x3c  (in drivers/class.c)
      [<801cb14c>] subsys_attr_store+0x2c/0x50
      [<801cb80c>] flush_write_buffer+0x38/0x5c
      [<801cb900>] sysfs_write_file+0xd0/0x190
      [<80181444>] vfs_write+0xc4/0x1a0
      [<80181cdc>] sys_write+0x54/0xa0
      [<8010dae4>] stack_done+0x20/0x3c
      
      flush_write_buffer() passes kobject of spi_master_class.subsys to
      subsys_addr_store(), then subsys_addr_store() passes a pointer to a struct
      subsystem to store_uevent() which expects a pointer to a struct
      class_device.  The problem seems subsys_attr_store() called instead of
      class_device_attr_store().
      
      This mismatch was caused by commit
      3bd0f694, which overrides kset of master
      class.  This made spi_master_class.subsys.kset.ktype NULL so
      subsys_sysfs_ops is used instead of class_dev_sysfs_ops.
      
      The commit was to fix spi_busnum_to_master().  Here is a patch fixes
      this function in other way, just searching children list of
      class_device.
      Signed-off-by: NAtsushi Nemoto <anemo@mba.ocn.ne.jp>
      Signed-off-by: NDavid Brownell <dbrownell@users.sourceforge.net>
      Signed-off-by: NAndrew Morton <akpm@osdl.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      1e9a51dc
  11. 08 12月, 2006 4 次提交
  12. 04 11月, 2006 1 次提交
  13. 04 7月, 2006 1 次提交
  14. 29 6月, 2006 1 次提交
  15. 22 5月, 2006 1 次提交
  16. 17 5月, 2006 2 次提交
  17. 21 2月, 2006 1 次提交
  18. 14 1月, 2006 5 次提交
    • A
      [PATCH] spi: remove fastcall crap · 5d870c8e
      Andrew Morton 提交于
      gcc4 generates warnings when a non-FASTCALL function pointer is assigned to a
      FASTCALL one.  Perhaps it has taste.
      
      Cc: David Brownell <david-b@pacbell.net>
      Signed-off-by: NAndrew Morton <akpm@osdl.org>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      5d870c8e
    • V
      [PATCH] spi: use linked lists rather than an array · 8275c642
      Vitaly Wool 提交于
      This makes the SPI core and its users access transfers in the SPI message
      structure as linked list not as an array, as discussed on LKML.
      
      From: David Brownell <dbrownell@users.sourceforge.net>
      
        Updates including doc, bugfixes to the list code, add
        spi_message_add_tail().  Plus, initialize things _before_ grabbing the
        locks in some cases (in case it grows more expensive).  This also merges
        some bitbang updates of mine that didn't yet make it into the mm tree.
      Signed-off-by: NVitaly Wool <vwool@ru.mvista.com>
      Signed-off-by: NDmitry Pervushin <dpervushin@gmail.com>
      Signed-off-by: NDavid Brownell <dbrownell@users.sourceforge.net>
      Signed-off-by: NAndrew Morton <akpm@osdl.org>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      8275c642
    • D
      [PATCH] SPI core tweaks, bugfix · 0c868461
      David Brownell 提交于
      This includes various updates to the SPI core:
      
        - Fixes a driver model refcount bug in spi_unregister_master() paths.
      
        - The spi_master structures now have wrappers which help keep drivers
          from needing class-level get/put for device data or for refcounts.
      
        - Check for a few setup errors that would cause oopsing later.
      
        - Docs say more about memory management.  Highlights the use of DMA-safe
          i/o buffers, and zero-initializing spi_message and such metadata.
      
        - Provide a simple alloc/free for spi_message and its spi_transfer;
          this is only one of the possible memory management policies.
      
      Nothing to break code that already works.
      Signed-off-by: NDavid Brownell <dbrownell@users.sourceforge.net>
      Signed-off-by: NAndrew Morton <akpm@osdl.org>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      0c868461
    • D
      [PATCH] spi: add spi_driver to SPI framework · b885244e
      David Brownell 提交于
      This is a refresh of the "Simple SPI Framework" found in 2.6.15-rc3-mm1
      which makes the following changes:
      
        * There's now a "struct spi_driver".  This increase the footprint
          of the core a bit, since it now includes code to do what the driver
          core was previously handling directly.  Documentation and comments
          were updated to match.
      
        * spi_alloc_master() now does class_device_initialize(), so it can
          at least be refcounted before spi_register_master().  To match,
          spi_register_master() switched over to class_device_add().
      
        * States explicitly that after transfer errors, spi_devices will be
          deselected.  We want fault recovery procedures to work the same
          for all controller drivers.
      
        * Minor tweaks:  controller_data no longer points to readonly data;
          prevent some potential cast-from-null bugs with container_of calls;
          clarifies some existing kerneldoc,
      
      And a few small cleanups.
      Signed-off-by: NDavid Brownell <dbrownell@users.sourceforge.net>
      Signed-off-by: NAndrew Morton <akpm@osdl.org>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      b885244e
    • D
      [PATCH] spi: simple SPI framework · 8ae12a0d
      David Brownell 提交于
      This is the core of a small SPI framework, implementing the model of a
      queue of messages which complete asynchronously (with thin synchronous
      wrappers on top).
      
        - It's still less than 2KB of ".text" (ARM).  If there's got to be a
          mid-layer for something so simple, that's the right size budget.  :)
      
        - The guts use board-specific SPI device tables to build the driver
          model tree.  (Hardware probing is rarely an option.)
      
        - This version of Kconfig includes no drivers.  At this writing there
          are two known master controller drivers (PXA/SSP, OMAP MicroWire)
          and three protocol drivers (CS8415a, ADS7846, DataFlash) with LKML
          mentions of other drivers in development.
      
        - No userspace API.  There are several implementations to compare.
          Implement them like any other driver, and bind them with sysfs.
      
      The changes from last version posted to LKML (on 11-Nov-2005) are minor,
      and include:
      
        - One bugfix (removes a FIXME), with the visible effect of making device
          names be "spiB.C" where B is the bus number and C is the chipselect.
      
        - The "caller provides DMA mappings" mechanism now has kerneldoc, for
          DMA drivers that want to be fancy.
      
        - Hey, the framework init can be subsys_init.  Even though board init
          logic fires earlier, at arch_init ... since the framework init is
          for driver support, and the board init support uses static init.
      
        - Various additional spec/doc clarifications based on discussions
          with other folk.  It adds a brief "thank you" at the end, for folk
          who've helped nudge this framework into existence.
      
      As I've said before, I think that "protocol tweaking" is the main support
      that this driver framework will need to evolve.
      
      From: Mark Underwood <basicmark@yahoo.com>
      
        Update the SPI framework to remove a potential priority inversion case by
        reverting to kmalloc if the pre-allocated DMA-safe buffer isn't available.
      Signed-off-by: NDavid Brownell <dbrownell@users.sourceforge.net>
      Signed-off-by: NAndrew Morton <akpm@osdl.org>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      8ae12a0d