27 Jul, 2011

1 commit

  • This allows us to move duplicated code in
    (atomic_inc_not_zero() for now) to

    Signed-off-by: Arun Sharma
    Reviewed-by: Eric Dumazet
    Cc: Ingo Molnar
    Cc: David Miller
    Cc: Eric Dumazet
    Acked-by: Mike Frysinger
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Arun Sharma
     

27 May, 2011

1 commit

  • Reorganize so the netlink connector one wire search command will update
    the kernel list of detected slave devices. Otherwise, a newly detected
    device is unusable because unless it's in the kernel list of known devices
    any commands will result in ENODEV status.

    Signed-off-by: David Fries
    Cc: Evgeniy Polyakov
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    David Fries
     

28 Oct, 2010

1 commit

  • The search/pullup/add/remove device attributes were 0666 which would allow
    arbitrary users to affect the 1 wire bus. Change to 0664 to prevent that.

    I found this patch in the Android tree, apparently this has never been
    sent upstream so doing it now.

    Signed-off-by: Brian Swetland
    Signed-off-by: Linus Walleij
    Cc: Evgeniy Polyakov
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Brian Swetland
     

22 May, 2010

1 commit


05 Feb, 2010

1 commit


07 Jan, 2009

1 commit


17 Oct, 2008

9 commits

  • s/printk/dev_dbg/

    Signed-off-by: David Fries
    Signed-off-by: Evgeniy Polyakov
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    David Fries
     
  • Fix bug reading the id sysfs file. If less than the full 8 bytes were
    read, the next read would start at the first byte instead of continuing.
    It needed the offset added to memcpy, or the better solution was to
    replace it with the device attribute instead of bin attribute.

    Signed-off-by: David Fries
    Signed-off-by: Evgeniy Polyakov
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    David Fries
     
  • Simplified the logic in w1_slave_found by using the new
    w1_attach_slave_device function to find a slave and mark it as active or
    add the device if the crc checks.

    Signed-off-by: David Fries
    Signed-off-by: Evgeniy Polyakov
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    David Fries
     
  • sysfs entries were added to manually add and remove slave devices. This
    is useful if the automatic bus searching is disabled, and the device ids
    are already known.

    [akpm@linux-foundation.org: fix printk types]
    Signed-off-by: David Fries
    Signed-off-by: Evgeniy Polyakov
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    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: David Fries
    Cc: Evgeniy Polyakov
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    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: David Fries
    Signed-off-by: Evgeniy Polyakov
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    David Fries
     
  • Move the creation of the w1_process thread to after the device has been
    initialized. This way w1_process doesn't have to check to see if it has
    been initialized and the bus search can proceed without sleeping. That
    also eliminates two checks in the w1_process loop. The sleep now happens
    at the end of the loop not the beginning.

    Also added a comment for why the atomic_set was 2.

    Signed-off-by: David Fries
    Signed-off-by: Evgeniy Polyakov
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    David Fries
     
  • Early abort if the master driver or the hardware goes away in the middle
    of a bus search operation. The alternative is to spam the print buffer up
    to 64*64 times with read errors in the case of USB.

    Signed-off-by: David Fries
    Signed-off-by: Evgeniy Polyakov
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    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: David Fries
    Signed-off-by: Evgeniy Polyakov
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    David Fries
     

07 Feb, 2008

1 commit


15 Jan, 2008

1 commit

  • Decrement the slave counter only in ->release() callback instead of both
    in ->release() and w1 control.

    Patch is based on debug work and preliminary patch made by Henri Laakso.
    Henri noticed in debug that this counter becomes negative after w1 slave
    device is physically removed.

    Signed-off-by: Evgeniy Polyakov
    Cc: Henri Laakso
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Evgeniy Polyakov
     

13 Oct, 2007

1 commit

  • 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: Kay Sievers
    Cc: Mathieu Desnoyers
    Cc: Cornelia Huck
    Signed-off-by: Greg Kroah-Hartman

    Kay Sievers
     

