31 Jul, 2012

7 commits

  • Pull writeback updates from Wu Fengguang:
    "Use time based periods to age the writeback proportions, which can
    adapt equally well to fast/slow devices."

    Fix up trivial conflict in comment in fs/sync.c

    * tag 'writeback-proportions' of git://git.kernel.org/pub/scm/linux/kernel/git/wfg/linux:
    writeback: Fix some comment errors
    block: Convert BDI proportion calculations to flexible proportions
    lib: Fix possible deadlock in flexible proportion code
    lib: Proportions with flexible period

    Linus Torvalds
     
  • Merge Andrew's first set of patches:
    "Non-MM patches:

    - lots of misc bits

    - tree-wide have_clk() cleanups

    - quite a lot of printk tweaks. I draw your attention to "printk:
    convert the format for KERN_ to a 2 byte pattern" which
    looks a bit scary. But afaict it's solid.

    - backlight updates

    - lib/ feature work (notably the addition and use of memweight())

    - checkpatch updates

    - rtc updates

    - nilfs updates

    - fatfs updates (partial, still waiting for acks)

    - kdump, proc, fork, IPC, sysctl, taskstats, pps, etc

    - new fault-injection feature work"

    * Merge emailed patches from Andrew Morton : (128 commits)
    drivers/misc/lkdtm.c: fix missing allocation failure check
    lib/scatterlist: do not re-write gfp_flags in __sg_alloc_table()
    fault-injection: add tool to run command with failslab or fail_page_alloc
    fault-injection: add selftests for cpu and memory hotplug
    powerpc: pSeries reconfig notifier error injection module
    memory: memory notifier error injection module
    PM: PM notifier error injection module
    cpu: rewrite cpu-notifier-error-inject module
    fault-injection: notifier error injection
    c/r: fcntl: add F_GETOWNER_UIDS option
    resource: make sure requested range is included in the root range
    include/linux/aio.h: cpp->C conversions
    fs: cachefiles: add support for large files in filesystem caching
    pps: return PTR_ERR on error in device_create
    taskstats: check nla_reserve() return
    sysctl: suppress kmemleak messages
    ipc: use Kconfig options for __ARCH_WANT_[COMPAT_]IPC_PARSE_VERSION
    ipc: compat: use signed size_t types for msgsnd and msgrcv
    ipc: allow compat IPC version field parsing if !ARCH_WANT_OLD_COMPAT_IPC
    ipc: add COMPAT_SHMLBA support
    ...

    Linus Torvalds
     
  • This provides the ability to inject artifical errors to pSeries reconfig
    notifier chain callbacks. It is controlled through debugfs interface
    under /sys/kernel/debug/notifier-error-inject/pSeries-reconfig

    If the notifier call chain should be failed with some events
    notified, write the error code to "actions//error".

    Signed-off-by: Akinobu Mita
    Cc: Pavel Machek
    Cc: "Rafael J. Wysocki"
    Cc: Greg KH
    Cc: Benjamin Herrenschmidt
    Cc: Paul Mackerras
    Cc: Michael Ellerman
    Cc: Dave Jones
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Akinobu Mita
     
  • This provides the ability to inject artifical errors to memory hotplug
    notifier chain callbacks. It is controlled through debugfs interface
    under /sys/kernel/debug/notifier-error-inject/memory

    If the notifier call chain should be failed with some events notified,
    write the error code to "actions//error".

    Example: Inject memory hotplug offline error (-12 == -ENOMEM)

    # cd /sys/kernel/debug/notifier-error-inject/memory
    # echo -12 > actions/MEM_GOING_OFFLINE/error
    # echo offline > /sys/devices/system/memory/memoryXXX/state
    bash: echo: write error: Cannot allocate memory

    Signed-off-by: Akinobu Mita
    Cc: Pavel Machek
    Cc: "Rafael J. Wysocki"
    Cc: Greg KH
    Cc: Benjamin Herrenschmidt
    Cc: Paul Mackerras
    Cc: Michael Ellerman
    Cc: Dave Jones
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Akinobu Mita
     
  • This provides the ability to inject artifical errors to PM notifier chain
    callbacks. It is controlled through debugfs interface under
    /sys/kernel/debug/notifier-error-inject/pm

    Each of the files in "error" directory represents an event which can be
    failed and contains the error code. If the notifier call chain should be
    failed with some events notified, write the error code to the files.

    If the notifier call chain should be failed with some events notified,
    write the error code to "actions//error".

    Example: Inject PM suspend error (-12 = -ENOMEM)

    # cd /sys/kernel/debug/notifier-error-inject/pm
    # echo -12 > actions/PM_SUSPEND_PREPARE/error
    # echo mem > /sys/power/state
    bash: echo: write error: Cannot allocate memory

    Signed-off-by: Akinobu Mita
    Acked-by: "Rafael J. Wysocki"
    Cc: Pavel Machek
    Cc: Greg KH
    Cc: Benjamin Herrenschmidt
    Cc: Paul Mackerras
    Cc: Michael Ellerman
    Cc: Dave Jones
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Akinobu Mita
     
  • This patchset provides kernel modules that can be used to test the error
    handling of notifier call chain failures by injecting artifical errors to
    the following notifier chain callbacks.

    * CPU notifier
    * PM notifier
    * memory hotplug notifier
    * powerpc pSeries reconfig notifier

    Example: Inject CPU offline error (-1 == -EPERM)

    # cd /sys/kernel/debug/notifier-error-inject/cpu
    # echo -1 > actions/CPU_DOWN_PREPARE/error
    # echo 0 > /sys/devices/system/cpu/cpu1/online
    bash: echo: write error: Operation not permitted

    The patchset also adds cpu and memory hotplug tests to
    tools/testing/selftests These tests first do simple online and offline
    test and then do fault injection tests if notifier error injection
    module is available.

    This patch:

    The notifier error injection provides the ability to inject artifical
    errors to specified notifier chain callbacks. It is useful to test the
    error handling of notifier call chain failures.

    This adds common basic functions to define which type of events can be
    fail and to initialize the debugfs interface to control what error code
    should be returned and which event should be failed.

    Signed-off-by: Akinobu Mita
    Cc: Pavel Machek
    Cc: "Rafael J. Wysocki"
    Cc: Greg KH
    Cc: Benjamin Herrenschmidt
    Cc: Paul Mackerras
    Cc: Michael Ellerman
    Cc: Dave Jones
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Akinobu Mita
     
  • memweight() is the function that counts the total number of bits set in
    memory area. Unlike bitmap_weight(), memweight() takes pointer and size
    in bytes to specify a memory area which does not need to be aligned to
    long-word boundary.

    [akpm@linux-foundation.org: rename `w' to `ret']
    Signed-off-by: Akinobu Mita
    Cc: Anders Larsen
    Cc: Alasdair Kergon
    Cc: Laurent Pinchart
    Cc: Mark Fasheh
    Cc: Joel Becker
    Cc: Jan Kara
    Cc: Andreas Dilger
    Cc: "Theodore Ts'o"
    Cc: Matthew Wilcox
    Cc: Mauro Carvalho Chehab
    Cc: Tony Luck
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Akinobu Mita
     

23 Jul, 2012

1 commit

  • libfdt is part of the device tree support in scripts/dtc/libfdt. For
    some platforms that use the Device Tree, we want to be able to edit
    the flattened device tree form.

    We don't want to burden kernel builds that do not require it, so we
    gate compilation of libfdt files with CONFIG_LIBFDT. So if it is
    needed, you need to do this in your Kconfig:

    select LIBFDT

    And in the Makefile of the code using libfdt something like:

    ccflags-y := -I$(src)/../../../scripts/dtc/libfdt

    Signed-off-by: David Daney
    Cc: linux-mips@linux-mips.org
    Cc: devicetree-discuss@lists.ozlabs.org
    Cc: Grant Likely
    Cc: linux-kernel@vger.kernel.org
    Acked-by: Rob Herring
    Signed-off-by: Ralf Baechle

    David Daney
     

09 Jun, 2012

1 commit

  • Implement code computing proportions of events of different type (like code in
    lib/proportions.c) but allowing periods to have different lengths. This allows
    us to have aging periods of fixed wallclock time which gives better proportion
    estimates given the hugely varying throughput of different devices - previous
    measuring of aging period by number of events has the problem that a reasonable
    period length for a system with low-end USB stick is not a reasonable period
    length for a system with high-end storage array resulting either in too slow
    proportion updates or too fluctuating proportion updates.

    Acked-by: Peter Zijlstra
    Signed-off-by: Jan Kara
    Signed-off-by: Fengguang Wu

    Jan Kara
     

27 May, 2012

3 commits

  • This makes actually live up to its promise of
    allowing architectures to help tune the string functions that do their
    work a word at a time.

    David had already taken the x86 strncpy_from_user() function, modified
    it to work on sparc, and then done the extra work to make it generically
    useful. This then expands on that work by making x86 use that generic
    version, completing the circle.

    But more importantly, it fixes up the word-at-a-time interfaces so that
    it's now easy to also support things like strnlen_user(), and pretty
    much most random string functions.

    David reports that it all works fine on sparc, and Jonas Bonn reported
    that an earlier version of this worked on OpenRISC too. It's pretty
    easy for architectures to add support for this and just replace their
    private versions with the generic code.

    * generic-string-functions:
    sparc: use the new generic strnlen_user() function
    x86: use the new generic strnlen_user() function
    lib: add generic strnlen_user() function
    word-at-a-time: make the interfaces truly generic
    x86: use generic strncpy_from_user routine

    Linus Torvalds
     
  • Pull arm-soc stmp-dev library code from Olof Johansson:
    "A number of devices are using a common register layout, this adds
    support code for it in lib/stmp_device.c so we do not need to
    duplicate it in each driver."

    Fix up trivial conflicts in drivers/i2c/busses/i2c-mxs.c and
    lib/Makefile

    * tag 'stmp-dev' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc:
    i2c: mxs: use global reset function
    lib: add support for stmp-style devices

    Linus Torvalds
     
  • This adds a new generic optimized strnlen_user() function that uses the
    infrastructure to portably do efficient string
    handling.

    In many ways, strnlen is much simpler than strncpy, and in particular we
    can always pre-align the words we load from memory. That means that all
    the worries about alignment etc are a non-issue, so this one can easily
    be used on any architecture. You obviously do have to do the
    appropriate word-at-a-time.h macros.

    Signed-off-by: Linus Torvalds

    Linus Torvalds
     

25 May, 2012

2 commits

  • Pull sparc changes from David S. Miller:
    "This has the generic strncpy_from_user() implementation architectures
    can now use, which we've been developing on linux-arch over the past
    few days.

    For good measure I ran both a 32-bit and a 64-bit glibc testsuite run,
    and the latter of which pointed out an adjustment I needed to make to
    sparc's user_addr_max() definition. Linus, you were right, STACK_TOP
    was not the right thing to use, even on sparc itself :-)

    From Sam Ravnborg, we have a conversion of sparc32 over to the common
    alloc_thread_info_node(), since the aspect which originally blocked
    our doing so (sun4c) has been removed."

    Fix up trivial arch/sparc/Kconfig and lib/Makefile conflicts.

    * git://git.kernel.org/pub/scm/linux/kernel/git/davem/sparc:
    sparc: Fix user_addr_max() definition.
    lib: Sparc's strncpy_from_user is generic enough, move under lib/
    kernel: Move REPEAT_BYTE definition into linux/kernel.h
    sparc: Increase portability of strncpy_from_user() implementation.
    sparc: Optimize strncpy_from_user() zero byte search.
    sparc: Add full proper error handling to strncpy_from_user().
    sparc32: use the common implementation of alloc_thread_info_node()

    Linus Torvalds
     
  • To use this, an architecture simply needs to:

    1) Provide a user_addr_max() implementation via asm/uaccess.h

    2) Add "select GENERIC_STRNCPY_FROM_USER" to their arch Kcnfig

    3) Remove the existing strncpy_from_user() implementation and symbol
    exports their architecture had.

    Signed-off-by: David S. Miller
    Acked-by: David Howells

    David S. Miller
     

