17 Dec, 2009

1 commit

  • * 'next' of git://git.secretlab.ca/git/linux-2.6: (23 commits)
    powerpc: fix up for mmu_mapin_ram api change
    powerpc: wii: allow ioremap within the memory hole
    powerpc: allow ioremap within reserved memory regions
    wii: use both mem1 and mem2 as ram
    wii: bootwrapper: add fixup to calc useable mem2
    powerpc: gamecube/wii: early debugging using usbgecko
    powerpc: reserve fixmap entries for early debug
    powerpc: wii: default config
    powerpc: wii: platform support
    powerpc: wii: hollywood interrupt controller support
    powerpc: broadway processor support
    powerpc: wii: bootwrapper bits
    powerpc: wii: device tree
    powerpc: gamecube: default config
    powerpc: gamecube: platform support
    powerpc: gamecube/wii: flipper interrupt controller support
    powerpc: gamecube/wii: udbg support for usbgecko
    powerpc: gamecube/wii: do not include PCI support
    powerpc: gamecube/wii: declare as non-coherent platforms
    powerpc: gamecube/wii: introduce GAMECUBE_COMMON
    ...

    Fix up conflicts in arch/powerpc/mm/fsl_booke_mmu.c.

    Hopefully even close to correctly.

    Linus Torvalds
     

16 Dec, 2009

