28 May, 2010

17 commits

  • Now that nobody ever changes subprocess_info->cred we can kill this member
    and related code. ____call_usermodehelper() always runs in the context of
    freshly forked kernel thread, it has the proper ->cred copied from its
    parent kthread, keventd.

    Signed-off-by: Oleg Nesterov
    Acked-by: Neil Horman
    Acked-by: David Howells
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Oleg Nesterov
     
  • call_usermodehelper_keys() uses call_usermodehelper_setkeys() to change
    subprocess_info->cred in advance. Now that we have info->init() we can
    change this code to set tgcred->session_keyring in context of execing
    kernel thread.

    Note: since currently call_usermodehelper_keys() is never called with
    UMH_NO_WAIT, call_usermodehelper_keys()->key_get() and umh_keys_cleanup()
    are not really needed, we could rely on install_session_keyring_to_cred()
    which does key_get() on success.

    Signed-off-by: Oleg Nesterov
    Acked-by: Neil Horman
    Acked-by: David Howells
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Oleg Nesterov
     
  • The first patch in this series introduced an init function to the
    call_usermodehelper api so that processes could be customized by caller.
    This patch takes advantage of that fact, by customizing the helper in
    do_coredump to create the pipe and set its core limit to one (for our
    recusrsion check). This lets us clean up the previous uglyness in the
    usermodehelper internals and factor call_usermodehelper out entirely.
    While I'm at it, we can also modify the helper setup to look for a core
    limit value of 1 rather than zero for our recursion check

    Signed-off-by: Neil Horman
    Reviewed-by: Oleg Nesterov
    Cc: Andi Kleen
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Neil Horman
     
  • About 6 months ago, I made a set of changes to how the core-dump-to-a-pipe
    feature in the kernel works. We had reports of several races, including
    some reports of apps bypassing our recursion check so that a process that
    was forked as part of a core_pattern setup could infinitely crash and
    refork until the system crashed.

    We fixed those by improving our recursion checks. The new check basically
    refuses to fork a process if its core limit is zero, which works well.

    Unfortunately, I've been getting grief from maintainer of user space
    programs that are inserted as the forked process of core_pattern. They
    contend that in order for their programs (such as abrt and apport) to
    work, all the running processes in a system must have their core limits
    set to a non-zero value, to which I say 'yes'. I did this by design, and
    think thats the right way to do things.

    But I've been asked to ease this burden on user space enough times that I
    thought I would take a look at it. The first suggestion was to make the
    recursion check fail on a non-zero 'special' number, like one. That way
    the core collector process could set its core size ulimit to 1, and enable
    the kernel's recursion detection. This isn't a bad idea on the surface,
    but I don't like it since its opt-in, in that if a program like abrt or
    apport has a bug and fails to set such a core limit, we're left with a
    recursively crashing system again.

    So I've come up with this. What I've done is modify the
    call_usermodehelper api such that an extra parameter is added, a function
    pointer which will be called by the user helper task, after it forks, but
    before it exec's the required process. This will give the caller the
    opportunity to get a call back in the processes context, allowing it to do
    whatever it needs to to the process in the kernel prior to exec-ing the
    user space code. In the case of do_coredump, this callback is ues to set
    the core ulimit of the helper process to 1. This elimnates the opt-in
    problem that I had above, as it allows the ulimit for core sizes to be set
    to the value of 1, which is what the recursion check looks for in
    do_coredump.

    This patch:

    Create new function call_usermodehelper_fns() and allow it to assign both
    an init and cleanup function, as we'll as arbitrary data.

    The init function is called from the context of the forked process and
    allows for customization of the helper process prior to calling exec. Its
    return code gates the continuation of the process, or causes its exit.
    Also add an arbitrary data pointer to the subprocess_info struct allowing
    for data to be passed from the caller to the new process, and the
    subsequent cleanup process

    Also, use this patch to cleanup the cleanup function. It currently takes
    an argp and envp pointer for freeing, which is ugly. Lets instead just
    make the subprocess_info structure public, and pass that to the cleanup
    and init routines

    Signed-off-by: Neil Horman
    Reviewed-by: Oleg Nesterov
    Cc: Andi Kleen
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Neil Horman
     
  • Some workloads that create a large number of small files tend to assign
    too many pages to node 0 (multi-node systems). Part of the reason is that
    the rotor (in cpuset_mem_spread_node()) used to assign nodes starts at
    node 0 for newly created tasks.

    This patch changes the rotor to be initialized to a random node number of
    the cpuset.

    [akpm@linux-foundation.org: fix layout]
    [Lee.Schermerhorn@hp.com: Define stub numa_random() for !NUMA configuration]
    Signed-off-by: Jack Steiner
    Signed-off-by: Lee Schermerhorn
    Cc: Christoph Lameter
    Cc: Pekka Enberg
    Cc: Paul Menage
    Cc: Jack Steiner
    Cc: Robin Holt
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Jack Steiner
     
  • We have observed several workloads running on multi-node systems where
    memory is assigned unevenly across the nodes in the system. There are
    numerous reasons for this but one is the round-robin rotor in
    cpuset_mem_spread_node().

    For example, a simple test that writes a multi-page file will allocate
    pages on nodes 0 2 4 6 ... Odd nodes are skipped. (Sometimes it
    allocates on odd nodes & skips even nodes).

    An example is shown below. The program "lfile" writes a file consisting
    of 10 pages. The program then mmaps the file & uses get_mempolicy(...,
    MPOL_F_NODE) to determine the nodes where the file pages were allocated.
    The output is shown below:

    # ./lfile
    allocated on nodes: 2 4 6 0 1 2 6 0 2

    There is a single rotor that is used for allocating both file pages & slab
    pages. Writing the file allocates both a data page & a slab page
    (buffer_head). This advances the RR rotor 2 nodes for each page
    allocated.

    A quick confirmation seems to confirm this is the cause of the uneven
    allocation:

    # echo 0 >/dev/cpuset/memory_spread_slab
    # ./lfile
    allocated on nodes: 6 7 8 9 0 1 2 3 4 5

    This patch introduces a second rotor that is used for slab allocations.

    Signed-off-by: Jack Steiner
    Acked-by: Christoph Lameter
    Cc: Pekka Enberg
    Cc: Paul Menage
    Cc: Jack Steiner
    Cc: Robin Holt
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Jack Steiner
     
  • Since we are unable to handle an error returned by
    cftype.unregister_event() properly, let's make the callback
    void-returning.

    mem_cgroup_unregister_event() has been rewritten to be a "never fail"
    function. On mem_cgroup_usage_register_event() we save old buffer for
    thresholds array and reuse it in mem_cgroup_usage_unregister_event() to
    avoid allocation.

    Signed-off-by: Kirill A. Shutemov
    Acked-by: KAMEZAWA Hiroyuki
    Cc: Phil Carmody
    Cc: Balbir Singh
    Cc: Daisuke Nishimura
    Cc: Paul Menage
    Cc: Li Zefan
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Kirill A. Shutemov
     
  • FILE_MAPPED per memcg of migrated file cache is not properly updated,
    because our hook in page_add_file_rmap() can't know to which memcg
    FILE_MAPPED should be counted.

    Basically, this patch is for fixing the bug but includes some big changes
    to fix up other messes.

    Now, at migrating mapped file, events happen in following sequence.

    1. allocate a new page.
    2. get memcg of an old page.
    3. charge ageinst a new page before migration. But at this point,
    no changes to new page's page_cgroup, no commit for the charge.
    (IOW, PCG_USED bit is not set.)
    4. page migration replaces radix-tree, old-page and new-page.
    5. page migration remaps the new page if the old page was mapped.
    6. Here, the new page is unlocked.
    7. memcg commits the charge for newpage, Mark the new page's page_cgroup
    as PCG_USED.

    Because "commit" happens after page-remap, we can count FILE_MAPPED
    at "5", because we should avoid to trust page_cgroup->mem_cgroup.
    if PCG_USED bit is unset.
    (Note: memcg's LRU removal code does that but LRU-isolation logic is used
    for helping it. When we overwrite page_cgroup->mem_cgroup, page_cgroup is
    not on LRU or page_cgroup->mem_cgroup is NULL.)

    We can lose file_mapped accounting information at 5 because FILE_MAPPED
    is updated only when mapcount changes 0->1. So we should catch it.

    BTW, historically, above implemntation comes from migration-failure
    of anonymous page. Because we charge both of old page and new page
    with mapcount=0, we can't catch
    - the page is really freed before remap.
    - migration fails but it's freed before remap
    or .....corner cases.

    New migration sequence with memcg is:

    1. allocate a new page.
    2. mark PageCgroupMigration to the old page.
    3. charge against a new page onto the old page's memcg. (here, new page's pc
    is marked as PageCgroupUsed.)
    4. page migration replaces radix-tree, page table, etc...
    5. At remapping, new page's page_cgroup is now makrked as "USED"
    We can catch 0->1 event and FILE_MAPPED will be properly updated.

    And we can catch SWAPOUT event after unlock this and freeing this
    page by unmap() can be caught.

    7. Clear PageCgroupMigration of the old page.

    So, FILE_MAPPED will be correctly updated.

    Then, for what MIGRATION flag is ?
    Without it, at migration failure, we may have to charge old page again
    because it may be fully unmapped. "charge" means that we have to dive into
    memory reclaim or something complated. So, it's better to avoid
    charge it again. Before this patch, __commit_charge() was working for
    both of the old/new page and fixed up all. But this technique has some
    racy condtion around FILE_MAPPED and SWAPOUT etc...
    Now, the kernel use MIGRATION flag and don't uncharge old page until
    the end of migration.

    I hope this change will make memcg's page migration much simpler. This
    page migration has caused several troubles. Worth to add a flag for
    simplification.

    Reviewed-by: Daisuke Nishimura
    Tested-by: Daisuke Nishimura
    Reported-by: Daisuke Nishimura
    Signed-off-by: KAMEZAWA Hiroyuki
    Cc: Balbir Singh
    Cc: Christoph Lameter
    Cc: "Kirill A. Shutemov"
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    akpm@linux-foundation.org
     
  • This patch adds support for moving charge of file pages, which include
    normal file, tmpfs file and swaps of tmpfs file. It's enabled by setting
    bit 1 of /memory.move_charge_at_immigrate.

    Unlike the case of anonymous pages, file pages(and swaps) in the range
    mmapped by the task will be moved even if the task hasn't done page fault,
    i.e. they might not be the task's "RSS", but other task's "RSS" that maps
    the same file. And mapcount of the page is ignored(the page can be moved
    even if page_mapcount(page) > 1). So, conditions that the page/swap
    should be met to be moved is that it must be in the range mmapped by the
    target task and it must be charged to the old cgroup.

    [akpm@linux-foundation.org: coding-style fixes]
    [akpm@linux-foundation.org: fix warning]
    Signed-off-by: Daisuke Nishimura
    Acked-by: KAMEZAWA Hiroyuki
    Cc: Balbir Singh
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Daisuke Nishimura
     
  • A few architectures, like OMAP, allow you to set a debouncing time for the
    gpio before generating the IRQ. Teach gpiolib about that.

    Mark said:
    : This would be generally useful for embedded systems, especially where
    : the interrupt concerned is a wake source. It allows drivers to avoid
    : spurious interrupts from noisy sources so if the hardware supports it
    : the driver can avoid having to explicitly wait for the signal to become
    : stable and software has to cope with fewer events. We've lived without
    : it for quite some time, though.

    David said:
    : I looked at adding debounce support to the generic GPIO calls (and thus
    : gpiolib) some time back, but decided against it. I forget why at this
    : time (check list archives) but it wasn't because of lack of utility in
    : certain contexts.
    :
    : One thing to watch out for is just how variable the hardware capabilities
    : are. Atmel GPIOs have something like a fixed number of 32K clock cycles
    : for debounce, twl4030 had something odd, OMAPs were more like the Atmel
    : chips but with a different clock. In some cases debouncing had to be
    : ganged, not per-GPIO. And so forth.

    Signed-off-by: Felipe Balbi
    Cc: Tony Lindgren
    Cc: David Brownell
    Reviewed-by: Mark Brown
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Felipe Balbi
     
  • gpiolib doesn't need to modify the names and I assume most initializers
    use string constants that shouldn't be modified anyhow.

    [akpm@linux-foundation.org: fix drivers/gpio/cs5535-gpio.c]
    Signed-off-by: Uwe Kleine-König
    Cc: Kevin Wells
    Cc: David Brownell
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Uwe Kleine-König
     
  • Most of the GPIO expanders supported by the max732x driver have interrupt
    generation capability by reporting changes on input pins through an INT#
    pin. This patch implements the irq_chip functionnality (edge detection
    only).

    Signed-off-by: Marc Zyngier
    Cc: Eric Miao
    Cc: Jebediah Huang
    Cc: David Brownell
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Marc Zyngier
     
  • Add a glue layer to support the sdhci driver on the ST SPEAr platform.

    Signed-off-by: Viresh Kumar
    Cc:
    Cc: Linus Walleij
    Cc: Russell King
    Cc:
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Viresh KUMAR
     
  • SDIO specification allows RAW (Read after Write) operation using
    IO_RW_DIRECT command (CMD52) by setting the RAW bit. This operation is
    similar to ordinary read/write commands, except that both write and read
    are performed using single command/response pair. The Linux SDIO layer
    already supports this internaly, only external function is missing for
    drivers to make use, which is added by this patch.

    This type of command is required to implement proper power save mode
    support in wl1251 wifi driver.

    Android has similar patch for G1 in it's tree for the same reason:

    http://android.git.kernel.org/?p=kernel/common.git;a=commitdiff;h=74a47786f6ecbe6c1cf9fb15efe6a968451deb52

    Signed-off-by: Grazvydas Ignotas
    Acked-by: Kalle Valo
    Cc: Dmitry Shmidt
    Cc:
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Grazvydas Ignotas
     
  • Even though many mmc host drivers pass a pm_message_t argument to
    mmc_suspend_host() that argument isn't used the by MMC core. As host
    drivers are converted to dev_pm_ops they'll have to construct
    pm_message_t's (as they won't be passed by the PM subsystem any more) just
    to appease the mmc suspend interface.

    We might as well just delete the unused paramter.

    Signed-off-by: Matt Fleming
    Acked-by: Anton Vorontsov
    Acked-by: Michal Miroslaw ZZ
    Acked-by: Sascha Sommer
    Cc:
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Matt Fleming
     
  • MMCIF is the MMC Host Interface in SuperH.

    Signed-off-by: Yusuke Goda
    Cc: Ben Hutchings
    Cc: Paul Mundt
    Cc: Magnus Damm
    Cc:
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Yusuke Goda
     
  • This includes platform ops, quirks and (de)initialization callbacks.

    Signed-off-by: Anton Vorontsov
    Cc: Richard Röjfors
    Cc: David Vrabel
    Cc: Pierre Ossman
    Cc: Ben Dooks
    Cc:
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Anton Vorontsov
     