02 May, 2012

1 commit

  • add LPDDR2 data from the JEDEC spec JESD209-2. The data
    includes:

    1. Addressing information for LPDDR2 memories of different
    densities and types(S2/S4)
    2. AC timing data.

    This data will useful for memory controller device drivers.
    Right now this is used by the TI EMIF SDRAM controller
    driver.

    Signed-off-by: Aneesh V
    Reviewed-by: Santosh Shilimkar
    Reviewed-by: Benoit Cousson
    [santosh.shilimkar@ti.com: Moved to drivers/memory from drivers/misc]
    Signed-off-by: Santosh Shilimkar
    Tested-by: Lokesh Vutla
    Signed-off-by: Greg Kroah-Hartman

    Aneesh V
     

21 Apr, 2012

1 commit

  • MX23/28 use IP cores which follow a register layout I have first seen on
    STMP3xxx SoCs. In this layout, every register actually has four u32:

    1.) to store a value directly
    2.) a SET register where every 1-bit sets the corresponding bit,
    others are unaffected
    3.) same with a CLR register
    4.) same with a TOG (toggle) register

    Also, the 2 MSBs in register 0 are always the same and can be used to reset
    the IP core.

    All this is strictly speaking not mach-specific (but IP core specific) and,
    thus, doesn't need to be in mach-mxs/include. At least mx6 also uses IP cores
    following this stmp-style. So:

    Introduce a stmp-style device, put the code and defines for that in a public
    place (lib/), and let drivers for stmp-style devices select that code.
    To avoid regressions and ease reviewing, the actual code is simply copied from
    mach-mxs. It definately wants updates, but those need a seperate patch series.

    Voila, mach dependency gone, reusable code introduced. Note that I didn't
    remove the duplicated code from mach-mxs yet, first the drivers have to be
    converted.

    Signed-off-by: Wolfram Sang
    Acked-by: Shawn Guo
    Acked-by: Dong Aisheng

    Wolfram Sang
     

