pandora-kernel.git
12 years agomm: tidy vmtruncate_range and related functions
Hugh Dickins [Tue, 26 Jul 2011 00:12:24 +0000 (17:12 -0700)]
mm: tidy vmtruncate_range and related functions

Use consistent variable names in truncate_pagecache(), truncate_setsize(),
vmtruncate() and vmtruncate_range().

unmap_mapping_range() and vmtruncate_range() have mismatched interfaces:
don't change either, but make the vmtruncates more precise about what they
expect unmap_mapping_range() to do.

vmtruncate_range() is currently called only with page-aligned start and
end+1: can handle unaligned start, but unaligned end+1 would hit BUG_ON in
truncate_inode_pages_range() (lacks partial clearing of the end page).

Signed-off-by: Hugh Dickins <hughd@google.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
12 years agomm: truncate functions are in truncate.c
Hugh Dickins [Tue, 26 Jul 2011 00:12:23 +0000 (17:12 -0700)]
mm: truncate functions are in truncate.c

Correct comment on truncate_inode_pages*() in linux/mm.h; and remove
declaration of page_unuse(), it didn't exist even in 2.2.26 or 2.4.0!

Signed-off-by: Hugh Dickins <hughd@google.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
12 years agomm: cleanup descriptions of filler arg
Hugh Dickins [Tue, 26 Jul 2011 00:12:23 +0000 (17:12 -0700)]
mm: cleanup descriptions of filler arg

The often-NULL data arg to read_cache_page() and read_mapping_page()
functions is misdescribed as "destination for read data": no, it's the
first arg to the filler function, often struct file * to ->readpage().

Satisfy checkpatch.pl on those filler prototypes, and tidy up the
declarations in linux/pagemap.h.

Signed-off-by: Hugh Dickins <hughd@google.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
12 years agosparc64: implement get_user_pages_fast()
David S. Miller [Tue, 26 Jul 2011 00:12:22 +0000 (17:12 -0700)]
sparc64: implement get_user_pages_fast()

Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
12 years agosparc64: add support for _PAGE_SPECIAL
David S. Miller [Tue, 26 Jul 2011 00:12:21 +0000 (17:12 -0700)]
sparc64: add support for _PAGE_SPECIAL

Luckily there are still a few software PTE bits remaining and they even
match up in both the sun4u and sun4v pte layouts.

Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
12 years agosparc64: use RCU page table freeing
David S. Miller [Tue, 26 Jul 2011 00:12:21 +0000 (17:12 -0700)]
sparc64: use RCU page table freeing

Make use of the generic RCU page table freeing on Sparc64, doing so allows
for race-free software page-table walkers like gup_fast().

Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
12 years agosparc64: kill page table quicklists
David S. Miller [Tue, 26 Jul 2011 00:12:20 +0000 (17:12 -0700)]
sparc64: kill page table quicklists

With the recent mmu_gather changes that included generic RCU freeing of
page-tables, it is now quite straightforward to implement gup_fast() on
sparc64.

This patch:

Remove the page table quicklists.  They are pointless and make it harder
to use RCU page table freeing and share code with other architectures.

BTW, this is the second time this has happened, see commit 3c936465249f
("[SPARC64]: Kill pgtable quicklists and use SLAB.")

Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
12 years agommap: fix and tidy up overcommit page arithmetic
Dmitry Fink [Tue, 26 Jul 2011 00:12:19 +0000 (17:12 -0700)]
mmap: fix and tidy up overcommit page arithmetic

- shmem pages are not immediately available, but they are not
  potentially available either, even if we swap them out, they will just
  relocate from memory into swap, total amount of immediate and
  potentially available memory is not going to be affected, so we
  shouldn't count them as potentially free in the first place.

- nr_free_pages() is not an expensive operation anymore, there is no
  need to split the decision making in two halves and repeat code.

Signed-off-by: Dmitry Fink <dmitry.fink@palm.com>
Reviewed-by: Minchan Kim <minchan.kim@gmail.com>
Acked-by: Hugh Dickins <hughd@google.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
12 years agomm/memblock.c: avoid abuse of RED_INACTIVE
Andrew Morton [Tue, 26 Jul 2011 00:12:18 +0000 (17:12 -0700)]
mm/memblock.c: avoid abuse of RED_INACTIVE

RED_INACTIVE is a slab thing, and reusing it for memblock was
inappropriate, because memblock is dealing with phys_addr_t's which have a
Kconfigurable sizeof().

Create a new poison type for this application.  Fixes the sparse warning

    warning: cast truncates bits from constant value (9f911029d74e35b becomes 9d74e35b)

Reported-by: H Hartley Sweeten <hartleys@visionengravers.com>
Tested-by: H Hartley Sweeten <hartleys@visionengravers.com>
Acked-by: Pekka Enberg <penberg@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
12 years agooom: make deprecated use of oom_adj more verbose
David Rientjes [Tue, 26 Jul 2011 00:12:18 +0000 (17:12 -0700)]
oom: make deprecated use of oom_adj more verbose

/proc/pid/oom_adj is deprecated and scheduled for removal in August 2012
according to Documentation/feature-removal-schedule.txt.

This patch makes the warning more verbose by making it appear as a more
serious problem (the presence of a stack trace and being multiline should
attract more attention) so that applications still using the old interface
can get fixed.

Very popular users of the old interface have been converted since the oom
killer rewrite has been introduced.  udevd switched to the
/proc/pid/oom_score_adj interface for v162, kde switched in 4.6.1, and
opensshd switched in 5.7p1.

At the start of 2012, this should be changed into a WARN() to emit all
such incidents and then finally remove the tunable in August 2012 as
scheduled.

Signed-off-by: David Rientjes <rientjes@google.com>
Cc: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
Cc: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
12 years agooom: remove references to old badness() function
David Rientjes [Tue, 26 Jul 2011 00:12:17 +0000 (17:12 -0700)]
oom: remove references to old badness() function

The badness() function in the oom killer was renamed to oom_badness() in
a63d83f427fb ("oom: badness heuristic rewrite") since it is a globally
exported function for clarity.

The prototype for the old function still existed in linux/oom.h, so remove
it.  There are no existing users.

Also fixes documentation and comment references to badness() and adjusts
them accordingly.

Signed-off-by: David Rientjes <rientjes@google.com>
Reviewed-by: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
12 years agomm/memory.c: remove ZAP_BLOCK_SIZE
Andrew Morton [Tue, 26 Jul 2011 00:12:16 +0000 (17:12 -0700)]
mm/memory.c: remove ZAP_BLOCK_SIZE

