19 May, 2011

21 commits

  • This is a rename of the usr_strtobool proposal, which was a renamed,
    relocated and fixed version of previous kstrtobool RFC

    Signed-off-by: Jonathan Cameron
    Signed-off-by: Rusty Russell

    Jonathan Cameron
     
  • Binutils 2.18.50 made a backwards-incompatible change in the way it
    writes ELF objects with over 65280 sections, to improve conformance
    with the ELF specification and interoperability with other ELF tools.
    Specifically, it no longer adds 256 to section indices SHN_LORESERVE
    and higher to skip over the reserved range SHN_LORESERVE through
    SHN_HIRESERVE; those values are only considered special in the
    st_shndx field, and not in other places where section indices are
    stored. See:

    http://sourceware.org/bugzilla/show_bug.cgi?id=5900
    http://groups.google.com/group/generic-abi/browse_thread/thread/e8bb63714b072e67/6c63738f12cc8a17

    Signed-off-by: Anders Kaseorg
    Signed-off-by: Rusty Russell

    Anders Kaseorg
     
  • The function is_exported() with its helper function lookup_symbol() are used to
    verify if a provided symbol is effectively exported by the kernel or by the
    modules. Now that both have their symbols sorted we can replace a linear search
    with a binary search which provide a considerably speed-up.

    This work was supported by a hardware donation from the CE Linux Forum.

    Signed-off-by: Alessio Igor Bogani
    Acked-by: Greg Kroah-Hartman
    Signed-off-by: Rusty Russell

    Alessio Igor Bogani
     
  • Takes advantage of the order and locates symbols using binary search.

    This work was supported by a hardware donation from the CE Linux Forum.

    Signed-off-by: Alessio Igor Bogani
    Signed-off-by: Rusty Russell
    Tested-by: Dirk Behme

    Alessio Igor Bogani
     
  • There a large number hand-coded binary searches in the kernel (run
    "git grep search | grep binary" to find many of them). Since in my
    experience, hand-coding binary searches can be error-prone, it seems
    worth cleaning this up by providing a generic binary search function.

    This generic binary search implementation comes from Ksplice. It has
    the same basic API as the C library bsearch() function. Ksplice uses
    it in half a dozen places with 4 different comparison functions, and I
    think our code is substantially cleaner because of this.

    Signed-off-by: Tim Abbott
    Extra-bikeshedding-by: Alan Jenkins
    Extra-bikeshedding-by: André Goddard Rosa
    Extra-bikeshedding-by: Rusty Russell
    Signed-off-by: Rusty Russell
    Signed-off-by: Alessio Igor Bogani
    Signed-off-by: Rusty Russell

    Tim Abbott
     
  • This patch places every exported symbol in its own section
    (i.e. "___ksymtab+printk"). Thus the linker will use its SORT() directive
    to sort and finally merge all symbol in the right and final section
    (i.e. "__ksymtab").

    The symbol prefixed archs use an underscore as prefix for symbols.
    To avoid collision we use a different character to create the temporary
    section names.

    This work was supported by a hardware donation from the CE Linux Forum.

    Signed-off-by: Alessio Igor Bogani
    Signed-off-by: Rusty Russell (folded in '+' fixup)
    Tested-by: Dirk Behme

    Alessio Igor Bogani
     
  • Instead of having a callback function for each symbol in the kernel,
    have a callback for each array of symbols.

    This eases the logic when we move to sorted symbols and binary search.

    Signed-off-by: Rusty Russell
    Signed-off-by: Alessio Igor Bogani

    Rusty Russell
     
  • Split the unprotect function into a function per section to make
    the code more readable and add the missing static declaration.

    Signed-off-by: Jan Glauber
    Signed-off-by: Rusty Russell

    Jan Glauber
     
  • While debugging I stumbled over two problems in the code that protects module
    pages.

    First issue is that disabling the protection before freeing init or unload of
    a module is not symmetric with the enablement. For instance, if pages are set
    to RO the page range from module_core to module_core + core_ro_size is
    protected. If a module is unloaded the page range from module_core to
    module_core + core_size is set back to RW.
    So pages that were not set to RO are also changed to RW.
    This is not critical but IMHO it should be symmetric.

    Second issue is that while set_memory_rw & set_memory_ro are used for
    RO/RW changes only set_memory_nx is involved for NX/X. One would await that
    the inverse function is called when the NX protection should be removed,
    which is not the case here, unless I'm missing something.

    Signed-off-by: Jan Glauber
    Signed-off-by: Rusty Russell

    Jan Glauber
     
  • Reset mod->init_ro_size to zero after the init part of a module is unloaded.
    Otherwise we need to check if module->init is NULL in the unprotect functions
    in the next patch.

    Signed-off-by: Jan Glauber
    Signed-off-by: Rusty Russell

    Jan Glauber
     
  • Fix function prototype to be ANSI-C compliant, consistent with other
    function prototypes, addressing a sparse warning.

    Signed-off-by: Daniel J Blueman
    Signed-off-by: Rusty Russell

    Daniel J Blueman
     
  • Reorder structure kparam_array to remove 8 bytes of alignment padding on
    64 bit builds, dropping its size from 40 to 32 bytes.

    Also update the macro module_param_array_named to initialise the
    structure using its member names to allow it to be changed without
    touching all its call sites.

    'git grep' finds module_param_array in 1037 places so this patch will
    save a small amount of data space across many modules.

    Signed-off-by: Richard Kennedy
    Signed-off-by: Rusty Russell

    Richard Kennedy
     
  • Reorder struct module to remove 24 bytes of alignment padding on 64 bit
    builds when the CONFIG_TRACE options are selected. This allows the
    structure to fit into one fewer cache lines, and its size drops from 592
    to 568 on x86_64.

    Signed-off-by: Richard Kennedy
    Signed-off-by: Rusty Russell

    Richard Kennedy
     
  • Doing so prevents the following warning from sparse:

    CHECK kernel/params.c
    kernel/params.c:817:9: warning: symbol '__modver_version_show' was not
    declared. Should it be static?

    since kernel/params.c is never compiled with MODULE being set.

    Signed-off-by: Dmitry Torokhov
    Signed-off-by: Rusty Russell

    Dmitry Torokhov
     
  • On m68k natural alignment is 2-byte boundary but we are trying to
    align structures in __modver section on sizeof(void *) boundary.
    This causes trouble when we try to access elements in this section
    in array-like fashion when create "version" attributes for built-in
    modules.

    Moreover, as DaveM said, we can't reliably put structures into
    independent objects, put them into a special section, and then expect
    array access over them (via the section boundaries) after linking the
    objects together to just "work" due to variable alignment choices in
    different situations. The only solution that seems to work reliably
    is to make an array of plain pointers to the objects in question and
    put those pointers in the special section.

    Reported-by: Geert Uytterhoeven
    Signed-off-by: Dmitry Torokhov
    Signed-off-by: Rusty Russell

    Dmitry Torokhov
     
  • Linus Torvalds
     
  • * 'fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jlbec/ocfs2:
    configfs: Fix race between configfs_readdir() and configfs_d_iput()
    configfs: Don't try to d_delete() negative dentries.
    ocfs2/dlm: Target node death during resource migration leads to thread spin
    ocfs2: Skip mount recovery for hard-ro mounts
    ocfs2/cluster: Heartbeat mismatch message improved
    ocfs2/cluster: Increase the live threshold for global heartbeat
    ocfs2/dlm: Use negotiated o2dlm protocol version
    ocfs2: skip existing hole when removing the last extent_rec in punching-hole codes.
    ocfs2: Initialize data_ac (might be used uninitialized)

    Linus Torvalds
     
  • * 'devicetree/merge' of git://git.secretlab.ca/git/linux-2.6:
    drivercore: revert addition of of_match to struct device
    of: fix race when matching drivers

    Linus Torvalds
     
  • * 'upstream' of git://git.linux-mips.org/pub/scm/upstream-linus:
    MIPS: Kludge IP27 build for 2.6.39.
    MIPS: AR7: Fix GPIO register size for Titan variant.
    MIPS: Fix duplicate invocation of notify_die.
    MIPS: RB532: Fix iomap resource size miscalculation.

    Linus Torvalds
     
  • Commit b826291c, "drivercore/dt: add a match table pointer to struct
    device" added an of_match pointer to struct device to cache the
    of_match_table entry discovered at driver match time. This was unsafe
    because matching is not an atomic operation with probing a driver. If
    two or more drivers are attempted to be matched to a driver at the
    same time, then the cached matching entry pointer could get
    overwritten.

    This patch reverts the of_match cache pointer and reworks all users to
    call of_match_device() directly instead.

    Signed-off-by: Grant Likely

    Grant Likely
     
  • If two drivers are probing devices at the same time, both will write
    their match table result to the dev->of_match cache at the same time.

    Only write the result if the device matches.

    In a thread titled "SBus devices sometimes detected, sometimes not",
    Meelis reported his SBus hme was not detected about 50% of the time.
    From the debug suggested by Grant it was obvious another driver matched
    some devices between the call to match the hme and the hme discovery
    failling.

    Reported-by: Meelis Roos
    Signed-off-by: Milton Miller
    [grant.likely: modified to only call of_match_device() once]
    Signed-off-by: Grant Likely

    Milton Miller
     