02 Feb, 2012

1 commit

  • Both sparc 32-bit's software divide assembler and MPILIB provide
    clz_tab[] with identical contents.

    Break it out into a seperate object file and select it when
    SPARC32 or MPILIB is set.

    Reported-by: Al Viro
    Signed-off-by: David S. Miller
    Signed-off-by: James Morris

    David Miller
     

18 Jan, 2012

1 commit


11 Jan, 2012

2 commits

  • * 'for-linus' of git://selinuxproject.org/~jmorris/linux-security: (32 commits)
    ima: fix invalid memory reference
    ima: free duplicate measurement memory
    security: update security_file_mmap() docs
    selinux: Casting (void *) value returned by kmalloc is useless
    apparmor: fix module parameter handling
    Security: tomoyo: add .gitignore file
    tomoyo: add missing rcu_dereference()
    apparmor: add missing rcu_dereference()
    evm: prevent racing during tfm allocation
    evm: key must be set once during initialization
    mpi/mpi-mpow: NULL dereference on allocation failure
    digsig: build dependency fix
    KEYS: Give key types their own lockdep class for key->sem
    TPM: fix transmit_cmd error logic
    TPM: NSC and TIS drivers X86 dependency fix
    TPM: Export wait_for_stat for other vendor specific drivers
    TPM: Use vendor specific function for status probe
    tpm_tis: add delay after aborting command
    tpm_tis: Check return code from getting timeouts/durations
    tpm: Introduce function to poll for result of self test
    ...

    Fix up trivial conflict in lib/Makefile due to addition of CONFIG_MPI
    and SIGSIG next to CONFIG_DQL addition.

    Linus Torvalds
     
  • lib: use generic pci_iomap on all architectures

    Many architectures don't want to pull in iomap.c,
    so they ended up duplicating pci_iomap from that file.
    That function isn't trivial, and we are going to modify it
    https://lkml.org/lkml/2011/11/14/183
    so the duplication hurts.

    This reduces the scope of the problem significantly,
    by moving pci_iomap to a separate file and
    referencing that from all architectures.

    * tag 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mst/vhost:
    alpha: drop pci_iomap/pci_iounmap from pci-noop.c
    mn10300: switch to GENERIC_PCI_IOMAP
    mn10300: add missing __iomap markers
    frv: switch to GENERIC_PCI_IOMAP
    tile: switch to GENERIC_PCI_IOMAP
    tile: don't panic on iomap
    sparc: switch to GENERIC_PCI_IOMAP
    sh: switch to GENERIC_PCI_IOMAP
    powerpc: switch to GENERIC_PCI_IOMAP
    parisc: switch to GENERIC_PCI_IOMAP
    mips: switch to GENERIC_PCI_IOMAP
    microblaze: switch to GENERIC_PCI_IOMAP
    arm: switch to GENERIC_PCI_IOMAP
    alpha: switch to GENERIC_PCI_IOMAP
    lib: add GENERIC_PCI_IOMAP
    lib: move GENERIC_IOMAP to lib/Kconfig

    Fix up trivial conflicts due to changes nearby in arch/{m68k,score}/Kconfig

    Linus Torvalds
     