ZAP_BLOCK_SIZE became unused in the preemptible-mmu_gather work ("mm:
Remove i_mmap_lock lockbreak").  So zap it.

Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
12 years agomm: hugetlb: fix coding style issues
Chris Forbes [Tue, 26 Jul 2011 00:12:14 +0000 (17:12 -0700)]
mm: hugetlb: fix coding style issues

Fix coding style issues flagged by checkpatch.pl

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Acked-by: Eric B Munson <emunson@mgebm.net>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
12 years agomm/huge_memory.c: minor lock simplification in __khugepaged_exit
Chris Wright [Tue, 26 Jul 2011 00:12:14 +0000 (17:12 -0700)]
mm/huge_memory.c: minor lock simplification in __khugepaged_exit

The lock is released first thing in all three branches.  Simplify this by
unconditionally releasing lock and remove else clause which was only there
to be sure lock was released.

Signed-off-by: Chris Wright <chrisw@sous-sol.org>
Reviewed-by: Michal Hocko <mhocko@suse.cz>
Cc: Andrea Arcangeli <aarcange@redhat.com>
Acked-by: Johannes Weiner <jweiner@redhat.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
12 years agomm/page_cgroup.c: simplify code by using SECTION_ALIGN_UP() and SECTION_ALIGN_DOWN...
Daniel Kiper [Tue, 26 Jul 2011 00:12:13 +0000 (17:12 -0700)]
mm/page_cgroup.c: simplify code by using SECTION_ALIGN_UP() and SECTION_ALIGN_DOWN() macros

Commit a539f3533b78e3 ("mm: add SECTION_ALIGN_UP() and
SECTION_ALIGN_DOWN() macro") introduced the SECTION_ALIGN_UP() and
SECTION_ALIGN_DOWN() macros.  Use those macros to increase code
readability.

Signed-off-by: Daniel Kiper <dkiper@net-space.pl>
Acked-by: David Rientjes <rientjes@google.com>
Acked-by: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
12 years agomm: remove the leftovers of noswapaccount
WANG Cong [Tue, 26 Jul 2011 00:12:12 +0000 (17:12 -0700)]
mm: remove the leftovers of noswapaccount

In commit a2c8990aed5ab ("memsw: remove noswapaccount kernel parameter"),
Michal forgot to remove some left pieces of noswapaccount in the tree,
this patch removes them all.

Signed-off-by: WANG Cong <xiyou.wangcong@gmail.com>
Acked-by: Michal Hocko <mhocko@suse.cz>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
12 years agopagewalk: fix code comment for THP
KOSAKI Motohiro [Tue, 26 Jul 2011 00:12:11 +0000 (17:12 -0700)]
pagewalk: fix code comment for THP

Commit bae9c19bf1 ("thp: split_huge_page_mm/vma") changed locking behavior
of walk_page_range().  Thus this patch changes the comment too.

Signed-off-by: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
Cc: Naoya Horiguchi <n-horiguchi@ah.jp.nec.com>
Cc: Hiroyuki Kamezawa <kamezawa.hiroyuki@gmail.com>
Cc: Andrea Arcangeli <aarcange@redhat.com>
Cc: Matt Mackall <mpm@selenic.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
12 years agopagewalk: add locking-rule comments
KOSAKI Motohiro [Tue, 26 Jul 2011 00:12:10 +0000 (17:12 -0700)]
pagewalk: add locking-rule comments

Originally, walk_hugetlb_range() didn't require a caller take any lock.
But commit d33b9f45bd ("mm: hugetlb: fix hugepage memory leak in
walk_page_range") changed its rule.  Because it added find_vma() call in
walk_hugetlb_range().

Any locking-rule change commit should write a doc too.

[akpm@linux-foundation.org: clarify comment]
Signed-off-by: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
Cc: Naoya Horiguchi <n-horiguchi@ah.jp.nec.com>
Cc: Hiroyuki Kamezawa <kamezawa.hiroyuki@gmail.com>
Cc: Andrea Arcangeli <aarcange@redhat.com>
Cc: Matt Mackall <mpm@selenic.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
12 years agopagewalk: don't look up vma if walk->hugetlb_entry is unused
KOSAKI Motohiro [Tue, 26 Jul 2011 00:12:09 +0000 (17:12 -0700)]
pagewalk: don't look up vma if walk->hugetlb_entry is unused

Currently, walk_page_range() calls find_vma() every page table for walk
iteration.  but it's completely unnecessary if walk->hugetlb_entry is
unused.  And we don't have to assume find_vma() is a lightweight
operation.  So this patch checks the walk->hugetlb_entry and avoids the
find_vma() call if possible.

This patch also makes some cleanups.  1) remove ugly uninitialized_var()
and 2) #ifdef in function body.

Signed-off-by: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
Cc: Naoya Horiguchi <n-horiguchi@ah.jp.nec.com>
Cc: Hiroyuki Kamezawa <kamezawa.hiroyuki@gmail.com>
Cc: Andrea Arcangeli <aarcange@redhat.com>
Cc: Matt Mackall <mpm@selenic.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
12 years agopagewalk: fix walk_page_range() don't check find_vma() result properly
KOSAKI Motohiro [Tue, 26 Jul 2011 00:12:09 +0000 (17:12 -0700)]
pagewalk: fix walk_page_range() don't check find_vma() result properly

The doc of find_vma() says,

    /* Look up the first VMA which satisfies  addr < vm_end,  NULL if none. */
    struct vm_area_struct *find_vma(struct mm_struct *mm, unsigned long addr)
    {
     (snip)

Thus, caller should confirm whether the returned vma matches a desired one.

Signed-off-by: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
Cc: Naoya Horiguchi <n-horiguchi@ah.jp.nec.com>
Cc: Hiroyuki Kamezawa <kamezawa.hiroyuki@gmail.com>
Cc: Andrea Arcangeli <aarcange@redhat.com>
Cc: Matt Mackall <mpm@selenic.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
12 years agomm: swap-token: add a comment for priority aging
KOSAKI Motohiro [Tue, 26 Jul 2011 00:12:08 +0000 (17:12 -0700)]
mm: swap-token: add a comment for priority aging

Document some swap token aging design decisions.

Signed-off-by: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
Acked-by: Rik van Riel <riel@redhat.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
12 years agomm: swap-token: makes global variables to function local
KOSAKI Motohiro [Tue, 26 Jul 2011 00:12:07 +0000 (17:12 -0700)]
mm: swap-token: makes global variables to function local

global_faults and last_aging are only used in grab_swap_token().  Move
them into grab_swap_token().

Signed-off-by: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
Acked-by: Rik van Riel <riel@redhat.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
12 years agomm: swap-token: fix dead link
KOSAKI Motohiro [Tue, 26 Jul 2011 00:12:06 +0000 (17:12 -0700)]
mm: swap-token: fix dead link

http://www.cs.wm.edu/~sjiang/token.pdf is now dead.  Replace it with an
alive alternative.

Signed-off-by: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
Acked-by: Rik van Riel <riel@redhat.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
12 years agoxen/balloon: memory hotplug support for Xen balloon driver
Daniel Kiper [Tue, 26 Jul 2011 00:12:06 +0000 (17:12 -0700)]
xen/balloon: memory hotplug support for Xen balloon driver

Memory hotplug support for Xen balloon driver.  It should be mentioned
that hotplugged memory is not onlined automatically.  It should be onlined
by user through standard sysfs interface.

Memory could be hotplugged in following steps:

  1) dom0: xl mem-max <domU> <maxmem>
     where <maxmem> is >= requested memory size,

  2) dom0: xl mem-set <domU> <memory>
     where <memory> is requested memory size; alternatively memory
     could be added by writing proper value to
     /sys/devices/system/xen_memory/xen_memory0/target or
     /sys/devices/system/xen_memory/xen_memory0/target_kb on dumU,

  3) domU: for i in /sys/devices/system/memory/memory*/state; do \
             [ "`cat "$i"`" = offline ] && echo online > "$i"; done

Memory could be onlined automatically on domU by adding following line to
udev rules:

  SUBSYSTEM=="memory", ACTION=="add", RUN+="/bin/sh -c '[ -f /sys$devpath/state ] && echo online > /sys$devpath/state'"

In that case step 3 should be omitted.

Signed-off-by: Daniel Kiper <dkiper@net-space.pl>
Acked-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Cc: Ian Campbell <ian.campbell@citrix.com>
Cc: Jeremy Fitzhardinge <jeremy@goop.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
12 years agomm: extend memory hotplug API to allow memory hotplug in virtual machines
Daniel Kiper [Tue, 26 Jul 2011 00:12:05 +0000 (17:12 -0700)]
mm: extend memory hotplug API to allow memory hotplug in virtual machines

This patch contains online_page_callback and apropriate functions for
registering/unregistering online page callbacks.  It allows to do some
machine specific tasks during online page stage which is required to
implement memory hotplug in virtual machines.  Currently this patch is
required by latest memory hotplug support for Xen balloon driver patch
which will be posted soon.

Additionally, originial online_page() function was splited into
following functions doing "atomic" operations:

  - __online_page_set_limits() - set new limits for memory management code,
  - __online_page_increment_counters() - increment totalram_pages and totalhigh_pages,
  - __online_page_free() - free page to allocator.

It was done to:
  - not duplicate existing code,
  - ease hotplug code devolpment by usage of well defined interface,
  - avoid stupid bugs which are unavoidable when the same code
    (by design) is developed in many places.

[akpm@linux-foundation.org: use explicit indirect-call syntax]
Signed-off-by: Daniel Kiper <dkiper@net-space.pl>
Reviewed-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Cc: Ian Campbell <ian.campbell@citrix.com>
Cc: Jeremy Fitzhardinge <jeremy@goop.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
12 years agobacklight: set backlight type and max_brightness before backlights are registered
Axel Lin [Tue, 26 Jul 2011 00:12:01 +0000 (17:12 -0700)]
backlight: set backlight type and max_brightness before backlights are registered

Since commit a19a6ee "backlight: Allow properties to be passed at
registration" and commit bb7ca74 "backlight: add backlight type", we can
set backlight type and max_brightness before backlights are registered.
Some newly added drivers did not set it properly, let's fix it.

Signed-off-by: Axel Lin <axel.lin@gmail.com>
Cc: Matthew Garrett <mjg@redhat.com>
Cc: Jingoo Han <jg1.han@samsung.com>
Cc: Donghwa Lee <dh09.lee@samsung.com>
Cc: InKi Dae <inki.dae@samsung.com>
Cc: Richard Purdie <rpurdie@rpsys.net>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
12 years agobacklight: add ams369fg06 amoled driver
Jingoo Han [Tue, 26 Jul 2011 00:12:00 +0000 (17:12 -0700)]
backlight: add ams369fg06 amoled driver

Add the ams369fg06 amoled panel driver.  The ams369fg06 amoled panel (480
x 800) driver uses 3-wired SPI inteface.  The brightness can be controlled
by gamma setting of amoled panel.

