14 Dec, 2010

2 commits

  • Running the annotate branch profiler on three boxes, including my
    main box that runs firefox, evolution, xchat, and is part of the distcc farm,
    showed this with the likelys in the workqueue code:

    correct incorrect % Function File Line
    ------- --------- - -------- ---- ----
    96 996253 99 wq_worker_sleeping workqueue.c 703
    96 996247 99 wq_worker_waking_up workqueue.c 677

    The likely()s in this case were assuming that WORKER_NOT_RUNNING will
    most likely be false. But this is not the case. The reason is
    (and shown by adding trace_printks and testing it) that most of the time
    WORKER_PREP is set.

    In worker_thread() we have:

    worker_clr_flags(worker, WORKER_PREP);

    [ do work stuff ]

    worker_set_flags(worker, WORKER_PREP, false);

    (that 'false' means not to wake up an idle worker)

    The wq_worker_sleeping() is called from schedule when a worker thread
    is putting itself to sleep. Which happens most of the time outside
    of that [ do work stuff ].

    The wq_worker_waking_up is called by the wakeup worker code, which
    is also callod outside that [ do work stuff ].

    Thus, the likely and unlikely used by those two functions are actually
    backwards.

    Remove the annotation and let gcc figure it out.

    Acked-by: Tejun Heo
    Signed-off-by: Steven Rostedt
    Signed-off-by: Tejun Heo

    Steven Rostedt
     
  • Signed-off-by: Tejun Heo

    Tejun Heo
     

26 Nov, 2010

1 commit


25 Nov, 2010