08 Jan, 2012

1 commit

  • * 'driver-core-next' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core: (73 commits)
    arm: fix up some samsung merge sysdev conversion problems
    firmware: Fix an oops on reading fw_priv->fw in sysfs loading file
    Drivers:hv: Fix a bug in vmbus_driver_unregister()
    driver core: remove __must_check from device_create_file
    debugfs: add missing #ifdef HAS_IOMEM
    arm: time.h: remove device.h #include
    driver-core: remove sysdev.h usage.
    clockevents: remove sysdev.h
    arm: convert sysdev_class to a regular subsystem
    arm: leds: convert sysdev_class to a regular subsystem
    kobject: remove kset_find_obj_hinted()
    m86k: gpio - convert sysdev_class to a regular subsystem
    mips: txx9_sram - convert sysdev_class to a regular subsystem
    mips: 7segled - convert sysdev_class to a regular subsystem
    sh: dma - convert sysdev_class to a regular subsystem
    sh: intc - convert sysdev_class to a regular subsystem
    power: suspend - convert sysdev_class to a regular subsystem
    power: qe_ic - convert sysdev_class to a regular subsystem
    power: cmm - convert sysdev_class to a regular subsystem
    s390: time - convert sysdev_class to a regular subsystem
    ...

    Fix up conflicts with 'struct sysdev' removal from various platform
    drivers that got changed:
    - arch/arm/mach-exynos/cpu.c
    - arch/arm/mach-exynos/irq-eint.c
    - arch/arm/mach-s3c64xx/common.c
    - arch/arm/mach-s3c64xx/cpu.c
    - arch/arm/mach-s5p64x0/cpu.c
    - arch/arm/mach-s5pv210/common.c
    - arch/arm/plat-samsung/include/plat/cpu.h
    - arch/powerpc/kernel/sysfs.c
    and fix up cpu_is_hotpluggable() as per Greg in include/linux/cpu.h

    Linus Torvalds
     