18 May, 2011

19 commits

  • * 'for-linus' of git://git.kernel.dk/linux-2.6-block:
    block: don't delay blk_run_queue_async
    scsi: remove performance regression due to async queue run
    blk-throttle: Use task_subsys_state() to determine a task's blkio_cgroup
    block: rescan partitions on invalidated devices on -ENOMEDIA too
    cdrom: always check_disk_change() on open
    block: unexport DISK_EVENT_MEDIA_CHANGE for legacy/fringe drivers

    Linus Torvalds
     
  • Signed-off-by: Ralf Baechle

    Ralf Baechle
     
  • The 'size' variable contains the correct register size for both AR7
    and Titan, but we never used it to ioremap the correct register size.
    This problem only shows up on Titan.

    [ralf@linux-mips.org: Fixed the fix. The original patch as in patchwork
    recognizes the problem correctly then fails to fix it ...]

    Reported-by: Alexander Clouter
    Signed-off-by: Florian Fainelli
    Patchwork: https://patchwork.linux-mips.org/patch/2380/
    Signed-off-by: Ralf Baechle

    Florian Fainelli
     
  • Initial patch by Yury Polyanskiy .

    Signed-off-by: Ralf Baechle
    Patchwork: https://patchwork.linux-mips.org/patch/2373/

    Ralf Baechle
     
  • This is the MIPS portion of Joe Perches 's
    https://patchwork.linux-mips.org/patch/2172/ which seems to have been
    lost in time and space.

    Signed-off-by: Ralf Baechle

    Ralf Baechle
     
  • configfs_readdir() will use the existing inode numbers of inodes in the
    dcache, but it makes them up for attribute files that aren't currently
    instantiated. There is a race where a closing attribute file can be
    tearing down at the same time as configfs_readdir() is trying to get its
    inode number.

    We want to get the inode number of open attribute files, because they
    should match while instantiated. We can't lock down the transition
    where dentry->d_inode is set to NULL, so we just check for NULL there.
    We can, however, ensure that an inode we find isn't iput() in
    configfs_d_iput() until after we've accessed it.

    Signed-off-by: Joel Becker

    Joel Becker
     
  • When configfs is faking mkdir() on its subsystem or default group
    objects, it starts by adding a negative dentry. It then tries to
    instantiate the group. If that should fail, it must clean up after
    itself.

    I was using d_delete() here, but configfs_attach_group() promises to
    return an empty dentry on error. d_delete() explodes with the entry
    dentry. Let's try d_drop() instead. The unhashing is what we want for
    our dentry.

    Signed-off-by: Joel Becker

    Joel Becker
     
  • Let's check a scenario:
    1. blk_delay_queue(q, SCSI_QUEUE_DELAY);
    2. blk_run_queue_async();
    the second one will became a noop, because q->delay_work already has
    WORK_STRUCT_PENDING_BIT set, so the delayed work will still run after
    SCSI_QUEUE_DELAY. But blk_run_queue_async actually hopes the delayed
    work runs immediately.

    Fix this by doing a cancel on potentially pending delayed work
    before queuing an immediate run of the workqueue.

    Signed-off-by: Shaohua Li
    Signed-off-by: Jens Axboe

    Shaohua Li
     
  • * 'v4l_for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-2.6:
    [media] V4L: soc-camera: regression fix: calculate .sizeimage in soc_camera.c
    [media] v4l2-subdev: fix broken subdev control enumeration
    [media] Fix cx88 remote control input
    [media] v4l: Release module if subdev registration fails

    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, AMD: Fix ARAT feature setting again
    Revert "x86, AMD: Fix APIC timer erratum 400 affecting K8 Rev.A-E processors"
    x86, apic: Fix spurious error interrupts triggering on all non-boot APs
    x86, mce, AMD: Fix leaving freed data in a list
    x86: Fix UV BAU for non-consecutive nasids
    x86, UV: Fix NMI handler for UV platforms

    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 evlist: Fix per thread mmap setup
    perf tools: Honour the cpu list parameter when also monitoring a thread list
    kprobes, x86: Disable irqs during optimized callback

    Linus Torvalds
     
  • * git://git.kernel.org/pub/scm/linux/kernel/git/sfrench/cifs-2.6:
    cifs: fix cifsConvertToUCS() for the mapchars case
    cifs: add fallback in is_path_accessible for old servers

    Linus Torvalds
     
  • Provide a stub for proc_mkdir_mode() when CONFIG_PROC_FS is not
    enabled, just like the stub for proc_mkdir().

    Fixes this linux-next build error:

    drivers/net/wireless/airo.c:4504: error: implicit declaration of function 'proc_mkdir_mode'

    Signed-off-by: Randy Dunlap
    Cc: Stephen Rothwell
    Cc: Alexey Dobriyan
    Cc: "John W. Linville"
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Randy Dunlap
     
  • os_dump_core() uses abort() to terminate UML in case of an fatal error.

    glibc's abort() calls raise(SIGABRT) which makes use of tgkill().
    tgkill() has no effect within UML's kernel threads because they are not
    pthreads. As fallback abort() executes an invalid instruction to
    terminate the process. Therefore UML gets killed by SIGSEGV and leaves a
    ugly log entry in the host's kernel ring buffer.

    To get rid of this we use our own abort routine.

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

    Richard Weinberger
     
  • ZONE_CONGESTED should be a state of global memory reclaim. If not, a busy
    memcg sets this and give unnecessary throttoling in wait_iff_congested()
    against memory recalim in other contexts. This makes system performance
    bad.

    I'll think about "memcg is congested!" flag is required or not, later.
    But this fix is required first.

    Signed-off-by: KAMEZAWA Hiroyuki
    Reviewed-by: Minchan Kim
    Cc: Daisuke Nishimura
    Acked-by: Ying Han
    Cc: Balbir Singh
    Cc: Johannes Weiner
    Cc: Michal Hocko
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    KAMEZAWA Hiroyuki
     
  • Adding the necessary MODULE_DEVICE_TABLE() information allows the driver
    to be automatically loaded by udev.

    Signed-off-by: Axel Lin
    Cc: Shreshtha Kumar SAHU
    Cc: Richard Purdie
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Axel Lin
     
  • Fix switch initialization to ensure that all switches have default routing
    disabled. This guarantees that no unexpected RapidIO packets arrive to
    the default port set by reset and there is no default routing destination
    until it is properly configured by software.

    This update also unifies handling of unmapped destinations by tsi57x, IDT
    Gen1 and IDT Gen2 switches.

    Signed-off-by: Alexandre Bounine
    Cc: Kumar Gala
    Cc: Matt Porter
    Cc: Li Yang
    Cc: Thomas Moll
    Cc: [2.6.37+]
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Alexandre Bounine
     
  • As Metze pointed out, commit 84cdf74e broke mapchars option:

    Commit "cifs: fix unaligned accesses in cifsConvertToUCS"
    (84cdf74e8096a10dd6acbb870dd404b92f07a756) does multiple steps
    in just one commit (moving the function and changing it without
    testing).

    put_unaligned_le16(temp, &target[j]); is never called for any
    codepoint the goes via the 'default' switch statement. As a result
    we put just zero (or maybe uninitialized) bytes into the target
    buffer.

    His proposed patch looks correct, but doesn't apply to the current head
    of the tree. This patch should also fix it.

    Cc: # .38.x: 581ade4: cifs: clean up various nits in unicode routines (try #2)
    Reported-by: Stefan Metzmacher
    Signed-off-by: Jeff Layton
    Signed-off-by: Steve French

    Jeff Layton
     
  • The is_path_accessible check uses a QPathInfo call, which isn't
    supported by ancient win9x era servers. Fall back to an older
    SMBQueryInfo call if it fails with the magic error codes.

    Cc: stable@kernel.org
    Reported-and-Tested-by: Sandro Bonazzola
    Signed-off-by: Jeff Layton
    Signed-off-by: Steve French

    Jeff Layton