23 Dec, 2009

12 commits

  • Fix the cx23888 driver to use the new kfifo API. Using kfifo_reset()
    may result in a possible race conditions. This patch fixes it by using
    a spinlock around the kfifo_reset() function.

    Signed-off-by: Stefani Seibold
    Cc: Mauro Carvalho Chehab
    Reviewed-by: Andy Walls
    Acked-by: Andy Walls
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Stefani Seibold
     
  • Add kfifo_in_rec() - puts some record data into the FIFO
    Add kfifo_out_rec() - gets some record data from the FIFO
    Add kfifo_from_user_rec() - puts some data from user space into the FIFO
    Add kfifo_to_user_rec() - gets data from the FIFO and write it to user space
    Add kfifo_peek_rec() - gets the size of the next FIFO record field
    Add kfifo_skip_rec() - skip the next fifo out record
    Add kfifo_avail_rec() - determinate the number of bytes available in a record FIFO

    Signed-off-by: Stefani Seibold
    Acked-by: Greg Kroah-Hartman
    Acked-by: Mauro Carvalho Chehab
    Acked-by: Andi Kleen
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Stefani Seibold
     
  • Add kfifo_reset_out() for save lockless discard the fifo output
    Add kfifo_skip() to skip a number of output bytes
    Add kfifo_from_user() to copy user space data into the fifo
    Add kfifo_to_user() to copy fifo data to user space

    Signed-off-by: Stefani Seibold
    Acked-by: Greg Kroah-Hartman
    Acked-by: Mauro Carvalho Chehab
    Acked-by: Andi Kleen
    Acked-by: Arnd Bergmann
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Stefani Seibold
     
  • Add DECLARE_KFIFO - macro to declare a kfifo and the associated buffer inside a struct
    Add INIT_KFIFO - Initialize a kfifo declared by DECLARED_KFIFO
    Add DEFINE_KFIFO - macro to define and initialize a kfifo as a global or local object
    Add kfifo_size() - returns the size of the fifo in bytes
    Add kfifo_is_empty() - returns true if the fifo is empty
    Add kfifo_is_full() - returns true if the fifo is full
    Add kfifo_avail() - returns the number of bytes available in the FIFO
    Do some code cleanup

    Signed-off-by: Stefani Seibold
    Acked-by: Greg Kroah-Hartman
    Acked-by: Mauro Carvalho Chehab
    Acked-by: Andi Kleen
    Acked-by: Arnd Bergmann
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Stefani Seibold
     
  • Fix the "ignoring return value of '...', declared with attribute
    warn_unused_result" compiler warning in several users of the new kfifo
    API.

    It removes the __must_check attribute from kfifo_in() and
    kfifo_in_locked() which must not necessary performed.

    Fix the allocation bug in the nozomi driver file, by moving out the
    kfifo_alloc from the interrupt handler into the probe function.

    Fix the kfifo_out() and kfifo_out_locked() users to handle a unexpected
    end of fifo.

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

    Stefani Seibold
     
  • rename kfifo_put... into kfifo_in... to prevent miss use of old non in
    kernel-tree drivers

    ditto for kfifo_get... -> kfifo_out...

    Improve the prototypes of kfifo_in and kfifo_out to make the kerneldoc
    annotations more readable.

    Add mini "howto porting to the new API" in kfifo.h

    Signed-off-by: Stefani Seibold
    Acked-by: Greg Kroah-Hartman
    Acked-by: Mauro Carvalho Chehab
    Acked-by: Andi Kleen
    Acked-by: Arnd Bergmann
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Stefani Seibold
     
  • change name of __kfifo_* functions to kfifo_*, because the prefix __kfifo
    should be reserved for internal functions only.

    Signed-off-by: Stefani Seibold
    Acked-by: Greg Kroah-Hartman
    Acked-by: Mauro Carvalho Chehab
    Acked-by: Andi Kleen
    Acked-by: Arnd Bergmann
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Stefani Seibold
     
  • Move the pointer to the spinlock out of struct kfifo. Most users in
    tree do not actually use a spinlock, so the few exceptions now have to
    call kfifo_{get,put}_locked, which takes an extra argument to a
    spinlock.

    Signed-off-by: Stefani Seibold
    Acked-by: Greg Kroah-Hartman
    Acked-by: Mauro Carvalho Chehab
    Acked-by: Andi Kleen
    Acked-by: Arnd Bergmann
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Stefani Seibold
     
  • This is a new generic kernel FIFO implementation.

    The current kernel fifo API is not very widely used, because it has to
    many constrains. Only 17 files in the current 2.6.31-rc5 used it.
    FIFO's are like list's a very basic thing and a kfifo API which handles
    the most use case would save a lot of development time and memory
    resources.

    I think this are the reasons why kfifo is not in use:

    - The API is to simple, important functions are missing
    - A fifo can be only allocated dynamically
    - There is a requirement of a spinlock whether you need it or not
    - There is no support for data records inside a fifo

    So I decided to extend the kfifo in a more generic way without blowing up
    the API to much. The new API has the following benefits:

    - Generic usage: For kernel internal use and/or device driver.
    - Provide an API for the most use case.
    - Slim API: The whole API provides 25 functions.
    - Linux style habit.
    - DECLARE_KFIFO, DEFINE_KFIFO and INIT_KFIFO Macros
    - Direct copy_to_user from the fifo and copy_from_user into the fifo.
    - The kfifo itself is an in place member of the using data structure, this save an
    indirection access and does not waste the kernel allocator.
    - Lockless access: if only one reader and one writer is active on the fifo,
    which is the common use case, no additional locking is necessary.
    - Remove spinlock - give the user the freedom of choice what kind of locking to use if
    one is required.
    - Ability to handle records. Three type of records are supported:
    - Variable length records between 0-255 bytes, with a record size
    field of 1 bytes.
    - Variable length records between 0-65535 bytes, with a record size
    field of 2 bytes.
    - Fixed size records, which no record size field.
    - Preserve memory resource.
    - Performance!
    - Easy to use!

    This patch:

    Since most users want to have the kfifo as part of another object,
    reorganize the code to allow including struct kfifo in another data
    structure. This requires changing the kfifo_alloc and kfifo_init
    prototypes so that we pass an existing kfifo pointer into them. This
    patch changes the implementation and all existing users.

    [akpm@linux-foundation.org: fix warning]
    Signed-off-by: Stefani Seibold
    Acked-by: Greg Kroah-Hartman
    Acked-by: Mauro Carvalho Chehab
    Acked-by: Andi Kleen
    Acked-by: Arnd Bergmann
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Stefani Seibold
     
  • Clean up typos/grammos/spellos in events-kmem.txt.

    Signed-off-by: Randy Dunlap
    Cc: Mel Gorman
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Randy Dunlap
     
  • Fix kernel-doc warnings (@arg name) in string.c::skip_spaces().

    Warning(lib/string.c:347): No description found for parameter 'str'
    Warning(lib/string.c:347): Excess function parameter 's' description in 'skip_spaces'

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

    Randy Dunlap
     
  • This reverts commit 7bc7d637452383d56ba4368d4336b0dde1bb476d, as
    requested by John Stultz. Quoting John:

    "Petr Titěra reported an issue where he saw odd atime regressions with
    2.6.33 where there were a full second worth of nanoseconds in the
    nanoseconds field.

    He also reviewed the time code and narrowed down the problem: unhandled
    overflow of the nanosecond field caused by rounding up the
    sub-nanosecond accumulated time.

    Details:

    * At the end of update_wall_time(), we currently round up the
    sub-nanosecond portion of accumulated time when storing it into xtime.
    This was added to avoid time inconsistencies caused when the
    sub-nanosecond portion was truncated when storing into xtime.
    Unfortunately we don't handle the possible second overflow caused by
    that rounding.

    * Previously the xtime_cache code hid this overflow by normalizing the
    xtime value when storing into the xtime_cache.

    * We could try to handle the second overflow after the rounding up, but
    since this affects the timekeeping's internal state, this would further
    complicate the next accumulation cycle, causing small errors in ntp
    steering. As much as I'd like to get rid of it, the xtime_cache code is
    known to work.

    * The correct fix is really to include the sub-nanosecond portion in the
    timekeeping accessor function, so we don't need to round up at during
    accumulation. This would greatly simplify the accumulation code.
    Unfortunately, we can't do this safely until the last three
    non-GENERIC_TIME arches (sparc32, arm, cris) are converted (those
    patches are in -mm) and we kill off the spots where arches set xtime
    directly. This is all 2.6.34 material, so I think reverting the
    xtime_cache change is the best approach for now.

    Many thanks to Petr for both reporting and finding the issue!"

    Reported-by: Petr Titěra
    Requested-by: john stultz
    Cc: Ingo Molnar
    Signed-off-by: Linus Torvalds

    Linus Torvalds
     