14 Dec, 2011

1 commit

  • These are tiny functions, there's no point in having them out-of-line.

    Cc: Alexey Dobriyan
    Cc: Eric Dumazet
    Cc: Ingo Molnar
    Signed-off-by: Peter Zijlstra
    Link: http://lkml.kernel.org/n/tip-8eccvi2ur2fzgi00xdjlbf5z@git.kernel.org
    Signed-off-by: Greg Kroah-Hartman

    Peter Zijlstra
     

30 Nov, 2011

1 commit

  • Implementation of dynamic queue limits (dql). This is a libary which
    allows a queue limit to be dynamically managed. The goal of dql is
    to set the queue limit, number of objects to the queue, to be minimized
    without allowing the queue to be starved.

    dql would be used with a queue which has these properties:

    1) Objects are queued up to some limit which can be expressed as a
    count of objects.
    2) Periodically a completion process executes which retires consumed
    objects.
    3) Starvation occurs when limit has been reached, all queued data has
    actually been consumed but completion processing has not yet run,
    so queuing new data is blocked.
    4) Minimizing the amount of queued data is desirable.

    A canonical example of such a queue would be a NIC HW transmit queue.

    The queue limit is dynamic, it will increase or decrease over time
    depending on the workload. The queue limit is recalculated each time
    completion processing is done. Increases occur when the queue is
    starved and can exponentially increase over successive intervals.
    Decreases occur when more data is being maintained in the queue than
    needed to prevent starvation. The number of extra objects, or "slack",
    is measured over successive intervals, and to avoid hysteresis the
    limit is only reduced by the miminum slack seen over a configurable
    time period.

    dql API provides routines to manage the queue:
    - dql_init is called to intialize the dql structure
    - dql_reset is called to reset dynamic values
    - dql_queued called when objects are being enqueued
    - dql_avail returns availability in the queue
    - dql_completed is called when objects have be consumed in the queue

    Configuration consists of:
    - max_limit, maximum limit
    - min_limit, minimum limit
    - slack_hold_time, time to measure instances of slack before reducing
    queue limit

    Signed-off-by: Tom Herbert
    Acked-by: Eric Dumazet
    Signed-off-by: David S. Miller

    Tom Herbert
     

