--- /dev/null
+From c24bf9b4cc6a0f330ea355d73bfdf1dae7e63a05 Mon Sep 17 00:00:00 2001
+From: Corey Minyard <cminyard@mvista.com>
+Date: Tue, 18 Dec 2012 14:21:19 -0800
+Subject: CRIS: fix I/O macros
+
+From: Corey Minyard <cminyard@mvista.com>
+
+commit c24bf9b4cc6a0f330ea355d73bfdf1dae7e63a05 upstream.
+
+The inb/outb macros for CRIS are broken from a number of points of view,
+missing () around parameters and they have an unprotected if statement
+in them. This was breaking the compile of IPMI on CRIS and thus I was
+being annoyed by build regressions, so I fixed them.
+
+Plus I don't think they would have worked at all, since the data values
+were missing "&" and the outsl had a "3" instead of a "4" for the size.
+From what I can tell, this stuff is not used at all, so this can't be
+any more broken than it was before, anyway.
+
+Signed-off-by: Corey Minyard <cminyard@mvista.com>
+Cc: Jesper Nilsson <jesper.nilsson@axis.com>
+Cc: Mikael Starvik <starvik@axis.com>
+Acked-by: Geert Uytterhoeven <geert@linux-m68k.org>
+Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
+Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ arch/cris/include/asm/io.h | 39 +++++++++++++++++++++++++++++++++------
+ 1 file changed, 33 insertions(+), 6 deletions(-)
+
+--- a/arch/cris/include/asm/io.h
++++ b/arch/cris/include/asm/io.h
+@@ -133,12 +133,39 @@ static inline void writel(unsigned int b
+ #define insb(port,addr,count) (cris_iops ? cris_iops->read_io(port,addr,1,count) : 0)
+ #define insw(port,addr,count) (cris_iops ? cris_iops->read_io(port,addr,2,count) : 0)
+ #define insl(port,addr,count) (cris_iops ? cris_iops->read_io(port,addr,4,count) : 0)
+-#define outb(data,port) if (cris_iops) cris_iops->write_io(port,(void*)(unsigned)data,1,1)
+-#define outw(data,port) if (cris_iops) cris_iops->write_io(port,(void*)(unsigned)data,2,1)
+-#define outl(data,port) if (cris_iops) cris_iops->write_io(port,(void*)(unsigned)data,4,1)
+-#define outsb(port,addr,count) if(cris_iops) cris_iops->write_io(port,(void*)addr,1,count)
+-#define outsw(port,addr,count) if(cris_iops) cris_iops->write_io(port,(void*)addr,2,count)
+-#define outsl(port,addr,count) if(cris_iops) cris_iops->write_io(port,(void*)addr,3,count)
++static inline void outb(unsigned char data, unsigned int port)
++{
++ if (cris_iops)
++ cris_iops->write_io(port, (void *) &data, 1, 1);
++}
++static inline void outw(unsigned short data, unsigned int port)
++{
++ if (cris_iops)
++ cris_iops->write_io(port, (void *) &data, 2, 1);
++}
++static inline void outl(unsigned int data, unsigned int port)
++{
++ if (cris_iops)
++ cris_iops->write_io(port, (void *) &data, 4, 1);
++}
++static inline void outsb(unsigned int port, const void *addr,
++ unsigned long count)
++{
++ if (cris_iops)
++ cris_iops->write_io(port, (void *)addr, 1, count);
++}
++static inline void outsw(unsigned int port, const void *addr,
++ unsigned long count)
++{
++ if (cris_iops)
++ cris_iops->write_io(port, (void *)addr, 2, count);
++}
++static inline void outsl(unsigned int port, const void *addr,
++ unsigned long count)
++{
++ if (cris_iops)
++ cris_iops->write_io(port, (void *)addr, 4, count);
++}
+
+ /*
+ * Convert a physical pointer to a virtual kernel pointer for /dev/mem
--- /dev/null
+From 532db570e5181abc8f4f7bfa6c77c69ec2240198 Mon Sep 17 00:00:00 2001
+From: Tony Prisk <linux@prisktech.co.nz>
+Date: Fri, 4 Jan 2013 15:35:47 -0800
+Subject: drivers/rtc/rtc-vt8500.c: correct handling of CR_24H bitfield
+
+From: Tony Prisk <linux@prisktech.co.nz>
+
+commit 532db570e5181abc8f4f7bfa6c77c69ec2240198 upstream.
+
+Control register bitfield for 12H/24H mode is handled incorrectly.
+Setting CR_24H actually enables 12H mode. This patch renames the define
+and changes the initialization code to correctly set 24H mode.
+
+Signed-off-by: Tony Prisk <linux@prisktech.co.nz>
+Cc: Edgar Toernig <froese@gmx.de>
+Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
+Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/rtc/rtc-vt8500.c | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+--- a/drivers/rtc/rtc-vt8500.c
++++ b/drivers/rtc/rtc-vt8500.c
+@@ -69,7 +69,7 @@
+ | ALARM_SEC_BIT)
+
+ #define VT8500_RTC_CR_ENABLE (1 << 0) /* Enable RTC */
+-#define VT8500_RTC_CR_24H (1 << 1) /* 24h time format */
++#define VT8500_RTC_CR_12H (1 << 1) /* 12h time format */
+ #define VT8500_RTC_CR_SM_ENABLE (1 << 2) /* Enable periodic irqs */
+ #define VT8500_RTC_CR_SM_SEC (1 << 3) /* 0: 1Hz/60, 1: 1Hz */
+ #define VT8500_RTC_CR_CALIB (1 << 4) /* Enable calibration */
+@@ -248,7 +248,7 @@ static int __devinit vt8500_rtc_probe(st
+ }
+
+ /* Enable RTC and set it to 24-hour mode */
+- writel(VT8500_RTC_CR_ENABLE | VT8500_RTC_CR_24H,
++ writel(VT8500_RTC_CR_ENABLE,
+ vt8500_rtc->regbase + VT8500_RTC_CR);
+
+ vt8500_rtc->rtc = rtc_device_register("vt8500-rtc", &pdev->dev,
--- /dev/null
+From 2f90b68309683f2c5765a1b04ca23d71e51f1494 Mon Sep 17 00:00:00 2001
+From: Tony Prisk <linux@prisktech.co.nz>
+Date: Fri, 4 Jan 2013 15:35:48 -0800
+Subject: drivers/rtc/rtc-vt8500.c: fix handling of data passed in struct rtc_time
+
+From: Tony Prisk <linux@prisktech.co.nz>
+
+commit 2f90b68309683f2c5765a1b04ca23d71e51f1494 upstream.
+
+tm_mon is 0..11, whereas vt8500 expects 1..12 for the month field,
+causing invalid date errors for January, and causing the day field to
+roll over incorrectly.
+
+The century flag is only handled in vt8500_rtc_read_time, but not set in
+vt8500_rtc_set_time. This patch corrects the behaviour of the century
+flag.
+
+Signed-off-by: Edgar Toernig <froese@gmx.de>
+Signed-off-by: Tony Prisk <linux@prisktech.co.nz>
+Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
+Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/rtc/rtc-vt8500.c | 7 ++++---
+ 1 file changed, 4 insertions(+), 3 deletions(-)
+
+--- a/drivers/rtc/rtc-vt8500.c
++++ b/drivers/rtc/rtc-vt8500.c
+@@ -118,7 +118,7 @@ static int vt8500_rtc_read_time(struct d
+ tm->tm_min = bcd2bin((time & TIME_MIN_MASK) >> TIME_MIN_S);
+ tm->tm_hour = bcd2bin((time & TIME_HOUR_MASK) >> TIME_HOUR_S);
+ tm->tm_mday = bcd2bin(date & DATE_DAY_MASK);
+- tm->tm_mon = bcd2bin((date & DATE_MONTH_MASK) >> DATE_MONTH_S);
++ tm->tm_mon = bcd2bin((date & DATE_MONTH_MASK) >> DATE_MONTH_S) - 1;
+ tm->tm_year = bcd2bin((date & DATE_YEAR_MASK) >> DATE_YEAR_S)
+ + ((date >> DATE_CENTURY_S) & 1 ? 200 : 100);
+ tm->tm_wday = (time & TIME_DOW_MASK) >> TIME_DOW_S;
+@@ -137,8 +137,9 @@ static int vt8500_rtc_set_time(struct de
+ }
+
+ writel((bin2bcd(tm->tm_year - 100) << DATE_YEAR_S)
+- | (bin2bcd(tm->tm_mon) << DATE_MONTH_S)
+- | (bin2bcd(tm->tm_mday)),
++ | (bin2bcd(tm->tm_mon + 1) << DATE_MONTH_S)
++ | (bin2bcd(tm->tm_mday))
++ | ((tm->tm_year >= 200) << DATE_CENTURY_S),
+ vt8500_rtc->regbase + VT8500_RTC_DS);
+ writel((bin2bcd(tm->tm_wday) << TIME_DOW_S)
+ | (bin2bcd(tm->tm_hour) << TIME_HOUR_S)
--- /dev/null
+From f9af7b9edccb87d4d80b58687ab63e58f3b64c4c Mon Sep 17 00:00:00 2001
+From: Ben Hutchings <ben@decadent.org.uk>
+Date: Sun, 2 Dec 2012 14:38:23 +0000
+Subject: HID: Add Apple wireless keyboard 2011 ANSI to special driver list
+
+From: Ben Hutchings <ben@decadent.org.uk>
+
+commit f9af7b9edccb87d4d80b58687ab63e58f3b64c4c upstream.
+
+Commit 0a97e1e9f9a6 ('HID: apple: Add Apple wireless keyboard 2011 ANSI PID')
+did not update the special driver list in hid-core.c, so hid-generic may
+still bind to this device.
+
+Reported-by: Ari Pollak <ari@scvngr.com>
+References: http://bugs.debian.org/694546
+Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
+Signed-off-by: Jiri Kosina <jkosina@suse.cz>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/hid/hid-core.c | 1 +
+ 1 file changed, 1 insertion(+)
+
+--- a/drivers/hid/hid-core.c
++++ b/drivers/hid/hid-core.c
+@@ -1385,6 +1385,7 @@ static const struct hid_device_id hid_ha
+ { HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_ALU_WIRELESS_2009_ANSI) },
+ { HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_ALU_WIRELESS_2009_ISO) },
+ { HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_ALU_WIRELESS_2009_JIS) },
++ { HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_ALU_WIRELESS_2011_ANSI) },
+ { HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_ALU_WIRELESS_2011_ISO) },
+ { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_FOUNTAIN_TP_ONLY) },
+ { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_GEYSER1_TP_ONLY) },
--- /dev/null
+From fcc16882ac4532aaa644bff444f0c5d6228ba71e Mon Sep 17 00:00:00 2001
+From: Stephen Boyd <sboyd@codeaurora.org>
+Date: Wed, 19 Dec 2012 23:39:48 -0800
+Subject: lib: atomic64: Initialize locks statically to fix early users
+
+From: Stephen Boyd <sboyd@codeaurora.org>
+
+commit fcc16882ac4532aaa644bff444f0c5d6228ba71e upstream.
+
+The atomic64 library uses a handful of static spin locks to implement
+atomic 64-bit operations on architectures without support for atomic
+64-bit instructions.
+
+Unfortunately, the spinlocks are initialized in a pure initcall and that
+is too late for the vfs namespace code which wants to use atomic64
+operations before the initcall is run.
+
+This became a problem as of commit 8823c079ba71: "vfs: Add setns support
+for the mount namespace".
+
+This leads to BUG messages such as:
+
+ BUG: spinlock bad magic on CPU#0, swapper/0/0
+ lock: atomic64_lock+0x240/0x400, .magic: 00000000, .owner: <none>/-1, .owner_cpu: 0
+ do_raw_spin_lock+0x158/0x198
+ _raw_spin_lock_irqsave+0x4c/0x58
+ atomic64_add_return+0x30/0x5c
+ alloc_mnt_ns.clone.14+0x44/0xac
+ create_mnt_ns+0xc/0x54
+ mnt_init+0x120/0x1d4
+ vfs_caches_init+0xe0/0x10c
+ start_kernel+0x29c/0x300
+
+coming out early on during boot when spinlock debugging is enabled.
+
+Fix this by initializing the spinlocks statically at compile time.
+
+Reported-and-tested-by: Vaibhav Bedia <vaibhav.bedia@ti.com>
+Tested-by: Tony Lindgren <tony@atomide.com>
+Cc: Eric W. Biederman <ebiederm@xmission.com>
+Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
+Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
+Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ lib/atomic64.c | 17 +++++------------
+ 1 file changed, 5 insertions(+), 12 deletions(-)
+
+--- a/lib/atomic64.c
++++ b/lib/atomic64.c
+@@ -31,7 +31,11 @@
+ static union {
+ raw_spinlock_t lock;
+ char pad[L1_CACHE_BYTES];
+-} atomic64_lock[NR_LOCKS] __cacheline_aligned_in_smp;
++} atomic64_lock[NR_LOCKS] __cacheline_aligned_in_smp = {
++ [0 ... (NR_LOCKS - 1)] = {
++ .lock = __RAW_SPIN_LOCK_UNLOCKED(atomic64_lock.lock),
++ },
++};
+
+ static inline raw_spinlock_t *lock_addr(const atomic64_t *v)
+ {
+@@ -173,14 +177,3 @@ int atomic64_add_unless(atomic64_t *v, l
+ return ret;
+ }
+ EXPORT_SYMBOL(atomic64_add_unless);
+-
+-static int init_atomic64_lock(void)
+-{
+- int i;
+-
+- for (i = 0; i < NR_LOCKS; ++i)
+- raw_spin_lock_init(&atomic64_lock[i].lock);
+- return 0;
+-}
+-
+-pure_initcall(init_atomic64_lock);
--- /dev/null
+From 53a59fc67f97374758e63a9c785891ec62324c81 Mon Sep 17 00:00:00 2001
+From: Michal Hocko <mhocko@suse.cz>
+Date: Fri, 4 Jan 2013 15:35:12 -0800
+Subject: mm: limit mmu_gather batching to fix soft lockups on !CONFIG_PREEMPT
+
+From: Michal Hocko <mhocko@suse.cz>
+
+commit 53a59fc67f97374758e63a9c785891ec62324c81 upstream.
+
+Since commit e303297e6c3a ("mm: extended batches for generic
+mmu_gather") we are batching pages to be freed until either
+tlb_next_batch cannot allocate a new batch or we are done.
+
+This works just fine most of the time but we can get in troubles with
+non-preemptible kernel (CONFIG_PREEMPT_NONE or CONFIG_PREEMPT_VOLUNTARY)
+on large machines where too aggressive batching might lead to soft
+lockups during process exit path (exit_mmap) because there are no
+scheduling points down the free_pages_and_swap_cache path and so the
+freeing can take long enough to trigger the soft lockup.
+
+The lockup is harmless except when the system is setup to panic on
+softlockup which is not that unusual.
+
+The simplest way to work around this issue is to limit the maximum
+number of batches in a single mmu_gather. 10k of collected pages should
+be safe to prevent from soft lockups (we would have 2ms for one) even if
+they are all freed without an explicit scheduling point.
+
+This patch doesn't add any new explicit scheduling points because it
+relies on zap_pmd_range during page tables zapping which calls
+cond_resched per PMD.
+
+The following lockup has been reported for 3.0 kernel with a huge
+process (in order of hundreds gigs but I do know any more details).
+
+ BUG: soft lockup - CPU#56 stuck for 22s! [kernel:31053]
+ Modules linked in: af_packet nfs lockd fscache auth_rpcgss nfs_acl sunrpc mptctl mptbase autofs4 binfmt_misc dm_round_robin dm_multipath bonding cpufreq_conservative cpufreq_userspace cpufreq_powersave pcc_cpufreq mperf microcode fuse loop osst sg sd_mod crc_t10dif st qla2xxx scsi_transport_fc scsi_tgt netxen_nic i7core_edac iTCO_wdt joydev e1000e serio_raw pcspkr edac_core iTCO_vendor_support acpi_power_meter rtc_cmos hpwdt hpilo button container usbhid hid dm_mirror dm_region_hash dm_log linear uhci_hcd ehci_hcd usbcore usb_common scsi_dh_emc scsi_dh_alua scsi_dh_hp_sw scsi_dh_rdac scsi_dh dm_snapshot pcnet32 mii edd dm_mod raid1 ext3 mbcache jbd fan thermal processor thermal_sys hwmon cciss scsi_mod
+ Supported: Yes
+ CPU 56
+ Pid: 31053, comm: kernel Not tainted 3.0.31-0.9-default #1 HP ProLiant DL580 G7
+ RIP: 0010: _raw_spin_unlock_irqrestore+0x8/0x10
+ RSP: 0018:ffff883ec1037af0 EFLAGS: 00000206
+ RAX: 0000000000000e00 RBX: ffffea01a0817e28 RCX: ffff88803ffd9e80
+ RDX: 0000000000000200 RSI: 0000000000000206 RDI: 0000000000000206
+ RBP: 0000000000000002 R08: 0000000000000001 R09: ffff887ec724a400
+ R10: 0000000000000000 R11: dead000000200200 R12: ffffffff8144c26e
+ R13: 0000000000000030 R14: 0000000000000297 R15: 000000000000000e
+ FS: 00007ed834282700(0000) GS:ffff88c03f200000(0000) knlGS:0000000000000000
+ CS: 0010 DS: 0000 ES: 0000 CR0: 000000008005003b
+ CR2: 000000000068b240 CR3: 0000003ec13c5000 CR4: 00000000000006e0
+ DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
+ DR3: 0000000000000000 DR6: 00000000ffff0ff0 DR7: 0000000000000400
+ Process kernel (pid: 31053, threadinfo ffff883ec1036000, task ffff883ebd5d4100)
+ Call Trace:
+ release_pages+0xc5/0x260
+ free_pages_and_swap_cache+0x9d/0xc0
+ tlb_flush_mmu+0x5c/0x80
+ tlb_finish_mmu+0xe/0x50
+ exit_mmap+0xbd/0x120
+ mmput+0x49/0x120
+ exit_mm+0x122/0x160
+ do_exit+0x17a/0x430
+ do_group_exit+0x3d/0xb0
+ get_signal_to_deliver+0x247/0x480
+ do_signal+0x71/0x1b0
+ do_notify_resume+0x98/0xb0
+ int_signal+0x12/0x17
+ DWARF2 unwinder stuck at int_signal+0x12/0x17
+
+Signed-off-by: Michal Hocko <mhocko@suse.cz>
+Cc: Mel Gorman <mgorman@suse.de>
+Cc: Rik van Riel <riel@redhat.com>
+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>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ include/asm-generic/tlb.h | 9 +++++++++
+ mm/memory.c | 5 +++++
+ 2 files changed, 14 insertions(+)
+
+--- a/include/asm-generic/tlb.h
++++ b/include/asm-generic/tlb.h
+@@ -78,6 +78,14 @@ struct mmu_gather_batch {
+ #define MAX_GATHER_BATCH \
+ ((PAGE_SIZE - sizeof(struct mmu_gather_batch)) / sizeof(void *))
+
++/*
++ * Limit the maximum number of mmu_gather batches to reduce a risk of soft
++ * lockups for non-preemptible kernels on huge machines when a lot of memory
++ * is zapped during unmapping.
++ * 10K pages freed at once should be safe even without a preemption point.
++ */
++#define MAX_GATHER_BATCH_COUNT (10000UL/MAX_GATHER_BATCH)
++
+ /* struct mmu_gather is an opaque type used by the mm code for passing around
+ * any data needed by arch specific code for tlb_remove_page.
+ */
+@@ -94,6 +102,7 @@ struct mmu_gather {
+ struct mmu_gather_batch *active;
+ struct mmu_gather_batch local;
+ struct page *__pages[MMU_GATHER_BUNDLE];
++ unsigned int batch_count;
+ };
+
+ #define HAVE_GENERIC_MMU_GATHER
+--- a/mm/memory.c
++++ b/mm/memory.c
+@@ -182,10 +182,14 @@ static int tlb_next_batch(struct mmu_gat
+ return 1;
+ }
+
++ if (tlb->batch_count == MAX_GATHER_BATCH_COUNT)
++ return 0;
++
+ batch = (void *)__get_free_pages(GFP_NOWAIT | __GFP_NOWARN, 0);
+ if (!batch)
+ return 0;
+
++ tlb->batch_count++;
+ batch->next = NULL;
+ batch->nr = 0;
+ batch->max = MAX_GATHER_BATCH;
+@@ -212,6 +216,7 @@ void tlb_gather_mmu(struct mmu_gather *t
+ tlb->local.nr = 0;
+ tlb->local.max = ARRAY_SIZE(tlb->__pages);
+ tlb->active = &tlb->local;
++ tlb->batch_count = 0;
+
+ #ifdef CONFIG_HAVE_RCU_TABLE_FREE
+ tlb->batch = NULL;
bluetooth-ath3k-add-support-for-vaio-vpceh.patch
bluetooth-add-missing-lock-nesting-notation.patch
bluetooth-cancel-power_on-work-when-unregistering-the-device.patch
+lib-atomic64-initialize-locks-statically-to-fix-early-users.patch
+cris-fix-i-o-macros.patch
+drivers-rtc-rtc-vt8500.c-correct-handling-of-cr_24h-bitfield.patch
+drivers-rtc-rtc-vt8500.c-fix-handling-of-data-passed-in-struct-rtc_time.patch
+mm-limit-mmu_gather-batching-to-fix-soft-lockups-on-config_preempt.patch
+hid-add-apple-wireless-keyboard-2011-ansi-to-special-driver-list.patch