An error occurred fetching the project authors.
  1. 13 Jun, 2012 2 commits
    • NeilBrown's avatar
      W1: split master mutex to avoid deadlocks. · b02f8bed
      NeilBrown authored
      The 'mutex' in struct w1_master is use for two very different
      purposes.
      
      Firstly it protects various data structures such as the list of all
      slaves.
      
      Secondly it protects the w1 buss against concurrent accesses.
      
      This can lead to deadlocks when the ->probe code called while adding a
      slave needs to talk on the bus, as is the case for power_supply
      devices.
      ds2780 and ds2781 drivers contain a work around to track which
      process hold the lock simply to avoid this deadlock.  bq27000 doesn't
      have that work around and so deadlocks.
      
      There are other possible deadlocks involving sysfs.
      When removing a device the sysfs s_active lock is held, so the lock
      that protects the slave list must take precedence over s_active.
      However when access power_supply attributes via sysfs, the s_active
      lock must take precedence over the lock that protects accesses to
      the bus.
      
      So to avoid deadlocks between w1 slaves and sysfs, these must be
      two separate locks.  Making them separate means that the work around
      in ds2780 and ds2781 can be removed.
      
      So this patch:
       - adds a new mutex: "bus_mutex" which serialises access to the bus.
       - takes in mutex in w1_search and ds1wm_search while they access
         the bus for searching.  The mutex is dropped before calling the
         callback which adds the slave.
       - changes all slaves to use bus_mutex instead of mutex to
         protect access to the bus
       - removes w1_ds2790_io_nolock and w1_ds2781_io_nolock, and the
         related code from drivers/power/ds278[01]_battery.c which
         calls them.
      Signed-off-by: default avatarNeilBrown <neilb@suse.de>
      Acked-by: default avatarEvgeniy Polyakov <zbr@ioremap.net>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      b02f8bed
    • Greg Kroah-Hartman's avatar
      Revert "w1: introduce a slave mutex for serializing IO" · dd0aa67c
      Greg Kroah-Hartman authored
      This reverts commit 59d4467b.
      
      Turns out it was the wrong version, will apply the correct version after
      this.
      Reported-by: default avatarNeilBrown <neilb@suse.de>
      Cc: Evgeniy Polyakov <zbr@ioremap.net>
      Cc: Andrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      dd0aa67c
  2. 12 Jun, 2012 1 commit
  3. 24 Feb, 2012 3 commits
  4. 16 Feb, 2012 1 commit
    • NeilBrown's avatar
      w1: Fix w1_bq27000 · 9f3519d2
      NeilBrown authored
      w1_bq27000 adds a bq27000-battery platform device but does not provide
      platform data for it. This causes the bq27x00 driver to dereference a NULL
      pointer.
      So provide the appropriate platform data.  This requires modifying
      w1_bq27000_read so that it find the w1 device as the parent of the bq device.
      
      Also there is no point exporting w1_bq27000_read as nothing else uses it
      or could use it.  So make it static.
      
      Finally, as there is no way to track how many batteries have been found, and
      we will probably only find one, use an id number of '-1' to assert that this
      is a unique instance.
      Signed-off-by: default avatarNeilBrown <neilb@suse.de>
      Tested-by: default avatarThomas Weber <weber@corscience.de>
      Acked-by: default avatarEvgeniy Polyakov <zbr@ioremap.net>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      9f3519d2
  5. 13 Nov, 2008 1 commit