37 commits

  • * 'hwmon-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/groeck/staging:
    hwmon: (lis3lv02d_i2c) Fix compile warnings
    hwmon: (i5k_amb) Fix compile warning

    Linus Torvalds
     
  • * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/konrad/xen:
    xen: remove duplicated #include
    xen: x86/32: perform initial startup on initial_page_table

    Linus Torvalds
     
  • * git://git.kernel.org/pub/scm/linux/kernel/git/cmetcalf/linux-tile:
    arch/tile: fix memchr() not to dereference memory for zero length
    arch/tile: make glibc's sysconf(_SC_NPROCESSORS_CONF) work correctly
    arch/tile: fix rwlock so would-be write lockers don't block new readers

    Linus Torvalds
     
  • * 'drivers' of git://git.kernel.org/pub/scm/linux/kernel/git/cmetcalf/linux-tile:
    pci root complex: support for tile architecture
    drivers/net/tile/: on-chip network drivers for the tile architecture
    MAINTAINERS: add drivers/char/hvc_tile.c as maintained by tile

    Linus Torvalds
     
  • * master.kernel.org:/home/rmk/linux-2.6-arm:
    ARM: 6482/2: Fix find_next_zero_bit and related assembly
    ARM: 6490/1: MM: bugfix: initialize spinlock for init_mm.context
    ARM: avoid annoying 's in printk output
    SCSI: arm fas216: fix missing ';'
    ARM: avoid marking decompressor .stack section as having contents
    ARM: 6489/1: thumb2: fix incorrect optimisation in usracc
    ARM: 6488/1: nomadik: prevent sched_clock() wraparound
    ARM: 6484/1: fix compile warning in mm/init.c
    ARM: 6473/1: Small update to ux500 specific L2 cache code
    ARM: improve compiler's ability to optimize page tables
    mx25: fix spi device registration typo
    ARM i.MX27 eukrea: Fix compilation
    ARM i.MX spi: fix compilation for i.MX21
    ARM i.MX pcm037 eet: compile fixes
    ARM i.MX: sdma is merged, so remove #ifdef SDMA_IS_MERGED
    ARM mx3fb: check for DMA engine type
    mach-pcm037_eet: Fix section mismatch for eet_init_devices()

    Linus Torvalds
     
  • …l/git/lethal/fbdev-2.6

    * 'fbdev-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/lethal/fbdev-2.6:
    sisfb: delete osdef.h
    sisfb: move the CONFIG warning to sis_main.c
    sisfb: replace SiS_SetMemory with memset_io
    sisfb: remove InPort/OutPort wrappers
    sisfb: use CONFIG_FB_SIS_301/315 instead of SIS301/315H
    sisfb: delete redudant #define SIS_LINUX_KERNEL
    sisfb: delete dead SIS_XORG_XF86 code
    sisfb: delete fallback code for pci_map_rom()
    sisfb: delete obsolete PCI ROM bug workaround
    fbdev: Update documentation index file.
    lxfb: Program panel v/h sync output polarity correctly
    fbcmap: integer overflow bug
    fbcmap: cleanup white space in fb_alloc_cmap()
    MAINTAINERS: Add fbdev patchwork entry, tidy up file patterns.
    fbdev: da8xx: punt duplicated FBIO_WAITFORVSYNC define
    fbdev: sh_mobile_lcdcfb: fix bug in reconfig()

    Linus Torvalds
     
  • * 'sh-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/lethal/sh-2.6:
    sh: clkfwk: Build fix for non-legacy CPG changes.
    sh: Use GCC __builtin_prefetch() to implement prefetch().
    sh: fix vsyscall compilation due to .eh_frame issue
    sh: avoid to flush all cache in sys_cacheflush
    sh: clkfwk: Disable init clk op for non-legacy clocks.
    sh: clkfwk: Kill off now unused algo_id in set_rate op.
    sh: clkfwk: Kill off unused clk_set_rate_ex().

    Linus Torvalds
     
  • * 'for-linus' of git://neil.brown.name/md:
    md: Call blk_queue_flush() to establish flush/fua support
    md/raid1: really fix recovery looping when single good device fails.
    md: fix return value of rdev_size_change()

    Linus Torvalds
     
  • * git://git.kernel.org/pub/scm/linux/kernel/git/rusty/linux-2.6-for-linus:
    virtio: fix format of sysfs driver/vendor files
    Char: virtio_console, fix memory leak
    virtio: return correct capacity to users
    module: Update prototype for ref_module (formerly use_module)

    Linus Torvalds
     
  • When compiling arch/x86/kernel/early_printk_mrst.c with i386
    allmodconfig, gcc-4.1.0 generates an out-of-line copy of
    __set_fixmap_offset() which contains a reference to
    __this_fixmap_does_not_exist which the compiler cannot elide.

    Marking __set_fixmap_offset() as __always_inline prevents this.

    Cc: Thomas Gleixner
    Cc: Ingo Molnar
    Cc: "H. Peter Anvin"
    Cc: Feng Tang
    Acked-by: Randy Dunlap
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Andrew Morton
     
  • The recent changes to gfp.h to satisfy sparse broke scripts/gfp-translate.
    This patch fixes it up to work with old and new versions of gfp.h .

    [akpm@linux-foundation.org: use `grep -q', per WANG Cong]
    Signed-off-by: Mel Gorman
    Cc: Namhyung Kim
    Reviewed-by: WANG Cong
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Mel Gorman
     
  • reiserfs_unpack() locks the inode mutex with reiserfs_mutex_lock_safe()
    to protect against reiserfs lock dependency. However this protection
    requires to have the reiserfs lock to be locked.

    This is the case if reiserfs_unpack() is called by reiserfs_ioctl but
    not from reiserfs_quota_on() when it tries to unpack tails of quota
    files.

    Fix the ordering of the two locks in reiserfs_unpack() to fix this
    issue.

    Signed-off-by: Frederic Weisbecker
    Reported-by: Markus Gapp
    Reported-by: Jan Kara
    Cc: Jeff Mahoney
    Cc: [2.6.36.x]
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Frederic Weisbecker
     
  • According to the comment describing ops_lock in the definition of struct
    backlight_device and when comparing with other functions in backlight.c
    the mutex must be hold when checking ops to be non-NULL.

    Fixes a problem added by c835ee7f4154992e6 ("backlight: Add suspend/resume
    support to the backlight core") in Jan 2009.

    Signed-off-by: Uwe Kleine-König
    Acked-by: Richard Purdie
    Cc:
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Uwe Kleine-König
     
  • struct als_data *data is not used in this driver at all.

    Also add a missing ">" character for MODULE_AUTHOR.

    Signed-off-by: Axel Lin
    Acked-by: Alan Cox
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Axel Lin
     
  • Currently one pagemap_read() call walks in PAGEMAP_WALK_SIZE bytes (== 512
    pages.) But there is a corner case where walk_pmd_range() accidentally
    runs over a VMA associated with a hugetlbfs file.

    For example, when a process has mappings to VMAs as shown below:

    # cat /proc//maps
    ...
    3a58f6d000-3a58f72000 rw-p 00000000 00:00 0
    7fbd51853000-7fbd51855000 rw-p 00000000 00:00 0
    7fbd5186c000-7fbd5186e000 rw-p 00000000 00:00 0
    7fbd51a00000-7fbd51c00000 rw-s 00000000 00:12 8614 /hugepages/test

    then pagemap_read() goes into walk_pmd_range() path and walks in the range
    0x7fbd51853000-0x7fbd51a53000, but the hugetlbfs VMA should be handled by
    walk_hugetlb_range(). Otherwise PMD for the hugepage is considered bad
    and cleared, which causes undesirable results.

    This patch fixes it by separating pagemap walk range into one PMD.

    Signed-off-by: Naoya Horiguchi
    Cc: Jun'ichi Nomura
    Acked-by: KAMEZAWA Hiroyuki
    Cc: Matt Mackall
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Naoya Horiguchi
     
  • Commit d33b9f45 ("mm: hugetlb: fix hugepage memory leak in
    walk_page_range()") introduces a check if a vma is a hugetlbfs one and
    later in 5dc37642 ("mm hugetlb: add hugepage support to pagemap") it is
    moved under #ifdef CONFIG_HUGETLB_PAGE but a needless find_vma call is
    left behind and its result is not used anywhere else in the function.

    The side-effect of caching vma for @addr inside walk->mm is neither
    utilized in walk_page_range() nor in called functions.

    Signed-off-by: David Sterba
    Reviewed-by: Naoya Horiguchi
    Acked-by: Andi Kleen
    Cc: Andy Whitcroft
    Cc: David Rientjes
    Cc: Hugh Dickins
    Cc: Lee Schermerhorn
    Cc: Matt Mackall
    Acked-by: Mel Gorman
    Cc: Wu Fengguang
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    David Sterba
     
  • … under stop_machine_run()

    During memory hotplug, build_allzonelists() may be called under
    stop_machine_run(). In this function, setup_zone_pageset() is called.
    But it's bug because it will do page allocation under stop_machine_run().

    Here is a report from Alok Kataria.

    BUG: sleeping function called from invalid context at kernel/mutex.c:94
    in_atomic(): 0, irqs_disabled(): 1, pid: 4, name: migration/0
    Pid: 4, comm: migration/0 Not tainted 2.6.35.6-45.fc14.x86_64 #1
    Call Trace:
    [<ffffffff8103d12b>] __might_sleep+0xeb/0xf0
    [<ffffffff81468245>] mutex_lock+0x24/0x50
    [<ffffffff8110eaa6>] pcpu_alloc+0x6d/0x7ee
    [<ffffffff81048888>] ? load_balance+0xbe/0x60e
    [<ffffffff8103a1b3>] ? rt_se_boosted+0x21/0x2f
    [<ffffffff8103e1cf>] ? dequeue_rt_stack+0x18b/0x1ed
    [<ffffffff8110f237>] __alloc_percpu+0x10/0x12
    [<ffffffff81465e22>] setup_zone_pageset+0x38/0xbe
    [<ffffffff810d6d81>] ? build_zonelists_node.clone.58+0x79/0x8c
    [<ffffffff81452539>] __build_all_zonelists+0x419/0x46c
    [<ffffffff8108ef01>] ? cpu_stopper_thread+0xb2/0x198
    [<ffffffff8108f075>] stop_machine_cpu_stop+0x8e/0xc5
    [<ffffffff8108efe7>] ? stop_machine_cpu_stop+0x0/0xc5
    [<ffffffff8108ef57>] cpu_stopper_thread+0x108/0x198
    [<ffffffff81467a37>] ? schedule+0x5b2/0x5cc
    [<ffffffff8108ee4f>] ? cpu_stopper_thread+0x0/0x198
    [<ffffffff81065f29>] kthread+0x7f/0x87
    [<ffffffff8100aae4>] kernel_thread_helper+0x4/0x10
    [<ffffffff81065eaa>] ? kthread+0x0/0x87
    [<ffffffff8100aae0>] ? kernel_thread_helper+0x0/0x10
    Built 5 zonelists in Node order, mobility grouping on. Total pages: 289456
    Policy zone: Normal

    This patch tries to fix the issue by moving setup_zone_pageset() out from
    stop_machine_run(). It's obviously not necessary to be called under
    stop_machine_run().

    [akpm@linux-foundation.org: remove unneeded local]
    Reported-by: Alok Kataria <akataria@vmware.com>
    Signed-off-by: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
    Cc: Tejun Heo <tj@kernel.org>
    Cc: Petr Vandrovec <petr@vmware.com>
    Cc: Pekka Enberg <penberg@cs.helsinki.fi>
    Reviewed-by: Christoph Lameter <cl@linux-foundation.org>
    Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
    Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

    KAMEZAWA Hiroyuki
     
  • Swap accounting can be configured by CONFIG_CGROUP_MEM_RES_CTLR_SWAP
    configuration option and then it is turned on by default. There is a boot
    option (noswapaccount) which can disable this feature.

    This makes it hard for distributors to enable the configuration option as
    this feature leads to a bigger memory consumption and this is a no-go for
    general purpose distribution kernel. On the other hand swap accounting
    may be very usuful for some workloads.

    This patch adds a new configuration option which controls the default
    behavior (CGROUP_MEM_RES_CTLR_SWAP_ENABLED). If the option is selected
    then the feature is turned on by default.

    It also adds a new boot parameter swapaccount[=1|0] which enhances the
    original noswapaccount parameter semantic by means of enable/disable logic
    (defaults to 1 if no value is provided to be still consistent with
    noswapaccount).

    The default behavior is unchanged (if CONFIG_CGROUP_MEM_RES_CTLR_SWAP is
    enabled then CONFIG_CGROUP_MEM_RES_CTLR_SWAP_ENABLED is enabled as well)

    Signed-off-by: Michal Hocko
    Acked-by: Daisuke Nishimura
    Cc: Balbir Singh
    Cc: KAMEZAWA Hiroyuki
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Michal Hocko
     
  • __mem_cgroup_try_charge() can be called under down_write(&mmap_sem)(e.g.
    mlock does it). This means it can cause deadlock if it races with move charge:

    Ex.1)
    move charge | try charge
    --------------------------------------+------------------------------
    mem_cgroup_can_attach() | down_write(&mmap_sem)
    mc.moving_task = current | ..
    mem_cgroup_precharge_mc() | __mem_cgroup_try_charge()
    mem_cgroup_count_precharge() | prepare_to_wait()
    down_read(&mmap_sem) | if (mc.moving_task)
    -> cannot aquire the lock | -> true
    | schedule()

    Ex.2)
    move charge | try charge
    --------------------------------------+------------------------------
    mem_cgroup_can_attach() |
    mc.moving_task = current |
    mem_cgroup_precharge_mc() |
    mem_cgroup_count_precharge() |
    down_read(&mmap_sem) |
    .. |
    up_read(&mmap_sem) |
    | down_write(&mmap_sem)
    mem_cgroup_move_task() | ..
    mem_cgroup_move_charge() | __mem_cgroup_try_charge()
    down_read(&mmap_sem) | prepare_to_wait()
    -> cannot aquire the lock | if (mc.moving_task)
    | -> true
    | schedule()

    To avoid this deadlock, we do all the move charge works (both can_attach() and
    attach()) under one mmap_sem section.
    And after this patch, we set/clear mc.moving_task outside mc.lock, because we
    use the lock only to check mc.from/to.

    Signed-off-by: Daisuke Nishimura
    Cc: Balbir Singh
    Acked-by: KAMEZAWA Hiroyuki
    Cc:
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Daisuke Nishimura
     
  • Chip detection may fail if the chip is in some odd state for example after
    system restart. Chip doesn't have HW reset line.

    Signed-off-by: Samu Onkalo
    Cc: Richard Purdie
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Samu Onkalo
     
  • Chip detection may fail if the chip is in some odd state for example after
    system restart. Chip doesn't have HW reset line.

    Signed-off-by: Samu Onkalo
    Cc: Richard Purdie
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Samu Onkalo
     
  • Delays were little bit too long. Adjust delay times and add some comments
    to them.

    Signed-off-by: Samu Onkalo
    Cc: Richard Purdie
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Samu Onkalo
     
  • Delays were little bit too long. Adjust delay times and add some comments
    to them.

    Signed-off-by: Samu Onkalo
    Cc: Richard Purdie
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Samu Onkalo
     
  • A small macro changed to inline function to have proper type checking.
    Inline added to two similar small functions.

    Signed-off-by: Samu Onkalo
    Cc: Richard Purdie
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Samu Onkalo
     
  • Some small macros changed to inline functions to have proper type
    checking.

    Signed-off-by: Samu Onkalo
    Cc: Richard Purdie
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Samu Onkalo
     
  • The attribute cache for a file was not being cleared when a file is opened
    with O_TRUNC.

    If the filesystem's open operation truncates the file ("atomic_o_trunc"
    feature flag is set) then the kernel should invalidate the cached st_mtime
    and st_ctime attributes.

    Also i_size should be explicitly be set to zero as it is used sometimes
    without refreshing the cache.

    Signed-off-by: Ken Sumrall
    Cc: Anfei
    Cc: "Anand V. Avati"
    Signed-off-by: Miklos Szeredi
    Cc:
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Ken Sumrall
     
  • UV hardware defines 256 memory protection regions versus the baseline 64
    with increasing size for the SN2 ia64. This was overlooked when XPC was
    modified to accomodate both UV and SN2.

    Without this patch, a user could reconfigure their existing system and
    suddenly disable cross-partition communications with no indication of what
    has gone wrong. It also prevents larger configurations from using
    cross-partition communication.

    Signed-off-by: Robin Holt
    Cc:
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Robin@sgi.com
     
  • Fix this:

    kernel BUG at mm/memcontrol.c:2155!
    invalid opcode: 0000 [#1]
    last sysfs file:

    Pid: 18, comm: sh Not tainted 2.6.37-rc3 #3 /Bochs
    EIP: 0060:[] EFLAGS: 00000246 CPU: 0
    EIP is at mem_cgroup_move_account+0xe2/0xf0
    EAX: 00000004 EBX: c6f931d4 ECX: c681c300 EDX: c681c000
    ESI: c681c300 EDI: ffffffea EBP: c681c000 ESP: c46f3e30
    DS: 007b ES: 007b FS: 0000 GS: 0033 SS: 0068
    Process sh (pid: 18, ti=c46f2000 task=c6826e60 task.ti=c46f2000)
    Stack:
    00000155 c681c000 0805f000 c46ee180 c46f3e5c c7058820 c1074d37 00000000
    08060000 c46db9a0 c46ec080 c7058820 0805f000 08060000 c46f3e98 c1074c50
    c106c75e c46f3e98 c46ec080 08060000 0805ffff c46db9a0 c46f3e98 c46e0340
    Call Trace:
    [] ? mem_cgroup_move_charge_pte_range+0xe7/0x130
    [] ? mem_cgroup_move_charge_pte_range+0x0/0x130
    [] ? walk_page_range+0xee/0x1d0
    [] ? mem_cgroup_move_task+0x66/0x90
    [] ? mem_cgroup_move_charge_pte_range+0x0/0x130
    [] ? mem_cgroup_move_task+0x0/0x90
    [] ? cgroup_attach_task+0x136/0x200
    [] ? cgroup_tasks_write+0x48/0xc0
    [] ? cgroup_file_write+0xde/0x220
    [] ? do_page_fault+0x17d/0x3f0
    [] ? alloc_fd+0x2d/0xd0
    [] ? cgroup_file_write+0x0/0x220
    [] ? vfs_write+0x92/0xc0
    [] ? sys_write+0x41/0x70
    [] ? syscall_call+0x7/0xb
    Code: 03 00 74 09 8b 44 24 04 e8 1c f1 ff ff 89 73 04 8d 86 b0 00 00 00 b9 01 00 00 00 89 da 31 ff e8 65 f5 ff ff e9 4d ff ff ff 0f 0b 0b 0f 0b 0f 0b 90 8d b4 26 00 00 00 00 83 ec 10 8b 0d f4 e3
    EIP: [] mem_cgroup_move_account+0xe2/0xf0 SS:ESP 0068:c46f3e30
    ---[ end trace 7daa1582159b6532 ]---

    lock_page_cgroup and unlock_page_cgroup are implemented using
    bit_spinlock. bit_spinlock doesn't touch the bit if we are on non-SMP
    machine, so we can't use the bit to check whether the lock was taken.

    Let's introduce is_page_cgroup_locked based on bit_spin_is_locked instead
    of PageCgroupLocked to fix it.

    [akpm@linux-foundation.org: s/is_page_cgroup_locked/page_is_cgroup_locked/]
    Signed-off-by: Kirill A. Shutemov
    Reviewed-by: Johannes Weiner
    Acked-by: KAMEZAWA Hiroyuki
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Kirill A. Shutemov
     
  • Disable the winch irq early to make sure we don't take an interrupt part
    way through the freeing of the handler data, resulting in a crash on
    shutdown:

    winch_interrupt : read failed, errno = 9
    fd 13 is losing SIGWINCH support
    ------------[ cut here ]------------
    WARNING: at lib/list_debug.c:48 list_del+0xc6/0x100()
    list_del corruption, next is LIST_POISON1 (00100100)
    082578c8: [] dump_stack+0x22/0x24
    082578e0: [] warn_slowpath_common+0x5a/0x80
    08257908: [] warn_slowpath_fmt+0x2e/0x30
    08257920: [] list_del+0xc6/0x100
    08257940: [] free_winch+0x14/0x80
    08257958: [] winch_interrupt+0xdb/0xe0
    08257978: [] handle_IRQ_event+0x35/0xe0
    08257998: [] handle_edge_irq+0xb7/0x170
    082579bc: [] do_IRQ+0x34/0x50
    082579d4: [] sigio_handler+0x5b/0x80
    082579ec: [] sig_handler_common+0x44/0xb0
    08257a68: [] sig_handler+0x38/0x50
    08257a78: [] handle_signal+0x5c/0xa0
    08257a9c: [] hard_handler+0x18/0x20
    08257aac: [] 0xc14400

    Signed-off-by: Will Newton
    Acked-by: WANG Cong
    Cc: Jeff Dike
    Cc:
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Will Newton
     
  • Depending on processor speed, page size, and the amount of memory a
    process is allowed to amass, cleanup of a large VM may freeze the system
    for many seconds. This can result in a watchdog timeout.

    Make sure other tasks receive some service when cleaning up large VMs.

    Signed-off-by: Steven J. Magnani
    Cc: Greg Ungerer
    Reviewed-by: KOSAKI Motohiro
    Cc:
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Steven J. Magnani
     
  • dpkg uses fiemap but didn't particularly need to include stdint.h so far.
    Since 367a51a33902 ("fs: Add FITRIM ioctl"), build of linux/fs.h failed in
    dpkg with:

    In file included from ../../src/filesdb.c:27:0:
    /usr/include/linux/fs.h:37:2: error: expected specifier-qualifier-list before 'uint64_t'

    Use exportable type __u64 to avoid the dependency on stdint.h.

    b31d42a5af18 ("Fix compile brekage with !CONFIG_BLOCK") fixed only the
    kernel build by including linux/types.h, but this also fixed "make
    headers_check", so don't revert it.

    Signed-off-by: Loïc Minier
    Tested-by: Arnd Bergmann
    Cc: Lukas Czerner
    Cc: Dmitry Monakhov
    Cc: Theodore Ts'o
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Loïc Minier
     
  • While running randconfg with ktest.pl I stumbled upon this bug:

    BUG: unable to handle kernel NULL pointer dereference at 0000000000000003
    IP: [] strstr+0x39/0x86
    PGD 0
    Oops: 0000 [#1] SMP
    last sysfs file:
    CPU 0
    Modules linked in:

    Pid: 1, comm: swapper Not tainted 2.6.37-rc1-test+ #6 DG965MQ/
    RIP: 0010:[] [] strstr+0x39/0x86
    RSP: 0018:ffff8800797cbd80 EFLAGS: 00010213
    RAX: 0000000000000000 RBX: 0000000000000003 RCX: ffffffffffffffff
    RDX: 0000000000000000 RSI: ffffffff82eb7ac9 RDI: 0000000000000003
    RBP: ffff8800797cbda0 R08: ffff880000000003 R09: 0000000000030725
    R10: ffff88007d294c00 R11: 0000000000014c00 R12: 0000000000000020
    R13: ffffffff82eb7ac9 R14: ffffffffffffffff R15: ffffffff82eb7b08
    FS: 0000000000000000(0000) GS:ffff88007d200000(0000) knlGS:0000000000000000
    CS: 0010 DS: 0000 ES: 0000 CR0: 000000008005003b
    CR2: 0000000000000003 CR3: 0000000002a1d000 CR4: 00000000000006f0
    DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
    DR3: 0000000000000000 DR6: 00000000ffff0ff0 DR7: 0000000000000400
    Process swapper (pid: 1, threadinfo ffff8800797ca000, task ffff8800797d0000)
    Stack:
    00000000000000ba ffffffff82eb7ac9 ffffffff82eb7ab8 00000000000000ba
    ffff8800797cbdf0 ffffffff81e2050f ffff8800797cbdc0 00000000815f913b
    ffff8800797cbe00 ffffffff82eb7ab8 0000000000000000 0000000000000000
    Call Trace:
    [] dmi_matches+0x117/0x154
    [] dmi_check_system+0x3d/0x8d
    [] ? nas_gpio_init+0x0/0x2c8
    [] nas_gpio_init+0x24/0x2c8
    [] ? wm8350_led_init+0x0/0x20
    [] ? nas_gpio_init+0x0/0x2c8
    [] do_one_initcall+0xab/0x1b2
    [] kernel_init+0x248/0x331
    [] kernel_thread_helper+0x4/0x10
    [] ? kernel_init+0x0/0x331

    Found that the nas_led_whitelist dmi_system_id structure array had no
    NULL end delimiter, causing the dmi_check_system() loop to read an
    undefined entry.

    Signed-off-by: Steven Rostedt
    Acked-by: Dave Hansen
    Acked-by: Richard Purdie
    Acked-by: Arjan van de Ven
    Cc:
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Steven Rostedt
     
  • The find_next_bit, find_first_bit, find_next_zero_bit
    and find_first_zero_bit functions were not properly
    clamping to the maxbit argument at the bit level. They
    were instead only checking maxbit at the byte level.
    To fix this, add a compare and a conditional move
    instruction to the end of the common bit-within-the-
    byte code used by all the functions and be sure not to
    clobber the maxbit argument before it is used.

    Cc:
    Reviewed-by: Nicolas Pitre
    Tested-by: Stephen Warren
    Signed-off-by: James Jones
    Signed-off-by: Russell King

    James Jones
     
  • This change fixes a bug that memchr() will read the first word
    of the source even if the length is zero. Ironically, the code
    was originally written with a test to avoid exactly this problem,
    but to make the code conform to Linux coding standards with all
    declarations preceding all statements, the first load from memory
    was moved up above that test as the initial value for a variable.

    The change just moves all the variable declarations to the top
    of the file, with no initializers, so that the test can also be
    at the top of the file.

    Signed-off-by: Chris Metcalf

    Chris Metcalf
     
  • glibc assumes that it can count /sys/devices/system/cpu/cpu* to get
    the number of configured cpus. For this to be valid on tile, we need
    to generate a "cpu" entry for all cpus, including the ones that are
    not currently allocated for Linux's use.

    Signed-off-by: Chris Metcalf

    Chris Metcalf
     
  • Chris Metcalf
     
  • This change enables PCI root complex support for TILEPro. Unlike
    TILE-Gx, TILEPro has no support for memory-mapped I/O, so the PCI
    support consists of hypervisor upcalls for PIO, DMA, etc. However,
    the performance is fine for the devices we have tested with so far
    (1Gb Ethernet, SATA, etc.).

    The header was tweaked to be a little bit more aggressive
    about disabling attempts to map/unmap IO port space. The hacky
    header was rolled into the header
    and the result was simplified. Both of the latter two headers were
    preliminary versions not meant for release before now - oh well.

    There is one quirk for our TILEmpower platform, which accidentally
    negotiates up to 5GT and needs to be kicked down to 2.5GT.

    Signed-off-by: Chris Metcalf

    Chris Metcalf