Revert "mm-compaction-handle-incorrect-migrate_unmovable-type-pageblocks-fix"

This reverts commit 8b772a2d31d42ab149544c66f0a2359896526e0e.
Revert "mm: compaction: handle incorrect MIGRATE_UNMOVABLE type pageblocks"

This reverts commit 94d065f70e1c5ee6fb0d5614ec93ffb4c3553238.
drivers/rtc/rtc-ab8500.c: use IRQF_ONESHOT when requesting a threaded IRQ

This driver's IRQ registration is failing because the kernel now forces
IRQs to be ONESHOT if no IRQ handler is passed.

Signed-off-by: Lee Jones <lee.jones@linaro.org>
Cc: Alessandro Zummo <a.zummo@towertech.it>
Cc: <stable@vger.kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
drivers/rtc/rtc-ab8500.c: ensure correct probing of the AB8500 RTC when Device Tree is enabled

Without this patch, if Device Tree is enabled the AB8500 RTC wouldn't get
probed at all, as there is no reference to it from platform code.  This
patch ensures the driver is probed during normal DT start-up.

Signed-off-by: Lee Jones <lee.jones@linaro.org>
Cc: Alessandro Zummo <a.zummo@towertech.it>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
rtc-ensure-correct-probing-of-the-ab8500-rtc-when-device-tree-is-enabled-checkpatch-fixes

ERROR: code indent should use tabs where possible
#41: FILE: drivers/rtc/rtc-ab8500.c:458:
+        { .compatible = "stericsson,ab8500-rtc", },$

WARNING: please, no spaces at the start of a line
#41: FILE: drivers/rtc/rtc-ab8500.c:458:
+        { .compatible = "stericsson,ab8500-rtc", },$

ERROR: code indent should use tabs where possible
#42: FILE: drivers/rtc/rtc-ab8500.c:459:
+        {}$

WARNING: please, no spaces at the start of a line
#42: FILE: drivers/rtc/rtc-ab8500.c:459:
+        {}$

total: 2 errors, 2 warnings, 30 lines checked

NOTE: whitespace errors detected, you may wish to use scripts/cleanpatch or
      scripts/cleanfile

./patches/rtc-ensure-correct-probing-of-the-ab8500-rtc-when-device-tree-is-enabled.patch has style problems, please review.

If any of these errors are false positives, please report
them to the maintainer, see CHECKPATCH in MAINTAINERS.

Please run checkpatch prior to sending patches

Cc: Lee Jones <lee.jones@linaro.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
mm: fix goal calculating with usemap

PAGE_SECTION_MASK should be used with pfn instead of pa.

Also restore the old behavoir: limit the allocating to same section at
first.  need to expose __alloc_bootmem_node_nopanic with limit.

Signed-off-by: Yinghai Lu <yinghai@kernel.org>
Cc: Johannes Weiner <hannes@cmpxchg.org>
Cc: Tejun Heo <tj@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
h8300/pgtable: add missing #include <asm-generic/pgtable.h>

kernel/sched/core.c: In function 'context_switch':
kernel/sched/core.c:2061:2: error: implicit declaration of function 'arch_start_context_switch' [-Werror=implicit-function-declaration]

Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
Cc: Yoshinori Sato <ysato@users.sourceforge.jp>
Cc: Tony Breeds <tony@bakeyournoodle.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
h8300/signal: fix typo "statis"

The keyword is "static", not "statis":

arch/h8300/kernel/signal.c:455:8: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'void'
arch/h8300/kernel/signal.c: In function 'do_notify_resume':
arch/h8300/kernel/signal.c:511:3: error: implicit declaration of function 'do_signal' [-Werror=implicit-function-declaration]
arch/h8300/kernel/signal.c: At top level:
arch/h8300/kernel/signal.c:414:1: warning: 'handle_signal' defined but not used [-Wunused-function]

