1. 07 12月, 2009 4 次提交
  2. 26 11月, 2009 1 次提交
    • J
      i2c: Fix userspace_device list corruption · bbd2d9c9
      Jean Delvare 提交于
      Fix userspace_device list corruption. The corruption was caused by
      clients not being removed when adapters with such clients were
      themselves removed. Something like the following would trigger it
      (assuming i2c-stub gets adapter number 3):
      
      # modprobe i2c-stub chip_addr=0x50
      # echo 24c08 0x50 > /sys/bus/i2c/devices/i2c-3/new_device 
      # rmmod i2c-stub
      # modprobe i2c-stub chip_addr=0x50
      # echo 24c08 0x50 > /sys/bus/i2c/devices/i2c-3/new_device 
      
      For the records, the stack trace in the kernel logs look like this:
      
      kernel: WARNING: at lib/list_debug.c:30 __list_add+0x8b/0x90()
      kernel: Hardware name: (...)
      kernel: list_add corruption. prev->next should be next (c137fc84), but was (null). (prev=f57111b8).
      kernel: Modules linked in: (...)
      kernel: Pid: 4669, comm: bash Not tainted 2.6.32-rc8 #259
      kernel: Call Trace:
      kernel:  [<c111eb8b>] ? __list_add+0x8b/0x90
      kernel:  [<c111eb8b>] ? __list_add+0x8b/0x90
      kernel:  [<c103265c>] warn_slowpath_common+0x6c/0xc0
      kernel:  [<c111eb8b>] ? __list_add+0x8b/0x90
      kernel:  [<c10326f6>] warn_slowpath_fmt+0x26/0x30
      kernel:  [<c111eb8b>] __list_add+0x8b/0x90
      kernel:  [<c11ba165>] i2c_sysfs_new_device+0x1c5/0x250
      kernel:  [<c10861be>] ? might_fault+0x2e/0x80
      kernel:  [<c11b9fa0>] ? i2c_sysfs_new_device+0x0/0x250
      kernel:  [<c118c625>] dev_attr_store+0x25/0x30
      kernel:  [<c10e305c>] sysfs_write_file+0x9c/0xf0
      kernel:  [<c109d35c>] vfs_write+0x9c/0x160
      kernel:  [<c10e2fc0>] ? sysfs_write_file+0x0/0xf0
      kernel:  [<c109d4dd>] sys_write+0x3d/0x70
      kernel:  [<c1002ed8>] sysenter_do_call+0x12/0x36
      Signed-off-by: NJean Delvare <khali@linux-fr.org>
      bbd2d9c9
  3. 19 9月, 2009 3 次提交
  4. 19 6月, 2009 9 次提交
  5. 16 6月, 2009 3 次提交
  6. 13 4月, 2009 1 次提交
  7. 29 3月, 2009 3 次提交
  8. 25 3月, 2009 1 次提交
    • M
      Driver core: implement uevent suppress in kobject · f67f129e
      Ming Lei 提交于
      This patch implements uevent suppress in kobject and removes it
      from struct device, based on the following ideas:
      
      1,Uevent sending should be one attribute of kobject, so suppressing it
      in kobject layer is more natural than in device layer. By this way,
      we can do it for other objects embedded with kobject.
      
      2,It may save several bytes for each instance of struct device.(On my
      omap3(32bit ARM) based box, can save 8bytes per device object)
      
      This patch also introduces dev_set|get_uevent_suppress() helpers to
      set and query uevent_suppress attribute in case to help kobject
      as private part of struct device in future.
      
      [This version is against the latest driver-core patch set of Greg,please
      ignore the last version.]
      Signed-off-by: NMing Lei <tom.leiming@gmail.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      f67f129e
  9. 25 2月, 2009 1 次提交
  10. 07 1月, 2009 1 次提交
    • K
      i2c: Replace bus_id with dev_name(), dev_set_name() · 27d9c183
      Kay Sievers 提交于
      This patch is part of a larger patch series which will remove
      the "char bus_id[20]" name string from struct device. The device
      name is managed in the kobject anyway, and without any size
      limitation, and just needlessly copied into "struct device".
      
      To set and read the device name dev_name(dev) and dev_set_name(dev)
      must be used. If your code uses static kobjects, which it shouldn't
      do, "const char *init_name" can be used to statically provide the
      name the registered device should have. At registration time, the
      init_name field is cleared, to enforce the use of dev_name(dev) to
      access the device name at a later time.
      
      We need to get rid of all occurrences of bus_id in the entire tree
      to be able to enable the new interface. Please apply this patch,
      and possibly convert any remaining remaining occurrences of bus_id.
      
      We want to submit a patch to -next, which will remove bus_id from
      "struct device", to find the remaining pieces to convert, and finally
      switch over to the new api, which will remove the 20 bytes array
      and does no longer have a size limitation.
      Acked-by: NGreg Kroah-Hartman <gregkh@suse.de>
      Signed-off-by: NKay Sievers <kay.sievers@vrfy.org>
      Signed-off-by: NJean Delvare <khali@linux-fr.org>
      27d9c183
  11. 28 11月, 2008 1 次提交
  12. 23 10月, 2008 1 次提交
  13. 14 10月, 2008 3 次提交
  14. 28 8月, 2008 2 次提交
  15. 11 8月, 2008 2 次提交
  16. 22 7月, 2008 1 次提交
  17. 17 7月, 2008 1 次提交
  18. 15 7月, 2008 2 次提交
    • J
      i2c: Add detection capability to new-style drivers · 4735c98f
      Jean Delvare 提交于
      Add a mechanism to let new-style i2c drivers optionally autodetect
      devices they would support on selected buses and ask i2c-core to
      instantiate them. This is a replacement for legacy i2c drivers, much
      cleaner.
      
      Where drivers had to implement both a legacy i2c_driver and a
      new-style i2c_driver so far, this mechanism makes it possible to get
      rid of the legacy i2c_driver and implement both enumerated and
      detected device support with just one (new-style) i2c_driver.
      
      Here is a quick conversion guide for these drivers, step by step:
      
      * Delete the legacy driver definition, registration and removal.
        Delete the attach_adapter and detach_client methods of the legacy
        driver.
      
      * Change the prototype of the legacy detect function from
          static int foo_detect(struct i2c_adapter *adapter, int address, int kind);
        to
          static int foo_detect(struct i2c_client *client, int kind,
          			  struct i2c_board_info *info);
      
      * Set the new-style driver detect callback to this new function, and
        set its address_data to &addr_data (addr_data is generally provided
        by I2C_CLIENT_INSMOD.)
      
      * Add the appropriate class to the new-style driver. This is
        typically the class the legacy attach_adapter method was checking
        for. Class checking is now mandatory (done by i2c-core.) See
        <linux/i2c.h> for the list of available classes.
      
      * Remove the i2c_client allocation and freeing from the detect
        function. A pre-allocated client is now handed to you by i2c-core,
        and is freed automatically.
      
      * Make the detect function fill the type field of the i2c_board_info
        structure it was passed as a parameter, and return 0, on success. If
        the detection fails, return -ENODEV.
      Signed-off-by: NJean Delvare <khali@linux-fr.org>
      4735c98f
    • J
      i2c: Call client_unregister for new-style devices too · 8508159e
      Jean Delvare 提交于
      We call adapter->client_register for both legacy and new-style i2c
      devices, however we only call adapter->client_unregister for legacy
      drivers. This doesn't make much sense. Usually, drivers will undo
      in client_unregister what they did in client_register, so we should
      call neither or both for every given i2c device.
      
      In order to ease the transition from legacy to new-style devices, it
      seems preferable to actually call both.
      Signed-off-by: NJean Delvare <khali@linux-fr.org>
      Cc: David Brownell <david-b@pacbell.net>
      8508159e