1. 26 5月, 2017 1 次提交
  2. 09 4月, 2017 1 次提交
  3. 25 1月, 2017 2 次提交
  4. 31 8月, 2016 1 次提交
  5. 02 5月, 2016 1 次提交
  6. 12 2月, 2016 1 次提交
  7. 25 5月, 2015 1 次提交
  8. 27 11月, 2014 1 次提交
  9. 20 6月, 2014 1 次提交
  10. 28 5月, 2014 1 次提交
  11. 17 4月, 2014 1 次提交
    • D
      w1: avoid recursive device_add · 18d7f891
      David Fries 提交于
      __w1_attach_slave_device calls device_add which calls w1_bus_notify
      which calls the w1_bq27000 slave driver, which calls
      platform_device_add and device_add and deadlocks on getting
      &(&priv->bus_notifier)->rwsem as it is still held in the previous
      device_add.  This avoids the problem by processing the family
      add/remove outside of the slave device_add call.
      
      Commit 47eba33a introduced this deadlock and added
      a KOBJ_ADD, as the add was already reported in device_register two add
      events were being sent.  This change suppresses the device_register
      add so that any slave device sysfs entries are setup before the add
      goes out.
      
      Belisko Marek reported this change fixed the deadlock he was seeing on
      ARM device tree, while testing on my x86-64 system never saw the
      deadlock.
      Reported-by: NBelisko Marek <marek.belisko@gmail.com>
      Signed-off-by: NDavid Fries <David@Fries.net>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      18d7f891
  12. 16 2月, 2014 1 次提交
  13. 08 2月, 2014 7 次提交
  14. 13 11月, 2013 1 次提交
    • M
      drivers: w1: make w1_slave::flags long to avoid memory corruption · bb670937
      Michal Nazarewicz 提交于
      On architectures where long is more then 32 bits, modifying a 32-bit field
      with set_bit (and other atomic bit operations) may cause bytes following
      the field to by modified.
      
      Because the endianness of the bits within a field is the native endianness
      of the CPU[1], on big-endian machines, bit number zero is in the last byte
      of the field.
      
      Therefore, `set_bit(0, ptr)' on a 64-bit big-endian machine is roughly
      equivalent to `((char *)ptr)[7] |= 1', and since w1 driver uses a 32-bit
      field for holding the flags, this causes bytes beyond the field to be
      modified.
      
      [1] From Documentation/atomic_ops.txt:
      
          Native atomic bit operations are defined to operate on objects
          aligned to the size of an "unsigned long" C data type, and are
          least of that size.  The endianness of the bits within each
          "unsigned long" are the native endianness of the cpu.
      Signed-off-by: NMichal Nazarewicz <mina86@mina86.com>
      Cc: Evgeniy Polyakov <zbr@ioremap.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>
      bb670937
  15. 07 10月, 2013 2 次提交
  16. 12 9月, 2013 1 次提交
  17. 23 8月, 2013 3 次提交
  18. 04 6月, 2013 1 次提交
  19. 13 3月, 2013 1 次提交
    • M
      w1: fix oops when w1_search is called from netlink connector · 9d1817ca
      Marcin Jurkowski 提交于
      On Sat, Mar 02, 2013 at 10:45:10AM +0100, Sven Geggus wrote:
      > This is the bad commit I found doing git bisect:
      > 04f482fa is the first bad commit
      > commit 04f482fa
      > Author: Patrick McHardy <kaber@trash.net>
      > Date:   Mon Mar 28 08:39:36 2011 +0000
      
      Good job. I was too lazy to bisect for bad commit;)
      
      Reading the code I found problematic kthread_should_stop call from netlink
      connector which causes the oops. After applying a patch, I've been testing
      owfs+w1 setup for nearly two days and it seems to work very reliable (no
      hangs, no memleaks etc).
      More detailed description and possible fix is given below:
      
      Function w1_search can be called from either kthread or netlink callback.
      While the former works fine, the latter causes oops due to kthread_should_stop
      invocation.
      
      This patch adds a check if w1_search is serving netlink command, skipping
      kthread_should_stop invocation if so.
      Signed-off-by: NMarcin Jurkowski <marcin1j@gmail.com>
      Acked-by: NEvgeniy Polyakov <zbr@ioremap.net>
      Cc: Josh Boyer <jwboyer@gmail.com>
      Tested-by: NSven Geggus <lists@fuchsschwanzdomain.de>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      Cc: stable <stable@vger.kernel.org> # 3.0+
      9d1817ca
  20. 22 11月, 2012 1 次提交
  21. 14 6月, 2012 2 次提交
    • N
      W1: split master mutex to avoid deadlocks. · b02f8bed
      NeilBrown 提交于
      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: NNeilBrown <neilb@suse.de>
      Acked-by: NEvgeniy Polyakov <zbr@ioremap.net>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      b02f8bed
    • G
      Revert "w1: introduce a slave mutex for serializing IO" · dd0aa67c
      Greg Kroah-Hartman 提交于
      This reverts commit 59d4467b.
      
      Turns out it was the wrong version, will apply the correct version after
      this.
      Reported-by: NNeilBrown <neilb@suse.de>
      Cc: Evgeniy Polyakov <zbr@ioremap.net>
      Cc: Andrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      dd0aa67c
  22. 13 6月, 2012 2 次提交
  23. 10 4月, 2012 1 次提交
  24. 03 4月, 2012 1 次提交
  25. 10 12月, 2011 1 次提交
  26. 26 8月, 2011 1 次提交
  27. 27 7月, 2011 1 次提交
  28. 27 5月, 2011 1 次提交