26 May, 2010

6 commits

  • This reverts commit b3b77c8caef1750ebeea1054e39e358550ea9f55, which was
    also totally broken (see commit 0d2daf5cc858 that reverted the crc32
    version of it). As reported by Stephen Rothwell, it causes problems on
    big-endian machines:

    > In file included from fs/jfs/jfs_types.h:33,
    > from fs/jfs/jfs_incore.h:26,
    > from fs/jfs/file.c:22:
    > fs/jfs/endian24.h:36:101: warning: "__LITTLE_ENDIAN" is not defined

    The kernel has never had that crazy "__BYTE_ORDER == __LITTLE_ENDIAN"
    model. It's not how we do things, and it isn't how we _should_ do
    things. So don't go there.

    Requested-by: Stephen Rothwell
    Signed-off-by: Linus Torvalds

    Linus Torvalds
     
  • * git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6: (63 commits)
    drivers/net/usb/asix.c: Fix pointer cast.
    be2net: Bug fix to avoid disabling bottom half during firmware upgrade.
    proc_dointvec: write a single value
    hso: add support for new products
    Phonet: fix potential use-after-free in pep_sock_close()
    ath9k: remove VEOL support for ad-hoc
    ath9k: change beacon allocation to prefer the first beacon slot
    sock.h: fix kernel-doc warning
    cls_cgroup: Fix build error when built-in
    macvlan: do proper cleanup in macvlan_common_newlink() V2
    be2net: Bug fix in init code in probe
    net/dccp: expansion of error code size
    ath9k: Fix rx of mcast/bcast frames in PS mode with auto sleep
    wireless: fix sta_info.h kernel-doc warnings
    wireless: fix mac80211.h kernel-doc warnings
    iwlwifi: testing the wrong variable in iwl_add_bssid_station()
    ath9k_htc: rare leak in ath9k_hif_usb_alloc_tx_urbs()
    ath9k_htc: dereferencing before check in hif_usb_tx_cb()
    rt2x00: Fix rt2800usb TX descriptor writing.
    rt2x00: Fix failed SLEEP->AWAKE and AWAKE->SLEEP transitions.
    ...

    Linus Torvalds
     
  • This adds:
    alias: devname:
    to some common kernel modules, which will allow the on-demand loading
    of the kernel module when the device node is accessed.

    Ideally all these modules would be compiled-in, but distros seems too
    much in love with their modularization that we need to cover the common
    cases with this new facility. It will allow us to remove a bunch of pretty
    useless init scripts and modprobes from init scripts.

    The static device node aliases will be carried in the module itself. The
    program depmod will extract this information to a file in the module directory:
    $ cat /lib/modules/2.6.34-00650-g537b60d-dirty/modules.devname
    # Device nodes to trigger on-demand module loading.
    microcode cpu/microcode c10:184
    fuse fuse c10:229
    ppp_generic ppp c108:0
    tun net/tun c10:200
    dm_mod mapper/control c10:235

    Udev will pick up the depmod created file on startup and create all the
    static device nodes which the kernel modules specify, so that these modules
    get automatically loaded when the device node is accessed:
    $ /sbin/udevd --debug
    ...
    static_dev_create_from_modules: mknod '/dev/cpu/microcode' c10:184
    static_dev_create_from_modules: mknod '/dev/fuse' c10:229
    static_dev_create_from_modules: mknod '/dev/ppp' c108:0
    static_dev_create_from_modules: mknod '/dev/net/tun' c10:200
    static_dev_create_from_modules: mknod '/dev/mapper/control' c10:235
    udev_rules_apply_static_dev_perms: chmod '/dev/net/tun' 0666
    udev_rules_apply_static_dev_perms: chmod '/dev/fuse' 0666

    A few device nodes are switched to statically allocated numbers, to allow
    the static nodes to work. This might also useful for systems which still run
    a plain static /dev, which is completely unsafe to use with any dynamic minor
    numbers.

    Note:
    The devname aliases must be limited to the *common* and *single*instance*
    device nodes, like the misc devices, and never be used for conceptually limited
    systems like the loop devices, which should rather get fixed properly and get a
    control node for losetup to talk to, instead of creating a random number of
    device nodes in advance, regardless if they are ever used.

    This facility is to hide the mess distros are creating with too modualized
    kernels, and just to hide that these modules are not compiled-in, and not to
    paper-over broken concepts. Thanks! :)

    Cc: Greg Kroah-Hartman
    Cc: David S. Miller
    Cc: Miklos Szeredi
    Cc: Chris Mason
    Cc: Alasdair G Kergon
    Cc: Tigran Aivazian
    Cc: Ian Kent
    Signed-Off-By: Kay Sievers
    Signed-off-by: Greg Kroah-Hartman

    Kay Sievers
     
  • * 'devel' of master.kernel.org:/home/rmk/linux-2.6-arm: (103 commits)
    ARM: 6141/1: Add audio support part in arch/arm/mach-w90x900
    ARM: 5939/1: ARM: Add option CMDLINE_FORCE to force usage of the in-kernel cmdline
    ARM: 6140/1: silence a bogus sparse warning in unwind.c
    ARM: mach-at91: duplicated include
    ARM: arch/arm/nwfpe/fpsr.h: Checkpatch cleanup
    ARM: arch/arm/mach-shark/pci.c: Checkpatch cleanup
    ARM: arch/arm/nwfpe/ChangeLog: Checkpatch cleanup
    ARM: arch/arm/mach-sa1100/leds.c: Checkpatch cleanup
    ARM: arch/arm/mach-h720x/common.h: Checkpatch cleanup
    ARM: arch/arm/mach-footbridge/ebsa285-pci.c: Checkpatch cleanup
    ARM: arch/arm/mach-clps711x/Makefile.boot: Checkpatch cleanup
    ARM: arch/arm/boot/bootp/bootp.lds: Checkpatch cleanup
    ARM: SPEAR6xx: remove duplicated #include
    ARM: s3c6400_defconfig: Add NAND driver
    ARM: s3c6400_defconfig: enable sound as modules
    ARM: s3c6400_defconfig: enable power management
    ARM: s5pv210_defconfig: Update s5pv210_defconfig to v2.6.34
    ARM: s5pc110_defconfig: Update s5pc110_defconfig to v2.6.34
    ARM: s5p6442_defconfig: Update s5p6442_defconfig to v2.6.34
    ARM: s5p6440_defconfig: Update s5p6440_defconfig to v2.6.34
    ...

    Linus Torvalds
     
  • * 'next-spi' of git://git.secretlab.ca/git/linux-2.6:
    spi/xilinx: Fix compile error
    spi/davinci: Fix clock prescale factor computation
    spi: move bitbang txrx utility functions to private header
    spi/mpc5121: Add SPI master driver for MPC5121 PSC
    powerpc/mpc5121: move PSC FIFO memory init to platform code
    spi/ep93xx: implemented driver for Cirrus EP93xx SPI controller
    Documentation/spi/* compile warning fix
    spi/omap2_mcspi: Check params before dereference or use
    spi/omap2_mcspi: add turbo mode support
    spi/omap2_mcspi: change default DMA_MIN_BYTES value to 160
    spi/pl022: fix stop queue procedure
    spi/pl022: add support for the PL023 derivate
    spi/pl022: fix up differences between ARM and ST versions
    spi/spi_mpc8xxx: Do not use map_tx_dma to unmap rx_dma
    spi/spi_mpc8xxx: Fix QE mode Litte Endian
    spi/spi_mpc8xxx: fix potential memory corruption.

    Linus Torvalds
     
  • * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/lrg/voltage-2.6:
    regulator: return set_mode is same mode is requested
    Regulators: ab3100/bq24022: add a missing .owner field in regulator_desc
    twl6030: regulator: Remove vsel tables and use formula for calculation
    mc13783-regulator: fix vaild voltage range checking for mc13783_fixed_regulator_set_voltage
    regulator: use voltage number array in 88pm860x
    regulator: make 88pm860x sharing one driver structure
    regulator: simplify regulator_register() error handling
    regulator: fix unset_regulator_supplies() to remove all matches
    regulator: prevent registration of matching regulator consumer supplies
    regulator: Allow regulator-regulator supplies to be specified by name

    Linus Torvalds
     

25 May, 2010

17 commits

  • FBIO_WAITFORVSYNC is currently implemented by matroxfb, atyfb, intelfb and
    more. All of them keep redefining the same FBIO_WAITFORVSYNC macro over
    and over again, so move it to linux/fb.h and clean up those duplicate
    defines.

    Signed-off-by: Grazvydas Ignotas
    Cc: Ville Syrjala
    Cc: Grant Likely
    Cc: Maik Broemme
    Cc: Petr Vandrovec
    Cc: Benjamin Herrenschmidt
    Cc: Krzysztof Helt
    Cc: "Hiremath, Vaibhav"
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Grazvydas Ignotas
     
  • Content for the 8bit device threaded interrupt handlers. Depending on the
    interrupt line and chip configuration, either click or wakeup / freefall
    handler is called. In case of click, BTN_ event is sent via input device.
    In case of wakeup or freefall, input device ABS_ events are updated
    immediatelly.

    It is still possible to configure interrupt line 1 for fast freefall
    detection and use the second line either for click or threshold based
    interrupts. Or both lines can be used for click / threshold interrupts.

    Polled input device can be set to stopped state and still get coordinate
    updates via input device using interrupt based method. Polled mode and
    interrupt mode can also be used parallel.

    BTN_ events are remapped based on existing axis remapping information.

    Signed-off-by: Samu Onkalo
    Acked-by: Eric Piel
    Cc: Daniel Mack
    Cc: Pavel Machek
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Samu Onkalo
     
  • Original lis3 driver didn't provide interrupt handler(s) for click or
    threshold event handling. This patch adds threaded handlers for one or
    two interrupt lines for 8 bit device. Actual content for interrupt
    handling is provided in the separate patch.

    Signed-off-by: Samu Onkalo
    Tested-by: Daniel Mack
    Acked-by: Eric Piel
    Cc: Pavel Machek
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Samu Onkalo
     
  • 8 bit device has two wakeup / free fall units. It was not possible to
    configure the second unit. This patch introduces configuration entry to
    the platform data and also corresponding changes to the 8 bit setup
    function.

    High pass filters were enabled by default. Patch introduces configuration
    option for high pass filter cut off frequency and also possibility to
    disable or enable the filter via platform data. Since the control is a
    new one and default state was filter enabled, new option is used to
    disable the filter. This way old platform data is still compatible with
    the change.

    Signed-off-by: Samu Onkalo
    Acked-by: Eric Piel
    Tested-by: Daniel Mack
    Cc: Pavel Machek
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Samu Onkalo
     
  • hex_to_bin() is a little method which converts hex digit to its actual
    value. There are plenty of places where such functionality is needed.

    [akpm@linux-foundation.org: use tolower(), saving 3 bytes, test the more common case first - it's quicker]
    [akpm@linux-foundation.org: relocate tolower to make it even faster! (Joe)]
    Signed-off-by: Andy Shevchenko
    Cc: Tilman Schmidt
    Cc: Duncan Sands
    Cc: Eric W. Biederman
    Cc: Greg Kroah-Hartman
    Cc: "Richard Russon (FlatCap)"
    Cc: John W. Linville
    Cc: Len Brown
    Cc: Joe Perches
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Andy Shevchenko
     
  • [akpm@linux-foundation.org: coding-style fixes]
    Signed-off-by: Florian Ragwitz
    Cc: Jason Baron
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Florian Ragwitz
     
  • For now, all users of ratelimit_state allocates it statically, so
    DEFINE_RATELIMIT_STATE() is enough. But, I want to use ratelimit_state
    for fs, i.e. per super_block to suppress too many error reports.

    So, this adds ratelimit_state_init() to initialize ratelimite_state
    which is dynamically allocated, instead of opencoding.

    Signed-off-by: OGAWA Hirofumi
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    OGAWA Hirofumi
     
  • ratelimit_state initialization of printk_ratelimited() seems broken. This
    fixes it by using DEFINE_RATELIMIT_STATE() to initialize spinlock
    properly.

    Signed-off-by: OGAWA Hirofumi
    Cc: Joe Perches
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    OGAWA Hirofumi
     
  • The current logging macros are
    pr_, dev_, netdev_, and netif_.
    pr_ uses warning, the other use warn.

    Standardize these logging macros a bit more by adding pr_warn and
    pr_warn_ratelimited.

    Right now, there are:

    $ for level in emerg alert crit err warn warning notice info ; do \
    for prefix in pr dev netdev netif ; do \
    echo -n "${prefix}_${level}: `git grep -w "${prefix}_${level}" | wc -l` " ; \
    done ; \
    echo ; \
    done
    pr_emerg: 45 dev_emerg: 4 netdev_emerg: 1 netif_emerg: 4
    pr_alert: 24 dev_alert: 36 netdev_alert: 1 netif_alert: 6
    pr_crit: 24 dev_crit: 22 netdev_crit: 1 netif_crit: 4
    pr_err: 2013 dev_err: 8467 netdev_err: 267 netif_err: 240
    pr_warn: 0 dev_warn: 1818 netdev_warn: 126 netif_warn: 23
    pr_warning: 773 dev_warning: 0 netdev_warning: 0 netif_warning: 0
    pr_notice: 148 dev_notice: 111 netdev_notice: 9 netif_notice: 3
    pr_info: 1717 dev_info: 3007 netdev_info: 101 netif_info: 85

    Signed-off-by: Joe Perches
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Joe Perches
     
  • - C99 knows about USHRT_MAX/SHRT_MAX/SHRT_MIN, not
    USHORT_MAX/SHORT_MAX/SHORT_MIN.

    - Make SHRT_MIN of type s16, not int, for consistency.

    [akpm@linux-foundation.org: fix drivers/dma/timb_dma.c]
    [akpm@linux-foundation.org: fix security/keys/keyring.c]
    Signed-off-by: Alexey Dobriyan
    Acked-by: WANG Cong
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Alexey Dobriyan
     
  • Linux does not define __BYTE_ORDER in its endian header files which makes
    some header files bend backwards to get at the current endian. Lets
    #define __BYTE_ORDER in big_endian.h/litte_endian.h to make it easier for
    header files that are used in user space too.

    In userspace the convention is that

    1. _both_ __LITTLE_ENDIAN and __BIG_ENDIAN are defined,
    2. you have to test for e.g. __BYTE_ORDER == __BIG_ENDIAN.

    Signed-off-by: Joakim Tjernlund
    Cc: Geert Uytterhoeven
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Joakim Tjernlund
     
  • Add __must_check to error pointer handlers to have the compiler warn about
    mistakes like:

    if (err)
    ERR_PTR(err);

    It found two bugs:

    Mar 12 Nikula Jani [PATCH] enclosure: fix error path - actually return ERR_PTR() on error
    Mar 12 Nikula Jani [PATCH] sunrpc: fix error path - actually return ERR_PTR() on error

    Signed-off-by: Jani Nikula
    Cc: Phil Carmody
    Cc: Alexey Dobriyan
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Jani Nikula
     
  • This ensures that platforms with lowmem PAs above 32 bits work correctly
    by avoiding truncating the PA during a left shift.

    Signed-off-by: Chris Metcalf
    Cc: Barry Song
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Chris Metcalf
     
  • Add global mutex zonelists_mutex to fix the possible race:

    CPU0 CPU1 CPU2
    (1) zone->present_pages += online_pages;
    (2) build_all_zonelists();
    (3) alloc_page();
    (4) free_page();
    (5) build_all_zonelists();
    (6) __build_all_zonelists();
    (7) zone->pageset = alloc_percpu();

    In step (3,4), zone->pageset still points to boot_pageset, so bad
    things may happen if 2+ nodes are in this state. Even if only 1 node
    is accessing the boot_pageset, (3) may still consume too much memory
    to fail the memory allocations in step (7).

    Besides, atomic operation ensures alloc_percpu() in step (7) will never fail
    since there is a new fresh memory block added in step(6).

    [haicheng.li@linux.intel.com: hold zonelists_mutex when build_all_zonelists]
    Signed-off-by: Haicheng Li
    Signed-off-by: Wu Fengguang
    Reviewed-by: Andi Kleen
    Cc: Christoph Lameter
    Cc: Mel Gorman
    Cc: Tejun Heo
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Haicheng Li
     
  • For each new populated zone of hotadded node, need to update its pagesets
    with dynamically allocated per_cpu_pageset struct for all possible CPUs:

    1) Detach zone->pageset from the shared boot_pageset
    at end of __build_all_zonelists().

    2) Use mutex to protect zone->pageset when it's still
    shared in onlined_pages()

    Otherwises, multiple zones of different nodes would share same boot strapping
    boot_pageset for same CPU, which will finally cause below kernel panic:

    ------------[ cut here ]------------
    kernel BUG at mm/page_alloc.c:1239!
    invalid opcode: 0000 [#1] SMP
    ...
    Call Trace:
    [] __alloc_pages_nodemask+0x131/0x7b0
    [] alloc_pages_current+0x87/0xd0
    [] __page_cache_alloc+0x67/0x70
    [] __do_page_cache_readahead+0x120/0x260
    [] ra_submit+0x21/0x30
    [] ondemand_readahead+0x166/0x2c0
    [] page_cache_async_readahead+0x80/0xa0
    [] generic_file_aio_read+0x364/0x670
    [] nfs_file_read+0xca/0x130
    [] do_sync_read+0xfa/0x140
    [] vfs_read+0xb5/0x1a0
    [] sys_read+0x51/0x80
    [] system_call_fastpath+0x16/0x1b
    RIP [] get_page_from_freelist+0x883/0x900
    RSP
    ---[ end trace 4bda28328b9990db ]

    [akpm@linux-foundation.org: merge fix]
    Signed-off-by: Haicheng Li
    Signed-off-by: Wu Fengguang
    Reviewed-by: Andi Kleen
    Reviewed-by: Christoph Lameter
    Cc: Mel Gorman
    Cc: Tejun Heo
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Haicheng Li
     
  • Got this while compiling for ARM/SA1100:

    mm/sparse.c: In function '__section_nr':
    mm/sparse.c:135: warning: 'root' is used uninitialized in this function

    This patch follows Russell King's suggestion for a new calculation for
    NR_SECTION_ROOTS. Thanks also to Sergei Shtylyov for pointing out the
    existence of the macro DIV_ROUND_UP.

    Atsushi Nemoto observed:
    : This fix doesn't just silence the warning - it fixes a real problem.
    :
    : Without this fix, mem_section[] might have 0 size so mem_section[0]
    : will share other variable area. For example, I got:
    :
    : c030c700 b __warned.16478
    : c030c700 B mem_section
    : c030c701 b __warned.16483
    :
    : This might cause very strange behavior. Your patch actually fixes it.

    Signed-off-by: Marcelo Roberto Jimenez
    Cc: Atsushi Nemoto
    Cc: KOSAKI Motohiro
    Cc: Christoph Lameter
    Cc: Mel Gorman
    Cc: Minchan Kim
    Cc: Yinghai Lu
    Cc: Sergei Shtylyov
    Cc: Russell King
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Marcelo Roberto Jimenez
     
  • In f4112de6b679d84bd9b9681c7504be7bdfb7c7d5 ("mm: introduce
    debug_kmap_atomic") I said that debug_kmap_atomic() needs
    CONFIG_TRACE_IRQFLAGS_SUPPORT.

    It was wrong. (I thought irqs_disabled() is only available when the
    architecture has CONFIG_TRACE_IRQFLAGS_SUPPORT)

    Remove the #ifdef CONFIG_TRACE_IRQFLAGS_SUPPORT check to enable
    kmap_atomic() debugging for the architectures which do not have
    CONFIG_TRACE_IRQFLAGS_SUPPORT.

    Reported-by: Andrew Morton
    Signed-off-by: Akinobu Mita
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Akinobu Mita