29 Nov, 2011

1 commit


09 Nov, 2011

2 commits

  • This patch implements RSA digital signature verification using GnuPG library.

    The format of the signature and the public key is defined by their respective
    headers. The signature header contains version information, algorithm,
    and keyid, which was used to generate the signature.
    The key header contains version and algorythim type.
    The payload of the signature and the key are multi-precision integers.

    The signing and key management utilities evm-utils provide functionality
    to generate signatures and load keys into the kernel keyring.
    When the key is added to the kernel keyring, the keyid defines the name
    of the key.

    Signed-off-by: Dmitry Kasatkin
    Acked-by: Mimi Zohar

    Dmitry Kasatkin
     
  • Adds the multi-precision-integer maths library which was originally taken
    from GnuPG and ported to the kernel by (among others) David Howells.
    This version is taken from Fedora kernel 2.6.32-71.14.1.el6.
    The difference is that checkpatch reported errors and warnings have been fixed.

    This library is used to implemenet RSA digital signature verification
    used in IMA/EVM integrity protection subsystem.

    Due to patch size limitation, the patch is divided into 4 parts.

    Signed-off-by: Dmitry Kasatkin

    Dmitry Kasatkin
     

04 Oct, 2011

1 commit

  • Because llist code will be used in performance critical scheduler
    code path, make llist_add() and llist_del_all() inline to avoid
    function calling overhead and related 'glue' overhead.

    Signed-off-by: Huang Ying
    Acked-by: Mathieu Desnoyers
    Signed-off-by: Peter Zijlstra
    Link: http://lkml.kernel.org/r/1315461646-1379-2-git-send-email-ying.huang@intel.com
    Signed-off-by: Ingo Molnar

    Huang Ying
     

31 Aug, 2011

1 commit

  • If there are no builtin users of find_next_bit_le() and
    find_next_zero_bit_le(), these functions are not present in the kernel
    image, causing m68k allmodconfig to fail with:

    ERROR: "find_next_zero_bit_le" [fs/ufs/ufs.ko] undefined!
    ERROR: "find_next_bit_le" [fs/udf/udf.ko] undefined!
    ...

    This started to happen after commit 171d809df189 ("m68k: merge mmu and
    non-mmu bitops.h"), as m68k had its own inline versions before.

    commit 63e424c84429 ("arch: remove CONFIG_GENERIC_FIND_{NEXT_BIT,
    BIT_LE, LAST_BIT}") added find_last_bit.o to obj-y (so it's always
    included), but find_next_bit.o to lib-y (so it gets removed by the
    linker if there are no builtin users).

    Signed-off-by: Geert Uytterhoeven
    Cc: Akinobu Mita
    Cc: Greg Ungerer
    Cc: Andrew Morton
    Signed-off-by: Linus Torvalds

    Geert Uytterhoeven
     

07 Aug, 2011

1 commit


03 Aug, 2011