22 Dec, 2009

5 commits

  • The second parameter to alignf() in allocate_resource() must
    reflect what new resource is attempted to be allocated, else
    functions like pcibios_align_resource() (at least on x86) or
    pcmcia_align() can't work correctly.

    Commit 1e5ad9679016275d422e36b12a98b0927d76f556 broke this by
    setting the "new" resource until we're about to return success.
    To keep the resource untouched when allocate_resource() fails,
    a "tmp" resource is introduced.

    Signed-off-by: Dominik Brodowski
    Acked-by: Bjorn Helgaas
    Cc: Yinghai Lu
    Cc: Jesse Barnes
    Signed-off-by: Linus Torvalds

    Dominik Brodowski
     
  • * 'upstream-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jgarzik/libata-dev:
    pata_cmd64x: fix overclocking of UDMA0-2 modes
    Revert "pata_cmd64x: implement serialization as per notes"

    Linus Torvalds
     
  • * git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6:
    bnx2: Fix bnx2_netif_stop() merge error.
    gianfar: Fix bit definitions of IMASK_GRSC and IMASK_GTSC
    gianfar: Fix stats support
    gianfar: Fix a filer bug
    bnx2: fixing a timout error due not refreshing TX timers correctly
    can/at91: don't check platform_get_irq's return value against zero
    mISDN: use DECLARE_COMPLETION_ONSTACK for non-constant completion
    bnx2: reset_task is crashing the kernel. Fixing it.
    ipv6: fix an oops when force unload ipv6 module
    TI DaVinci EMAC: Fix MDIO bus frequency configuration
    e100: Fix broken cbs accounting due to missing memset.
    broadcom: bcm54xx_shadow_read() errors ignored in bcm54xx_adjust_rxrefclk()
    e1000e: LED settings in EEPROM ignored on 82571 and 82572
    netxen: use module parameter correctly
    netns: fix net.ipv6.route.gc_min_interval_ms in netns
    Bluetooth: Prevent ill-timed autosuspend in USB driver
    Bluetooth: Fix L2CAP locking scheme regression
    Bluetooth: Ack L2CAP I-frames before retransmit missing packet
    Bluetooth: Fix unset of RemoteBusy flag for L2CAP
    Bluetooth: Fix PTR_ERR return of wrong pointer in hidp_setup_hid()

    Linus Torvalds
     
  • …l/git/tip/linux-2.6-tip

    * 'sched-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip:
    sched: Fix hotplug hang
    sched: Restore printk sanity

    Linus Torvalds
     
  • * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound-2.6: (24 commits)
    ALSA: sbawe: fix memory detection
    ALSA: fix incorrect rounding direction in snd_interval_ratnum()
    ALSA: HDA: add powersaving hook for Realtek
    ALSA: HDA: remove useless mixers on Aspire 8930G
    ALSA: HDA: simplify Aspire 8930G verb array
    ALSA: hda: Set Front Mic to input vref 50% for Lenovo 3000 Y410
    ALSA: hda/realtek: Remove extra .capsrc_nids initialization for ALC889_INTEL
    ALSA: Use kzalloc for allocating only one thing
    ALSA: AACI: switch to per-pcm locking
    ALSA: AACI: add double-rate support
    ALSA: AACI: factor common hw_params logic into aaci_pcm_hw_params
    ALSA: AACI: cleanup aaci_pcm_hw_params
    ALSA: AACI: simplify codec rate information
    ALSA: aaci - Fix a typo
    ASoC: wm8974: fix a wrong bit definition
    sound: sgio2audio/pdaudiocf/usb-audio: initialize PCM buffer
    ALSA: hda - Fix quirk for Maxdata obook4-1
    ALSA: hda - Fix missing capsrc_nids for ALC88x
    ALSA: hda - Make use of beep device found in Dell Vostro 1015n
    ALSA: hda - Fixed internal mic initialization for Dell Vostro 1015
    ...

    Linus Torvalds
     

