14 Jan, 2011

40 commits

  • Signed-off-by: Lasse Collin
    Cc: "H. Peter Anvin"
    Cc: Alain Knaff
    Cc: Albin Tonnerre
    Cc: Phillip Lougher
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Lasse Collin
     
  • This header uses things like __be32, so pull in linux/types.h.

    Further, it uses BLOCK_SIZE, so pull in linux/fs.h.

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

    Mike Frysinger
     
  • Cc: Ahmed S. Darwish
    Cc: Kyungmin Park
    Cc: Marco Stornelli
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Andrew Morton
     
  • Generate a unique inode numbers for any entries in the cram file system.
    For files which did not contain data's (device nodes, fifos and sockets)
    the offset of the directory entry inside the cramfs plus 1 will be used as
    inode number.

    The + 1 for the inode will it make possible to distinguish between a file
    which contains no data and files which has data, the later one has a inode
    value where the lower two bits are always 0.

    It also reimplements the behavior to set the size and the number of block
    to 0 for special file, which is the right value for empty files, devices,
    fifos and sockets

    As a little benefit it will be also more compatible which older mkcramfs,
    because it will never use the cramfs_inode->offset for creating a inode
    number for special files.

    [akpm@linux-foundation.org: trivial comment fix]
    [akpm@linux-foundation.org: coding-style fixes]
    Signed-off-by: Stefani Seibold
    Cc: Al Viro
    Cc: Pekka Enberg
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Stefani Seibold
     
  • Currently, 3 kernel function prototypes are present in a header
    file exported to userland. This patch fixes it.

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

    Alexander Shishkin
     
  • aio_run_iocbs() is not used at all, so get rid of it.

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

    Jeff Moyer
     
  • 'nr >= min_nr >= 0' always satisfies 'nr >= 0' so the check is unnecesary.

    Signed-off-by: Namhyung Kim
    Acked-by: Jeff Moyer
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Namhyung Kim
     
  • When hypervisor decides to decrease target balloon size while the balloon
    driver tries to lock pages hypervisor may respond with
    VMW_BALLOON_PPN_NOTNEEDED. Use this data and immediately stop reserving
    pages and wait for the next update cycle to fetch new target instead of
    continuing trying to lock pages until size of refused list grows above
    VMW_BALLOON_MAX_REFUSED (16) pages.

    As a result the driver stops bothering the hypervisor with its attempts to
    lock more pages that are not needed anymore. Most likely next order from
    hypervisor will be to reduce ballon size anyway.

    It is a small optimization.

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

    Dmitry Torokhov
     
  • This is a 1-wire/w1 DS2423 slave driver for reading the values from all 4
    counters available DS2423 devices by using standard w1_slave file. In
    ds2423 the counters are tied to ram pages 12-15 in and each of those
    ram-pages. Each of these counter values (and asoociated ram page values)
    are represented as a own line in w1_slave file. Driver has been tested on
    mips and x86.

    usage example:
    cat /sys/bus/w1/devices/1d-00000009b964/w1_slave

    00 02 00 00 00 00 00 00 00 6d 38 00 ff ff 00 00 fe ff 00 00 ff ff 00 00 ff
    ff 00 00 ff ff 00 00 ff ff 00 00 ff ff 00 00 ff ff crc=YES c=2
    00 02 00 00 00 00 00 00 00 e0 1f 00 ff ff 00 00 ff ff 00 00 ff ff 00 00 ff
    ff 00 00 ff ff 00 00 ff ff 00 00 ff ff 00 00 ff ff crc=YES c=2
    00 5a 0e 5f 18 00 00 00 00 0b 28 00 ff ff 00 00 ff ff 00 00 ff ff 00 00 ff
    ff 00 00 ff ff 00 00 ff ff 00 00 ff ff 00 00 ff ff crc=YES c=408882778
    00 05 00 00 00 00 00 00 00 8d 39 ff ff ff ff ff ff ff ff ff ff ff ff ff ff
    ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff crc=YES c=5

    Patch includes also the documentation.

    [randy.dunlap@oracle.com: fix ds2423 build, needs to select CRC16]
    Signed-off-by: Mika Laitio
    Signed-off-by: Randy Dunlap
    Cc: Evgeniy Polyakov
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Mika Laitio
     
  • Apart from currently used standard memstick data transfer method, Sony
    introduced several newer ones, to uncover full bandwidth/capacity of its
    Pro, HG and XC media formats. This patch lays a foundation to enable
    those methods as made possible by host/media capabilities.

    As a side effect of this patch, mspro_block_read_attributes became more
    streamlined and readable.

    [akpm@linux-foundation.org: fix printk warning]
    Signed-off-by: Alex Dubov
    Reported-by: Maxim Levitsky
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Alex Dubov
     
  • mspro_block_mutex is identical in scope to mspro_block_disk_lock and therefore
    unnecessary.

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

    Alex Dubov
     
  • Implement the usual pattern around idr_pre_get() and idr_get_new() to
    handlethe situation where another thread concurrently steals this thread's
    idr_pre_get() preallocation.

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

    Alex Dubov
     
  • Signed-off-by: Aries Lee
    Signed-off-by: Takashi Iwai
    Cc: Alex Dubov
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Takashi Iwai
     
  • Add a function jmb38x_ms_pmos() to enable / disable PMOS setups for
    JMicron 38x controllers.

    Signed-off-by: Aries Lee
    Signed-off-by: Takashi Iwai
    Cc: Alex Dubov
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Takashi Iwai
     
  • This patch corrects the definition of clock values for JMicron 38x
    controllers and sets the value properly per interface type.
    Also, it adds a check for TPC errors in the interrupt handler.

    Signed-off-by: Aries Lee
    Signed-off-by: Takashi Iwai
    Cc: Alex Dubov
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Takashi Iwai
     
  • If device_register() fails then call put_device(). See comment to
    device_register.

    Signed-off-by: Vasiliy Kulikov
    Cc: Maxim Levitsky
    Cc: Alex Dubov
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Vasiliy Kulikov
     
  • Add PPS signal generator which utilizes STROBE pin of a parallel port to
    send PPS signals. It uses parport abstraction layer and hrtimers to
    precisely control the signal.

    Signed-off-by: Alexander Gordeev
    Cc: Rodolfo Giometti
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Alexander Gordeev
     
  • Add PPS signal generator which utilizes STROBE pin of a parallel port to
    send PPS signals. It uses parport abstraction layer and hrtimers to
    precisely control the signal.

    [akpm@linux-foundation.org: fix build]
    Signed-off-by: Alexander Gordeev
    Acked-by: Rodolfo Giometti
    Cc: john stultz
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Alexander Gordeev
     
  • Add parallel port PPS client. It uses a standard method for capturing
    timestamps for assert edge transitions: getting a timestamp soon after an
    interrupt has happened.

    This is not a very precise source of time information due to interrupt
    handling delays. However, timestamps for clear edge transitions are much
    more precise because the interrupt handler continuously polls hardware
    port until the transition is done.

    Hardware port operations require only about 1us so the maximum error
    should not exceed this value. This was my primary goal when developing
    this client.

    Clear edge capture could be disabled using clear_wait parameter.

    Signed-off-by: Alexander Gordeev
    Acked-by: Rodolfo Giometti
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Alexander Gordeev
     
  • Add an optional feature of PPSAPI, kernel consumer support, which uses the
    added hardpps() function.

    Signed-off-by: Alexander Gordeev
    Acked-by: Rodolfo Giometti
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Alexander Gordeev
     
  • MONOTONIC_RAW clock timestamps are ideally suited for frequency
    calculation and also fit well into the original NTP hardpps design. Now
    phase and frequency can be adjusted separately: the former based on
    REALTIME clock and the latter based on MONOTONIC_RAW clock.

    A new function getnstime_raw_and_real is added to timekeeping subsystem to
    capture both timestamps at the same time and atomically.

    Signed-off-by: Alexander Gordeev
    Acked-by: John Stultz
    Cc: Rodolfo Giometti
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Alexander Gordeev
     
  • This commit adds hardpps() implementation based upon the original one from
    the NTPv4 reference kernel code from David Mills. However, it is highly
    optimized towards very fast syncronization and maximum stickness to PPS
    signal. The typical error is less then a microsecond.

    To make it sync faster I had to throw away exponential phase filter so
    that the full phase offset is corrected immediately. Then I also had to
    throw away median phase filter because it gives a bigger error itself if
    used without exponential filter.

    Maybe we will find an appropriate filtering scheme in the future but it's
    not necessary if the signal quality is ok.

    Signed-off-by: Alexander Gordeev
    Acked-by: John Stultz
    Cc: Rodolfo Giometti
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Alexander Gordeev
     
  • Remove the code that gatheres timestamp in pps_tty_dcd_change() in case
    passed ts parameter is NULL because it never happens in the current code.
    Fix comments as well.

    Signed-off-by: Alexander Gordeev
    Acked-by: Rodolfo Giometti
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Alexander Gordeev
     
  • Bitwise conjunction is distributive so we can simplify some conditions.

    Signed-off-by: Alexander Gordeev
    Acked-by: Rodolfo Giometti
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Alexander Gordeev
     
  • This way less overhead is involved when running production kernel. If you
    want to debug a pps client module please define DEBUG to enable the
    checks.

    Signed-off-by: Alexander Gordeev
    Acked-by: Rodolfo Giometti
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Alexander Gordeev
     
  • Now pps_idr_lock is never used in interrupt context so we can replace
    spin_lock_irq/spin_unlock_irq with plain spin_lock/spin_unlock. But
    there is also a potential race condition when someone can steal an id
    which was allocated by idr_pre_get before it is used. So convert spin
    lock to mutex and protect the whole id generation process.

    Signed-off-by: Alexander Gordeev
    Cc: Rodolfo Giometti
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Alexander Gordeev
     
  • Since now idr is only used to manage char device id's and not used in
    kernel API anymore it should be moved to pps.c. This also makes it
    possible to release id only at actual device freeing so nobody can
    register a pps device with the same id while our device is not freed yet.

    Signed-off-by: Alexander Gordeev
    Acked-by: Rodolfo Giometti
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Alexander Gordeev
     
  • Since we now have direct pointers to struct pps_device everywhere it's
    easy to use dev_* functions to print messages instead of plain printks.
    Where dev_* cannot be used printks are converted to pr_*.

    Signed-off-by: Alexander Gordeev
    Acked-by: Rodolfo Giometti
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Alexander Gordeev
     
  • Using device index as a pointer needs some unnecessary work to be done
    every time the pointer is needed (in irq handler for example). Using a
    direct pointer is much more easy (and safe as well).

    Signed-off-by: Alexander Gordeev
    Acked-by: Rodolfo Giometti
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Alexander Gordeev
     
  • Add a helper function to gather timestamps. This way clients don't have
    to duplicate it.

    Signed-off-by: Alexander Gordeev
    Acked-by: Rodolfo Giometti
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Alexander Gordeev
     
  • There was a race in PPS_FETCH ioctl handler when several processes want to
    obtain PPS data simultaneously using sleeping PPS_FETCH. They all sleep
    most of the time in the system call.

    With the old approach when the first process waiting on the pps queue is
    waken up it makes new system call right away and zeroes pps->go. So other
    processes continue to sleep. This is a clear race condition because of
    the global 'go' variable.

    With the new approach pps->last_ev holds some value increasing at each PPS
    event. PPS_FETCH ioctl handler saves current value to the local variable
    at the very beginning so it can safely check that there is a new event by
    just comparing both variables.

    Signed-off-by: Alexander Gordeev
    Acked-by: Rodolfo Giometti
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Alexander Gordeev
     
  • Move variable declarations where they are used in pps_cdev_ioctl.

    Signed-off-by: Alexander Gordeev
    Acked-by: Rodolfo Giometti
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Alexander Gordeev
     
  • Here are some very trivial fixes combined:

    - add macro definitions to protect header file from including several times

    - remove declaration for an unexistent array

    - fix typos

    Signed-off-by: Alexander Gordeev
    Acked-by: Rodolfo Giometti
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Alexander Gordeev
     
  • Commit 4be2c95d ("taskstats: pad taskstats netlink response for aligment
    issues on ia64") added a null field to align the taskstats structure but
    the discussion centered around ia64. The issue exists on other platforms
    with inefficient unaligned access and adding them piecemeal would be an
    unmaintainable mess.

    This patch uses Dave Miller's suggestion of using a combination of
    CONFIG_64BIT && !CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS to determine
    whether alignment is needed.

    Note that this will cause breakage on those platforms with applications
    like iotop which had hard-coded offsets into the packet to access the
    taskstats structure.

    The message seen on systems without the alignment fixes looks like: kernel
    unaligned access to 0xe000023879dca9bc, ip=0xa000000100133d10

    The addresses may vary but resolve to locations inside __delayacct_add_tsk.

    iotop makes what I'd call unreasonable assumptions about the contents of a
    netlink genetlink packet containing generic attributes. They're typed and
    have headers that specify value lengths, so the client can (should)
    identify and skip the ones the client doesn't understand.

    The kernel, as of version 2.6.36, presented a packet like so:
    +--------------------------------+
    | genlmsghdr - 4 bytes |
    +--------------------------------+
    | NLA header - 4 bytes | /* Aggregate header */
    +-+------------------------------+
    | | NLA header - 4 bytes | /* PID header */
    | +------------------------------+
    | | pid/tgid - 4 bytes |
    | +------------------------------+
    | | NLA header - 4 bytes | /* stats header */
    | + -----------------------------+
    Reported-by: David S. Miller
    Acked-by: David S. Miller
    Cc: Dan Carpenter
    Cc: Balbir Singh
    Cc: Florian Mickler
    Cc: Guillaume Chazarain
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Jeff Mahoney
     
  • Creates a new "Near Field Communication" subsystem in drivers/nfc.
    http://en.wikipedia.org/wiki/Near_Field_Communication is useful ;)

    This is a driver for the pn544 NFC device. The driver transfers
    ETSI messages between the device and the user space.

    Signed-off-by: Matti J. Aaltonen
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Matti J. Aaltonen
     
  • Currently on 64-bit arch the user_namespace is 2096 and when being
    kmalloc-ed it resides on a 4k slab wasting 2003 bytes.

    If we allocate a separate cache for it and reduce the hash size from 128
    to 64 chains the packaging becomes *much* better - the struct is 1072
    bytes and the hole between is 98 bytes.

    [akpm@linux-foundation.org: s/__initcall/module_init/]
    Signed-off-by: Pavel Emelyanov
    Acked-by: Serge E. Hallyn
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Pavel Emelyanov
     
  • ctl_unnumbered.txt have been removed in Documentation directory so just
    also remove this invalid comments

    [akpm@linux-foundation.org: fix Documentation/sysctl/00-INDEX, per Dave]
    Signed-off-by: Jovi Zhang
    Cc: Dave Young
    Acked-by: WANG Cong
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Jovi Zhang
     
  • Signed-off-by: Jovi Zhang
    Acked-by: WANG Cong
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Jovi Zhang
     
  • In fsl_rio_dbell_handler() the code currently simply acknowledges the QFI
    queue full interrupt, but does nothing to resolve the queue full
    condition. Instead, it jumps to the end of the isr. When a queue full
    condition occurs, the isr is then re-entered immediately and continually,
    forever.

    The fix is to just fall through and read out current doorbell entries.

    Signed-off-by: Thomas Taranowski
    Cc: Alexandre Bounine
    Cc: Kumar Gala
    Cc: Matt Porter
    Cc: Li Yang
    Cc: Thomas Moll
    Cc: Micha Nelissen
    Cc: Benjamin Herrenschmidt
    Cc: Grant Likely
    Cc:
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Thomas Taranowski
     
  • Add new sRIO switch device IDs and enable a basic support for them.

    Signed-off-by: Alexandre Bounine
    Cc: Kumar Gala
    Cc: Matt Porter
    Cc: Li Yang
    Cc: Thomas Moll
    Cc: Micha Nelissen
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Alexandre Bounine