10 Sep, 2010

32 commits

  • next_active_pageblock() is for finding next _used_ freeblock. It skips
    several blocks when it finds there are a chunk of free pages lager than
    pageblock. But it has 2 bugs.

    1. We have no lock. page_order(page) - pageblock_order can be minus.
    2. pageblocks_stride += is wrong. it should skip page_order(p) of pages.

    Signed-off-by: KAMEZAWA Hiroyuki
    Cc: Michal Hocko
    Cc: Wu Fengguang
    Cc: Mel Gorman
    Cc: KAMEZAWA Hiroyuki
    Cc:
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    KAMEZAWA Hiroyuki
     
  • Iram reported that compaction's too_many_isolated() loops forever.
    (http://www.spinics.net/lists/linux-mm/msg08123.html)

    The meminfo when the situation happened was inactive anon is zero. That's
    because the system has no memory pressure until then. While all anon
    pages were in the active lru, compaction could select active lru as well
    as inactive lru. That's a different thing from vmscan's isolated. So we
    has been two too_many_isolated.

    While compaction can isolate pages in both active and inactive, current
    implementation of too_many_isolated only considers inactive. It made
    Iram's problem.

    This patch handles active and inactive fairly. That's because we can't
    expect where from and how many compaction would isolated pages.

    This patch changes (nr_isolated > nr_inactive) with
    nr_isolated > (nr_active + nr_inactive) / 2.

    Signed-off-by: Minchan Kim
    Reported-by: Iram Shahzad
    Acked-by: Mel Gorman
    Acked-by: Wu Fengguang
    Cc:
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Minchan Kim
     
  • gid_t is a unsigned int. If group_info contains a gid greater than
    MAX_INT, groups_search() function may look on the wrong side of the search
    tree.

    This solves some unfair "permission denied" problems.

    Signed-off-by: Jerome Marchand
    Cc:
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Jerome Marchand
     
  • The slab.h header is required to use the kmalloc() family of functions.
    Due to recent kernel changes, this header must be directly included by
    code that calls into the memory allocator.

    Without this patch, any code which includes this header fails to build.

    Signed-off-by: Ira W. Snyder
    Cc: Dan Williams
    Cc: Benjamin Herrenschmidt
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Ira W. Snyder
     
  • Commit b485fe5ea ("rtc/m41t80: use rtc_valid_tm() to check returned tm")
    added rtc_valid_tm to m41t80_rtc_read_alarm() but it was wrong while the
    t->time does not contain complete date/time.

    This patch also fixes a warning:
    warning: passing argument 1 of 'rtc_valid_tm' from incompatible pointer type

    Signed-off-by: Atsushi Nemoto
    Cc: Wan ZongShun
    Cc: Alessandro Zummo
    Cc: Geert Uytterhoeven
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Atsushi Nemoto
     
  • Commit 74641f584da ("alpha: binfmt_aout fix") (May 2009) introduced a
    regression - binfmt_misc is now consulted after binfmt_elf, which will
    unfortunately break ia32el. ia32 ELF binaries on ia64 used to be matched
    using binfmt_misc and executed using wrapper. As 32bit binaries are now
    matched by binfmt_elf before bindmt_misc kicks in, the wrapper is ignored.

    The fix increases precedence of binfmt_misc to the original state.

    Signed-off-by: Jan Sembera
    Cc: Ivan Kokshaysky
    Cc: Al Viro
    Cc: Richard Henderson [2.6.everything.x]
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Jan Sembera
     
  • COMPACTION enables MIGRATION, but MIGRATION spawns a warning if numa or
    memhotplug aren't selected. However MIGRATION doesn't depend on them. I
    guess it's just trying to be strict doing a double check on who's enabling
    it, but it doesn't know that compaction also enables MIGRATION.

    Signed-off-by: Andrea Arcangeli
    Acked-by: Mel Gorman
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Andrea Arcangeli
     
  • The pte_same check is reliable only if the swap entry remains pinned (by
    the page lock on swapcache). We've also to ensure the swapcache isn't
    removed before we take the lock as try_to_free_swap won't care about the
    page pin.

    One of the possible impacts of this patch is that a KSM-shared page can
    point to the anon_vma of another process, which could exit before the page
    is freed.

    This can leave a page with a pointer to a recycled anon_vma object, or
    worse, a pointer to something that is no longer an anon_vma.

    [riel@redhat.com: changelog help]
    Signed-off-by: Andrea Arcangeli
    Acked-by: Hugh Dickins
    Reviewed-by: Rik van Riel
    Cc:
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Andrea Arcangeli
     
  • Move the second if (reg & ...) test into the branch indicated by its
    indentation. The test was previously always executed after the if
    containing that branch, but it was always false unless the if branch was
    taken.

    The semantic match that finds this problem is as follows:
    (http://coccinelle.lip6.fr/)

    //
    @r disable braces4@
    position p1,p2;
    statement S1,S2;
    @@

    (
    if (...) { ... }
    |
    if (...) S1@p1 S2@p2
    )

    @script:python@
    p1 << r.p1;
    p2 << r.p2;
    @@

    if (p1[0].column == p2[0].column):
    cocci.print_main("branch",p1)
    cocci.print_secs("after",p2)
    //

    Signed-off-by: Julia Lawall
    Signed-off-by: Chris Ball
    Cc: Pavel Pisa
    Cc:
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Julia Lawall
     
  • If suspend called when kmmcd is doing host->ops->disable, as kmmcd already
    increased host->en_dis_recurs to 1, the mmc_host_enable in suspend
    function will return directly without increase the nesting_cnt, which will
    cause the followed register access carried out to the disabled host.

    mmc_suspend_host will enable host itself. No need to enable host before
    it. Also works on kmmcd will get flushed in mmc_suspend_host, enable host
    after it will be safe. So make the mmc_host_enable after it.

    [cjb: rebase against current Linus]
    Signed-off-by: Ethan
    Signed-off-by: Chris Ball
    Acked-by: Adrian Hunter
    Acked-by: Madhusudhan Chikkature
    Cc:
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Ethan Du
     
  • Fix the following error:

    at91_mci.c: In function 'at91_mci_sg_to_dma':
    at91_mci.c:236: error: implicit declaration of function 'kmap_atomic'
    at91_mci.c:236: error: 'KM_BIO_SRC_IRQ' undeclared (first use in this function)
    at91_mci.c:236: error: (Each undeclared identifier is reported only once
    at91_mci.c:236: error: for each function it appears in.)
    at91_mci.c:236: warning: assignment makes pointer from integer without a cast
    at91_mci.c:252: error: implicit declaration of function 'kunmap_atomic'
    at91_mci.c: In function 'at91_mci_post_dma_read':
    at91_mci.c:302: error: 'KM_BIO_SRC_IRQ' undeclared (first use in this function)
    at91_mci.c:302: warning: assignment makes pointer from integer without a cast
    at91_mci.c:317: error: implicit declaration of function 'flush_kernel_dcache_page'

    Signed-off-by: Marc Kleine-Budde
    Signed-off-by: Chris Ball
    Cc: Nicolas Ferre
    Cc: Andrew Victor
    Cc: Wolfgang Muees
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Marc Kleine-Budde
     
  • This fixes the following warning:

    drivers/mmc/host/omap_hsmmc.c: In function 'omap_hsmmc_suspend':
    drivers/mmc/host/omap_hsmmc.c:2275: warning: unused variable 'state'

    Introduced by commit ID:

    commit 1a13f8fa76c880be41d6b1e6a2b44404bcbfdf9e
    Author: Matt Fleming
    Date: Wed May 26 14:42:08 2010 -0700

    mmc: remove the "state" argument to mmc_suspend_host()

    The unique usage of this var was removed there, and missed
    removing the respective declaration aswell.

    Signed-off-by: Sergio Aguirre
    Signed-off-by: Chris Ball
    Acked-by: Matt Fleming
    Cc: Madhusudhan Chikkature
    Cc:
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Sergio Aguirre
     
  • [cjb: fix line-wrapped patch]
    Signed-off-by: Jiri Pinkava
    Signed-off-by: Chris Ball
    Cc: Matt Fleming
    Cc: Russell King
    Cc: Ben Dooks
    Cc:
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Jiri Pinkava
     
  • kunmap_atomic() takes the cookie, returned by the kmap_atomic() as its
    argument and not the page address, used as an argument to kmap_atomic().
    This patch fixes the compile error:

    In file included from drivers/mmc/host/tmio_mmc.c:37:
    drivers/mmc/host/tmio_mmc.h: In function 'tmio_mmc_kunmap_atomic':
    drivers/mmc/host/tmio_mmc.h:192: error: negative width in bit-field ''

    Signed-off-by: Guennadi Liakhovetski
    Acked-by: Eric Miao
    Tested-by: Magnus Damm
    Cc:
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Guennadi Liakhovetski
     
  • Previously, it was possible for ack_mmc_irqs() to clear pending interrupt
    bits in the CTL_STATUS register, even though the interrupt handler had not
    been called. This was because of a race that existed when doing a
    read-modify-write sequence on CTL_STATUS. After the read step in this
    sequence, if an interrupt occurred (causing one of the bits in CTL_STATUS
    to be set) the write step would inadvertently clear it.

    Observed with the TMIO_STAT_RXRDY bit together with CMD53 on AR6002 and
    BCM4318 SDIO cards in polled mode.

    This patch eliminates this race by only writing to CTL_STATUS and clearing
    the interrupts that were passed as an argument to ack_mmc_irqs()."

    [matt@console-pimps.org: rewrote changelog]
    Signed-off-by: Yusuke Goda
    Acked-by: Magnus Damm "
    Tested-by: Arnd Hannemann "
    Acked-by: Ian Molton
    Cc: Matt Fleming
    Cc: Samuel Ortiz
    Cc: Paul Mundt
    Cc:
    Cc:
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Yusuke Goda
     
  • Add cgroup_attach_task_all()

    The existing cgroup_attach_task_current_cg() API is called by a thread to
    attach another thread to all of its cgroups; this is unsuitable for cases
    where a privileged task wants to attach itself to the cgroups of a less
    privileged one, since the call must be made from the context of the target
    task.

    This patch adds a more generic cgroup_attach_task_all() API that allows
    both the source task and to-be-moved task to be specified.
    cgroup_attach_task_current_cg() becomes a specialization of the more
    generic new function.

    [menage@google.com: rewrote changelog]
    [akpm@linux-foundation.org: address reviewer comments]
    Signed-off-by: Michael S. Tsirkin
    Tested-by: Alex Williamson
    Acked-by: Paul Menage
    Cc: Li Zefan
    Cc: Ben Blum
    Cc: Sridhar Samudrala
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Michael S. Tsirkin
     
  • Fix the left-over old ifdef for PG_uncached in /proc/kpageflags. Now it's
    used by x86, too.

    Signed-off-by: Takashi Iwai
    Cc: Wu Fengguang
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Takashi Iwai
     
  • The gcov-kernel infrastructure expects that each object file is loaded
    only once. This may not be true, e.g. when loading multiple kernel
    modules which are linked to the same object file. As a result, loading
    such kernel modules will result in incorrect gcov results while unloading
    will cause a null-pointer dereference.

    This patch fixes these problems by changing the gcov-kernel infrastructure
    so that multiple profiling data sets can be associated with one debugfs
    entry. It applies to 2.6.36-rc1.

    Signed-off-by: Peter Oberparleiter
    Reported-by: Werner Spies
    Cc:
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Peter Oberparleiter
     
  • Kexec tools has been moved to http://kernel.org/pub/linux/utils/kernel/kexec/
    as user-space code shouldn't be in /pub/linux/kernel

    Signed-off-by: Simon Horman
    Acked-by: "Eric W. Biederman"
    Cc: "H. Peter Anvin"
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Simon Horman
     
  • commit c2c6ca4 (direct-io: do not merge logically non-contiguous requests)
    introduced a bug whereby all O_DIRECT I/Os were submitted a page at a time
    to the block layer. The problem is that the code expected
    dio->block_in_file to correspond to the current page in the dio. In fact,
    it corresponds to the previous page submitted via submit_page_section.
    This was purely an oversight, as the dio->cur_page_fs_offset field was
    introduced for just this purpose. This patch simply uses the correct
    variable when calculating whether there is a mismatch between contiguous
    logical blocks and contiguous physical blocks (as described in the
    comments).

    I also switched the if conditional following this check to an else if, to
    ensure that we never call dio_bio_submit twice for the same dio (in
    theory, this should not happen, anyway).

    I've tested this by running blktrace and verifying that a 64KB I/O was
    submitted as a single I/O. I also ran the patched kernel through
    xfstests' aio tests using xfs, ext4 (with 1k and 4k block sizes) and btrfs
    and verified that there were no regressions as compared to an unpatched
    kernel.

    Signed-off-by: Jeff Moyer
    Acked-by: Josef Bacik
    Cc: Christoph Hellwig
    Cc: Chris Mason
    Cc: [2.6.35.x]
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Jeff Moyer
     
  • Added missing axis-mapping for HP ProBook 532x and HP Mini 5102.

    Signed-off-by: Takashi Iwai
    Cc: Eric Piel
    Cc:
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Takashi Iwai
     
  • bob.picco@hp.com doesn't work any more and Bob says that he's unlikely to
    work on hpet.c in the future.

    Signed-off-by: Jiri Slaby
    Acked-by: Bob Picco
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Jiri Slaby
     
  • Much (but not all) of the RTC state is kept in the RTC peripheral which
    has its own power domain. Periodically (1 HZ), that state is synced from
    one power domain to the other (peripheral->core). When we are resuming,
    we need to wait for the sync to occur so that we don't get a mismatch of
    reading undefined state in the rest of the driver.

    Further, once the externally maintained bits have been synced back into
    the core, we then need to restore the bits maintained in the core. In our
    particular case, that is just the write completion interrupt bit.

    If we don't do any of this, working with the RTC causes ~5 second delays
    from time to time after waking up due to the write completion interrupt
    never firing.

    Reported-by: Michael Dean
    Reported-by: Michael Hennerich
    Signed-off-by: Mike Frysinger
    Acked-by: Alessandro Zummo
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Mike Frysinger
     
  • The int_clear helper takes a bitmask of interrupts to keep, not to
    disable. When suspending without wakeup enabled, we want to disable
    all interrupts, so use 0 (keep none) instead of -1 (keep all).

    Signed-off-by: Mike Frysinger
    Acked-by: Alessandro Zummo
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Mike Frysinger
     
  • Some macro parameter references inside typeof() operator are not enclosed
    with parenthesis. It should be safer to add them.

    Signed-off-by: Huang Ying
    Acked-by: Stefani Seibold
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Huang Ying
     
  • The introduction of support for SD combo cards breaks the initialization
    of all CSR SDIO chips. The GO_IDLE (CMD0) in mmc_sd_get_cid() causes CSR
    chips to be reset (this is non-standard behavior).

    When initializing an SDIO card check for a combo card by using the memory
    present bit in the R4 response to IO_SEND_OP_COND (CMD5). This avoids the
    call to mmc_sd_get_cid() on an SDIO-only card.

    Signed-off-by: David Vrabel
    Acked-by: Michal Mirolaw
    Cc:
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    David Vrabel
     
  • * master.kernel.org:/home/rmk/linux-2.6-arm: (30 commits)
    ARM: Update mach-types
    ARM: Partially revert "Auto calculate ZRELADDR and provide option for exceptions"
    ARM: Ensure PTE modifications via dma_alloc_coherent are visible
    ARM: 6359/1: ep93xx: move clock initialization earlier
    Revert "[ARM] pxa: remove now unnecessary dma_needs_bounce()"
    ARM: 6352/1: perf: fix event validation
    ARM: 6344/1: Mark CPU_32v6K as depended on CPU_V7
    ARM: 6343/1: wire up fanotify and prlimit64 syscalls on ARM
    ARM: 6330/1: perf: reword comments relating to perf_event_do_pending
    ARM: pxa168fb: fix section mismatch
    ARM: pxa: Make id const in pwm_probe()
    ARM: pxa: fix CI_HSYNC and CI_VSYNC MFP defines for pxa300
    ARM: pxa: remove __init from cpufreq_driver->init()
    ARM: imx: set cache line size to 64 bytes for i.MX5
    mx5/clock: fix clear bit fields issue in _clk_ccgr_disable function
    mxc/tzic: add base address when accessing TZIC registers
    ARM: mach-shmobile: ap4evb: fix write protect for SDHI1
    ARM: mach-shmobile: ap4evb: modify FSI2 ID
    ARM: mach-shmobile: do not enable the PLLC2 clock on init
    ARM: mach-shmobile: Clock framework comment fix
    ...

    Linus Torvalds
     
  • Signed-off-by: Russell King

    Russell King
     
  • Partially revert e69edc7, which introduced automatic zreladdr
    support. The change in the way the manual definition is defined
    seems to be error and conflict prone. Go back to the original way
    we were handling this for the time being, while keeping the automatic
    zreladdr facility.

    Acked-by: Uwe Kleine-König

    Russell King
     
  • Russell King
     
  • lg_lock_global() currently only acquires spinlocks for online CPUs, but
    it's meant to lock all possible CPUs. Lglock-protected resources may be
    associated with removed CPUs - and, indeed, that could happen with the
    per-superblock open files lists.

    At Nick's suggestion, change for_each_online_cpu() to
    for_each_possible_cpu() to protect accesses to those resources.

    Cc: Al Viro
    Acked-by: Nick Piggin
    Signed-off-by: Jonathan Corbet
    Signed-off-by: Linus Torvalds

    Jonathan Corbet
     
  • So it can be used by all that need to check for that.

    Signed-off-by: Stefan Bader
    Signed-off-by: Linus Torvalds

    Stefan Bader
     

09 Sep, 2010

8 commits

  • * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/roland/infiniband:
    RDMA/nes: Fix hang with modified FIN handling on A0 cards
    RDMA/nes: Change state to closing after FIN
    RDMA/nes: Fix double CLOSE event indication crash
    RDMA/nes: Write correct register write to set TX pause param
    RDMA/cxgb3: Don't exceed the max HW CQ depth

    Linus Torvalds
     
  • * 'fixes' of git://oss.oracle.com/git/tma/linux-2.6:
    ocfs2: Fix orphan add in ocfs2_create_inode_in_orphan
    ocfs2: split out ocfs2_prepare_orphan_dir() into locking and prep functions
    ocfs2: allow return of new inode block location before allocation of the inode
    ocfs2: use ocfs2_alloc_dinode_update_counts() instead of open coding
    ocfs2: split out inode alloc code from ocfs2_mknod_locked
    Ocfs2: Fix a regression bug from mainline commit(6b933c8e6f1a2f3118082c455eef25f9b1ac7b45).
    ocfs2: Fix deadlock when allocating page
    ocfs2: properly set and use inode group alloc hint
    ocfs2: Use the right group in nfs sync check.
    ocfs2: Flush drive's caches on fdatasync
    ocfs2: make __ocfs2_page_mkwrite handle file end properly.
    ocfs2: Fix incorrect checksum validation error
    ocfs2: Fix metaecc error messages

    Linus Torvalds
     
  • Roland Dreier
     
  • Changing state to CLOSING when FIN is received causes A0 cards to
    hang. Fix this by checking for A0 cards in FIN handling.

    Signed-off-by: Faisal Latif
    Signed-off-by: Roland Dreier

    Faisal Latif
     
  • When the driver receives an AE for FIN received, it closes the
    connection without changing the state of the connection in the
    hardware to closing. By changing the state to closing, hardware will
    do a normal close sequence.

    Signed-off-by: Faisal Latif
    Signed-off-by: Roland Dreier

    Faisal Latif
     
  • During a stress testing in a large cluster, multiple close event are
    detected and BUG() is hit in the iWARP core. The cause is that the
    active node gave up while waiting for an MPA response from the peer
    and tried to close the connection by sending RST. The passive node
    driver receives the RST but is waiting for MPA response from the user.
    When the MPA accept is received, the driver offloads the connection
    and sends a CLOSE event. The driver gets an AE indicating RESET
    received and also sends a CLOSE event, hitting a BUG().

    Fix this by correcting RESET handling and sending CLOSE events.

    Signed-off-by: Faisal Latif
    Signed-off-by: Roland Dreier

    Faisal Latif
     
  • Setting TX pause param writes to the wrong register location causing
    the adapter to hang. Correct the define used to write the reigster.

    Addresses: https://bugs.openfabrics.org/show_bug.cgi?id=2116
    Reported-by: Shiri Franchi
    Signed-off-by: Chien Tung
    Signed-off-by: Roland Dreier

    Chien Tung
     
  • * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input:
    Input: i8042 - fix device removal on unload
    Input: bcm5974 - adjust major/minor to scale
    Input: MT - initialize slots to unused
    Input: use PIT_TICK_RATE in vt beep ioctl
    Input: wacom - fix mousewheel handling for old wacom tablets

    Linus Torvalds