21 Dec, 2009

16 commits

  • Takashi Iwai
     
  • Takashi Iwai
     
  • Takashi Iwai
     
  • Memory amount is increased before a successful write-read
    sequence is done. Thus, 512 kB of onboard memory is detected
    on memoryless cards like SB32.

    Move the increasing of memory counter after successful read
    is done.

    Signed-off-by: Krzysztof Helt
    Signed-off-by: Takashi Iwai

    Krzysztof Helt
     
  • The direction of rounding is incorrect in the snd_interval_ratnum()
    It was detected with following parameters (sb8 driver playing
    8kHz stereo file):
    - num is always 1000000
    - requested frequency rate is from 7999 to 7999 (single frequency)

    The first loop calculates div_down(num, freq->min) which is 125.
    Thus, a frequency range's minimum value is 1000000 / 125 = 8000 Hz.
    The second loop calculates div_up(num, freq->max) which is 126
    The frequency range's maximum value is 1000000 / 126 = 7936 Hz.
    The range maximum is lower than the range minimum so the function
    fails due to empty result range.

    Signed-off-by: Krzysztof Helt
    Signed-off-by: Takashi Iwai

    Krzysztof Helt
     
  • Takashi Iwai
     
  • The current Realtek code makes no specific provision for turning stuff
    off. The codec chip is placed into low-power mode generically, but this
    doesn't turn off any external hardware connected to it, in particular
    external amplifiers.

    This patch creates a hook function that is called by the codec
    suspend/resume functions. It ought to disable any external hardware in a
    device-specific way. I've implemented a generic ALC889 function that
    sets the EAPD pin properly, and used it for the Acer Aspire 8930G which
    can benefit from this feature.

    On my laptop, this results in ~0.5W extra savings.

    Signed-off-by: Hector Martin
    Signed-off-by: Takashi Iwai

    Hector Martin
     
  • This patch removes some extra mixers that do nothing on the Acer Aspire
    8930G.

    The CD mixer is useless because the SATA DVD/Blu-Ray drive has no analog
    audio output, and the Side mixer is useless because we max out at 6ch
    anyway.

    Signed-off-by: Hector Martin
    Signed-off-by: Takashi Iwai

    Hector Martin
     
  • This patch just simplifies the 8930G verb array a bit. Just use the
    common ALC889 EAPD verb array to make things more consistent. The file
    is already huge enough already.

    Signed-off-by: Hector Martin
    Signed-off-by: Takashi Iwai

    Hector Martin
     
  • BugLink: https://bugs.launchpad.net/bugs/479373

    The OR has verified with hda-verb that the internal microphone needs
    VREF50 set for audible capture.

    Signed-off-by: Daniel T Chen
    Signed-off-by: Takashi Iwai

    Daniel T Chen
     
  • A typo in 12045a6ee9908b "nfsd: let "insecure" flag vary by
    pseudoflavor" reversed the sense of the "insecure" flag.

    Reported-by: Michael Guntsche
    Signed-off-by: J. Bruce Fields
    Signed-off-by: Linus Torvalds

    J. Bruce Fields
     
  • The error was introduced while merging:

    commit 4529819c45161e4a119134f56ef504e69420bc98
    bnx2: reset_task is crashing the kernel. Fixing it.

    Signed-off-by: Michael Chan k
    Signed-off-by: David S. Miller

    Michael Chan
     
  • The hot-unplug kstopmachine usage does a wakeup after
    deactivating the cpu, hence we cannot use cpu_active()
    here but must rely on the good olde online.

    Reported-by: Sachin Sant
    Reported-by: Jens Axboe
    Signed-off-by: Peter Zijlstra
    Tested-by: Jens Axboe
    Cc: Heiko Carstens
    Cc: Benjamin Herrenschmidt
    LKML-Reference:
    Signed-off-by: Ingo Molnar

    Peter Zijlstra
     
  • adev->dma_mode stores the transfer mode value not UDMA mode number
    so the condition in cmd64x_set_dmamode() is always true and the higher
    UDMA clock is always selected. This can potentially result in data
    corruption when UDMA33 device is used, when 40-wire cable is used or
    when the error recovery code decides to lower the device speed down.

    The issue was introduced in the commit 6a40da0 ("libata cmd64x: whack
    into a shape that looks like the documentation") which goes back to
    kernel 2.6.20.

    Cc: stable@kernel.org
    Signed-off-by: Bartlomiej Zolnierkiewicz
    Signed-off-by: Jeff Garzik

    Bartlomiej Zolnierkiewicz
     
  • This reverts commit d43744390e460dce6626fb8de2c02a24ff650005, because
    it breaks the boot on several machines (mostly sparc64, at present).

    Signed-off-by: Jeff Garzik

    Jeff Garzik
     
  • Revert the braindead pr_* crap. (Commit 663997d "sched: Use
    pr_fmt() and pr_()")

    It's dumb and causes stupid "sched: " strings all over the place.

    Signed-off-by: Peter Zijlstra
    Acked-by: Mike Galbraith
    Cc: Joe Perches
    Cc: Linus Torvalds
    Cc: Andrew Morton
    LKML-Reference:
    [ i dont mind the pr_*() patterns that much - but Peter dislikes them with a vengence. ]
    [ - v2: remove spurious diffstat from changelog :-/ ]
    Signed-off-by: Ingo Molnar

    Peter Zijlstra
     

20 Dec, 2009

7 commits

  • Signed-off-by: Jaroslav Kysela

    Jaroslav Kysela
     
  • Jaroslav Kysela
     
  • * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mattst88/alpha-2.6:
    alpha: Convert BUG() to use unreachable()
    alpha: Add minimal support for software performance events
    alpha: Wire up missing/new syscalls

    Linus Torvalds
     
  • * 'upstream-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jgarzik/libata-dev:
    sata_mv: remove pointless NULL test
    pata_hpt3x2n: fix clock turnaround
    libata: fix reporting of drained bytes when clearing DRQ
    sata_mv: add power management support for the PCI controllers.
    sata_mv: store the board_idx into the host private data
    pata_octeon_cf: use resource_size(), to fix resource sizing bug
    libata: use the WRITE_SAME_16 define
    sata_mv: move the PCI bar description initialization code
    sata_mv: add power management support for the platform driver
    sata_mv: support clkdev framework
    sata_mv: increase PIO IORDY timeout

    Fixed crazy mode-change in merge.

    Linus Torvalds
     
  • …/git/tip/linux-2.6-tip

    * 'perf-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip:
    perf session: Make events_stats u64 to avoid overflow on 32-bit arches
    hw-breakpoints: Fix hardware breakpoints -> perf events dependency
    perf events: Dont report side-band events on each cpu for per-task-per-cpu events
    perf events, x86/stacktrace: Fix performance/softlockup by providing a special frame pointer-only stack walker
    perf events, x86/stacktrace: Make stack walking optional
    perf events: Remove unused perf_counter.h header file
    perf probe: Check new event name
    kprobe-tracer: Check new event/group name
    perf probe: Check whether debugfs path is correct
    perf probe: Fix libdwarf include path for Debian

    Linus Torvalds
     
  • …git/tip/linux-2.6-tip

    * 'x86-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip:
    x86, irq: Allow 0xff for /proc/irq/[n]/smp_affinity on an 8-cpu system
    Makefile: Unexport LC_ALL instead of clearing it
    x86: Fix objdump version check in arch/x86/tools/chkobjdump.awk
    x86: Reenable TSC sync check at boot, even with NONSTOP_TSC
    x86: Don't use POSIX character classes in gen-insn-attr-x86.awk
    Makefile: set LC_CTYPE, LC_COLLATE, LC_NUMERIC to C
    x86: Increase MAX_EARLY_RES; insufficient on 32-bit NUMA
    x86: Fix checking of SRAT when node 0 ram is not from 0
    x86, cpuid: Add "volatile" to asm in native_cpuid()
    x86, msr: msrs_alloc/free for CONFIG_SMP=n
    x86, amd: Get multi-node CPU info from NodeId MSR instead of PCI config space
    x86: Add IA32_TSC_AUX MSR and use it
    x86, msr/cpuid: Register enough minors for the MSR and CPUID drivers
    initramfs: add missing decompressor error check
    bzip2: Add missing checks for malloc returning NULL
    bzip2/lzma/gzip: pre-boot malloc doesn't return NULL on failure

    Linus Torvalds
     
  • …l/git/tip/linux-2.6-tip

    * 'sched-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip: (25 commits)
    sched: Fix broken assertion
    sched: Assert task state bits at build time
    sched: Update task_state_arraypwith new states
    sched: Add missing state chars to TASK_STATE_TO_CHAR_STR
    sched: Move TASK_STATE_TO_CHAR_STR near the TASK_state bits
    sched: Teach might_sleep() about preemptible RCU
    sched: Make warning less noisy
    sched: Simplify set_task_cpu()
    sched: Remove the cfs_rq dependency from set_task_cpu()
    sched: Add pre and post wakeup hooks
    sched: Move kthread_bind() back to kthread.c
    sched: Fix select_task_rq() vs hotplug issues
    sched: Fix sched_exec() balancing
    sched: Ensure set_task_cpu() is never called on blocked tasks
    sched: Use TASK_WAKING for fork wakups
    sched: Select_task_rq_fair() must honour SD_LOAD_BALANCE
    sched: Fix task_hot() test order
    sched: Fix set_cpu_active() in cpu_down()
    sched: Mark boot-cpu active before smp_init()
    sched: Fix cpu_clock() in NMIs, on !CONFIG_HAVE_UNSTABLE_SCHED_CLOCK
    ...

    Linus Torvalds