25 Sep, 2007

1 commit


20 Jul, 2007

1 commit

  • Transform some calls to kmalloc/memset to a single kzalloc (or kcalloc).

    Here is a short excerpt of the semantic patch performing
    this transformation:

    @@
    type T2;
    expression x;
    identifier f,fld;
    expression E;
    expression E1,E2;
    expression e1,e2,e3,y;
    statement S;
    @@

    x =
    - kmalloc
    + kzalloc
    (E1,E2)
    ... when != \(x->fld=E;\|y=f(...,x,...);\|f(...,x,...);\|x=E;\|while(...) S\|for(e1;e2;e3) S\)
    - memset((T2)x,0,E1);

    @@
    expression E1,E2,E3;
    @@

    - kzalloc(E1 * E2,E3)
    + kcalloc(E1,E2,E3)

    [akpm@linux-foundation.org: get kcalloc args the right way around]
    Signed-off-by: Yoann Padioleau
    Cc: Richard Henderson
    Cc: Ivan Kokshaysky
    Acked-by: Russell King
    Cc: Bryan Wu
    Acked-by: Jiri Slaby
    Cc: Dave Airlie
    Acked-by: Roland Dreier
    Cc: Jiri Kosina
    Acked-by: Dmitry Torokhov
    Cc: Benjamin Herrenschmidt
    Acked-by: Mauro Carvalho Chehab
    Acked-by: Pierre Ossman
    Cc: Jeff Garzik
    Cc: "David S. Miller"
    Acked-by: Greg KH
    Cc: James Bottomley
    Cc: "Antonino A. Daplas"
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Yoann Padioleau
     

18 Jul, 2007

1 commit

  • Currently, the freezer treats all tasks as freezable, except for the kernel
    threads that explicitly set the PF_NOFREEZE flag for themselves. This
    approach is problematic, since it requires every kernel thread to either
    set PF_NOFREEZE explicitly, or call try_to_freeze(), even if it doesn't
    care for the freezing of tasks at all.

    It seems better to only require the kernel threads that want to or need to
    be frozen to use some freezer-related code and to remove any
    freezer-related code from the other (nonfreezable) kernel threads, which is
    done in this patch.

    The patch causes all kernel threads to be nonfreezable by default (ie. to
    have PF_NOFREEZE set by default) and introduces the set_freezable()
    function that should be called by the freezable kernel threads in order to
    unset PF_NOFREEZE. It also makes all of the currently freezable kernel
    threads call set_freezable(), so it shouldn't cause any (intentional)
    change of behaviour to appear. Additionally, it updates documentation to
    describe the freezing of tasks more accurately.

    [akpm@linux-foundation.org: build fixes]
    Signed-off-by: Rafael J. Wysocki
    Acked-by: Nigel Cunningham
    Cc: Pavel Machek
    Cc: Oleg Nesterov
    Cc: Gautham R Shenoy
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Rafael J. Wysocki
     

12 Jul, 2007