[sfr@canb.auug.org.au: fix build error]
[axel.lin@gmail.com: unregister backlight device when unloading the module]
[axel.lin@gmail.com: staticize ams369fg06_shutdown]
Signed-off-by: Jingoo Han <jg1.han@samsung.com>
Cc: Richard Purdie <rpurdie@rpsys.net>
Cc: Inki Dae <inki.dae@samsung.com>
Cc: anish singh <anish198519851985@gmail.com>
Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
Signed-off-by: Axel Lin <axel.lin@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
12 years agodrivers/video/backlight/adp8860_bl.c: remove a redundant assignment for max_brightness
Axel Lin [Tue, 26 Jul 2011 00:11:59 +0000 (17:11 -0700)]
drivers/video/backlight/adp8860_bl.c: remove a redundant assignment for max_brightness

We have set props.max_brightness before registering backlight device.

Signed-off-by: Axel Lin <axel.lin@gmail.com>
Acked-by: Mike Frysinger <vapier@gentoo.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
12 years agodrivers/video/backlight/ld9040.c: small fixes
Axel Lin [Tue, 26 Jul 2011 00:11:58 +0000 (17:11 -0700)]
drivers/video/backlight/ld9040.c: small fixes

- Fix checking of wrong return value for backlight_device_register()

- Properly free allocated resources in ld9040_probe() error path and
  ld9040_remove().

Signed-off-by: Axel Lin <axel.lin@gmail.com>
Cc: Donghwa Lee <dh09.lee@samsung.com>
Cc: Richard Purdie <rpurdie@rpsys.net>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
12 years agomm/backing-dev.c: reset bdi min_ratio in bdi_unregister()
Peter Zijlstra [Tue, 26 Jul 2011 00:11:57 +0000 (17:11 -0700)]
mm/backing-dev.c: reset bdi min_ratio in bdi_unregister()

Vito said:

: The system has many usb disks coming and going day to day, with their
: respective bdi's having min_ratio set to 1 when inserted.  It works for
: some time until eventually min_ratio can no longer be set, even when the
: active set of bdi's seen in /sys/class/bdi/*/min_ratio doesn't add up to
: anywhere near 100.
:
: This then leads to an unrelated starvation problem caused by write-heavy
: fuse mounts being used atop the usb disks, a problem the min_ratio setting
: at the underlying devices bdi effectively prevents.

Fix this leakage by resetting the bdi min_ratio when unregistering the
BDI.

Signed-off-by: Peter Zijlstra <peterz@infradead.org>
Reported-by: Vito Caputo <lkml@pengaru.com>
Cc: Wu Fengguang <fengguang.wu@intel.com>
Cc: Miklos Szeredi <miklos@szeredi.hu>
Cc: <stable@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
12 years agodrivers/misc/pch_phub.c: don't oops if dmi_get_system_info returns NULL
Alexander Stein [Tue, 26 Jul 2011 00:11:54 +0000 (17:11 -0700)]
drivers/misc/pch_phub.c: don't oops if dmi_get_system_info returns NULL

If dmi_get_system_info() returns NULL, pch_phub_probe() will dereferencea
a zero pointer.

This oops was observed on an Atom based board which has no BIOS, but a
bootloder which doesn't privde DMI data.

Signed-off-by: Alexander Stein <alexander.stein@systec-electronic.com>
Cc: Tomoya MORINAGA <tomoya-linux@dsn.okisemi.com>
Cc: Greg KH <gregkh@suse.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
12 years agoxtensa: fix a build error in arch/xtensa/include/asm/uaccess.h
WANG Cong [Tue, 26 Jul 2011 00:11:54 +0000 (17:11 -0700)]
xtensa: fix a build error in arch/xtensa/include/asm/uaccess.h

Fix the following build error:

  arch/xtensa/include/asm/uaccess.h:403: error: implicit declaration of function 'prefetch'
  arch/xtensa/include/asm/uaccess.h:412: error: implicit declaration of function 'prefetchw'

Signed-off-by: WANG Cong <xiyou.wangcong@gmail.com>
Cc: Chris Zankel <chris@zankel.net>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
12 years agoxtensa: prevent arbitrary read in ptrace
Dan Rosenberg [Tue, 26 Jul 2011 00:11:53 +0000 (17:11 -0700)]
xtensa: prevent arbitrary read in ptrace

Prevent an arbitrary kernel read.  Check the user pointer with access_ok()
before copying data in.

[akpm@linux-foundation.org: s/EIO/EFAULT/]
Signed-off-by: Dan Rosenberg <drosenberg@vsecurity.com>
Cc: Christian Zankel <chris@zankel.net>
Cc: Oleg Nesterov <oleg@redhat.com>
Cc: <stable@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
12 years agomm: use const struct page for r/o page-flag accessor methods
Ian Campbell [Tue, 26 Jul 2011 00:11:52 +0000 (17:11 -0700)]
mm: use const struct page for r/o page-flag accessor methods

In a subsquent patch I have a const struct page in my hand...

[akpm@linux-foundation.org: coding-style fixes]
Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Cc: Andrea Arcangeli <aarcange@redhat.com>
Cc: Rik van Riel <riel@redhat.com>
Cc: Martin Schwidefsky <schwidefsky@de.ibm.com>
Cc: Michel Lespinasse <walken@google.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
12 years agomm: make some struct page's const
Ian Campbell [Tue, 26 Jul 2011 00:11:51 +0000 (17:11 -0700)]
mm: make some struct page's const

These uses are read-only and in a subsequent patch I have a const struct
page in my hand...

[akpm@linux-foundation.org: fix warnings in lowmem_page_address()]
Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Cc: Rik van Riel <riel@redhat.com>
Cc: Andrea Arcangeli <aarcange@redhat.com>
Cc: Mel Gorman <mel@csn.ul.ie>
Cc: Michel Lespinasse <walken@google.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
12 years agohugetlb: add phys addr to struct huge_bootmem_page
Becky Bruce [Tue, 26 Jul 2011 00:11:50 +0000 (17:11 -0700)]
hugetlb: add phys addr to struct huge_bootmem_page

This is needed on HIGHMEM systems - we don't always have a virtual
address so store the physical address and map it in as needed.

[akpm@linux-foundation.org: cleanup]
Signed-off-by: Becky Bruce <beckyb@kernel.crashing.org>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
12 years agofs/hugetlbfs/inode.c: fix pgoff alignment checking on 32-bit
Becky Bruce [Tue, 26 Jul 2011 00:11:49 +0000 (17:11 -0700)]
fs/hugetlbfs/inode.c: fix pgoff alignment checking on 32-bit

This:

    vma->vm_pgoff & ~(huge_page_mask(h) >> PAGE_SHIFT)

is incorrect on 32-bit.  It causes us to & the pgoff with something that
looks like this (for a 4m hugepage): 0xfff003ff.  The mask should be
flipped and *then* shifted, to give you 0x0000_03fff.

Signed-off-by: Becky Bruce <beckyb@kernel.crashing.org>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
12 years agoipc/sem.c: fix race with concurrent semtimedop() timeouts and IPC_RMID
Manfred Spraul [Tue, 26 Jul 2011 00:11:47 +0000 (17:11 -0700)]
ipc/sem.c: fix race with concurrent semtimedop() timeouts and IPC_RMID

If a semaphore array is removed and in parallel a sleeping task is woken
up (signal or timeout, does not matter), then the woken up task does not
wait until wake_up_sem_queue_do() is completed.  This will cause crashes,
because wake_up_sem_queue_do() will read from a stale pointer.

The fix is simple: Regardless of anything, always call get_queue_result().
This function waits until wake_up_sem_queue_do() has finished it's task.

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

Reported-by: Yuriy Yevtukhov <yuriy@ucoz.com>
Reported-by: Harald Laabs <kernel@dasr.de>
Signed-off-by: Manfred Spraul <manfred@colorfullife.com>
Acked-by: Eric Dumazet <eric.dumazet@gmail.com>
Cc: <stable@kernel.org> [2.6.35+]
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
12 years agoMerge branches 'kbuild', 'packaging' and 'misc' of git://git.kernel.org/pub/scm/linux...
Linus Torvalds [Tue, 26 Jul 2011 03:01:57 +0000 (20:01 -0700)]
Merge branches 'kbuild', 'packaging' and 'misc' of git://git./linux/kernel/git/mmarek/kbuild-2.6

* 'kbuild' of git://git.kernel.org/pub/scm/linux/kernel/git/mmarek/kbuild-2.6:
  genksyms: Use same type in loop comparison
  kbuild: silence generated makefile message
  kernel: prevent unnecessary rebuilding due to config_data.gz
  headers_install: fix __packed in exported kernel headers
  dtc: regen parser
  dtc: migrate parser to implicit rules
  kconfig: regen parser
  kconfig: migrate parser to implicit rules
  kconfig/zconf.l: do not ask to generate backup
  kconfig: kill no longer needed reference to YYDEBUG
  kconfig: constify `kconf_id_lookup'
  genksym: regen parser
  genksyms: migrate parser to implicit rules
  genksyms: drop -Wno-uninitialized from HOSTCFLAGS_parse.tab.o
  genksyms: pass hash and lookup functions name and target language though the input file
  kbuild: simplify the %_shipped rule
  kbuild: add implicit rules for parser generation
  kbuild: add `baseprereq'
  kbuild: Fix reference to vermagic.h

