24 Mar, 2011

1 commit

  • Some subsystems in the x86 tree need to carry out suspend/resume and
    shutdown operations with one CPU on-line and interrupts disabled and
    they define sysdev classes and sysdevs or sysdev drivers for this
    purpose. This leads to unnecessarily complicated code and excessive
    memory usage, so switch them to using struct syscore_ops objects for
    this purpose instead.

    Generally, there are three categories of subsystems that use
    sysdevs for implementing PM operations: (1) subsystems whose
    suspend/resume callbacks ignore their arguments entirely (the
    majority), (2) subsystems whose suspend/resume callbacks use their
    struct sys_device argument, but don't really need to do that,
    because they can be implemented differently in an arguably simpler
    way (io_apic.c), and (3) subsystems whose suspend/resume callbacks
    use their struct sys_device argument, but the value of that argument
    is always the same and could be ignored (microcode_core.c). In all
    of these cases the subsystems in question may be readily converted to
    using struct syscore_ops objects for power management and shutdown.

    Signed-off-by: Rafael J. Wysocki
    Reviewed-by: Thomas Gleixner
    Acked-by: Ingo Molnar

    Rafael J. Wysocki
     

23 Mar, 2011

39 commits

  • * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound-2.6:
    ALSA: HDA: Realtek: Avoid unnecessary volume control index on Surround/Side
    ASoC: Support !REGULATOR build for sgtl5000
    ALSA: hda - VIA: Fix VT1708 can't build up Headphone control issue
    ALSA: hda - VIA: Correct stream names for VT1818S
    ALSA: hda - VIA: Fix codec type for VT1708BCE at the right timing
    ALSA: hda - VIA: Fix invalid A-A path volume adjust issue
    ALSA: hda - VIA: Add missing support for VT1718S in A-A path
    ALSA: hda - VIA: Fix independent headphone no sound issue
    ALSA: hda - VIA: Fix stereo mixer recording no sound issue
    ALSA: hda - Set EAPD for Realtek ALC665
    ALSA: usb - Remove trailing spaces from USB card name strings
    sound: read i_size with i_size_read()
    ASoC: Remove bogus check for register validity in debugfs write
    ASoC: mini2440: Fix uda134x codec problem.

    Linus Torvalds
     
  • A conflict between 52c50567d8ab ("mm: swap: unlock swapfile inode mutex
    before closing file on bad swapfiles") and 83ef99befc32 ("sys_swapon:
    remove did_down variable") caused a double unlock of the inode mutex
    (once in bad_swap: before the filp_close, once at the end just before
    returning).

    The patch which added the extra unlock cleared did_down to avoid
    unlocking twice, but the other patch removed the did_down variable.

    To fix, set inode to NULL after the first unlock, since it will be used
    after that point only for the final unlock.

    While checking this patch, I found a path which could unlock without
    locking, in case the same inode was added as a swapfile twice. To fix,
    move the setting of the inode variable further down, to just before
    claim_swapfile, which will lock the inode before doing anything else.

    Cc: Mel Gorman
    Cc: Hugh Dickins
    Cc: Eric B Munson
    Cc: KAMEZAWA Hiroyuki
    Cc: Andrew Morton
    Signed-off-by: Cesar Eduardo Barros
    Signed-off-by: Linus Torvalds

    Cesar Eduardo Barros
     
  • Commit 34db18a054c6 ("smp: move smp setup functions to kernel/smp.c")
    causes this build error on s390 because of a missing init.h include:

    CC arch/s390/kernel/asm-offsets.s
    In file included from /home2/heicarst/linux-2.6/arch/s390/include/asm/spinlock.h:14:0,
    from include/linux/spinlock.h:87,
    from include/linux/seqlock.h:29,
    from include/linux/time.h:8,
    from include/linux/timex.h:56,
    from include/linux/sched.h:57,
    from arch/s390/kernel/asm-offsets.c:10:
    include/linux/smp.h:117:20: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'setup_nr_cpu_ids'
    include/linux/smp.h:118:20: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'smp_init'

    Fix it by adding the include statement.

    Signed-off-by: Heiko Carstens
    Acked-by: WANG Cong
    Signed-off-by: Linus Torvalds

    Heiko Carstens
     
  • Takashi Iwai
     
  • Similar to commit 7e59e097c09b82760bb0fe08b0fa2b704d76c3f4, this patch
    avoids unnecessary volume control indices for more
    Realtek auto-parsers, e g the ALC66x family, on the "Surround" and "Side"
    controls.
    These indices cause these volume controls to be ignored by PulseAudio and
    vmaster and should be removed whenever possible.

    Cc: stable@kernel.org
    Reported-by: Jan Losinski
    Signed-off-by: David Henningsson
    Signed-off-by: Takashi Iwai

    David Henningsson
     
  • * 'next' of git://git.kernel.org/pub/scm/linux/kernel/git/djbw/async_tx: (66 commits)
    avr32: at32ap700x: fix typo in DMA master configuration
    dmaengine/dmatest: Pass timeout via module params
    dma: let IMX_DMA depend on IMX_HAVE_DMA_V1 instead of an explicit list of SoCs
    fsldma: make halt behave nicely on all supported controllers
    fsldma: reduce locking during descriptor cleanup
    fsldma: support async_tx dependencies and automatic unmapping
    fsldma: fix controller lockups
    fsldma: minor codingstyle and consistency fixes
    fsldma: improve link descriptor debugging
    fsldma: use channel name in printk output
    fsldma: move related helper functions near each other
    dmatest: fix automatic buffer unmap type
    drivers, pch_dma: Fix warning when CONFIG_PM=n.
    dmaengine/dw_dmac fix: use readl & writel instead of __raw_readl & __raw_writel
    avr32: at32ap700x: Specify DMA Flow Controller, Src and Dst msize
    dw_dmac: Setting Default Burst length for transfers as 16.
    dw_dmac: Allow src/dst msize & flow controller to be configured at runtime
    dw_dmac: Changing type of src_master and dest_master to u8.
    dw_dmac: Pass Channel Priority from platform_data
    dw_dmac: Pass Channel Allocation Order from platform_data
    ...

    Linus Torvalds
     
  • I'm not sure why the read-only data section is excluded from the report,
    it seems as relevant as the other data sections (b and d).

    I've stripped the symbols starting with __mod_ as they can have their
    names dynamically generated and thus comparison between binaries is not
    possible.

    Signed-off-by: Jean Delvare
    Cc: Andi Kleen
    Acked-by: Nathan Lynch
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Jean Delvare
     
  • Instead of always creating a huge (268K) deflate_workspace with the
    maximum compression parameters (windowBits=15, memLevel=8), allow the
    caller to obtain a smaller workspace by specifying smaller parameter
    values.

    For example, when capturing oops and panic reports to a medium with
    limited capacity, such as NVRAM, compression may be the only way to
    capture the whole report. In this case, a small workspace (24K works
    fine) is a win, whether you allocate the workspace when you need it (i.e.,
    during an oops or panic) or at boot time.

    I've verified that this patch works with all accepted values of windowBits
    (positive and negative), memLevel, and compression level.

    Signed-off-by: Jim Keniston
    Cc: Herbert Xu
    Cc: David Miller
    Cc: Chris Mason
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Jim Keniston
     
  • d_alloc_name return NULL in case error, but we expect errno in
    devpts_pty_new.

    Addresses http://bugzilla.openvz.org/show_bug.cgi?id=1758

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

    Andrey Vagin
     
  • The test program below will hang because io_getevents() uses
    add_wait_queue_exclusive(), which means the wake_up() in io_destroy() only
    wakes up one of the threads. Fix this by using wake_up_all() in the aio
    code paths where we want to make sure no one gets stuck.

    // t.c -- compile with gcc -lpthread -laio t.c

    #include
    #include
    #include
    #include

    static const int nthr = 2;

    void *getev(void *ctx)
    {
    struct io_event ev;
    io_getevents(ctx, 1, 1, &ev, NULL);
    printf("io_getevents returned\n");
    return NULL;
    }

    int main(int argc, char *argv[])
    {
    io_context_t ctx = 0;
    pthread_t thread[nthr];
    int i;

    io_setup(1024, &ctx);

    for (i = 0; i < nthr; ++i)
    pthread_create(&thread[i], NULL, getev, ctx);

    sleep(1);

    io_destroy(ctx);

    for (i = 0; i < nthr; ++i)
    pthread_join(thread[i], NULL);

    return 0;
    }

    Signed-off-by: Roland Dreier
    Reviewed-by: Jeff Moyer
    Cc:
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Roland Dreier
     
  • Remove code enabled only when CONFIG_PREEMPT_RT is turned on because it is
    not used in the vanilla kernel.

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

    Alexander Gordeev
     
  • ADFS (FileCore) storage complies with the RISC OS filetype specification
    (12 bits of file type information is stored in the file load address,
    rather than using a file extension). The existing driver largely ignores
    this information and does not present it to the end user.

    It is desirable that stored filetypes be made visible to the end user to
    facilitate a precise copy of data and metadata from a hard disc (or image
    thereof) into a RISC OS emulator (such as RPCEmu) or to a network share
    which can be accessed by real Acorn systems.

    This patch implements a per-mount filetype suffix option (use -o
    ftsuffix=1) to present any filetype as a ,xyz hexadecimal suffix on each
    file. This type suffix is compatible with that used by RISC OS systems
    that access network servers using NFS client software and by RPCemu's host
    filing system.

    Signed-off-by: Stuart Swales
    Cc: Russell King
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Stuart Swales
     
  • ADFS (FileCore) storage complies with the RISC OS timestamp specification
    (40-bit centiseconds since 01 Jan 1900 00:00:00). It is desirable that
    stored timestamp precision be maintained to facilitate a precise copy of
    data and metadata from a hard disc (or image thereof) into a RISC OS
    emulator (such as RPCEmu).

    This patch implements a full-precision conversion from ADFS to Unix
    timestamp as the existing driver, for ease of calculation with old 32-bit
    compilers, uses the common trick of shifting the 40-bits representing
    centiseconds around into 32-bits representing seconds thereby losing
    precision.

    Signed-off-by: Stuart Swales
    Cc: Russell King
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Stuart Swales
     
  • Kernel crashes in fs/adfs module when accessing directories with a large
    number of objects on mounted Acorn ADFS E+/F+ format discs (or images) as
    the existing code writes off the end of the fixed array of struct
    buffer_head pointers.

    Additionally, each directory access that didn't crash would leak a buffer
    as nr_buffers was not adjusted correctly for E+/F+ discs (was always left
    as one less than required).

    The patch fixes this by allocating a dynamically-sized set of struct
    buffer_head pointers if necessary for the E+/F+ case (many directories
    still do in fact fit in 2048 bytes) and sets the correct nr_buffers so
    that all buffers are released.

    Addresses https://bugzilla.kernel.org/show_bug.cgi?id=26072

    Tested by tar'ing the contents of my RISC PC's E+ format 20Gb HDD which
    contains a number of large directories that previously crashed the kernel.

    Signed-off-by: Stuart Swales
    Cc: Russell King
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Stuart Swales
     
  • page-types.c doesn't supply a way to specify the debugfs path and the
    original debugfs path is not usual on most machines. This patch supplies
    a way to auto mount debugfs if needed.

    This patch is heavily inspired by tools/perf/utils/debugfs.c

    [akpm@linux-foundation.org: make functions static]
    [akpm@linux-foundation.org: fix debugfs_mount() signature]
    Signed-off-by: Chen Gong
    Reviewed-by: KOSAKI Motohiro
    Reviewed-by: Wu Fengguang
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Chen Gong
     
  • I noticed the 'mcelog' program had no comment and then ended up "fixing"
    a few more things:

    * reiserfsck -V does not print "reiserfsprogs" (any more?)
    * is "udevinfo" still shipped? udevd certainly is
    * grub2 doesn't have a 'grub' binary
    * add a "# how to get the mcelog version" comment

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

    Christian Kujau
     
  • There is a missing case for "Chapter 3: Placing Braces and Spaces". We
    often know we should not use braces where a single statement. The first
    case is:

    if (condition)
    action();

    Another case is:

    if (condition)
    do_this();
    else
    do_that();

    However, I can not find a description of the second case.

    Signed-off-by: Harry Wei
    Cc: Randy Dunlap
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Harry Wei
     
  • When CONFIG_SYSCTL=n, we get the following warning:

    fs/coda/sysctl.c:18: warning: `coda_tabl' defined but not used

    Fix the warning by making sure coda_table and it's callee function are in
    the same context. Also clean up the code by removing extra #ifdef.

    [akpm@linux-foundation.org: remove unneeded stub macros]
    Signed-off-by: Rakib Mullick
    Cc: Jan Harkes
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Rakib Mullick
     
  • Not all 64-bit systems require ISA-style DMA, so allow it to be
    configurable. x86 utilizes the generic ISA DMA allocator from
    kernel/dma.c, so require it only when CONFIG_ISA_DMA_API is enabled.

    Disabling CONFIG_ISA_DMA_API is dependent on x86_64 since those machines
    do not have ISA slots and benefit the most from disabling the option (and
    on CONFIG_EXPERT as required by H. Peter Anvin).

    When disabled, this also avoids declaring claim_dma_lock(),
    release_dma_lock(), request_dma(), and free_dma() since those interfaces
    will no longer be provided.

    Signed-off-by: David Rientjes
    Cc: Ingo Molnar
    Cc: "H. Peter Anvin"
    Cc: Thomas Gleixner
    Cc: Bjorn Helgaas
    Cc: Russell King
    Cc: "Luck, Tony"
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    David Rientjes
     
  • The generic floppy disk driver utilizies the interface provided by
    CONFIG_ISA_DMA_API, specifically claim_dma_lock(), release_dma_lock(),
    request_dma(), and free_dma(). Thus, there's a strict dependency on the
    config option and the driver should only be loaded if the kernel supports
    ISA-style DMA.

    Signed-off-by: David Rientjes
    Cc: Ingo Molnar
    Cc: "H. Peter Anvin"
    Cc: Thomas Gleixner
    Cc: Bjorn Helgaas
    Cc: Russell King
    Cc: "Luck, Tony"
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    David Rientjes
     
  • 8237A utilizes the interface provided by CONFIG_ISA_DMA_API, specifically
    claim_dma_lock() and release_dma_lock(). Thus, there's a strict
    dependency on the config option and the module should only be loaded if
    the kernel supports ISA-style DMA.

    Signed-off-by: David Rientjes
    Cc: Ingo Molnar
    Cc: "H. Peter Anvin"
    Cc: Thomas Gleixner
    Cc: Bjorn Helgaas
    Cc: Russell King
    Cc: "Luck, Tony"
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    David Rientjes
     
  • IORESOURCE_DMA cannot be assigned without utilizing the interface
    provided by CONFIG_ISA_DMA_API, specifically request_dma() and
    free_dma(). Thus, there's a strict dependency on the config option and
    limits IORESOURCE_DMA only to architectures that support ISA-style DMA.

    ia64 is not one of those architectures, so pnp_check_dma() no longer
    needs to be special-cased for that architecture.

    pnp_assign_resources() will now return -EINVAL if IORESOURCE_DMA is
    attempted on such a kernel.

    Signed-off-by: David Rientjes
    Cc: Ingo Molnar
    Cc: "H. Peter Anvin"
    Cc: Thomas Gleixner
    Cc: Bjorn Helgaas
    Cc: Russell King
    Cc: "Luck, Tony"
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    David Rientjes
     
  • This is a platform driver that supports the built-in real-time clock on
    Tegra SOCs.

    Signed-off-by: Andrew Chew
    Acked-by: Alessandro Zummo
    Acked-by: Wan ZongShun
    Acked-by: Jon Mayo
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Andrew Chew
     
  • Don't allow everybogy to write to NVRAM.

    Signed-off-by: Vasiliy Kulikov
    Cc: Andy Sharp
    Cc: Alessandro Zummo
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Vasiliy Kulikov
     
  • Add alarm/wakeup support to rtc isl1208 driver

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

    Ryan Mallon
     
  • There is a general move to replace bus-specific PM ops with dev_pm_ops in
    order to facilitate core improvements. Do this conversion for DS1374.

    Signed-off-by: Mark Brown
    Cc: Alessandro Zummo
    Cc: john stultz
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Mark Brown
     
  • In do_mounts_rd() if memory cannot be allocated, return -ENOMEM.

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

    Davidlohr Bueso
     
  • With GCC-4.6 we get warnings about things being 'set but not used'.

    In load_elf_binary() this can happen with reloc_func_desc if ELF_PLAT_INIT
    is defined, but doesn't use the reloc_func_desc argument.

    Quiet the warning/error by marking reloc_func_desc as __maybe_unused.

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

    David Daney
     
  • Add a comment to ep_poll(), rename labels a bit clearly, fix a warning of
    unused variable from gcc and optimize the non-blocking path a little.

    Hinted-by: Andrew Morton
    Signed-off-by: Davide Libenzi

    hannes@cmpxchg.org:

    : The non-blocking ep_poll path optimization introduced skipping over the
    : return value setup.
    :
    : Initialize it properly, my userspace gets upset by epoll_wait() returning
    : random things.
    :
    : In addition, remove the reinitialization at the fetch_events label, the
    : return value is garuanteed to be zero when execution reaches there.

    [hannes@cmpxchg.org: fix initialization]
    Signed-off-by: Johannes Weiner
    Cc: Shawn Bohrer
    Acked-by: Davide Libenzi
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Shawn Bohrer
     
  • Move the event readiness check into a proper inline, and use it uniformly
    inside ep_poll() code. Events in the ->ovflist are no less ready than the
    ones in ->rdllist.

    Signed-off-by: Davide Libenzi
    Cc: Shawn Bohrer
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Davide Libenzi
     
  • Add brackets around typecasted argument in crc32() macro.

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

    Konstantin Khlebnikov
     
  • Because the second and third arguments of memset have the same type, it
    turns out to be really easy to mix them up.

    This bug comes up time after time, so checkpatch should really be checking
    for it at patch submission time.

    Signed-off-by: Dave Jones
    Cc: Steven Rostedt
    Cc: Andy Whitcroft
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Dave Jones
     
  • If you run checkpatch against multiple patches, and one of them has a
    whitespace issue which can be helped via a script (rpt_cleaners), you will
    see the same NOTE over and over for all subsequent patches. It makes it
    seem like those patches also have whitespace problems when in reality,
    there's only one or two bad apples.

    So reset rpt_cleaners back to 0 after we've issued the note so that it
    only shows up near the patch with the actual problems.

    Signed-off-by: Mike Frysinger
    Cc: Andy Whitcroft
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Mike Frysinger
     
  • Use resource_size().

    Signed-off-by: Chris Ball
    Cc: Madhusudhan Chikkature
    Cc:
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Chris Ball
     
  • Signed-off-by: Chris Ball
    Cc: Jarkko Lavinen
    Cc: Tony Lindgren
    Cc:
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Chris Ball
     
  • Analog Devices' SigmaStudio can produce firmware blobs for devices with
    these DSPs embedded (like some audio codecs). Allow these device drivers
    to easily parse and load them.

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

    Mike Frysinger
     
  • 1. simple_strto*() do not contain overflow checks and crufty,
    libc way to indicate failure.
    2. strict_strto*() also do not have overflow checks but the name and
    comments pretend they do.
    3. Both families have only "long long" and "long" variants,
    but users want strtou8()
    4. Both "simple" and "strict" prefixes are wrong:
    Simple doesn't exactly say what's so simple, strict should not exist
    because conversion should be strict by default.

    The solution is to use "k" prefix and add convertors for more types.
    Enter
    kstrtoull()
    kstrtoll()
    kstrtoul()
    kstrtol()
    kstrtouint()
    kstrtoint()

    kstrtou64()
    kstrtos64()
    kstrtou32()
    kstrtos32()
    kstrtou16()
    kstrtos16()
    kstrtou8()
    kstrtos8()

    Include runtime testsuite (somewhat incomplete) as well.

    strict_strto*() become deprecated, stubbed to kstrto*() and
    eventually will be removed altogether.

    Use kstrto*() in code today!

    Note: on some archs _kstrtoul() and _kstrtol() are left in tree, even if
    they'll be unused at runtime. This is temporarily solution,
    because I don't want to hardcode list of archs where these
    functions aren't needed. Current solution with sizeof() and
    __alignof__ at least always works.

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

    Alexey Dobriyan
     
  • Signed-off-by: Kenneth Heitke
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Kenneth Heitke
     
  • commit 5b2e303f6df ("[media] rc-core: convert winbond-cir") moved the
    files, update the pattern.

    Signed-off-by: Joe Perches
    Acked-by: David Härdeman
    Acked-by: Mauro Carvalho Chehab
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Joe Perches