31 Jul, 2012

40 commits

  • Add omitted comments for structures in nilfs2_fs.h.

    Signed-off-by: Vyacheslav Dubeyko
    Signed-off-by: Ryusuke Konishi
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Vyacheslav Dubeyko
     
  • An fs-thaw ioctl causes deadlock with a chcp or mkcp -s command:

    chcp D ffff88013870f3d0 0 1325 1324 0x00000004
    ...
    Call Trace:
    nilfs_transaction_begin+0x11c/0x1a0 [nilfs2]
    wake_up_bit+0x20/0x20
    copy_from_user+0x18/0x30 [nilfs2]
    nilfs_ioctl_change_cpmode+0x7d/0xcf [nilfs2]
    nilfs_ioctl+0x252/0x61a [nilfs2]
    do_page_fault+0x311/0x34c
    get_unmapped_area+0x132/0x14e
    do_vfs_ioctl+0x44b/0x490
    __set_task_blocked+0x5a/0x61
    vm_mmap_pgoff+0x76/0x87
    __set_current_blocked+0x30/0x4a
    sys_ioctl+0x4b/0x6f
    system_call_fastpath+0x16/0x1b
    thaw D ffff88013870d890 0 1352 1351 0x00000004
    ...
    Call Trace:
    rwsem_down_failed_common+0xdb/0x10f
    call_rwsem_down_write_failed+0x13/0x20
    down_write+0x25/0x27
    thaw_super+0x13/0x9e
    do_vfs_ioctl+0x1f5/0x490
    vm_mmap_pgoff+0x76/0x87
    sys_ioctl+0x4b/0x6f
    filp_close+0x64/0x6c
    system_call_fastpath+0x16/0x1b

    where the thaw ioctl deadlocked at thaw_super() when called while chcp was
    waiting at nilfs_transaction_begin() called from
    nilfs_ioctl_change_cpmode(). This deadlock is 100% reproducible.

    This is because nilfs_ioctl_change_cpmode() first locks sb->s_umount in
    read mode and then waits for unfreezing in nilfs_transaction_begin(),
    whereas thaw_super() locks sb->s_umount in write mode. The locking of
    sb->s_umount here was intended to make snapshot mounts and the downgrade
    of snapshots to checkpoints exclusive.

    This fixes the deadlock issue by replacing the sb->s_umount usage in
    nilfs_ioctl_change_cpmode() with a dedicated mutex which protects snapshot
    mounts.

    Signed-off-by: Ryusuke Konishi
    Cc: Fernando Luis Vazquez Cao
    Tested-by: Ryusuke Konishi
    Cc:
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Ryusuke Konishi
     
  • The checkpoint deletion ioctl (rmcp ioctl) has potential for breaking
    snapshot because it is not fully exclusive with checkpoint mode change
    ioctl (chcp ioctl).

    The rmcp ioctl first tests if the specified checkpoint is a snapshot or
    not within nilfs_cpfile_delete_checkpoint function, and then calls
    nilfs_cpfile_delete_checkpoints function to actually invalidate the
    checkpoint only if it's not a snapshot. However, the checkpoint can be
    changed into a snapshot by the chcp ioctl between these two operations.
    In that case, calling nilfs_cpfile_delete_checkpoints() wrongly
    invalidates the snapshot, which leads to snapshot list corruption and
    snapshot count mismatch.

    This fixes the issue by changing nilfs_cpfile_delete_checkpoints() so
    that it reconfirms the target checkpoints are snapshot or not.

    This second check is exclusive with the chcp operation since it is
    protected by an existing semaphore.

    Signed-off-by: Ryusuke Konishi
    Cc: Fernando Luis Vazquez Cao
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Ryusuke Konishi
     
  • ->delete_inode(), ->write_super_lockfs(), ->unlockfs() are gone so remove
    references to them in the NTFS code. Noticed while cleaning up the
    fsfreeze mess.

    Signed-off-by: Fernando Luis Vazquez Cao
    Signed-off-by: Ryusuke Konishi
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Fernando Luis Vazquez Cao
     
  • Add omitted comment for ns_mount_state field of the_nilfs structure.

    Signed-off-by: Vyacheslav Dubeyko
    Signed-off-by: Ryusuke Konishi
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Vyacheslav Dubeyko
     
  • On minix2 and minix3 usually max_size is 7fffffff and the check in
    question prohibits creation of last block spanning right before 7fffffff,
    due to downward rounding during the division. Fix it by using
    multiplication instead.

    [akpm@linux-foundation.org: fix up code layout, use local `sb']
    Signed-off-by: Vladimir Serbinenko
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Vladimir Serbinenko
     
  • Set the of_match_table for this driver so that devices can be described
    in the device tree.

    Signed-off-by: Nick Bowler
    Cc: Alessandro Zummo
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Nick Bowler
     
  • The owner member is supposed to be set to the module implementing the
    device driver, i.e., THIS_MODULE. This enables the appropriate module
    link in sysfs.

    Signed-off-by: Nick Bowler
    Cc: Alessandro Zummo
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Nick Bowler
     
  • Freeing will trigger when driver unloads, so using devm_kfree() is not
    needed.

    Signed-off-by: Devendra Naga
    Cc: Alessandro Zummo
    Cc: Ashish Jangam
    Cc: David Dajun Chen
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Devendra Naga
     
  • Signed-off-by: Uwe Kleine-König
    Cc: Alessandro Zummo
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Uwe Kleine-König
     
  • This allows automatic driver loading for all supported device types.

    Signed-off-by: Uwe Kleine-König
    Cc: Alessandro Zummo
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Uwe Kleine-König
     
  • Fixes the following checkpatch warnings:

    WARNING: Use #include instead of
    WARNING: Use #include instead of

    Signed-off-by: Sachin Kamat
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Sachin Kamat
     
  • When the driver detects that the clock time is invalid, it attempts to
    write a sane time into the hardware. We curently assume that everything
    is OK if those writes succeeded. But it is better to re-read the time
    from the hardware to ensure that the new settings got there OK.

    Cc: Devendra Naga
    Cc: Alessandro Zummo
    Cc: Anatolij Gustschin
    Cc: Andreas Dumberger
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Andrew Morton
     
  • r9701_get_datetime() calls rtc_valid_tm() and returns the value returned
    by rtc_valid_tm(), which can be used in the `if', so calling
    rtc_valid_tm() a second time is not required.

    Signed-off-by: Devendra Naga
    Cc: Alessandro Zummo
    Cc: Anatolij Gustschin
    Cc: Andreas Dumberger
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Devendra Naga
     
  • AB8500 ED (Early Drop) is no longer supported by the kernel.

    Signed-off-by: Bengt Jonsson
    Signed-off-by: Linus Walleij
    Cc: Alessandro Zummo
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Bengt Jonsson
     
  • RTC: Fix to correct improper implementation of clock update irq
    (RTC_UIE) and enable UIE Emulation.

    [akpm@linux-foundation.org: checkpatch fixes]
    Signed-off-by: Ramesh Chandrasekaran
    Signed-off-by: Linus Walleij
    Cc: Alessandro Zummo
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Ramesh Chandrasekaran
     
  • The pl031 interrupt is shared between the timer part and the clockwatch
    part of the same HW block on the ux500, so mark it IRQF_SHARED on this
    variant.

    This patch also adds the IRQF_NO_SUSPEND flag to the rtc irq on all
    variants as we don't want this pretty important IRQ to be disabled in
    suspend.

    Signed-off-by: Mattias Wallin
    Signed-off-by: Linus Walleij
    Reviewed-by: Rickard Andersson
    Reviewed-by: Jonas Aberg
    Cc: Alessandro Zummo
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Mattias Wallin
     
  • Instead of hard-checking for certain vendor codes, follow the pattern of
    other AMBA (PrimeCell) drivers and use variables in the vendor data.
    Get rid of the locally cached vendor and hardware revision since we
    already have the nice vendor data variable in the state.

    Signed-off-by: Linus Walleij
    Cc: Alessandro Zummo
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Linus Walleij
     
  • Move the per-vendor operations for this RTC into a encapsulating struct so
    we can have more per-vendor variables than just the ops.

    Signed-off-by: Linus Walleij
    Cc: Alessandro Zummo
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Linus Walleij
     
  • Allocate memory, region, remap and irq for device state using devm_*
    helpers to simplify memory accounting.

    Signed-off-by: Linus Walleij
    Cc: Alessandro Zummo
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Linus Walleij
     
  • Make sure we prepare/unprepare the clock for the COH901331 RTC driver as
    is required by the clk API especially if you use common clock.

    Signed-off-by: Linus Walleij
    Cc: Alessandro Zummo
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Linus Walleij
     
  • Fix a case where users can try to allocate arbitarily large amounts of
    memory. 64K is overkill for a config request so apply an upper bound.

    Signed-off-by: Alan Cox
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Alan Cox
     
  • … array which is no longer valid

    ... when being used in the calling function. Although it may work, the
    behavior is undefined. Detected by cppcheck.

    Signed-off-by: Kamil Dudka <kdudka@redhat.com>
    Signed-off-by: Alan Cox <alan@linux.intel.com>
    Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
    Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

    Kamil Dudka
     
  • Variables t4, t5, t6 and t7 are only used when CRC_LE_BITS != 32. Fix
    the following compilation warnings:

    lib/crc32.c: In function 'crc32_body':
    lib/crc32.c:77:55: warning: unused variable 't7'
    lib/crc32.c:77:41: warning: unused variable 't6'
    lib/crc32.c:77:27: warning: unused variable 't5'
    lib/crc32.c:77:13: warning: unused variable 't4'

    Signed-off-by: Thiago Rafael Becker
    Cc: "Darrick J. Wong"
    Cc: Bob Pearson
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Thiago Rafael Becker
     
  • These types of macros should not be used for either a single statement
    nor should the macro end with a semi-colon.

    Add tests for these conditions.

    Signed-off-by: Joe Perches
    Cc: Andy Whitcroft
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Joe Perches
     
  • Kernel style uses parenthesis around sizeof.

    Signed-off-by: Joe Perches
    Cc: Andy Whitcroft
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Joe Perches
     
  • usleep_range() shouldn't use the same args for min and max.

    Report it when it happens and when both args are decimal and min > max.

    Signed-off-by: Joe Perches
    Cc: Yuval Mintz
    Cc: Andy Whitcroft
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Joe Perches
     
  • Warn on non-standard signature styles.

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

    Joe Perches
     
  • Parenthesis alignment doesn't correctly check an existing line after an
    inserted or modified line with an open parenthesis.

    Fix it.

    Signed-off-by: Joe Perches
    Cc: Andy Whitcroft
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Joe Perches
     
  • There are two ways to create /sys/firmware/memmap/X sysfs:

    - firmware_map_add_early
    When the system starts, it is calledd from e820_reserve_resources()
    - firmware_map_add_hotplug
    When the memory is hot plugged, it is called from add_memory()

    But these functions are called without unifying value of end argument as
    below:

    - end argument of firmware_map_add_early() : start + size - 1
    - end argument of firmware_map_add_hogplug() : start + size

    The patch unifies them to "start + size". Even if applying the patch,
    /sys/firmware/memmap/X/end file content does not change.

    [akpm@linux-foundation.org: clarify comments]
    Signed-off-by: Yasuaki Ishimatsu
    Reviewed-by: Dave Hansen
    Cc: Thomas Gleixner
    Cc: Ingo Molnar
    Cc: H. Peter Anvin
    Cc: Tejun Heo
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Yasuaki Ishimatsu
     
  • If there are two spinlocks embedded in a structure that kallsyms knows
    about and one of the spinlocks locks up we will print the name of the
    containing structure instead of the address of the lock. This is quite
    bad, so let's use %pS instead of %ps so we get an offset in addition to
    the symbol so we can determine which particular lock is having problems.

    Signed-off-by: Stephen Boyd
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Stephen Boyd
     
  • Introduce CONFIG_ARCH_HAS_ATOMIC64_DEC_IF_POSITIVE and use this instead
    of the multitude of #if defined() checks in atomic64_test.c

    Signed-off-by: Catalin Marinas
    Cc: Russell King
    Cc: Ralf Baechle
    Cc: Benjamin Herrenschmidt
    Cc: Paul Mackerras
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Catalin Marinas
     
  • Convert ext4_count_free() to use memweight() instead of table lookup
    based counting clear bits implementation. This change only affects the
    code segments enabled by EXT4FS_DEBUG.

    Note that this memweight() call can't be replaced with a single
    bitmap_weight() call, although the pointer to the memory area is aligned
    to long-word boundary. Because the size of the memory area may not be a
    multiple of BITS_PER_LONG, then it returns wrong value on big-endian
    architecture.

    This also includes the following change.

    - Remove unnecessary map == NULL check in ext4_count_free() which
    always takes non-null pointer as the memory area.

    Signed-off-by: Akinobu Mita
    Cc: "Theodore Ts'o"
    Cc: Andreas Dilger
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Akinobu Mita
     
  • Convert ext3_count_free() to use memweight() instead of table lookup
    based counting clear bits implementation. This change only affects the
    code segments enabled by EXT3FS_DEBUG.

    Note that this memweight() call can't be replaced with a single
    bitmap_weight() call, although the pointer to the memory area is aligned
    to long-word boundary. Because the size of the memory area may not be a
    multiple of BITS_PER_LONG, then it returns wrong value on big-endian
    architecture.

    This also includes the following changes.

    - Remove unnecessary map == NULL check in ext3_count_free() which
    always takes non-null pointer as the memory area.

    - Fix printk format warning that only reveals with EXT3FS_DEBUG.

    Signed-off-by: Akinobu Mita
    Acked-by: Jan Kara
    Cc: Andreas Dilger
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Akinobu Mita
     
  • Convert ext2_count_free() to use memweight() instead of table lookup
    based counting clear bits implementation. This change only affects the
    code segments enabled by EXT2FS_DEBUG.

    Note that this memweight() call can't be replaced with a single
    bitmap_weight() call, although the pointer to the memory area is aligned
    to long-word boundary. Because the size of the memory area may not be a
    multiple of BITS_PER_LONG, then it returns wrong value on big-endian
    architecture.

    This also includes the following changes.

    - Remove unnecessary map == NULL check in ext2_count_free() which
    always takes non-null pointer as the memory area.

    - Fix printk format warning that only reveals with EXT2FS_DEBUG.

    Signed-off-by: Akinobu Mita
    Acked-by: Jan Kara
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Akinobu Mita
     
  • Use memweight to count the total number of bits set in memory area.

    Signed-off-by: Akinobu Mita
    Cc: Mark Fasheh
    Cc: Joel Becker
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Akinobu Mita
     
  • Use memweight() to count the total number of bits set in memory area.

    Signed-off-by: Akinobu Mita
    Acked-by: Laurent Pinchart
    Acked-by: Mauro Carvalho Chehab
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Akinobu Mita
     
  • Use memweight() to count the total number of bits set in memory area.

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

    Akinobu Mita
     
  • Use memweight() to count the total number of bits set in memory area.

    Signed-off-by: Akinobu Mita
    Cc: Alasdair Kergon
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Akinobu Mita
     
  • Use memweight() to count the total number of bits clear in memory area.

    Note that this memweight() call can't be replaced with a single
    bitmap_weight() call, although the pointer to the memory area is aligned
    to long-word boundary. Because the size of the memory area may not be a
    multiple of BITS_PER_LONG, then it returns wrong value on big-endian
    architecture.

    Signed-off-by: Akinobu Mita
    Acked-by: Anders Larsen
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Akinobu Mita