2 commits

  • Some trivial conflicts due to other various merges
    adding to the end of common lists sooner than this one.

    arch/ia64/Kconfig
    arch/powerpc/Kconfig
    arch/x86/Kconfig
    lib/Kconfig
    lib/Makefile

    Signed-off-by: Len Brown

    Len Brown
     
  • Cmpxchg is used to implement adding new entry to the list, deleting
    all entries from the list, deleting first entry of the list and some
    other operations.

    Because this is a single list, so the tail can not be accessed in O(1).

    If there are multiple producers and multiple consumers, llist_add can
    be used in producers and llist_del_all can be used in consumers. They
    can work simultaneously without lock. But llist_del_first can not be
    used here. Because llist_del_first depends on list->first->next does
    not changed if list->first is not changed during its operation, but
    llist_del_first, llist_add, llist_add (or llist_del_all, llist_add,
    llist_add) sequence in another consumer may violate that.

    If there are multiple producers and one consumer, llist_add can be
    used in producers and llist_del_all or llist_del_first can be used in
    the consumer.

    This can be summarized as follow:

    | add | del_first | del_all
    add | - | - | -
    del_first | | L | L
    del_all | | | -

    Where "-" stands for no lock is needed, while "L" stands for lock is
    needed.

    The list entries deleted via llist_del_all can be traversed with
    traversing function such as llist_for_each etc. But the list entries
    can not be traversed safely before deleted from the list. The order
    of deleted entries is from the newest to the oldest added one. If you
    want to traverse from the oldest to the newest, you must reverse the
    order by yourself before traversing.

    The basic atomic operation of this list is cmpxchg on long. On
    architectures that don't have NMI-safe cmpxchg implementation, the
    list can NOT be used in NMI handler. So code uses the list in NMI
    handler should depend on CONFIG_ARCH_HAVE_NMI_SAFE_CMPXCHG.

    Signed-off-by: Huang Ying
    Reviewed-by: Andi Kleen
    Reviewed-by: Mathieu Desnoyers
    Cc: Andrew Morton
    Signed-off-by: Len Brown

    Huang Ying
     

09 Jun, 2011

1 commit


04 Jun, 2011

2 commits

  • The brcm80211 driver in the staging tree has a cordic function to
    determine cosine and sine for a given angle. Feedback received from
    John Linville suggested that these kind of functions should be made
    available to others as a library function in the kernel tree. The
    b43 driver also has a cordic angle calculation implemented.

    Cc: linux-kernel@vger.kernel.org
    Cc: linux-wireless@vger.kernel.org
    Cc: "John W. Linville"
    Cc: Greg Kroah-Hartman
    Cc: Dan Carpenter
    Cc: Randy Dunlap
    Cc: Larry Finger
    Reviewed-by: Roland Vossen
    Reviewed-by: Henry Ptasinski
    Reviewed-by: Franky (Zhenhui) Lin
    Signed-off-by: Arend van Spriel
    Signed-off-by: John W. Linville

    Arend van Spriel
     
  • The brcm80211 driver in staging tree uses a crc8 function. Based on
    feedback from John Linville to move this to lib directory, the linux
    source has been searched. Although there is currently only one other
    kernel driver using this algorithm (ie. drivers/ssb) we are providing
    this as a library function for others to use.

    Cc: linux-kernel@vger.kernel.org
    Cc: linux-wireless@vger.kernel.org
    Cc: Dan Carpenter
    Cc: George Spelvin
    Cc: Randy Dunlap
    Reviewed-by: Henry Ptasinski
    Reviewed-by: Roland Vossen
    Reviewed-by: "Franky (Zhenhui) Lin"
    Signed-off-by: Arend van Spriel
    Signed-off-by: John W. Linville

    Arend van Spriel
     

27 May, 2011

1 commit

  • By the previous style change, CONFIG_GENERIC_FIND_NEXT_BIT,
    CONFIG_GENERIC_FIND_BIT_LE, and CONFIG_GENERIC_FIND_LAST_BIT are not used
    to test for existence of find bitops anymore.

    Signed-off-by: Akinobu Mita
    Acked-by: Greg Ungerer
    Cc: Arnd Bergmann
    Cc: Russell King
    Cc: Martin Schwidefsky
    Cc: Heiko Carstens
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Akinobu Mita
     

19 May, 2011

1 commit

  • There a large number hand-coded binary searches in the kernel (run
    "git grep search | grep binary" to find many of them). Since in my
    experience, hand-coding binary searches can be error-prone, it seems
    worth cleaning this up by providing a generic binary search function.

    This generic binary search implementation comes from Ksplice. It has
    the same basic API as the C library bsearch() function. Ksplice uses
    it in half a dozen places with 4 different comparison functions, and I
    think our code is substantially cleaner because of this.

    Signed-off-by: Tim Abbott
    Extra-bikeshedding-by: Alan Jenkins
    Extra-bikeshedding-by: André Goddard Rosa
    Extra-bikeshedding-by: Rusty Russell
    Signed-off-by: Rusty Russell
    Signed-off-by: Alessio Igor Bogani
    Signed-off-by: Rusty Russell

    Tim Abbott
     