2 commits

  • Well, first of all, I don't want to change so many files either.

    What I do:
    Adding a new parameter "struct bin_attribute *" in the
    .read/.write methods for the sysfs binary attributes.

    In fact, only the four lines change in fs/sysfs/bin.c and
    include/linux/sysfs.h do the real work.
    But I have to update all the files that use binary attributes
    to make them compatible with the new .read and .write methods.
    I'm not sure if I missed any. :(

    Why I do this:
    For a sysfs attribute, we can get a pointer pointing to the
    struct attribute in the .show/.store method,
    while we can't do this for the binary attributes.
    I don't know why this is different, but this does make it not
    so handy to use the binary attributes as the regular ones.
    So I think this patch is reasonable. :)

    Who benefits from it:
    The patch that exposes ACPI tables in sysfs
    requires such an improvement.
    All the table binary attributes share the same .read method.
    Parameter "struct bin_attribute *" is used to get
    the table signature and instance number which are used to
    distinguish different ACPI table binary attributes.

    Without this parameter, we need to offer different .read methods
    for different ACPI table binary attributes.
    This is impossible as there are various ACPI tables on different
    platforms, and we don't know what they are until they are loaded.

    Signed-off-by: Zhang Rui
    Signed-off-by: Greg Kroah-Hartman

    Zhang Rui
     
  • sysfs is now completely out of driver/module lifetime game. After
    deletion, a sysfs node doesn't access anything outside sysfs proper,
    so there's no reason to hold onto the attribute owners. Note that
    often the wrong modules were accounted for as owners leading to
    accessing removed modules.

    This patch kills now unnecessary attribute->owner. Note that with
    this change, userland holding a sysfs node does not prevent the
    backing module from being unloaded.

    For more info regarding lifetime rule cleanup, please read the
    following message.

    http://article.gmane.org/gmane.linux.kernel/510293

    (tweaked by Greg to not delete the field just yet, to make it easier to
    merge things properly.)

    Signed-off-by: Tejun Heo
    Cc: Cornelia Huck
    Cc: Andrew Morton
    Signed-off-by: Greg Kroah-Hartman

    Tejun Heo
     

09 May, 2007

1 commit


08 Dec, 2006

1 commit


23 Jun, 2006

5 commits

  • drivers/w1/w1.c:423: warning: long long unsigned int format, __u64 arg (arg 8)

    u64 is not, never has been and never will be "unsigned long long"!

    While we're there, fix up some code layout - it looks awful in an 80-col
    display.

    Cc: Evgeniy Polyakov
    Signed-off-by: Andrew Morton
    Signed-off-by: Greg Kroah-Hartman

    Andrew Morton
     
  • Nice cleanup spotted by Adrian Bunk, which was lost due to moving to the
    completely new functionality.

    Shame-shame-shame on me.

    Signed-off-by: Evgeniy Polyakov
    Signed-off-by: Greg Kroah-Hartman

    Evgeniy Polyakov
     
  • Use mutexes instead of semaphores.
    Patch tested on x86_64 and i386 with test bus master driver.

    Signed-off-by: Evgeniy Polyakov
    Signed-off-by: Greg Kroah-Hartman

    Evgeniy Polyakov
     
  • There are three types of messages between w1 core and userspace:
    1. Events. They are generated each time new master or slave device found
    either due to automatic or requested search.
    2. Userspace commands. Includes read/write and search/alarm search comamnds.
    3. Replies to userspace commands.

    From: Evgeniy Polyakov
    Signed-off-by: Greg Kroah-Hartman

    Evgeniy Polyakov
     
  • Special file in each w1 slave device's directory called "rw" is created
    each time new slave and no appropriate w1 family is registered.
    "rw" file supports read and write operations, which allows to perform
    almost any kind of operations. Each logical operation is a transaction
    in nature, which can contain several (two or one) low-level operations.
    Let's see how one can read EEPROM context:
    1. one must write control buffer, i.e. buffer containing command byte
    and two byte address. At this step bus is reset and appropriate device
    is selected using either W1_SKIP_ROM or W1_MATCH_ROM command.
    Then provided control buffer is being written to the wire.
    2. reading. This will issue reading eeprom response.

    It is possible that between 1. and 2. w1 master thread will reset bus for
    searching and slave device will be even removed, but in this case 0xff will
    be read, since no device was selected.

    Signed-off-by: Evgeniy Polyakov
    Signed-off-by: Greg Kroah-Hartman

    Evgeniy Polyakov
     

24 Mar, 2006

4 commits


05 Jan, 2006

1 commit


15 Oct, 2005

1 commit

  • drivers/built-in.o: In function `w1_alloc_dev': undefined reference to `netlink_kernel_create'
    drivers/built-in.o: In function `w1_alloc_dev': undefined reference to `sock_release'

    Signed-off-by: Evgeniy Polyakov
    Cc: Greg KH
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Evgeniy Polyakov
     

09 Sep, 2005

4 commits