01 May, 2008

40 commits

  • timer_stats_timer_set_start_info is invoked twice, additionally, the
    invocation of this function can be moved to where it is only called when a
    delay is really required.

    Signed-off-by: Andrew Liu
    Cc: Pavel Machek
    Cc: Ingo Molnar
    Cc: Oleg Nesterov
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Andrew Liu
     
  • Implement trivial statistics for the memory resource controller.

    Signed-off-by: Balaji Rao
    Acked-by: Balbir Singh
    Cc: Dhaval Giani
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Balaji Rao
     
  • Add support for pca9555 I2C I/O expander. As the comment suggests this part
    is software compatible with the pca9539.

    Signed-off-by: Will Newton
    Cc: "eric miao"
    Cc: David Brownell
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Will Newton
     
  • Here are some more places where path_{get,put}() can be used instead of
    dput()/mntput() pair. Besides that it fixes a bug in autofs4_mount_busy()
    where mntput() was called before dput().

    Signed-off-by: Jan Blunck
    Cc: Ian Kent
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Jan Blunck
     
  • Jeff Moyer has identified a case where the autofs4 function
    root.c:try_to_fill_dentry() can return -EBUSY when it should return 0.

    Jeff's description of the way this happens is:

    "automount starts an expire for directory d. after the callout to the daemon,
    but before the rmdir, another process tries to walk into the same directory.
    It puts itself onto the waitq, pending the expiration.

    When the expire finishes, the second process is woken up. In
    try_to_fill_dentry, it does this check:

    status = d_invalidate(dentry);
    if (status != -EBUSY)
    return -EAGAIN;

    And status is EBUSY. The dentry still has a non-zero d_inode, and the
    flags do not contain LOOKUP_CONTINUE or LOOKUP_DIRECTORY

    So, we fall through and return -EBUSY to the caller."

    Signed-off-by: Jeff Moyer
    Signed-off-by: Ian Kent
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Jeff Moyer
     
  • Jeff Moyer has identified a race in due to an execution order dependency
    in the autofs4 function root.c:try_to_fill_dentry().

    Jeff's description of this race is:

    "P1 does a lookup of /mount/submount/foo. Since the VFS can't find an entry
    for "foo" under /mount/submount, it calls into the autofs4 kernel module to
    allocate a new dentry, D1. The kernel creates a new waitq for this lookup and
    calls the daemon to perform the mount.

    The daemon performs a mkdir of the "foo" directory under /mount/submount,
    which ends up creating a *new* dentry, D2.

    Then, P2 does a lookup of /mount/submount/foo. The VFS path walking logic
    finds a dentry in the dcache, D2, and calls the revalidate function with this.
    In the autofs4 revalidate code, we then trigger a mount, since the dentry is
    an empty directory that isn't a mountpoint, and so set DCACHE_AUTOFS_PENDING
    and call into the wait code to trigger the mount.

    The wait code finds our existing waitq entry (since it is keyed off of the
    directory name) and adds itself to the list of waiters.

    After the daemon finishes the mount, it calls back into the kernel to release
    the waiters. When this happens, P1 is woken up and goes about clearing the
    DCACHE_AUTOFS_PENDING flag, but it does this in D1! So, given that P1 in our
    case is a program that will immediately try to access a file under
    /mount/submount/foo, we end up finding the dentry D2 which still has the
    pending flag set, and we set out to wait for a mount *again*!

    So, one way to address this is to re-do the lookup at the end of
    try_to_fill_dentry, and to clear the pending flag on the hashed dentry. This
    seems a sane approach to me."

    And Jeff's patch does this.

    Signed-off-by: Jeff Moyer
    Signed-off-by-by: Ian Kent
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Jeff Moyer
     
  • Catch invalid dentry when calculating its path.

    Signed-off-by: Ian Kent
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Ian Kent
     
  • Re-order some code in expire.c:autofs4_expire_indirect() to avoid compile
    warning, reported by Harvey Harrison:

    CHECK fs/autofs4/expire.c
    fs/autofs4/expire.c:383:2: warning: context imbalance in
    'autofs4_expire_indirect' - unexpected unlock

    Signed-off-by: Ian Kent
    Reviewed-by: Harvey Harrison
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Ian Kent
     
  • Note that it cannot be an inline function because we don't have struct
    super_block prototype...

    Signed-off-by: Jan Kara
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Jan Kara
     
  • On Fri, Apr 18, 2008 at 09:08:55PM +0200, Julia Lawall wrote:
    > I found 63 occurrences of this problem with the following semantic match
    > (http://www.emn.fr/x-info/coccinelle/):
    >
    > @@ unsigned int i; @@
    >
    > * i < 0
    >

    Since this one's always in the range 0-255, it could probably be made
    signed, but it's just as easy to make it work unsigned.

    Reported-by: Julia Lawall
    Signed-off-by: Matthew Wilcox
    Signed-off-by: David Brownell
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Matthew Wilcox
     
  • Use PIO for full-duplex transfers, instead of DMA.

    Signed-off-by: Vitja Makarov
    Signed-off-by: Bryan Wu
    Signed-off-by: David Brownell
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Vitja Makarov
     
  • The declaration of dmi helper functions is a bit messy and inconsistent at the
    moment:

    * On ia64 they are declared in .
    * On x86-64 they are declared in .
    * On i386 they are declared both in and .

    Fix the header files so that the dmi helper functions are consistently
    defined in .

    Signed-off-by: Jean Delvare
    Cc: Matt Domsch
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Jean Delvare
     
  • Add new PCI Express Neo/JSM board to the supported list of drivers in
    the JSM driver.

    Signed-off-by: Scott Kilau
    Acked-by: Ananda V
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Scott Kilau
     
  • Signed-off-by: Alan Cox
    Cc: Russell King
    Cc: Ingo Molnar
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Alan Cox
     
  • The i8k driver multiplies the fan speed reported by the BIOS with a factor of
    30. On my Dell Latitude D800, this factor is not required.

    I'd suggest to make this configurable.

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

    Jochen Eisinger
     
  • The return inside the loop makes us free only a single layer.

    Signed-off-by: Nadia Derbey
    Cc: "Paul E. McKenney"
    Cc: Manfred Spraul
    Cc: Jim Houston
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Nadia Derbey
     
  • next-20080430/drivers/pnp/pnpbios/rsparser.c:594: warning: format '%d' expects type 'int', but argument 4 has type 'resource_size_t'
    next-20080430/drivers/pnp/pnpbios/rsparser.c:605: warning: format '%d' expects type 'int', but argument 4 has type 'resource_size_t'

    [joe@perches.com: fix it]
    [akpm@linux-foundation.org: coding-style fixes]
    Signed-off-by: Randy Dunlap
    Cc: Bjorn Helgaas
    Signed-off-by: Joe Perches

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

    Randy Dunlap
     
  • __FUNCTION__ is gcc-specific, use __func__

    Signed-off-by: Harvey Harrison
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Harvey Harrison
     
  • Cc: Russell King
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Andrew Morton
     
  • Alchemy Semi Au1000 pcmcia driver: The semaphore pcmcia_sockets_lock
    is used as a mutex, convert it to the mutex API

    (akpm: make it static too)

    Signed-off-by: Matthias Kaehlcke
    Cc: Ralf Baechle
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Matthias Kaehlcke
     
  • cb_alloc() uses a function (pci_scan_slot) that will be annotated __devinit.

    Annotate cb_alloc() with __ref to tell modpost to ignore this reference.

    Signed-off-by: Sam Ravnborg
    Cc: Dominik Brodowski
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Sam Ravnborg
     
  • Silence following warnings:
    WARNING: drivers/pcmcia/built-in.o(.data+0x14e0): Section mismatch in reference from the variable pd6729_pci_drv to the function .devinit.text:pd6729_pci_probe()
    WARNING: drivers/pcmcia/built-in.o(.data+0x14e8): Section mismatch in reference from the variable pd6729_pci_drv to the function .devexit.text:pd6729_pci_remove()
    WARNING: drivers/pcmcia/built-in.o(.data+0x16c0): Section mismatch in reference from the variable i82092aa_pci_drv to the function .devinit.text:i82092aa_pci_probe()
    WARNING: drivers/pcmcia/built-in.o(.data+0x16c8): Section mismatch in reference from the variable i82092aa_pci_drv to the function .devexit.text:i82092aa_pci_remove()

    Rename the variables from *_drv to *_driver so modpost ignore the OK
    references to __devinit/__devexit functions.

    Signed-off-by: Sam Ravnborg
    Cc: Dominik Brodowski
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Sam Ravnborg
     
  • Silence the following warnings:
    WARNING: drivers/pcmcia/built-in.o(.data+0x6e8): Section mismatch in reference from the variable pcmcia_bus_interface to the function .devinit.text:pcmcia_bus_add_socket()
    WARNING: drivers/pcmcia/built-in.o(.data+0xa88): Section mismatch in reference from the variable pccard_rsrc_interface to the function .devinit.text:pccard_sysfs_add_rsrc()
    WARNING: drivers/pcmcia/built-in.o(.data+0xa90): Section mismatch in reference from the variable pccard_rsrc_interface to the function .devexit.text:pccard_sysfs_remove_rsrc()

    The variables of type class_interface contains references
    to __devinit and __devexit functions which is OK.
    Silence warnings by annotating the variables with __refdata.

    Signed-off-by: Sam Ravnborg
    Cc: Dominik Brodowski
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Sam Ravnborg
     
  • The extended crashkernel syntax is a little confusing in the way it handles
    ranges. eg:

    crashkernel=512M-2G:64M,2G-:128M

    Means if the machine has between 512M and 2G of memory the crash region should
    be 64M, and if the machine has 2G of memory the region should be 64M. Only if
    the machine has more than 2G memory will 128M be allocated.

    Although that semantic is correct, it is somewhat baffling. Instead I propose
    that the end of the range means the first address past the end of the range,
    ie: 512M up to but not including 2G.

    [bwalle@suse.de: clarify inclusive/exclusive in crashkernel commandline in documentation]
    Signed-off-by: Michael Ellerman
    Acked-by: Bernhard Walle
    Cc: "Eric W. Biederman"
    Cc: Simon Horman
    Signed-off-by: Bernhard Walle
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Michael Ellerman
     
  • Fix vmalloc kernel-doc warning:

    Warning(linux-2.6.25-git14//mm/vmalloc.c:555): No description found for parameter 'caller'

    Signed-off-by: Randy Dunlap
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Randy Dunlap
     
  • x86.git randconfig testing found the following build error in latest
    -git:

    CC [M] drivers/isdn/hysdn/hysdn_procconf.o
    CC [M] drivers/isdn/hysdn/hysdn_init.o
    drivers/isdn/hysdn/hysdn_procconf.c: In function 'hysdn_procconf_init':
    drivers/isdn/hysdn/hysdn_procconf.c:408: error: too few arguments to function 'proc_create'

    with the following config:

    http://redhat.com/~mingo/misc/config-Wed_Apr_30_15_12_48_CEST_2008.bad

    Signed-off-by: Ingo Molnar
    Cc: "Denis V. Lunev"
    Cc: Karsten Keil
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Ingo Molnar
     
  • Add Paul and myself, and the linux-embedded list, to MAINTAINERS.

    Signed-off-by: David Woodhouse
    Signed-off-by: Paul Gortmaker
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    David Woodhouse
     
  • If utimensat() is called with both times set to UTIME_NOW or one of them to
    UTIME_NOW and the other to UTIME_OMIT, then it will update the file time
    without any permission checking.

    I don't think this can be used for anything other than a local DoS, but could
    be quite bewildering at that (e.g. "Why was that large source tree rebuilt
    when I didn't modify anything???")

    This affects all kernels from 2.6.22, when the utimensat() syscall was
    introduced.

    Fix by doing the same permission checking as for the "times == NULL" case.

    Thanks to Michael Kerrisk, whose utimensat-non-conformances-and-fixes.patch in
    -mm also fixes this (and breaks other stuff), only he didn't realize the
    security implications of this bug.

    Signed-off-by: Miklos Szeredi
    Cc: Ulrich Drepper
    Cc: Michael Kerrisk
    Cc:
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Miklos Szeredi
     
  • scsi_transport_spi uses sysfs_update_group() when CONFIG_SYSFS=n, so provide a
    stub for it.

    next-20080423/drivers/scsi/scsi_transport_spi.c:1467: error: implicit declaration of function 'sysfs_update_group'
    make[3]: *** [drivers/scsi/scsi_transport_spi.o] Error 1

    Signed-off-by: Randy Dunlap
    Cc: Greg KH
    Cc: James Bottomley
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Randy Dunlap
     
  • Add a new sysfs_streq() string comparison function, which ignores
    the trailing newlines found in sysfs inputs. By example:

    sysfs_streq("a", "b") ==> false
    sysfs_streq("a", "a") ==> true
    sysfs_streq("a", "a\n") ==> true
    sysfs_streq("a\n", "a") ==> true

    This is intended to simplify parsing of sysfs inputs, letting them
    avoid the need to manually strip off newlines from inputs.

    Signed-off-by: David Brownell
    Acked-by: Greg KH
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    David Brownell
     
  • Remove the leap second handling from second_overflow(), which doesn't have to
    check for it every second anymore. With CONFIG_NO_HZ this also makes sure the
    leap second is handled close to the full second. Additionally this makes it
    possible to abort a leap second properly by resetting the STA_INS/STA_DEL
    status bits.

    Signed-off-by: Roman Zippel
    Cc: john stultz
    Cc: Thomas Gleixner
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Roman Zippel
     
  • current_tick_length used to do a little more, but now it just returns
    tick_length, which we can also access directly at the few places, where it's
    needed.

    Signed-off-by: Roman Zippel
    Cc: john stultz
    Cc: Thomas Gleixner
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Roman Zippel
     
  • As TICK_LENGTH_SHIFT is used for more than just the tick length, the name
    isn't quite approriate anymore, so this renames it to NTP_SCALE_SHIFT.

    Signed-off-by: Roman Zippel
    Cc: john stultz
    Cc: Thomas Gleixner
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Roman Zippel
     
  • This adds support for setting the TAI value (International Atomic Time). The
    value is reported back to userspace via timex (as we don't have a
    ntp_gettime() syscall).

    Signed-off-by: Roman Zippel
    Cc: john stultz
    Cc: Thomas Gleixner
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Roman Zippel
     
  • time_offset is already a 64bit value but its resolution barely used, so this
    makes better use of it by replacing SHIFT_UPDATE with TICK_LENGTH_SHIFT.

    Side note: the SHIFT_HZ in SHIFT_UPDATE was incorrect for CONFIG_NO_HZ and the
    primary reason for changing time_offset to 64bit to avoid the overflow.

    Signed-off-by: Roman Zippel
    Cc: john stultz
    Cc: Thomas Gleixner
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Roman Zippel
     
  • This changes time_freq to a 64bit value and makes it static (the only outside
    user had no real need to modify it). Intermediate values were already 64bit,
    so the change isn't that big, but it saves a little in shifts by replacing
    SHIFT_NSEC with TICK_LENGTH_SHIFT. PPM_SCALE is then used to convert between
    user space and kernel space representation.

    Signed-off-by: Roman Zippel
    Cc: john stultz
    Cc: Thomas Gleixner
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Roman Zippel
     
  • This adds a few more things from the ntp nanokernel related to user space.
    It's now possible to select the resolution used of some values via STA_NANO
    and the kernel reports in which mode it works (pll/fll).

    If some values for adjtimex() are outside the acceptable range, they are now
    simply normalized instead of letting the syscall fail. I removed
    MOD_CLKA/MOD_CLKB as the mapping didn't really makes any sense, the kernel
    doesn't support setting the clock.

    Signed-off-by: Roman Zippel
    Cc: john stultz
    Cc: Thomas Gleixner
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Roman Zippel
     
  • This is mostly a style cleanup of ntp.c and extracts part of do_adjtimex as
    ntp_update_offset(). Otherwise the functionality is still the same as before.

    Signed-off-by: Roman Zippel
    Cc: john stultz
    Cc: Thomas Gleixner
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Roman Zippel
     
  • x86 is the only arch right now, which provides an optimized for
    div_long_long_rem and it has the downside that one has to be very careful that
    the divide doesn't overflow.

    The API is a little akward, as the arguments for the unsigned divide are
    signed. The signed version also doesn't handle a negative divisor and
    produces worse code on 64bit archs.

    There is little incentive to keep this API alive, so this converts the few
    users to the new API.

    Signed-off-by: Roman Zippel
    Cc: Ralf Baechle
    Cc: Ingo Molnar
    Cc: Thomas Gleixner
    Cc: john stultz
    Cc: Christoph Lameter
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Roman Zippel
     
  • Rename div64_64 to div64_u64 to make it consistent with the other divide
    functions, so it clearly includes the type of the divide. Move its definition
    to math64.h as currently no architecture overrides the generic implementation.
    They can still override it of course, but the duplicated declarations are
    avoided.

    Signed-off-by: Roman Zippel
    Cc: Avi Kivity
    Cc: Russell King
    Cc: Geert Uytterhoeven
    Cc: Ralf Baechle
    Cc: David Howells
    Cc: Jeff Dike
    Cc: Ingo Molnar
    Cc: "David S. Miller"
    Cc: Patrick McHardy
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Roman Zippel