* 'packaging' of git://git.kernel.org/pub/scm/linux/kernel/git/mmarek/kbuild-2.6:
  package: Makefile: fix perf target bug

* 'misc' of git://git.kernel.org/pub/scm/linux/kernel/git/mmarek/kbuild-2.6:
  gitignore: ignore debian build directory

12 years agovfs: make gcc generate more obvious code for acl permission checking
Linus Torvalds [Tue, 26 Jul 2011 02:55:52 +0000 (19:55 -0700)]
vfs: make gcc generate more obvious code for acl permission checking

The "fsuid is the inode owner" case is not necessarily always the likely
case, but it's the case that doesn't do anything odd and that we want in
straight-line code.  Make gcc not generate random "jump around for the
fun of it" code.

This just helps me read profiles.  That thing is one of the hottest
parts of the whole pathname lookup.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
12 years agoMerge branch 'hwmon-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jdelv...
Linus Torvalds [Mon, 25 Jul 2011 21:10:34 +0000 (14:10 -0700)]
Merge branch 'hwmon-for-linus' of git://git./linux/kernel/git/jdelvare/staging

* 'hwmon-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jdelvare/staging:
  hwmon: (lm78) Become the maintainer
  hwmon: (lm78) Make ISA interface depend on CONFIG_ISA
  hwmon: (lm78) Avoid forward declarations
  hwmon: (sht15) Correct a comment mistake
  hwmon: (max1111) Avoid extra memory allocations
  hwmon: (it87) Add chassis intrusion detection support
  hwmon: (via-cputemp) Add VID reporting support
  hwmon-vid: Add support for VIA family 6 model D CPU
  hwmon: New driver sch5636
  hwmon: (sch5627) Factor out some code shared with sch5636 driver

12 years agoMerge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/trivial
Linus Torvalds [Mon, 25 Jul 2011 20:56:39 +0000 (13:56 -0700)]
Merge branch 'for-linus' of git://git./linux/kernel/git/jikos/trivial

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/trivial: (43 commits)
  fs: Merge split strings
  treewide: fix potentially dangerous trailing ';' in #defined values/expressions
  uwb: Fix misspelling of neighbourhood in comment
  net, netfilter: Remove redundant goto in ebt_ulog_packet
  trivial: don't touch files that are removed in the staging tree
  lib/vsprintf: replace link to Draft by final RFC number
  doc: Kconfig: `to be' -> `be'
  doc: Kconfig: Typo: square -> squared
  doc: Konfig: Documentation/power/{pm => apm-acpi}.txt
  drivers/net: static should be at beginning of declaration
  drivers/media: static should be at beginning of declaration
  drivers/i2c: static should be at beginning of declaration
  XTENSA: static should be at beginning of declaration
  SH: static should be at beginning of declaration
  MIPS: static should be at beginning of declaration
  ARM: static should be at beginning of declaration
  rcu: treewide: Do not use rcu_read_lock_held when calling rcu_dereference_check
  Update my e-mail address
  PCIe ASPM: forcedly -> forcibly
  gma500: push through device driver tree
  ...

Fix up trivial conflicts:
 - arch/arm/mach-ep93xx/dma-m2p.c (deleted)
 - drivers/gpio/gpio-ep93xx.c (renamed and context nearby)
 - drivers/net/r8169.c (just context changes)

12 years agoMerge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs-2.6
Linus Torvalds [Mon, 25 Jul 2011 19:53:15 +0000 (12:53 -0700)]
Merge branch 'for-linus' of git://git./linux/kernel/git/viro/vfs-2.6

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs-2.6:
  fs: take the ACL checks to common code
  bury posix_acl_..._masq() variants
  kill boilerplates around posix_acl_create_masq()
  generic_acl: no need to clone acl just to push it to set_cached_acl()
  kill boilerplate around posix_acl_chmod_masq()
  reiserfs: cache negative ACLs for v1 stat format
  xfs: cache negative ACLs if there is no attribute fork
  9p: do no return 0 from ->check_acl without actually checking
  vfs: move ACL cache lookup into generic code
  CIFS: Fix oops while mounting with prefixpath
  xfs: Fix wrong return value of xfs_file_aio_write
  fix devtmpfs race
  caam: don't pass bogus S_IFCHR to debugfs_create_...()
  get rid of create_proc_entry() abuses - proc_mkdir() is there for purpose
  asus-wmi: ->is_visible() can't return negative
  fix jffs2 ACLs on big-endian with 16bit mode_t
  9p: close ACL leaks
  ocfs2_init_acl(): fix a leak
  VFS : mount lock scalability for internal mounts

12 years agohwmon: (lm78) Become the maintainer
Jean Delvare [Mon, 25 Jul 2011 19:46:11 +0000 (21:46 +0200)]
hwmon: (lm78) Become the maintainer

Declare myself the maintainer of the lm78 driver. I still have a
running system with one of these chips.

Also count myself as a co-author of the driver. With 34 commits over
6 years, it seems fair.

Signed-off-by: Jean Delvare <khali@linux-fr.org>
12 years agohwmon: (lm78) Make ISA interface depend on CONFIG_ISA
Jean Delvare [Mon, 25 Jul 2011 19:46:11 +0000 (21:46 +0200)]
hwmon: (lm78) Make ISA interface depend on CONFIG_ISA

We should only include support for the ISA interface of the LM78/LM79
if CONFIG_ISA is set. Not only this makes the driver somewhat smaller
on most architectures, but this also avoids poking at random I/O
ports on these architectures.

This is very similiar to what was done for the w83781d driver in
October 2008.

Signed-off-by: Jean Delvare <khali@linux-fr.org>
Cc: Dean Nelson <dnelson@redhat.com>
12 years agohwmon: (lm78) Avoid forward declarations
Jean Delvare [Mon, 25 Jul 2011 19:46:11 +0000 (21:46 +0200)]
hwmon: (lm78) Avoid forward declarations

Move code around to avoid several forward declarations. Also group
ISA-related functions together, to make future changes easier.

Signed-off-by: Jean Delvare <khali@linux-fr.org>
Cc: Dean Nelson <dnelson@redhat.com>
12 years agohwmon: (sht15) Correct a comment mistake
Vivien Didelot [Mon, 25 Jul 2011 19:46:10 +0000 (21:46 +0200)]
hwmon: (sht15) Correct a comment mistake

sht15_store_heater() is called on _write_ access to heater_enable.

Signed-off-by: Vivien Didelot <vivien.didelot@savoirfairelinux.com>
Signed-off-by: Jean Delvare <khali@linux-fr.org>
12 years agohwmon: (max1111) Avoid extra memory allocations
Jean Delvare [Mon, 25 Jul 2011 19:46:10 +0000 (21:46 +0200)]
hwmon: (max1111) Avoid extra memory allocations

We can allocate the tx and rx buffers as part of our data structure.
Doing so is faster and spares memory.

Signed-off-by: Jean Delvare <khali@linux-fr.org>
Tested-by: Stanislav Brabec <utx@penguin.cz>
12 years agohwmon: (it87) Add chassis intrusion detection support
Jean Delvare [Mon, 25 Jul 2011 19:46:10 +0000 (21:46 +0200)]
hwmon: (it87) Add chassis intrusion detection support

Add chassis intrusion detection support for all supported devices,
using the standard interface.

Signed-off-by: Jean Delvare <khali@linux-fr.org>
12 years agohwmon: (via-cputemp) Add VID reporting support
Jean Delvare [Mon, 25 Jul 2011 19:46:10 +0000 (21:46 +0200)]
hwmon: (via-cputemp) Add VID reporting support

At least VIA family 6 model D CPU report the VID settings in a MSR,
so expose the value to user-space. Not sure about model A.

Signed-off-by: Jean Delvare <khali@linux-fr.org>
Acked-by: Guenter Roeck <guenter.roeck@ericsson.com>
Tested-by: Jeff Rickman <jrickman@myamigos.us>
12 years agohwmon-vid: Add support for VIA family 6 model D CPU
Jean Delvare [Mon, 25 Jul 2011 19:46:10 +0000 (21:46 +0200)]
hwmon-vid: Add support for VIA family 6 model D CPU

The VIA family 6 model D CPU (C7-D, Eden 90 nm) can use two different
VID tables, we have to check the value of a MSR to decide which one to
use.

Signed-off-by: Jean Delvare <khali@linux-fr.org>
Acked-by: Guenter Roeck <guenter.roeck@ericsson.com>
Tested-by: Jeff Rickman <jrickman@myamigos.us>
12 years agohwmon: New driver sch5636
Hans de Goede [Mon, 25 Jul 2011 19:46:09 +0000 (21:46 +0200)]
hwmon: New driver sch5636