24 commits

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

    Akinobu Mita
     
  • Use bitmap library and kill some unused iommu helper functions.

    1. s/iommu_area_free/bitmap_clear/

    2. s/iommu_area_reserve/bitmap_set/

    3. Use bitmap_find_next_zero_area instead of find_next_zero_area

    This cannot be simple substitution because find_next_zero_area
    doesn't check the last bit of the limit in bitmap

    4. Remove iommu_area_free, iommu_area_reserve, and find_next_zero_area

    Signed-off-by: Akinobu Mita
    Cc: "David S. Miller"
    Cc: Benjamin Herrenschmidt
    Cc: Paul Mackerras
    Cc: Thomas Gleixner
    Cc: Ingo Molnar
    Cc: "H. Peter Anvin"
    Cc: FUJITA Tomonori
    Cc: Joerg Roedel
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Akinobu Mita
     
  • This introduces new bitmap functions:

    bitmap_set: Set specified bit area
    bitmap_clear: Clear specified bit area
    bitmap_find_next_zero_area: Find free bit area

    These are mostly stolen from iommu helper. The differences are:

    - Use find_next_bit instead of doing test_bit for each bit

    - Rewrite bitmap_set and bitmap_clear

    Instead of setting or clearing for each bit.

    - Check the last bit of the limit

    iommu-helper doesn't want to find such area

    - The return value if there is no zero area

    find_next_zero_area in iommu helper: returns -1
    bitmap_find_next_zero_area: return >= bitmap size

    Signed-off-by: Akinobu Mita
    Cc: FUJITA Tomonori
    Cc: "David S. Miller"
    Cc: Benjamin Herrenschmidt
    Cc: Paul Mackerras
    Cc: Thomas Gleixner
    Cc: Ingo Molnar
    Cc: "H. Peter Anvin"
    Cc: Greg Kroah-Hartman
    Cc: Lothar Wassmann
    Cc: Roland Dreier
    Cc: Yevgeny Petrilin
    Cc: Tony Luck
    Cc: Fenghua Yu
    Cc: Joerg Roedel
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Akinobu Mita
     
  • dma_mask is, when interpreted as address, the last valid byte, and hence
    comparison msut also be done using the last valid of the buffer in
    question.

    Also fix the open-coded instances in lib/swiotlb.c.

    Signed-off-by: Jan Beulich
    Cc: FUJITA Tomonori
    Cc: Becky Bruce
    Cc: "Luck, Tony"
    Cc: Benjamin Herrenschmidt
    Cc: Ingo Molnar
    Cc: Thomas Gleixner
    Cc: "H. Peter Anvin"
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Jan Beulich
     
  • …el/git/tip/linux-2.6-tip

    * 'core-locking-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip: (26 commits)
    clockevents: Convert to raw_spinlock
    clockevents: Make tick_device_lock static
    debugobjects: Convert to raw_spinlocks
    perf_event: Convert to raw_spinlock
    hrtimers: Convert to raw_spinlocks
    genirq: Convert irq_desc.lock to raw_spinlock
    smp: Convert smplocks to raw_spinlocks
    rtmutes: Convert rtmutex.lock to raw_spinlock
    sched: Convert pi_lock to raw_spinlock
    sched: Convert cpupri lock to raw_spinlock
    sched: Convert rt_runtime_lock to raw_spinlock
    sched: Convert rq->lock to raw_spinlock
    plist: Make plist debugging raw_spinlock aware
    bkl: Fixup core_lock fallout
    locking: Cleanup the name space completely
    locking: Further name space cleanups
    alpha: Fix fallout from locking changes
    locking: Implement new raw_spinlock
    locking: Convert raw_rwlock functions to arch_rwlock
    locking: Convert raw_rwlock to arch_rwlock
    ...

    Linus Torvalds
     
  • Move common crc body to new function crc32_body() cleaup and micro
    optimize crc32_body for speed and less size.

    [akpm@linux-foundation.org: coding-style fixes]
    Signed-off-by: Joakim Tjernlund
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Joakim Tjernlund
     
  • Recently, We marked strstrip() as must_check. because it was frequently
    misused and it should be checked. However, we found one exception.
    scsi/ipr.c intentionally ignore return value of strstrip. Because it
    wishes to keep the whitespace at the beginning.

    Thus we need to keep with and without checked whitespace trim function.
    This patch adds a new strim() and changes ipr.c to use it.

    [akpm@linux-foundation.org: coding-style fixes]
    Suggested-by: Alan Cox
    Signed-off-by: KOSAKI Motohiro
    Cc: James Bottomley
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    KOSAKI Motohiro
     
  • UUID/GUIDs are somewhat common in kernel source.

    Standardize the printed style of UUID/GUIDs by using
    another extension to %p.

    %pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
    %pUB: 01020304-0506-0708-090A-0B0C0D0E0F10 (upper case)
    %pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
    %pUL: 04030201-0605-0807-090A-0B0C0D0E0F10 (upper case)

    %pU defaults to %pUb

    Signed-off-by: Joe Perches
    Cc: Jeff Garzik
    Cc: Tejun Heo
    Cc: Alex Elder
    Cc: Christoph Hellwig
    Cc: Artem Bityutskiy
    Cc: Adrian Hunter
    Cc: Steven Whitehouse
    Cc: Mauro Carvalho Chehab
    Cc: Matt Mackall
    Cc: Neil Brown
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Joe Perches
     
  • No functional change. Cache strlen() result to avoid recalculating it up
    to 3 times on the worst case.

    Reduces code size a little by 32 bytes:
    text data bss dec hex filename
    1385 0 0 1385 569 lib/parser.o-BEFORE
    1353 0 0 1353 549 lib/parser.o-AFTER

    Signed-off-by: André Goddard Rosa
    Cc: Randy Dunlap
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    André Goddard Rosa
     
  • Makes use of skip_spaces() defined in lib/string.c for removing leading
    spaces from strings all over the tree.

    It decreases lib.a code size by 47 bytes and reuses the function tree-wide:
    text data bss dec hex filename
    64688 584 592 65864 10148 (TOTALS-BEFORE)
    64641 584 592 65817 10119 (TOTALS-AFTER)

    Also, while at it, if we see (*str && isspace(*str)), we can be sure to
    remove the first condition (*str) as the second one (isspace(*str)) also
    evaluates to 0 whenever *str == 0, making it redundant. In other words,
    "a char equals zero is never a space".

    Julia Lawall tried the semantic patch (http://coccinelle.lip6.fr) below,
    and found occurrences of this pattern on 3 more files:
    drivers/leds/led-class.c
    drivers/leds/ledtrig-timer.c
    drivers/video/output.c

    @@
    expression str;
    @@

    ( // ignore skip_spaces cases
    while (*str && isspace(*str)) { \(str++;\|++str;\) }
    |
    - *str &&
    isspace(*str)
    )

    Signed-off-by: André Goddard Rosa
    Cc: Julia Lawall
    Cc: Martin Schwidefsky
    Cc: Jeff Dike
    Cc: Ingo Molnar
    Cc: Thomas Gleixner
    Cc: "H. Peter Anvin"
    Cc: Richard Purdie
    Cc: Neil Brown
    Cc: Kyle McMartin
    Cc: Henrique de Moraes Holschuh
    Cc: David Howells
    Cc:
    Cc: Samuel Ortiz
    Cc: Patrick McHardy
    Cc: Takashi Iwai
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    André Goddard Rosa
     
  • ... so that strlen() iterates over a smaller string comprising of the
    remaining characters only.

    Signed-off-by: André Goddard Rosa
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    André Goddard Rosa
     
  • On the following sentence:
    while (*s && isspace(*s))
    s++;

    If *s == 0, isspace() evaluates to ((_ctype[*s] & 0x20) != 0), which
    evaluates to ((0x08 & 0x20) != 0) which equals to 0 as well.
    If *s == 1, we depend on isspace() result anyway. In other words,
    "a char equals zero is never a space", so remove this check.

    Also, *s != 0 is most common case (non-null string).

    Fixed const return as noticed by Jan Engelhardt and James Bottomley.
    Fixed unnecessary extra cast on strstrip() as noticed by Jan Engelhardt.

    Signed-off-by: André Goddard Rosa
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    André Goddard Rosa
     
  • While at it, use tabs to indent the comments.

    Signed-off-by: André Goddard Rosa
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    André Goddard Rosa
     
  • The difference between simple_strtoul() and simple_strtoull() is just
    the size of the variable used to keep track of the sum of characters
    converted to numbers:

    unsigned long simple_strtoul() {...}
    unsigned long long simple_strtoull(){...}

    Both are same size on my Core 2/gcc 4.4.1.
    Overflow condition is not checked on both functions, so an extremely large
    string can break these functions so that they don't even notice it.

    As we do not care for overflowing on these functions, always keep the sum
    using the larger variable around (unsigned long long) on simple_strtoull()
    and cast it to (unsigned long) on simple_strtoul(), which then becomes
    just a wrapper around simple_strtoull().

    Code size decreases by 304 bytes:
    text data bss dec hex filename
    15534 0 8 15542 3cb6 vsprintf.o (ex lib/lib.a-BEFORE)
    15230 0 8 15238 3b86 vsprintf.o (ex lib/lib.a-AFTER)

    Signed-off-by: André Goddard Rosa
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    André Goddard Rosa
     
  • When converting more caller sites, the inline decision will be left up to gcc.

    It decreases code size:
    text data bss dec hex filename
    15710 0 8 15718 3d66 vsprintf.o (ex lib/lib.a-BEFORE)
    15534 0 8 15542 3cb6 vsprintf.o (ex lib/lib.a-AFTER)

    Signed-off-by: André Goddard Rosa
    Acked-by: Frederic Weisbecker
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    André Goddard Rosa
     
  • Cleanup by moving variables closer to the scope where they're used in fact.
    Also, remove unneeded ones.

    Signed-off-by: André Goddard Rosa
    Acked-by: Frederic Weisbecker
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    André Goddard Rosa
     
  • No functional change, just refactor the code so that it avoid checking
    "if (hi)" two times in a sequence, taking advantage of previous check made.

    It also reduces code size:
    text data bss dec hex filename
    15726 0 8 15734 3d76 vsprintf.o (ex lib/lib.a-BEFORE)
    15710 0 8 15718 3d66 vsprintf.o (ex lib/lib.a-AFTER)

    Signed-off-by: André Goddard Rosa
    Acked-by: Frederic Weisbecker
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    André Goddard Rosa
     
  • It decreases code size as well:
    text data bss dec hex filename
    15758 0 8 15766 3d96 vsprintf.o (ex lib/lib.a-BEFORE)
    15726 0 8 15734 3d76 vsprintf.o (ex lib/lib.a-TOLOWER)

    Signed-off-by: André Goddard Rosa
    Acked-by: Frederic Weisbecker
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    André Goddard Rosa
     
  • Most relevant complaints were addressed.

    Signed-off-by: André Goddard Rosa
    Acked-by: Frederic Weisbecker
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    André Goddard Rosa
     
  • Signed-off-by: André Goddard Rosa
    Acked-by: Frederic Weisbecker
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    André Goddard Rosa
     
  • This patchset reduces lib/lib.a code size by 482 bytes on my Core 2 with
    gcc 4.4.1 even considering that it exports a newly defined function
    skip_spaces() to drivers:

    text data bss dec hex filename
    64867 840 592 66299 102fb (TOTALS-lib.a-BEFORE)
    64641 584 592 65817 10119 (TOTALS-lib.a-AFTER)
    and implements some code tidy up.

    Besides reducing lib.a size, it converts many in-tree drivers to use the
    newly defined function, which makes another small reduction on kernel size
    overall when those drivers are used.

    This patch:

    Change "" to "(null)", unifying 3 equal strings.
    glibc also uses "(null)" for the same purpose.

    It decreases code size by 7 bytes:
    text data bss dec hex filename
    15765 0 8 15773 3d9d vsprintf.o (ex lib/lib.a-BEFORE)
    15758 0 8 15766 3d96 vsprintf.o (ex lib/lib.a-AFTER)

    Signed-off-by: André Goddard Rosa
    Acked-by: Frederic Weisbecker
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    André Goddard Rosa
     
  • It's easy to lose useful DEBUG_BUGVERBOSE by switching EMBEDDED left and right.

    Signed-off-by: Alexey Dobriyan
    Cc: Sam Ravnborg
    Cc: Ingo Molnar
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Alexey Dobriyan
     
  • rwsem_is_locked() tests ->activity without locks, so we should always keep
    ->activity consistent. However, the code in __rwsem_do_wake() breaks this
    rule, it updates ->activity after _all_ readers waken up, this may give
    some reader a wrong ->activity value, thus cause rwsem_is_locked() behaves
    wrong.

    Quote from Andrew:

    "
    - we have one or more processes sleeping in down_read(), waiting for access.

    - we wake one or more processes up without altering ->activity

    - they start to run and they do rwsem_is_locked(). This incorrectly
    returns "false", because the waker process is still crunching away in
    __rwsem_do_wake().

    - the waker now alters ->activity, but it was too late.
    "

    So we need get a spinlock to protect this. And rwsem_is_locked() should
    not block, thus we use spin_trylock_irqsave().

    [akpm@linux-foundation.org: simplify code]
    Reported-by: Brian Behlendorf
    Cc: Ben Woodard
    Cc: David Howells
    Signed-off-by: WANG Cong
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Amerigo Wang
     
  • These functions need not to be exported, since no drivers should use them.

    __init_rwsem() is an exception, because init_rwsem(), which is a macro,
    is used.

    Signed-off-by: WANG Cong
    Cc: David Howells
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Amerigo Wang
     

15 Dec, 2009

10 commits

  • Convert locks which cannot be sleeping locks in preempt-rt to
    raw_spinlocks.

    Signed-off-by: Thomas Gleixner
    Acked-by: Peter Zijlstra
    Acked-by: Ingo Molnar

    Thomas Gleixner
     
  • plists are used with spinlocks and raw_spinlocks. Change the plist
    debugging to handle both types.

    Signed-off-by: Thomas Gleixner
    Acked-by: Peter Zijlstra
    Acked-by: Ingo Molnar

    Thomas Gleixner
     
  • kernel_lock.c emits a warning because a raw spinlock function is used
    with a spinlock. Convert BKL to raw_spinlock.

    Signed-off-by: Thomas Gleixner
    Acked-by: Peter Zijlstra
    Acked-by: Ingo Molnar

    Thomas Gleixner
     
  • The name space hierarchy for the internal lock functions is now a bit
    backwards. raw_spin* functions map to _spin* which use __spin*, while
    we would like to have _raw_spin* and __raw_spin*.

    _raw_spin* is already used by lock debugging, so rename those funtions
    to do_raw_spin* to free up the _raw_spin* name space.

    No functional change.

    Signed-off-by: Thomas Gleixner
    Acked-by: Peter Zijlstra
    Acked-by: Ingo Molnar

    Thomas Gleixner
     
  • Now that the raw_spin name space is freed up, we can implement
    raw_spinlock and the related functions which are used to annotate the
    locks which are not converted to sleeping spinlocks in preempt-rt.

    A side effect is that only such locks can be used with the low level
    lock fsunctions which circumvent lockdep.

    For !rt spin_* functions are mapped to the raw_spin* implementations.

    Signed-off-by: Thomas Gleixner
    Acked-by: Peter Zijlstra
    Acked-by: Ingo Molnar

    Thomas Gleixner
     
  • Name space cleanup for rwlock functions. No functional change.

    Signed-off-by: Thomas Gleixner
    Acked-by: Peter Zijlstra
    Acked-by: David S. Miller
    Acked-by: Ingo Molnar
    Cc: linux-arch@vger.kernel.org

    Thomas Gleixner
     
  • Not strictly necessary for -rt as -rt does not have non sleeping
    rwlocks, but it's odd to not have a consistent naming convention.

    No functional change.

    Signed-off-by: Thomas Gleixner
    Acked-by: Peter Zijlstra
    Acked-by: David S. Miller
    Acked-by: Ingo Molnar
    Cc: linux-arch@vger.kernel.org

    Thomas Gleixner
     
  • Name space cleanup. No functional change.

    Signed-off-by: Thomas Gleixner
    Acked-by: Peter Zijlstra
    Acked-by: David S. Miller
    Acked-by: Ingo Molnar
    Cc: linux-arch@vger.kernel.org

    Thomas Gleixner
     
  • Further name space cleanup. No functional change

    Signed-off-by: Thomas Gleixner
    Acked-by: Peter Zijlstra
    Acked-by: David S. Miller
    Acked-by: Ingo Molnar
    Cc: linux-arch@vger.kernel.org

    Thomas Gleixner
     
  • The raw_spin* namespace was taken by lockdep for the architecture
    specific implementations. raw_spin_* would be the ideal name space for
    the spinlocks which are not converted to sleeping locks in preempt-rt.

    Linus suggested to convert the raw_ to arch_ locks and cleanup the
    name space instead of using an artifical name like core_spin,
    atomic_spin or whatever

    No functional change.

    Signed-off-by: Thomas Gleixner
    Acked-by: Peter Zijlstra
    Acked-by: David S. Miller
    Acked-by: Ingo Molnar
    Cc: linux-arch@vger.kernel.org

    Thomas Gleixner
     

13 Dec, 2009

2 commits

  • Add a flag to let a platform ioremap memory regions marked as reserved.

    This flag will be used later by the Nintendo Wii support code to allow
    ioremapping the I/O region sitting between MEM1 and MEM2 and marked
    as reserved RAM in the patch "wii: use both mem1 and mem2 as ram".

    This will no longer be needed when proper discontig memory support
    for 32-bit PowerPC is added to the kernel.

    Signed-off-by: Albert Herranz
    Acked-by: Benjamin Herrenschmidt
    Signed-off-by: Grant Likely

    Albert Herranz
     
  • As shown by the previous patch (6698e3472: "tty: Fix BKL taken under a
    spinlock bug introduced in the BKL split") the BKL removal is prone to
    some subtle issues, where removing the BKL in one place may in fact make
    a previously nested BKL call the new outer call, and then prone to nasty
    deadlocks with other spinlocks.

    In general, we should never take the BKL while we're holding a spinlock,
    so let's just add a "might_sleep()" to it (even though the BKL doesn't
    technically sleep - at least not yet), and we'll get nice warnings the
    next time this kind of problem happens during BKL removal.

    Acked-and-Tested-by: Thomas Gleixner
    Signed-off-by: Linus Torvalds

    Linus Torvalds
     

12 Dec, 2009

2 commits

  • * git://git.kernel.org/pub/scm/linux/kernel/git/arnd/asm-generic:
    asm-generic: add sys_recvmmsg to unistd.h
    asm-generic: add sys_accept4 to unistd.h
    asm-generic/gpio.h: add some forward decls of the device struct
    asm-generic: Fix typo in asm-generic/unistd.h.
    lib/checksum: fix one more thinko
    lib/checksum.c: make do_csum optional
    lib/checksum.c: use 32-bit arithmetic consistently

    Linus Torvalds
     
  • * 'linux-next' of git://git.kernel.org/pub/scm/linux/kernel/git/jbarnes/pci-2.6: (109 commits)
    PCI: fix coding style issue in pci_save_state()
    PCI: add pci_request_acs
    PCI: fix BUG_ON triggered by logical PCIe root port removal
    PCI: remove ifdefed pci_cleanup_aer_correct_error_status
    PCI: unconditionally clear AER uncorr status register during cleanup
    x86/PCI: claim SR-IOV BARs in pcibios_allocate_resource
    PCI: portdrv: remove redundant definitions
    PCI: portdrv: remove unnecessary struct pcie_port_data
    PCI: portdrv: minor cleanup for pcie_port_device_register
    PCI: portdrv: add missing irq cleanup
    PCI: portdrv: enable device before irq initialization
    PCI: portdrv: cleanup service irqs initialization
    PCI: portdrv: check capabilities first
    PCI: portdrv: move PME capability check
    PCI: portdrv: remove redundant pcie type calculation
    PCI: portdrv: cleanup pcie_device registration
    PCI: portdrv: remove redundant pcie_port_device_probe
    PCI: Always set prefetchable base/limit upper32 registers
    PCI: read-modify-write the pcie device control register when initiating pcie flr
    PCI: show dma_mask bits in /sys
    ...

    Fixed up conflicts in:
    arch/x86/kernel/amd_iommu_init.c
    drivers/pci/dmar.c
    drivers/pci/hotplug/acpiphp_glue.c

    Linus Torvalds
     

11 Dec, 2009

1 commit