1. 13 11月, 2008 1 次提交
  2. 17 10月, 2008 4 次提交
    • D
      W1: w1_therm fix user buffer overflow and cat · 347ba8a5
      David Fries 提交于
      Fixed data reading bug by replacing binary attribute with device one.
      
      Switching the sysfs read from bin_attribute to device_attribute.  The data
      is far under PAGE_SIZE so the binary interface isn't required.  As the
      device_attribute interface will make one call to w1_therm_read per file
      open and buffer, the result is, the following problems go away.
      
      buffer overflow:
      	Execute a short read on w1_slave and w1_therm_read_bin would still
      	return the full string size worth of data clobbering the user space
      	buffer when it returned.  Switching to device_attribute avoids the
      	buffer overflow problems.  With the snprintf formatted output dealing
      	with short reads without doing a conversion per read would have
      	been difficult.
      bad behavior:
      	`cat w1_slave` would cause two temperature conversions to take place.
      	Previously the code assumed W1_SLAVE_DATA_SIZE would be returned with
      	each read.  It would not return 0 unless the offset was less
      	than W1_SLAVE_DATA_SIZE.  The result was the first read did a
      	temperature conversion, filled the buffer and returned, the
      	offset in the second read would be less than
      	W1_SLAVE_DATA_SIZE and also fill the buffer and return, the
      	third read would finnally have a big enough offset to return 0
      	and cause cat to stop.  Now w1_therm_read will be called at
      	most once per open.
      Signed-off-by: NDavid Fries <david@fries.net>
      Signed-off-by: NEvgeniy Polyakov <johnpol@2ka.mipt.ru>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      347ba8a5
    • D
      W1: feature, enable hardware strong pullup · 6a158c0d
      David Fries 提交于
      Add a strong pullup option to the w1 system.  This supplies extra power
      for parasite powered devices.  There is a w1_master_pullup sysfs entry and
      enable_pullup module parameter to enable or disable the strong pullup.
      
      The one wire bus requires at a minimum one wire and ground.  The common
      wire is used for sending and receiving data as well as supplying power to
      devices that are parasite powered of which temperature sensors can be one
      example.  The bus must be idle and left high while a temperature
      conversion is in progress, in addition the normal pullup resister on
      larger networks or even higher temperatures might not supply enough power.
       The pullup resister can't provide too much pullup current, because
      devices need to pull the bus down to write a value.  This enables the
      strong pullup for supported hardware, which can supply more current when
      requested.  Unsupported hardware will just delay with the bus high.
      
      The hardware USB 2490 one wire bus master has a bit on some commands which
      will enable the strong pullup as soon as the command finishes executing.
      To use strong pullup, call the new w1_next_pullup function to register the
      duration.  The next write command will call set_pullup before sending the
      data, and reset the duration to zero once it returns.
      
      Switched from simple_strtol to strict_strtol.
      Signed-off-by: NDavid Fries <david@fries.net>
      Cc: Evgeniy Polyakov <johnpol@2ka.mipt.ru>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      6a158c0d
    • D
      W1: w1_process, block or sleep · 3c52e4e6
      David Fries 提交于
      The w1_process thread's sleeping and termination has been modified.
      msleep_interruptible was replaced by schedule_timeout and schedule to
      allow for kthread_stop and wake_up_process to interrupt the sleep and the
      unbounded sleeping when a bus search is disabled.  The W1_MASTER_NEED_EXIT
      and flags variable were removed as they were redundant with
      kthread_should_stop and kthread_stop.  If w1_process is sleeping,
      requesting a search will immediately wake it up rather than waiting for
      the end of msleep_interruptible previously.
      Signed-off-by: NDavid Fries <david@fries.net>
      Signed-off-by: NEvgeniy Polyakov <johnpol@2ka.mipt.ru>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      3c52e4e6
    • D
      W1: fix deadlocks and remove w1_control_thread · c30c9b15
      David Fries 提交于
      w1_control_thread was removed which would wake up every second and process
      newly registered family codes and complete some final cleanup for a
      removed master.  Those routines were moved to the threads that were
      previously requesting those operations.  A new function
      w1_reconnect_slaves takes care of reconnecting existing slave devices when
      a new family code is registered or removed.  The removal case was missing
      and would cause a deadlock waiting for the family code reference count to
      decrease, which will now happen.  A problem with registering a family code
      was fixed.  A slave device would be unattached if it wasn't yet claimed,
      then attached at the end of the list, two unclaimed slaves would cause an
      infinite loop.
      
      The struct w1_bus_master.search now takes a pointer to the struct
      w1_master device to avoid searching for it, which would have caused a
      lock ordering deadlock with the removal of w1_control_thread.
      Signed-off-by: NDavid Fries <david@fries.net>
      Signed-off-by: NEvgeniy Polyakov <johnpol@2ka.mipt.ru>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      c30c9b15
  3. 23 6月, 2006 6 次提交
  4. 24 3月, 2006 3 次提交
  5. 09 9月, 2005 4 次提交
  6. 22 6月, 2005 5 次提交
  7. 17 4月, 2005 1 次提交
    • L
      Linux-2.6.12-rc2 · 1da177e4
      Linus Torvalds 提交于
      Initial git repository build. I'm not bothering with the full history,
      even though we have it. We can create a separate "historical" git
      archive of that later if we want to, and in the meantime it's about
      3.2GB when imported into git - space that would just make the early
      git days unnecessarily complicated, when we don't have a lot of good
      infrastructure for it.
      
      Let it rip!
      1da177e4