This patch adds a new driver for SMSC SCH5636 Super I/O chips.
The chips include an embedded microcontroller for hardware monitoring
solutions, allowing motherboard manufacturers to create their own
custom hwmon solution based upon the SCH5636.

Currently the sch5636 driver only supports the Fujitsu Theseus SCH5636
based hwmon solution. The sch5636 driver runs a sanity check on
loading to ensure it is dealing with a Fujitsu Theseus and not with
another custom SCH5636 based hwmon solution.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Jean Delvare <khali@linux-fr.org>
12 years agohwmon: (sch5627) Factor out some code shared with sch5636 driver
Hans de Goede [Mon, 25 Jul 2011 19:46:09 +0000 (21:46 +0200)]
hwmon: (sch5627) Factor out some code shared with sch5636 driver

This patch adds a new sch56xx-common.ko which contains code which will also
be used in the new sch5636 driver.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Jean Delvare <khali@linux-fr.org>
12 years agoMerge branch 'next/deletion' of git+ssh://master.kernel.org/pub/scm/linux/kernel...
Linus Torvalds [Mon, 25 Jul 2011 19:43:28 +0000 (12:43 -0700)]
Merge branch 'next/deletion' of git+ssh:///linux/kernel/git/arm/linux-arm-soc

* 'next/deletion' of git+ssh://master.kernel.org/pub/scm/linux/kernel/git/arm/linux-arm-soc:
  ARM: mach-loki: delete
  ARM: mach-s3c2400: delete
  ARM: mach-s3c24a0: delete

12 years agoMerge branch 'next/cleanup' of git://git.kernel.org/pub/scm/linux/kernel/git/arm...
Linus Torvalds [Mon, 25 Jul 2011 19:38:42 +0000 (12:38 -0700)]
Merge branch 'next/cleanup' of git://git./linux/kernel/git/arm/linux-arm-soc

* 'next/cleanup' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/linux-arm-soc: (133 commits)
  ARM: EXYNOS4: Change devname for FIMD clkdev
  ARM: S3C64XX: Cleanup mach/regs-fb.h from mach-s3c64xx
  ARM: S5PV210: Cleanup mach/regs-fb.h from mach-s5pv210
  ARM: S5PC100: Cleanup mach/regs-fb.h from mach-s5pc100
  ARM: S3C24XX: Use generic s3c_set_platdata for devices
  ARM: S3C64XX: Use generic s3c_set_platdata for OneNAND
  ARM: SAMSUNG: Use generic s3c_set_platdata for NAND
  ARM: SAMSUNG: Use generic s3c_set_platdata for USB OHCI
  ARM: SAMSUNG: Use generic s3c_set_platdata for HWMON
  ARM: SAMSUNG: Use generic s3c_set_platdata for FB
  ARM: SAMSUNG: Use generic s3c_set_platdata for TS
  ARM: S3C64XX: Add PWM backlight support on SMDK6410
  ARM: S5P64X0: Add PWM backlight support on SMDK6450
  ARM: S5P64X0: Add PWM backlight support on SMDK6440
  ARM: S5PC100: Add PWM backlight support on SMDKC100
  ARM: S5PV210: Add PWM backlight support on SMDKV210
  ARM: EXYNOS4: Add PWM backlight support on SMDKC210
  ARM: EXYNOS4: Add PWM backlight support on SMDKV310
  ARM: SAMSUNG: Create a common infrastructure for PWM backlight support
  clocksource: convert 32-bit down counting clocksource on S5PV210/S5P64X0
  ...

Fix up trivial conflict in arch/arm/mach-imx/mach-scb9328.c

12 years agoMerge branch 'next/fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/linux...
Linus Torvalds [Mon, 25 Jul 2011 18:53:35 +0000 (11:53 -0700)]
Merge branch 'next/fixes' of git://git./linux/kernel/git/arm/linux-arm-soc

* 'next/fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/linux-arm-soc: (35 commits)
  ARM: msm: platsmp: determine number of CPU cores at boot time
  ARM: Tegra: Seaboard: Fix I2C bus numbering for ADT7461
  ARM: Tegra: Trimslice: Tri-state DAP3 pinmux
  ARM: orion5x: fixup 5181 MPP mask check
  ARM: mxs-dma: include <linux/dmaengine.h>
  ARM: i.MX53: consistently use MX53_UART_PAD_CTRL for uart txd/rxd/rts/cts
  ARM: i.MX53: UARTn_CTS pin should not change RTS input select
  ARM: i.MX53: UARTn_TXD pin should not change RXD input select
  ARM: mx25: Fix typo on CAN1_RX pad setting
  iomux-mx53: add missing 'IOMUX_CONFIG_SION' for some I2C pad definitions
  ARM: NUC93X: add UL suffix to VMALLOC_END to ensure it is properly typed
  ARM: LPC32XXX: add UL suffix to VMALLOC_END to ensure it is properly typed
  ARM: CNS3XXX: add UL suffix to VMALLOC_END to ensure it is properly typed
  ARM: i.MX53: Fix IOMUX type o's
  ARM i.MX dma: Fix burstsize settings
  mach-mx5: fix the I2C clock parents
  ARM: mxs/tx28: according to the TX28's datasheet D4-D7 are not used for MMC0
  ARM i.MX23/28: platform-mxsfb: Add missing include of linux/dma-mapping.h
  ARM: mx53: Fix some interrupts marked as reserved.
  MXC: iomux-v3: correct NO_PAD_CTRL definition
  ...

Fix up trivial conflict in arch/arm/mach-imx/mach-mx31_3ds.c

12 years agoMerge branch 'i2c-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jdelvar...
Linus Torvalds [Mon, 25 Jul 2011 18:40:24 +0000 (11:40 -0700)]
Merge branch 'i2c-for-linus' of git://git./linux/kernel/git/jdelvare/staging

* 'i2c-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jdelvare/staging:
  i2c: Allow i2c_add_numbered_adapter() to assign a bus id
  i2c-ali1535: Fix style issues

12 years agofs: take the ACL checks to common code
Christoph Hellwig [Sat, 23 Jul 2011 15:37:31 +0000 (17:37 +0200)]
fs: take the ACL checks to common code

Replace the ->check_acl method with a ->get_acl method that simply reads an
ACL from disk after having a cache miss.  This means we can replace the ACL
checking boilerplate code with a single implementation in namei.c.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
12 years agobury posix_acl_..._masq() variants
Al Viro [Sat, 23 Jul 2011 07:27:37 +0000 (03:27 -0400)]
bury posix_acl_..._masq() variants

made static; no callers left outside of posix_acl.c.  posix_acl_clone() also
has lost all external callers and became static...

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
12 years agokill boilerplates around posix_acl_create_masq()
Al Viro [Sat, 23 Jul 2011 07:10:32 +0000 (03:10 -0400)]
kill boilerplates around posix_acl_create_masq()

new helper: posix_acl_create(&acl, gfp, mode_p).  Replaces acl with
modified clone, on failure releases acl and replaces with NULL.
Returns 0 or -ve on error.  All callers of posix_acl_create_masq()
switched.

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
12 years agogeneric_acl: no need to clone acl just to push it to set_cached_acl()
Al Viro [Sat, 23 Jul 2011 06:41:54 +0000 (02:41 -0400)]
generic_acl: no need to clone acl just to push it to set_cached_acl()

In-core acls are copy-on-write, so the reference taken by set_cached_acl() will
do just fine.

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
12 years agokill boilerplate around posix_acl_chmod_masq()
Al Viro [Sat, 23 Jul 2011 04:18:02 +0000 (00:18 -0400)]
kill boilerplate around posix_acl_chmod_masq()

new helper: posix_acl_chmod(&acl, gfp, mode).  Replaces acl with modified
clone or with NULL if that has failed; returns 0 or -ve on error.  All
callers of posix_acl_chmod_masq() switched to that - they'd been doing
exactly the same thing.

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
12 years agoreiserfs: cache negative ACLs for v1 stat format
Christoph Hellwig [Sat, 23 Jul 2011 15:37:03 +0000 (17:37 +0200)]
reiserfs: cache negative ACLs for v1 stat format

Always set up a negative ACL cache entry if the inode can't have ACLs.
That behaves much better than doing this check inside ->check_acl.

Also remove the left over MAY_NOT_BLOCK check.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
12 years agoxfs: cache negative ACLs if there is no attribute fork
Christoph Hellwig [Sat, 23 Jul 2011 15:36:50 +0000 (17:36 +0200)]
xfs: cache negative ACLs if there is no attribute fork

Always set up a negative ACL cache entry if the inode doesn't have an
attribute fork.  That behaves much better than doing this check inside
->check_acl.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
12 years ago9p: do no return 0 from ->check_acl without actually checking
Christoph Hellwig [Sat, 23 Jul 2011 15:36:38 +0000 (17:36 +0200)]
9p: do no return 0 from ->check_acl without actually checking