Introduced in commit 7ae4e32a65148353db3458e3eb87117f25620ac5 ("h8300: switch
to saved_sigmask-based sigsuspend/rt_sigsuspend")

Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
Cc: Al Viro <viro@zeniv.linux.org.uk>
Cc: Yoshinori Sato <ysato@users.sourceforge.jp>
Cc: Tony Breeds <tony@bakeyournoodle.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
h8300/time: add missing #include <asm/irq_regs.h>

arch/h8300/kernel/time.c: In function 'h8300_timer_tick':
arch/h8300/kernel/time.c:39:2: error: implicit declaration of function 'get_irq_regs' [-Werror=implicit-function-declaration]
arch/h8300/kernel/time.c:39:42: error: invalid type argument of '->' (have 'int')

Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
Cc: Yoshinori Sato <ysato@users.sourceforge.jp>
Cc: Tony Breeds <tony@bakeyournoodle.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
h8300/uaccess: remove assignment to __gu_val in unhandled case of get_user()

__gu_val is const if the passed ptr is const, giving:

include/linux/pagemap.h: In function 'fault_in_pages_readable':
include/linux/pagemap.h:442:2: error: assignment of read-only variable '__gu_val'
include/linux/pagemap.h:448:4: error: assignment of read-only variable '__gu_val'
include/linux/pagemap.h: In function 'fault_in_multipages_readable':
include/linux/pagemap.h:499:3: error: assignment of read-only variable '__gu_val'
include/linux/pagemap.h:508:3: error: assignment of read-only variable '__gu_val'
make[4]: *** [init/main.o] Error 1

As we don't care about the actual value of __gu_val in the unhandled
case (it will cause a link error anyway), just remove the assignment.

Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
Cc: Yoshinori Sato <ysato@users.sourceforge.jp>
Cc: Tony Breeds <tony@bakeyournoodle.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
h8300/uaccess: add mising __clear_user()

include/linux/regset.h: In function 'user_regset_copyout_zero':
include/linux/regset.h:289:3: error: implicit declaration of function '__clear_user' [-Werror=implicit-function-declaration]

Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
Cc: Yoshinori Sato <ysato@users.sourceforge.jp>
Cc: Tony Breeds <tony@bakeyournoodle.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
mm/memory_hotplug.c: release memory resources if hotadd_new_pgdat() fails

We should goto error to release memory resource if hotadd_new_pgdat()
failed.

Signed-off-by: Wen Congyang <wency@cn.fujitsu.com>
Cc: Yasuaki ISIMATU <isimatu.yasuaki@jp.fujitsu.com>
Acked-by: David Rientjes <rientjes@google.com>
Cc: Len Brown <lenb@kernel.org>
Cc: "Brown, Len" <len.brown@intel.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
drivers/rtc/rtc-mxc.c: fix irq enabled interrupts warning

[   29.669224] WARNING: at irq/handle.c:146 handle_irq_event_=
percpu+0x19c/0x1b8()
[   29.669269] irq 25 handler mxc_rtc_interrupt+0x0/0xac enabled interrupts
[   29.669284] Modules linked in:
[   29.669324] [<c0012218>] (unwind_backtrace+0x0/0xf0) from [<c001c1dc>] (=
warn_slowpath_common+0x4c/0x64)
[   29.669361] [<c001c1dc>] (warn_slowpath_common+0x4c/0x64) from [<c001c28=
8>] (warn_slowpath_fmt+0x30/0x40)
[   29.669399] [<c001c288>] (warn_slowpath_fmt+0x30/0x40) from [<c004c46c>]=
 (handle_irq_event_percpu+0x19c/0x1b8)
[   29.669439] [<c004c46c>] (handle_irq_event_percpu+0x19c/0x1b8) from [<c0=
04c4b0>] (handle_irq_event+0x28/0x38)
[   29.669479] [<c004c4b0>] (handle_irq_event+0x28/0x38) from [<c004e4b0>] =
(handle_level_irq+0x80/0xc4)
[   29.669517] [<c004e4b0>] (handle_level_irq+0x80/0xc4) from [<c004bcd0>] =
(generic_handle_irq+0x24/0x38)
[   29.669563] [<c004bcd0>] (generic_handle_irq+0x24/0x38) from [<c000e6cc>=
] (handle_IRQ+0x30/0x84)
[   29.669599] [<c000e6cc>] (handle_IRQ+0x30/0x84) from [<c0008508>] (avic_=
handle_irq+0x2c/0x4c)
[   29.669633] [<c0008508>] (avic_handle_irq+0x2c/0x4c) from [<c000db40>] (=
__irq_svc+0x40/0x60)
[   29.669655] Exception stack(0xc050bf60 to 0xc050bfa8)
[   29.669685] bf60: 00000001 00000000 003c4208 c0018e20 c050a000 c050a000 =
c054a4c8 c050a000
[   29.669717] bf80: c05157a8 4117b363 80503bb4 00000000 01000000 c050bfa8 =
c0018e2c c000e808
[   29.669739] bfa0: 60000013 ffffffff
[   29.669769] [<c000db40>] (__irq_svc+0x40/0x60) from [<c000e808>] (defaul=
t_idle+0x1c/0x30)
[   29.669805] [<c000e808>] (default_idle+0x1c/0x30) from [<c000e9bc>] (cpu=
_idle+0x68/0xa8)
[   29.669846] [<c000e9bc>] (cpu_idle+0x68/0xa8) from [<c04e76dc>] (start_k=
ernel+0x22c/0x26c)
[   29.669868] ---[ end trace 2f7406c4b6216986 ]---

Signed-off-by: Benoît Thébaudeau <benoit.thebaudeau@advansee.com>
Cc: Alessandro Zummo <a.zummo@towertech.it>
Cc: Sascha Hauer <kernel@pengutronix.de>
Acked-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Cc: <stable@vger.kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
fs: ramfs: file-nommu: add SetPageUptodate()

There is a bug in the below scenario for !CONFIG_MMU:

1. create a new file
2. mmap the file and write to it
3. read the file can't get the correct value

Because
sys_read() > generic_file_aio_read() > simple_readpage() > clear_page()
which make the page be zeroed.

Add SetPageUptodate() to ramfs_nommu_expand_for_mapping() so that
generic_file_aio_read() do not call simple_readpage().

Signed-off-by: Bob Liu <lliubbo@gmail.com>
Cc: Hugh Dickins <hughd@google.com>
Cc: David Howells <dhowells@redhat.com>
Cc: Geert Uytterhoeven <geert@linux-m68k.org>
Cc: Greg Ungerer <gerg@uclinux.org>
Cc: <stable@vger.kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
sgi-xp: nested calls to spin_lock_irqsave()

The code here has a nested spin_lock_irqsave().  It's not needed since
IRQs are already disabled and it causes a problem because it means that
IRQs won't be enabled again at the end.  The second call to
spin_lock_irqsave() will overwrite the value of irq_flags and we can't
restore the proper settings.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Robin Holt <holt@sgi.com>
Cc: Jack Steiner <steiner@sgi.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
MAINTAINERS: add OMAP CPUfreq driver to OMAP Power Management section

Add the OMAP CPUFreq driver to the list of files in the OMAP Power
Management section.

I've already been maintaining this driver, this just makes it official.

Signed-off-by: Kevin Hilman <khilman@ti.com>
Cc: Arnd Bergmann <arnd@arndb.de>
Cc: "Rafael J. Wysocki" <rjw@sisk.pl>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
memblock: free allocated memblock_reserved_regions later

memblock_free_reserved_regions() calls memblock_free(), but
memblock_free() would double reserved.regions too, so we could free the
old range for reserved.regions.

Also tj said there is another bug could be related to this too.

| I don't think we're saving any noticeable
| amount by doing this "free - give it to page allocator - reserve
| again" dancing.  We should just allocate regions aligned to page
| boundaries and free them later when memblock is no longer in use.

So try to allocate that in PAGE_SIZE alignment and free that later.

Reported-by: Sasha Levin <levinsasha928@gmail.com>
Acked-by: Tejun Heo <tj@kernel.org>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Yinghai Lu <yinghai@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
->encode_fh() API change

pass inode + parent's inode or NULL instead of dentry + bool saying
whether we want the parent or not.

NOTE: that needs ceph fix folded in.

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
fat: fix non-atomic NFS i_pos read

fat_encode_fh() can fetch an invalid i_pos value on systems where 64-bit
accesses are not atomic.  Make it use the same accessor as the rest of the
FAT code.

Signed-off-by: Steven J. Magnani <steve@digidescorp.com>
Acked-by: OGAWA Hirofumi <hirofumi@mail.parknet.co.jp>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
mm-hugetlb-add-new-hugetlb-cgroup-fix

s/CONFIG_CGROUP_HUGETLB_RES_CTLR/CONFIG_MEMCG_HUGETLB/g

Cc: "Aneesh Kumar K.V" <aneesh.kumar@linux.vnet.ibm.com>
Cc: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
Cc: David Rientjes <rientjes@google.com>
Cc: Hillf Danton <dhillf@gmail.com>
Cc: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
Cc: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
Cc: Michal Hocko <mhocko@suse.cz>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>