25 Mar, 2011

1 commit

  • …linux-2.6 into for-linus-1

    * 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6: (9356 commits)
    [media] rc: update for bitop name changes
    fs: simplify iget & friends
    fs: pull inode->i_lock up out of writeback_single_inode
    fs: rename inode_lock to inode_hash_lock
    fs: move i_wb_list out from under inode_lock
    fs: move i_sb_list out from under inode_lock
    fs: remove inode_lock from iput_final and prune_icache
    fs: Lock the inode LRU list separately
    fs: factor inode disposal
    fs: protect inode->i_state with inode->i_lock
    lib, arch: add filter argument to show_mem and fix private implementations
    SLUB: Write to per cpu data when allocating it
    slub: Fix debugobjects with lockless fastpath
    autofs4: Do not potentially dereference NULL pointer returned by fget() in autofs_dev_ioctl_setpipefd()
    autofs4 - remove autofs4_lock
    autofs4 - fix d_manage() return on rcu-walk
    autofs4 - fix autofs4_expire_indirect() traversal
    autofs4 - fix dentry leak in autofs4_expire_direct()
    autofs4 - reinstate last used update on access
    vfs - check non-mountpoint dentry might block in __follow_mount_rcu()
    ...

    NOTE!

    This merge commit was created to fix compilation error. The block
    tree was merged upstream and removed the 'elv_queue_empty()'
    function which the new 'mtdswap' driver is using. So a simple
    merge of the mtd tree with upstream does not compile. And the
    mtd tree has already be published, so re-basing it is not an option.

    To fix this unfortunate situation, I had to merge upstream into the
    mtd-2.6.git tree without committing, put the fixup patch on top of
    this, and then commit this. The result is that we do not have commits
    which do not compile.

    In other words, this merge commit "merges" 3 things: the MTD tree, the
    upstream tree, and the fixup patch.

    Artem Bityutskiy
     

24 Mar, 2011

1 commit

  • This introduces CONFIG_GENERIC_FIND_BIT_LE to tell whether to use generic
    implementation of find_*_bit_le() in lib/find_next_bit.c or not.

    For now we select CONFIG_GENERIC_FIND_BIT_LE for all architectures which
    enable CONFIG_GENERIC_FIND_NEXT_BIT.

    But m68knommu wants to define own faster find_next_zero_bit_le() and
    continues using generic find_next_{,zero_}bit().
    (CONFIG_GENERIC_FIND_NEXT_BIT and !CONFIG_GENERIC_FIND_BIT_LE)

    Signed-off-by: Akinobu Mita
    Cc: Greg Ungerer
    Cc: Arnd Bergmann
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Akinobu Mita
     

23 Mar, 2011

1 commit

  • 1. simple_strto*() do not contain overflow checks and crufty,
    libc way to indicate failure.
    2. strict_strto*() also do not have overflow checks but the name and
    comments pretend they do.
    3. Both families have only "long long" and "long" variants,
    but users want strtou8()
    4. Both "simple" and "strict" prefixes are wrong:
    Simple doesn't exactly say what's so simple, strict should not exist
    because conversion should be strict by default.

    The solution is to use "k" prefix and add convertors for more types.
    Enter
    kstrtoull()
    kstrtoll()
    kstrtoul()
    kstrtol()
    kstrtouint()
    kstrtoint()

    kstrtou64()
    kstrtos64()
    kstrtou32()
    kstrtos32()
    kstrtou16()
    kstrtos16()
    kstrtou8()
    kstrtos8()

    Include runtime testsuite (somewhat incomplete) as well.

    strict_strto*() become deprecated, stubbed to kstrto*() and
    eventually will be removed altogether.

    Use kstrto*() in code today!

    Note: on some archs _kstrtoul() and _kstrtol() are left in tree, even if
    they'll be unused at runtime. This is temporarily solution,
    because I don't want to hardcode list of archs where these
    functions aren't needed. Current solution with sizeof() and
    __alignof__ at least always works.

    Signed-off-by: Alexey Dobriyan
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Alexey Dobriyan
     

17 Mar, 2011

1 commit