If we do not want to use ACLs we at least need to perform normal Unix
permission checks.  From the comment I'm not quite sure that's what
is intended, but if 0p wants to do permission checks entirely on the
server it needs to do so in ->permission, not in ->check_acl.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
12 years agovfs: move ACL cache lookup into generic code
Linus Torvalds [Sat, 23 Jul 2011 02:30:19 +0000 (19:30 -0700)]
vfs: move ACL cache lookup into generic code

This moves logic for checking the cached ACL values from low-level
filesystems into generic code.  The end result is a streamlined ACL
check that doesn't need to load the inode->i_op->check_acl pointer at
all for the common cached case.

The filesystems also don't need to check for a non-blocking RCU walk
case in their acl_check() functions, because that is all handled at a
VFS layer.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
12 years agoCIFS: Fix oops while mounting with prefixpath
Pavel Shilovsky [Mon, 25 Jul 2011 13:59:10 +0000 (17:59 +0400)]
CIFS: Fix oops while mounting with prefixpath

commit fec11dd9a0109fe52fd631e5c510778d6cbff6cc caused
a regression when we have already mounted //server/share/a
and want to mount //server/share/a/b.

The problem is that lookup_one_len calls __lookup_hash
with nd pointer as NULL. Then __lookup_hash calls
do_revalidate in the case when dentry exists and we end
up with NULL pointer deference in cifs_d_revalidate:

if (nd->flags & LOOKUP_RCU)
return -ECHILD;

Fix this by checking nd for NULL.

Signed-off-by: Pavel Shilovsky <piastryyy@gmail.com>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
12 years agoxfs: Fix wrong return value of xfs_file_aio_write
Markus Trippelsdorf [Sun, 24 Jul 2011 12:03:30 +0000 (14:03 +0200)]
xfs: Fix wrong return value of xfs_file_aio_write

The fsync prototype change commit 02c24a82187d accidentally overwrote
the ssize_t return value of xfs_file_aio_write with 0 for SYNC type
writes. Fix this by checking if an error occured when calling
xfs_file_fsync and only change the return value in this case.
In addition xfs_file_fsync actually returns a normal negative error, so
fix this, too.

Signed-off-by: Markus Trippelsdorf <markus@trippelsdorf.de>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Tested-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
12 years agofix devtmpfs race
Al Viro [Mon, 25 Jul 2011 18:15:50 +0000 (14:15 -0400)]
fix devtmpfs race

After we's done complete(&req->done), there's nothing to prevent the
scope containing *req from being gone and *req overwritten by any
kind of junk.  So we must read req->next before that...

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
12 years agoMerge branch 'for-3.1/drivers' of git://git.kernel.dk/linux-block
Linus Torvalds [Mon, 25 Jul 2011 17:38:18 +0000 (10:38 -0700)]
Merge branch 'for-3.1/drivers' of git://git.kernel.dk/linux-block

* 'for-3.1/drivers' of git://git.kernel.dk/linux-block:
  cciss: do not attempt to read from a write-only register
  xen/blkback: Add module alias for autoloading
  xen/blkback: Don't let in-flight requests defer pending ones.
  bsg: fix address space warning from sparse
  bsg: remove unnecessary conditional expressions
  bsg: fix bsg_poll() to return POLLOUT properly

12 years agoMerge branch 'for-3.1/core' of git://git.kernel.dk/linux-block
Linus Torvalds [Mon, 25 Jul 2011 17:33:36 +0000 (10:33 -0700)]
Merge branch 'for-3.1/core' of git://git.kernel.dk/linux-block

* 'for-3.1/core' of git://git.kernel.dk/linux-block: (24 commits)
  block: strict rq_affinity
  backing-dev: use synchronize_rcu_expedited instead of synchronize_rcu
  block: fix patch import error in max_discard_sectors check
  block: reorder request_queue to remove 64 bit alignment padding
  CFQ: add think time check for group
  CFQ: add think time check for service tree
  CFQ: move think time check variables to a separate struct
  fixlet: Remove fs_excl from struct task.
  cfq: Remove special treatment for metadata rqs.
  block: document blk_plug list access
  block: avoid building too big plug list
  compat_ioctl: fix make headers_check regression
  block: eliminate potential for infinite loop in blkdev_issue_discard
  compat_ioctl: fix warning caused by qemu
  block: flush MEDIA_CHANGE from drivers on close(2)
  blk-throttle: Make total_nr_queued unsigned
  block: Add __attribute__((format(printf...) and fix fallout
  fs/partitions/check.c: make local symbols static
  block:remove some spare spaces in genhd.c
  block:fix the comment error in blkdev.h
  ...

12 years agoiomap: make IOPORT/PCI mapping functions conditional
Randy Dunlap [Sun, 24 Jul 2011 18:39:14 +0000 (11:39 -0700)]
iomap: make IOPORT/PCI mapping functions conditional

When CONFIG_PCI is not enabled, CONFIG_EISA=y, and CONFIG_GENERIC_IOMAP=y,
drivers/net/3c59x.c build fails due to a recent small change to
<asm-generic/iomap.h> that surrounds pci_iomap() and pci_iounmap() with
#ifdef CONFIG_PCI/#endif.

Since that patch to iomap.h looks correct, add stubs for pci_iomap() and
pci_iounmap() with CONFIG_PCI is not enabled to fix the build errors.

  drivers/net/3c59x.c:1026: error: implicit declaration of function 'pci_iomap'
  drivers/net/3c59x.c:1038: error: implicit declaration of function 'pci_iounmap'

Signed-off-by: Randy Dunlap <rdunlap@xenotime.net>
Cc: Jonas Bonn <jonas@southpole.se>
Cc: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
12 years agoi2c: Allow i2c_add_numbered_adapter() to assign a bus id
Grant Likely [Mon, 25 Jul 2011 15:49:43 +0000 (17:49 +0200)]
i2c: Allow i2c_add_numbered_adapter() to assign a bus id

Currently, if an i2c bus driver supports both static and dynamic bus
ids, it needs to choose between calling i2c_add_numbered_adapter() and
i2c_add_adapter().  This patch makes i2c_add_numbered_adapter()
redirect to i2c_add_adapter() if the requested bus id is -1.

Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
Signed-off-by: Jean Delvare <khali@linux-fr.org>
12 years agoi2c-ali1535: Fix style issues
LABBE Corentin [Mon, 25 Jul 2011 15:49:42 +0000 (17:49 +0200)]
i2c-ali1535: Fix style issues

This is a fix-style patch for i2c-ali1535 (issues reported by
checkpatch.pl.)

Signed-off-by: LABBE Corentin <corentin.labbe@geomatys.fr>
Signed-off-by: Jean Delvare <khali@linux-fr.org>
12 years agoMerge branch 'tegra/fixes' of git+ssh://master.kernel.org/pub/scm/linux/kernel/git...
Arnd Bergmann [Mon, 25 Jul 2011 15:16:00 +0000 (17:16 +0200)]
Merge branch 'tegra/fixes' of git+ssh:///linux/kernel/git/arm/linux-arm-soc into next/fixes

12 years agogenksyms: Use same type in loop comparison
Jesper Juhl [Mon, 11 Jul 2011 22:32:04 +0000 (00:32 +0200)]
genksyms: Use same type in loop comparison

The ARRAY_SIZE macro in scripts/genksyms/genksyms.c returns a value of
type size_t. That value is being compared to a variable of type int in
a loop in read_node(). Change the int variable to size_t type as well,
so we don't do signed vs unsigned type comparisons with all the
potential promotion/sign extension trouble that can cause (also
silences compiler warnings at high levels of warnings).

Signed-off-by: Jesper Juhl <jj@chaosbits.net>
Signed-off-by: Michal Marek <mmarek@suse.cz>
12 years agodrm/radeon: Add a rmb() in IH processing
Benjamin Herrenschmidt [Wed, 13 Jul 2011 06:28:19 +0000 (16:28 +1000)]
drm/radeon: Add a rmb() in IH processing

We should have a read memory barrier between reading the WPTR from
memory and reading ring entries based on that value (ie, we need to
ensure both loads are done in order by the CPU).

It could be argued that the MMIO reads in r600_ack_irq() might be
enough to get that barrier but I prefer keeping an explicit one just
in case.

[airlied: fix evergreen + r/w mixup]

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
12 years agodrm/radeon: ATOM Endian fix for atombios_crtc_program_pll()
Benjamin Herrenschmidt [Wed, 13 Jul 2011 06:28:15 +0000 (16:28 +1000)]
drm/radeon: ATOM Endian fix for atombios_crtc_program_pll()

v6 of the structure was programmed incorrectly:

  args.v6.ulCrtcPclkFreq.ulPixelClock = cpu_to_le32(clock / 10);

ulPixelClock is a 24-bit bitfield. This statement would thus
do a 32-bit swap of (clock / 10) and drop the top 8 bits which
are ... the LSB. Not what we want. Instead use masks & shifts.

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
12 years agodrm/radeon: Fix the definition of RADEON_BUF_SWAP_32BIT
Benjamin Herrenschmidt [Wed, 13 Jul 2011 06:28:26 +0000 (06:28 +0000)]
drm/radeon: Fix the definition of RADEON_BUF_SWAP_32BIT

(Note that this is duplicated under various other names such
as R600_BUF_SWAP_32BIT etc...). At least now all the definitions
agree.

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Dave Airlie <airlied@redhat.com>
12 years agodrm/radeon: Do an MMIO read on interrupts when not uisng MSIs
Benjamin Herrenschmidt [Wed, 13 Jul 2011 06:28:22 +0000 (06:28 +0000)]
drm/radeon: Do an MMIO read on interrupts when not uisng MSIs

When not using MSIs, there is no guarantee that DMA from the device
has been fully flushed to point where it's visible to the CPU when
taking an interrupt. To get this guarantee, we need to perform an
MMIO read from the device, which will flush all outstanding DMAs
from bridges between the device and the system.

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Dave Airlie <airlied@redhat.com>
12 years agodrm/radeon: Writeback endian fixes
Benjamin Herrenschmidt [Wed, 13 Jul 2011 06:28:17 +0000 (06:28 +0000)]
drm/radeon: Writeback endian fixes

The writeback ring pointer and IH ring pointer are read using le32_to_cpu
so we do not want the chip to byteswap them on big-endian.

We still want to byteswap the ring itself and the IBs, so we don't touch
that but we remove setting of the byteswap bits in CP_RB_RPTR_ADDR and
IH_CNTL.

In general, for things like that where we control all the accessors easily,
we are better off doing the swap in SW rather than HW. Paradoxally, it does
keep the code closer to x86 and avoid using poorly tested HW features.

I also changed the use of RADEON_ to R600_ in a couple of cases to be more
consistent with the surrounding code.

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Reviewed-by: Michel Dänzer <michel@daenzer.net>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
12 years agodrm/radeon: Remove a bunch of useless _iomem casts
Benjamin Herrenschmidt [Wed, 13 Jul 2011 06:28:12 +0000 (06:28 +0000)]
drm/radeon: Remove a bunch of useless _iomem casts

Just defining rdev->rmmio properly in the first place should do
the trick. In some cases, the cast were also complete dups as
the original variable was already of the right type.

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Dave Airlie <airlied@redhat.com>
12 years agodrm/gem: add support for private objects
Alan Cox [Tue, 7 Jun 2011 13:17:51 +0000 (14:17 +0100)]
drm/gem: add support for private objects

These small changes should allow GEM to be used with non shmem objects as
well as shmem objects. In the GMA500 case it allows the base framebuffer to
appear as a GEM object and thus acquire a handle and work with KMS.

For i915 it ought to be trivial to get back the wasted memory but putting the
system fb back into stolen RAM and in general I can imagine it allowing the
use of GEM and thus KMS with all the older cards that have their framebuffer
firmly placed in video RAM.

Signed-off-by: Alan Cox <alan@linux.intel.com>
Tested-by: Rob Clark <rob@ti.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
12 years agoDRM: clean up and document parsing of video= parameter
Rolf Eike Beer [Wed, 15 Jun 2011 09:27:02 +0000 (11:27 +0200)]
DRM: clean up and document parsing of video= parameter

The video= parameter of the DRM drivers supports some additional flags that
the normal fb drivers do not have. They also allow to limit these flags to
specific outputs. Both things were previously undocumented.

Also the parsing of the line had some oddities:
-A lot of misplaced options were silently ignored or partly rejected instead
 of stopping the parsing immediately
-The 'R' option is documented to follow the 'M' option if specified. It is not
 documented that 'M' is needed to specify 'R' (also this is the case for normal
 fb drivers). In fact the code is correct for normal fb drivers but wrong for
 DRM ones.
 The old code allowed 'R' only _before_ 'M' (since it parses backwards) and only
 if 'M' is given at all which is not needed for the DRM drivers.
-the margins option ('m') was parsed but later ignored even if the later
 functions support it.
-specifying multiple enable options at the same time did not lead to an error.
-specifying something bogus for horizontal resolution (i.e. other things as
 digits) did not lead to an error but an invalid resolution was used.

If any errors are encountered the position of the faulting string is now
printed to the user and the complete mode is ignored. This gives much
more consistent error behaviour.

I also removed some useless assignments and changed the local flag variables
to be bool.

Signed-off-by: Rolf Eike Beer <eike-kernel@sf-tec.de>
Signed-off-by: Dave Airlie <airlied@redhat.com>
12 years agoDRM: Radeon: Fix section mismatch.
Ralf Baechle [Mon, 27 Jun 2011 13:40:35 +0000 (13:40 +0000)]
DRM: Radeon: Fix section mismatch.

WARNING: drivers/gpu/drm/radeon/radeon.o(.text+0x5d1fc): Section mismatch in reference from the function radeon_get_clock_info() to the function .devinit.text:radeon_read_clocks_OF()
The function radeon_get_clock_info() references
the function __devinit radeon_read_clocks_OF().
This is often because radeon_get_clock_info lacks a __devinit
annotation or the annotation of radeon_read_clocks_OF is wrong.

Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Cc: dri-devel@lists.freedesktop.org
Cc: linux-kernel@vger.kernel.org
Cc: linux-mips@linux-mips.org
Signed-off-by: Dave Airlie <airlied@redhat.com>
12 years agodrm: really make debug levels match in edid failure code
Tormod Volden [Tue, 5 Jul 2011 20:12:53 +0000 (20:12 +0000)]
drm: really make debug levels match in edid failure code

Also disable the ascii dump and remove the literal printing of the
KERN_ERR macro in the log:

   [drm:drm_edid_block_valid] *ERROR* Raw EDID:
   <3>00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................

v2: Remove the trailing empty line as well.

Signed-off-by: Tormod Volden <debian.tormod@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
12 years agodrm/radeon/kms: fix i2c map for rv250/280
Alex Deucher [Sat, 23 Jul 2011 18:02:04 +0000 (18:02 +0000)]
drm/radeon/kms: fix i2c map for rv250/280

Those chips have crt2_ddc bus.

Fixes:
https://bugzilla.kernel.org/show_bug.cgi?id=39672

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Cc: stable@kernel.org
Signed-off-by: Dave Airlie <airlied@redhat.com>
12 years agoMerge branch 'drm-nouveau-next' of git://anongit.freedesktop.org/git/nouveau/linux...
Dave Airlie [Mon, 25 Jul 2011 09:15:18 +0000 (10:15 +0100)]
Merge branch 'drm-nouveau-next' of git://anongit.freedesktop.org/git/nouveau/linux-2.6 into drm-core-next

* 'drm-nouveau-next' of git://anongit.freedesktop.org/git/nouveau/linux-2.6:
  drm/nouveau/gr: disable fifo access and idle before suspend ctx unload
  drm/nouveau: pass flag to engine fini() method on suspend
  drm/nouveau: replace nv04_graph_fifo_access() use with direct reg bashing
  drm/nv40/gr: rewrite/split context takedown functions
  drm/nouveau: detect disabled device in irq handler and return IRQ_NONE
  drm/nouveau: ignore connector type when deciding digital/analog on DVI-I
  drm/nouveau: Add a quirk for Gigabyte NX86T
  drm/nouveau: do not leak in nv20_graph_create
  drm/nv50/dp: fix hack to work for macbooks booted via EFI

12 years agoMerge branch 'next' of git://git.kernel.org/pub/scm/linux/kernel/git/davej/cpufreq
Linus Torvalds [Mon, 25 Jul 2011 03:56:18 +0000 (20:56 -0700)]
Merge branch 'next' of git://git./linux/kernel/git/davej/cpufreq

* 'next' of git://git.kernel.org/pub/scm/linux/kernel/git/davej/cpufreq:
  [CPUFREQ] s5pv210: make needlessly global symbols static
  [CPUFREQ] exynos4210: make needlessly global symbols static
  [CPUFREQ] S3C6410: Add some lower frequencies for 800MHz base clock operation
  [CPUFREQ] S5PV210: Add reboot notifier to prevent system hang
  [CPUFREQ] S5PV210: Adjust udelay prior to voltage scaling down
  [CPUFREQ] S5PV210: Lock a mutex while changing the cpu frequency
  [CPUFREQ] S5PV210: Add pm_notifier to prevent system unstable
  [CPUFREQ] S5PV210: Add arm/int voltage control support
  [CPUFREQ] S5PV210: Add additional symantics for "relation" in cpufreq with pm
  [CPUFREQ] S3C64xx: Notify transition complete as soon as frequency changed
  [CPUFREQ] S3C6410: Support 800MHz operation in cpufreq
  [CPUFREQ] s5pv210-cpufreq.c: Add missing clk_put
  [CPUFREQ] Move compile for S3C64XX cpufreq to /drivers/cpufreq
  [CPUFREQ] Remove some vi noise that escaped into the Makefile.
  [CPUFREQ] Move ARM Samsung cpufreq drivers to drivers/cpufreq/
  [CPUFREQ/S3C64xx] Move S3C64xx CPUfreq driver into drivers/cpufreq
  [CPUFREQ] Handle CPUs with different capabilities in acpi-cpufreq

12 years agoMerge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
Linus Torvalds [Mon, 25 Jul 2011 03:55:48 +0000 (20:55 -0700)]
Merge git://git./linux/kernel/git/davem/net

* git://git.kernel.org/pub/scm/linux/kernel/git/davem/net: (145 commits)
  bnx2x: use pci_pcie_cap()
  bnx2x: fix bnx2x_stop_on_error flow in bnx2x_sp_rtnl_task
  bnx2x: enable internal target-read for 57712 and up only
  bnx2x: count statistic ramrods on EQ to prevent MC assert
  bnx2x: fix loopback for non 10G link
  bnx2x: dcb - send all unmapped priorities to same COS as L2
  iwlwifi: Fix build with CONFIG_PM disabled.
  gre: fix improper error handling
  ipv4: use RT_TOS after some rt_tos conversions
  via-velocity: remove duplicated #include
  qlge: remove duplicated #include
  igb: remove duplicated #include
  can: c_can: remove duplicated #include
  bnad: remove duplicated #include
  net: allow netif_carrier to be called safely from IRQ
  bna: Header File Consolidation
  bna: HW Error Counter Fix
  bna: Add HW Semaphore Unlock Logic
  bna: IOC Event Name Change
  bna: Mboxq Flush When IOC Disabled
  ...

12 years agogma500: udlay(20000) is too large
Stephen Rothwell [Mon, 25 Jul 2011 01:13:13 +0000 (11:13 +1000)]
gma500: udlay(20000) is too large

So use mdelay(20) instead.  Fixes this build error:

  ERROR: "__bad_udelay" [drivers/staging/gma500/psb_gfx.ko] undefined!

Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
12 years agom68k: Revive reporting of spurious interrupts
Geert Uytterhoeven [Wed, 13 Jul 2011 18:29:24 +0000 (20:29 +0200)]
m68k: Revive reporting of spurious interrupts

commit 2502b667ea835ee16685c74b2a0d89ba8afe117a ("Change the m68knommu irq
handling to use the generic irq framework.") removed the reporting of spurious
interrupts on nommu (68328 and 68360).

Bring it back in a generic way, using "atomic_t irq_err_count", as that's what
most of the other architectures are using.

Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
Signed-off-by: Greg Ungerer <gerg@uclinux.org>
12 years agom68knommu: Move forward declaration of do_IRQ() from machdep.h to irq.h
Geert Uytterhoeven [Sun, 3 Jul 2011 09:09:57 +0000 (11:09 +0200)]
m68knommu: Move forward declaration of do_IRQ() from machdep.h to irq.h

It is not machine-specific, but common irq infrastructure.
Also add the missing asmlinkage, to match its definition.

Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
Signed-off-by: Greg Ungerer <gerg@uclinux.org>
12 years agom68k: fix some atomic operation asm address modes for ColdFire
Greg Ungerer [Mon, 4 Jul 2011 05:30:55 +0000 (15:30 +1000)]
m68k: fix some atomic operation asm address modes for ColdFire

The ColdFire processors have a much more limited set of addressing modes
that can be used for most instructions. A number of the atomic operations
have already been fixed to limit the addressing modes used with add and
sub instructions when building for ColdFire. But we missed a few.
Fix the remaining atomic operations to be clean for ColdFire processors.

Signed-off-by: Greg Ungerer <gerg@uclinux.org>
12 years agom68k: use CPU_HAS_NO_BITFIELDS for signal functions
Greg Ungerer [Mon, 4 Jul 2011 04:23:09 +0000 (14:23 +1000)]
m68k: use CPU_HAS_NO_BITFIELDS for signal functions

When reworking bitops.h to be clean for all processor types we introduced
a CONFIG_CPU_HAS_NO_BITFIELDS define to signal whether this processor type
supported the bit field instructions. The ARCH_SIG_BITOPS functions for
m68k use these instruction types. We should base the use of these functions
(or the generic versions) on the CONFIG_CPU_HAS_NO_BITFIELDS define.

Signed-off-by: Greg Ungerer <gerg@uclinux.org>
12 years agom68k: merge and clean up delay.h files
Greg Ungerer [Fri, 1 Jul 2011 06:47:13 +0000 (16:47 +1000)]
m68k: merge and clean up delay.h files

The real difference between the mmu and non-mmu varients of the delay.h
files has nothing to do with having an mmu or not. It is processor family
differences that means slightly different code. Merge the delay_mm.h and
delay_no.h files back into a single file.

The primarly difference we need to deal with is whether the processor
supports a 32bit * 32bit -> 64bit multiply. Without it we need to do some
shift scaling as well as use a 32bit * 32bit -> 32bit multiply. If building
for a multi-CPU type kernel then we must use the simpler mult/shift scaling.

This version of delay code allows the CPU32 family to use a 64bit mul,
since it supports this instruction, the old code did not.

The changes use macros where appropriate to try and optimize constant sized
udelay times. And it removes the use of a fixed lib function for the non-mmu
case. Code size on typical kernel configurations is similar, or only larger
by a few tens of bytes.

Also removed the unused muldiv() code from delay_mm.h.

Build and run tested on ColdFire and ARAnyM. Build tested only on 68328
and 68360 (CPU32).

Signed-off-by: Greg Ungerer <gerg@uclinux.org>
12 years agom68knommu: correctly use trap_init
Greg Ungerer [Thu, 23 Jun 2011 05:52:25 +0000 (15:52 +1000)]
m68knommu: correctly use trap_init

Currently trap_init() is an empty function for m68knommu. Instead
the vectors are being setup as part of the IRQ initialization.
This is inconsistent with m68k and other architectures.

Change the local init_vectors() to be trap_init(), and init the
vectors at the correct time during startup. This will help merge of
m68k and m68knommu trap code in the furture.

Signed-off-by: Greg Ungerer <gerg@uclinux.org>
12 years agom68knommu: merge ColdFire 5206 and 5206e platform code
Greg Ungerer [Mon, 6 Jun 2011 03:33:11 +0000 (13:33 +1000)]
m68knommu: merge ColdFire 5206 and 5206e platform code

The ColdFire 5206 and 5206e CPU families are almost identical, we can
easily merge the platform support code for them. All the differences
are dealt with in the current include/asm/5206sim.h.

Signed-off-by: Greg Ungerer <gerg@uclinux.org>
12 years agom68k: merge mmu and non-mmu bitops.h
Greg Ungerer [Tue, 17 May 2011 06:45:00 +0000 (16:45 +1000)]
m68k: merge mmu and non-mmu bitops.h

The following patch merges the mmu and non-mmu versions of the m68k
bitops.h files. Now there is a good deal of difference between the two
files, but none of it is actually an mmu specific difference. It is
all about the specific m68k/coldfire varient we are targeting. So it
makes an awful lot of sense to merge these into a single bitops.h.

There is a number of ways I can see to factor this code. The approach
I have taken here is to keep the various versions of each macro/function
type together. This means that there is some ifdefery with each to handle
each CPU type.

I have added some comments in a couple of appropriate places to try
and make it clear what the differences we are dealing with are.
Specifically the instruction and addressing mode differences we have
to deal with.

The merged form keeps the same underlying optimizations for each CPU
type for all the general bit clear/set/change and find bit operations.
It does switch to using the generic le operations though, instead of
any local varients.

Build tested on ColdFire, 68328, 68360 (which is cpu32) and 68020+.
Run tested on ColdFire and ARAnyM.

Signed-off-by: Greg Ungerer <gerg@uclinux.org>
Acked-by: Geert Uytterhoeven <geert@linux-m68k.org>
12 years agom68k: merge MMU and non MMU versions of system.h
Greg Ungerer [Thu, 5 May 2011 12:32:12 +0000 (22:32 +1000)]
m68k: merge MMU and non MMU versions of system.h

The non-MMU m68k targets can use the same asm/system.h as the MMU
targets. So switch the current system_mm.h to be system.h and remove
system_no.h.

The assembly support code for the non-MMU resume functions needs to
be modified to match the now common switch_to() macro. Specifically
this means correctly saving and restoring the status flags in the case
of the ColdFire resume, and some reordering of the code to not use
registers before they are saved or after they are restored.

Signed-off-by: Greg Ungerer <gerg@uclinux.org>