--- /dev/null
+From 64aab720bdf8771214a7c88872bd8e3194c2d279 Mon Sep 17 00:00:00 2001
+From: Marcin Slusarz <marcin.slusarz@gmail.com>
+Date: Thu, 30 Sep 2010 15:15:30 -0700
+Subject: i7core_edac: fix panic in udimm sysfs attributes registration
+
+From: Marcin Slusarz <marcin.slusarz@gmail.com>
+
+commit 64aab720bdf8771214a7c88872bd8e3194c2d279 upstream.
+
+Array of udimm sysfs attributes was not ended with NULL marker, leading to
+dereference of random memory.
+
+ EDAC DEBUG: edac_create_mci_instance_attributes: edac_create_mci_instance_attributes() file udimm0
+ EDAC DEBUG: edac_create_mci_instance_attributes: edac_create_mci_instance_attributes() file udimm1
+ EDAC DEBUG: edac_create_mci_instance_attributes: edac_create_mci_instance_attributes() file udimm2
+ BUG: unable to handle kernel NULL pointer dereference at 00000000000001a4
+ IP: [<ffffffff81330b36>] edac_create_mci_instance_attributes+0x148/0x1f1
+ Pid: 1, comm: swapper Not tainted 2.6.36-rc3-nv+ #483 P6T SE/System Product Name
+ RIP: 0010:[<ffffffff81330b36>] [<ffffffff81330b36>] edac_create_mci_instance_attributes+0x148/0x1f1
+ (...)
+ Call Trace:
+ [<ffffffff81330b86>] edac_create_mci_instance_attributes+0x198/0x1f1
+ [<ffffffff81330c9a>] edac_create_sysfs_mci_device+0xbb/0x2b2
+ [<ffffffff8132f533>] edac_mc_add_mc+0x46b/0x557
+ [<ffffffff81428901>] i7core_probe+0xccf/0xec0
+ RIP [<ffffffff81330b36>] edac_create_mci_instance_attributes+0x148/0x1f1
+ ---[ end trace 20de320855b81d78 ]---
+ Kernel panic - not syncing: Attempted to kill init!
+
+Signed-off-by: Marcin Slusarz <marcin.slusarz@gmail.com>
+Cc: Mauro Carvalho Chehab <mchehab@redhat.com>
+Acked-by: Doug Thompson <dougthompson@xmission.com>
+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@suse.de>
+
+---
+ drivers/edac/i7core_edac.c | 1 +
+ 1 file changed, 1 insertion(+)
+
+--- a/drivers/edac/i7core_edac.c
++++ b/drivers/edac/i7core_edac.c
+@@ -1140,6 +1140,7 @@ static struct mcidev_sysfs_attribute i7c
+ ATTR_COUNTER(0),
+ ATTR_COUNTER(1),
+ ATTR_COUNTER(2),
++ { .attr = { .name = NULL } }
+ };
+
+ static struct mcidev_sysfs_group i7core_udimm_counters = {
--- /dev/null
+From 4e31635c367a9e21a43cfbfae4c9deda2e19d1f4 Mon Sep 17 00:00:00 2001
+From: Hugh Dickins <hughd@google.com>
+Date: Sat, 2 Oct 2010 17:49:08 -0700
+Subject: ksm: fix bad user data when swapping
+
+From: Hugh Dickins <hughd@google.com>
+
+commit 4e31635c367a9e21a43cfbfae4c9deda2e19d1f4 upstream.
+
+Building under memory pressure, with KSM on 2.6.36-rc5, collapsed with
+an internal compiler error: typically indicating an error in swapping.
+
+Perhaps there's a timing issue which makes it now more likely, perhaps
+it's just a long time since I tried for so long: this bug goes back to
+KSM swapping in 2.6.33.
+
+Notice how reuse_swap_page() allows an exclusive page to be reused, but
+only does SetPageDirty if it can delete it from swap cache right then -
+if it's currently under Writeback, it has to be left in cache and we
+don't SetPageDirty, but the page can be reused. Fine, the dirty bit
+will get set in the pte; but notice how zap_pte_range() does not bother
+to transfer pte_dirty to page_dirty when unmapping a PageAnon.
+
+If KSM chooses to share such a page, it will look like a clean copy of
+swapcache, and not be written out to swap when its memory is needed;
+then stale data read back from swap when it's needed again.
+
+We could fix this in reuse_swap_page() (or even refuse to reuse a
+page under writeback), but it's more honest to fix my oversight in
+KSM's write_protect_page(). Several days of testing on three machines
+confirms that this fixes the issue they showed.
+
+Signed-off-by: Hugh Dickins <hughd@google.com>
+Cc: Andrew Morton <akpm@linux-foundation.org>
+Cc: Andrea Arcangeli <aarcange@redhat.com>
+Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+
+---
+ mm/ksm.c | 6 ++++--
+ 1 file changed, 4 insertions(+), 2 deletions(-)
+
+--- a/mm/ksm.c
++++ b/mm/ksm.c
+@@ -731,7 +731,7 @@ static int write_protect_page(struct vm_
+ if (!ptep)
+ goto out;
+
+- if (pte_write(*ptep)) {
++ if (pte_write(*ptep) || pte_dirty(*ptep)) {
+ pte_t entry;
+
+ swapped = PageSwapCache(page);
+@@ -754,7 +754,9 @@ static int write_protect_page(struct vm_
+ set_pte_at(mm, addr, ptep, entry);
+ goto out_unlock;
+ }
+- entry = pte_wrprotect(entry);
++ if (pte_dirty(entry))
++ set_page_dirty(page);
++ entry = pte_mkclean(pte_wrprotect(entry));
+ set_pte_at_notify(mm, addr, ptep, entry);
+ }
+ *orig_pte = *ptep;
--- /dev/null
+From 9320f7cbbdd5febf013b0e91db29189724057738 Mon Sep 17 00:00:00 2001
+From: Marek Szyprowski <m.szyprowski@samsung.com>
+Date: Thu, 23 Sep 2010 16:22:05 +0200
+Subject: mmc: sdhci-s3c: fix NULL ptr access in sdhci_s3c_remove
+
+From: Marek Szyprowski <m.szyprowski@samsung.com>
+
+commit 9320f7cbbdd5febf013b0e91db29189724057738 upstream.
+
+If not all clocks have been defined in platform data, the driver will
+cause a null pointer dereference when it is removed. This patch fixes
+this issue.
+
+Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
+Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
+Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
+Signed-off-by: Chris Ball <cjb@laptop.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+
+---
+ drivers/mmc/host/sdhci-s3c.c | 6 ++++--
+ 1 file changed, 4 insertions(+), 2 deletions(-)
+
+--- a/drivers/mmc/host/sdhci-s3c.c
++++ b/drivers/mmc/host/sdhci-s3c.c
+@@ -372,8 +372,10 @@ static int __devexit sdhci_s3c_remove(st
+ sdhci_remove_host(host, 1);
+
+ for (ptr = 0; ptr < 3; ptr++) {
+- clk_disable(sc->clk_bus[ptr]);
+- clk_put(sc->clk_bus[ptr]);
++ if (sc->clk_bus[ptr]) {
++ clk_disable(sc->clk_bus[ptr]);
++ clk_put(sc->clk_bus[ptr]);
++ }
+ }
+ clk_disable(sc->clk_io);
+ clk_put(sc->clk_io);
arm-6395-1-vexpress-set-bit-22-in-the-pl310-cache-controller-auxctlr-register.patch
v4l-dvb-gspca-main-fix-a-crash-of-some-webcams-on-arm-arch.patch
v4l-dvb-gspca-sn9c20x-bad-transfer-size-of-bayer-images.patch
+mmc-sdhci-s3c-fix-null-ptr-access-in-sdhci_s3c_remove.patch
+x86-amd-iommu-set-iommu-configuration-flags-in-enable-loop.patch
+x86-amd-iommu-fix-rounding-bug-in-__unmap_single.patch
+x86-amd-iommu-work-around-s3-bios-bug.patch
+tracing-x86-don-t-use-mcount-in-pvclock.c.patch
+tracing-x86-don-t-use-mcount-in-kvmclock.c.patch
+ksm-fix-bad-user-data-when-swapping.patch
+i7core_edac-fix-panic-in-udimm-sysfs-attributes-registration.patch
--- /dev/null
+From 258af47479980d8238a04568b94a4e55aa1cb537 Mon Sep 17 00:00:00 2001
+From: Steven Rostedt <srostedt@redhat.com>
+Date: Wed, 22 Sep 2010 22:22:25 -0400
+Subject: tracing/x86: Don't use mcount in kvmclock.c
+
+From: Steven Rostedt <srostedt@redhat.com>
+
+commit 258af47479980d8238a04568b94a4e55aa1cb537 upstream.
+
+The guest can use the paravirt clock in kvmclock.c which is used
+by sched_clock(), which in turn is used by the tracing mechanism
+for timestamps, which leads to infinite recursion.
+
+Disable mcount/tracing for kvmclock.o.
+
+Cc: Jeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com>
+Cc: Avi Kivity <avi@redhat.com>
+Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+
+---
+ arch/x86/kernel/Makefile | 1 +
+ 1 file changed, 1 insertion(+)
+
+--- a/arch/x86/kernel/Makefile
++++ b/arch/x86/kernel/Makefile
+@@ -12,6 +12,7 @@ CFLAGS_REMOVE_tsc.o = -pg
+ CFLAGS_REMOVE_rtc.o = -pg
+ CFLAGS_REMOVE_paravirt-spinlocks.o = -pg
+ CFLAGS_REMOVE_pvclock.o = -pg
++CFLAGS_REMOVE_kvmclock.o = -pg
+ CFLAGS_REMOVE_ftrace.o = -pg
+ CFLAGS_REMOVE_early_printk.o = -pg
+ endif
--- /dev/null
+From 9ecd4e1689208afe9b059a5ce1333acb2f42c4d2 Mon Sep 17 00:00:00 2001
+From: Jeremy Fitzhardinge <jeremy@goop.org>
+Date: Wed, 22 Sep 2010 17:07:27 -0700
+Subject: tracing/x86: Don't use mcount in pvclock.c
+
+From: Jeremy Fitzhardinge <jeremy@goop.org>
+
+commit 9ecd4e1689208afe9b059a5ce1333acb2f42c4d2 upstream.
+
+When using a paravirt clock, pvclock.c can be used by sched_clock(),
+which in turn is used by the tracing mechanism for timestamps,
+which leads to infinite recursion.
+
+Disable mcount/tracing for pvclock.o.
+
+Signed-off-by: Jeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com>
+LKML-Reference: <4C9A9A3F.4040201@goop.org>
+Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+
+---
+ arch/x86/kernel/Makefile | 1 +
+ 1 file changed, 1 insertion(+)
+
+--- a/arch/x86/kernel/Makefile
++++ b/arch/x86/kernel/Makefile
+@@ -11,6 +11,7 @@ ifdef CONFIG_FUNCTION_TRACER
+ CFLAGS_REMOVE_tsc.o = -pg
+ CFLAGS_REMOVE_rtc.o = -pg
+ CFLAGS_REMOVE_paravirt-spinlocks.o = -pg
++CFLAGS_REMOVE_pvclock.o = -pg
+ CFLAGS_REMOVE_ftrace.o = -pg
+ CFLAGS_REMOVE_early_printk.o = -pg
+ endif
--- /dev/null
+From 04e0463e088b41060c08c255eb0d3278a504f094 Mon Sep 17 00:00:00 2001
+From: Joerg Roedel <joerg.roedel@amd.com>
+Date: Thu, 23 Sep 2010 16:12:48 +0200
+Subject: x86/amd-iommu: Fix rounding-bug in __unmap_single
+
+From: Joerg Roedel <joerg.roedel@amd.com>
+
+commit 04e0463e088b41060c08c255eb0d3278a504f094 upstream.
+
+In the __unmap_single function the dma_addr is rounded down
+to a page boundary before the dma pages are unmapped. The
+address is later also used to flush the TLB entries for that
+mapping. But without the offset into the dma page the amount
+of pages to flush might be miscalculated in the TLB flushing
+path. This patch fixes this bug by using the original
+address to flush the TLB.
+
+Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+
+---
+ arch/x86/kernel/amd_iommu.c | 4 +++-
+ 1 file changed, 3 insertions(+), 1 deletion(-)
+
+--- a/arch/x86/kernel/amd_iommu.c
++++ b/arch/x86/kernel/amd_iommu.c
+@@ -1953,6 +1953,7 @@ static void __unmap_single(struct dma_op
+ size_t size,
+ int dir)
+ {
++ dma_addr_t flush_addr;
+ dma_addr_t i, start;
+ unsigned int pages;
+
+@@ -1960,6 +1961,7 @@ static void __unmap_single(struct dma_op
+ (dma_addr + size > dma_dom->aperture_size))
+ return;
+
++ flush_addr = dma_addr;
+ pages = iommu_num_pages(dma_addr, size, PAGE_SIZE);
+ dma_addr &= PAGE_MASK;
+ start = dma_addr;
+@@ -1974,7 +1976,7 @@ static void __unmap_single(struct dma_op
+ dma_ops_free_addresses(dma_dom, dma_addr, pages);
+
+ if (amd_iommu_unmap_flush || dma_dom->need_flush) {
+- iommu_flush_pages(&dma_dom->domain, dma_addr, size);
++ iommu_flush_pages(&dma_dom->domain, flush_addr, size);
+ dma_dom->need_flush = false;
+ }
+ }
--- /dev/null
+From e9bf51971157e367aabfc111a8219db010f69cd4 Mon Sep 17 00:00:00 2001
+From: Joerg Roedel <joerg.roedel@amd.com>
+Date: Mon, 20 Sep 2010 14:33:07 +0200
+Subject: x86/amd-iommu: Set iommu configuration flags in enable-loop
+
+From: Joerg Roedel <joerg.roedel@amd.com>
+
+commit e9bf51971157e367aabfc111a8219db010f69cd4 upstream.
+
+This patch moves the setting of the configuration and
+feature flags out out the acpi table parsing path and moves
+it into the iommu-enable path. This is needed to reliably
+fix resume-from-s3.
+
+Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+
+---
+ arch/x86/include/asm/amd_iommu_types.h | 3 ++
+ arch/x86/kernel/amd_iommu_init.c | 49 ++++++++++++++++++---------------
+ 2 files changed, 30 insertions(+), 22 deletions(-)
+
+--- a/arch/x86/include/asm/amd_iommu_types.h
++++ b/arch/x86/include/asm/amd_iommu_types.h
+@@ -368,6 +368,9 @@ struct amd_iommu {
+ /* capabilities of that IOMMU read from ACPI */
+ u32 cap;
+
++ /* flags read from acpi table */
++ u8 acpi_flags;
++
+ /*
+ * Capability pointer. There could be more than one IOMMU per PCI
+ * device function if there are more than one AMD IOMMU capability
+--- a/arch/x86/kernel/amd_iommu_init.c
++++ b/arch/x86/kernel/amd_iommu_init.c
+@@ -649,29 +649,9 @@ static void __init init_iommu_from_acpi(
+ struct ivhd_entry *e;
+
+ /*
+- * First set the recommended feature enable bits from ACPI
+- * into the IOMMU control registers
++ * First save the recommended feature enable bits from ACPI
+ */
+- h->flags & IVHD_FLAG_HT_TUN_EN_MASK ?
+- iommu_feature_enable(iommu, CONTROL_HT_TUN_EN) :
+- iommu_feature_disable(iommu, CONTROL_HT_TUN_EN);
+-
+- h->flags & IVHD_FLAG_PASSPW_EN_MASK ?
+- iommu_feature_enable(iommu, CONTROL_PASSPW_EN) :
+- iommu_feature_disable(iommu, CONTROL_PASSPW_EN);
+-
+- h->flags & IVHD_FLAG_RESPASSPW_EN_MASK ?
+- iommu_feature_enable(iommu, CONTROL_RESPASSPW_EN) :
+- iommu_feature_disable(iommu, CONTROL_RESPASSPW_EN);
+-
+- h->flags & IVHD_FLAG_ISOC_EN_MASK ?
+- iommu_feature_enable(iommu, CONTROL_ISOC_EN) :
+- iommu_feature_disable(iommu, CONTROL_ISOC_EN);
+-
+- /*
+- * make IOMMU memory accesses cache coherent
+- */
+- iommu_feature_enable(iommu, CONTROL_COHERENT_EN);
++ iommu->acpi_flags = h->flags;
+
+ /*
+ * Done. Now parse the device entries
+@@ -1116,6 +1096,30 @@ static void init_device_table(void)
+ }
+ }
+
++static void iommu_init_flags(struct amd_iommu *iommu)
++{
++ iommu->acpi_flags & IVHD_FLAG_HT_TUN_EN_MASK ?
++ iommu_feature_enable(iommu, CONTROL_HT_TUN_EN) :
++ iommu_feature_disable(iommu, CONTROL_HT_TUN_EN);
++
++ iommu->acpi_flags & IVHD_FLAG_PASSPW_EN_MASK ?
++ iommu_feature_enable(iommu, CONTROL_PASSPW_EN) :
++ iommu_feature_disable(iommu, CONTROL_PASSPW_EN);
++
++ iommu->acpi_flags & IVHD_FLAG_RESPASSPW_EN_MASK ?
++ iommu_feature_enable(iommu, CONTROL_RESPASSPW_EN) :
++ iommu_feature_disable(iommu, CONTROL_RESPASSPW_EN);
++
++ iommu->acpi_flags & IVHD_FLAG_ISOC_EN_MASK ?
++ iommu_feature_enable(iommu, CONTROL_ISOC_EN) :
++ iommu_feature_disable(iommu, CONTROL_ISOC_EN);
++
++ /*
++ * make IOMMU memory accesses cache coherent
++ */
++ iommu_feature_enable(iommu, CONTROL_COHERENT_EN);
++}
++
+ /*
+ * This function finally enables all IOMMUs found in the system after
+ * they have been initialized
+@@ -1126,6 +1130,7 @@ static void enable_iommus(void)
+
+ for_each_iommu(iommu) {
+ iommu_disable(iommu);
++ iommu_init_flags(iommu);
+ iommu_set_device_table(iommu);
+ iommu_enable_command_buffer(iommu);
+ iommu_enable_event_buffer(iommu);
--- /dev/null
+From 4c894f47bb49284008073d351c0ddaac8860864e Mon Sep 17 00:00:00 2001
+From: Joerg Roedel <joerg.roedel@amd.com>
+Date: Thu, 23 Sep 2010 15:15:19 +0200
+Subject: x86/amd-iommu: Work around S3 BIOS bug
+
+From: Joerg Roedel <joerg.roedel@amd.com>
+
+commit 4c894f47bb49284008073d351c0ddaac8860864e upstream.
+
+This patch adds a workaround for an IOMMU BIOS problem to
+the AMD IOMMU driver. The result of the bug is that the
+IOMMU does not execute commands anymore when the system
+comes out of the S3 state resulting in system failure. The
+bug in the BIOS is that is does not restore certain hardware
+specific registers correctly. This workaround reads out the
+contents of these registers at boot time and restores them
+on resume from S3. The workaround is limited to the specific
+IOMMU chipset where this problem occurs.
+
+Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+
+---
+ arch/x86/include/asm/amd_iommu_proto.h | 6 ++++++
+ arch/x86/include/asm/amd_iommu_types.h | 9 +++++++++
+ arch/x86/kernel/amd_iommu_init.c | 18 ++++++++++++++++++
+ include/linux/pci_ids.h | 3 +++
+ 4 files changed, 36 insertions(+)
+
+--- a/arch/x86/include/asm/amd_iommu_proto.h
++++ b/arch/x86/include/asm/amd_iommu_proto.h
+@@ -38,4 +38,10 @@ static inline void amd_iommu_stats_init(
+
+ #endif /* !CONFIG_AMD_IOMMU_STATS */
+
++static inline bool is_rd890_iommu(struct pci_dev *pdev)
++{
++ return (pdev->vendor == PCI_VENDOR_ID_ATI) &&
++ (pdev->device == PCI_DEVICE_ID_RD890_IOMMU);
++}
++
+ #endif /* _ASM_X86_AMD_IOMMU_PROTO_H */
+--- a/arch/x86/include/asm/amd_iommu_types.h
++++ b/arch/x86/include/asm/amd_iommu_types.h
+@@ -414,6 +414,15 @@ struct amd_iommu {
+
+ /* default dma_ops domain for that IOMMU */
+ struct dma_ops_domain *default_dom;
++
++ /*
++ * This array is required to work around a potential BIOS bug.
++ * The BIOS may miss to restore parts of the PCI configuration
++ * space when the system resumes from S3. The result is that the
++ * IOMMU does not execute commands anymore which leads to system
++ * failure.
++ */
++ u32 cache_cfg[4];
+ };
+
+ /*
+--- a/arch/x86/kernel/amd_iommu_init.c
++++ b/arch/x86/kernel/amd_iommu_init.c
+@@ -632,6 +632,13 @@ static void __init init_iommu_from_pci(s
+ iommu->last_device = calc_devid(MMIO_GET_BUS(range),
+ MMIO_GET_LD(range));
+ iommu->evt_msi_num = MMIO_MSI_NUM(misc);
++
++ if (is_rd890_iommu(iommu->dev)) {
++ pci_read_config_dword(iommu->dev, 0xf0, &iommu->cache_cfg[0]);
++ pci_read_config_dword(iommu->dev, 0xf4, &iommu->cache_cfg[1]);
++ pci_read_config_dword(iommu->dev, 0xf8, &iommu->cache_cfg[2]);
++ pci_read_config_dword(iommu->dev, 0xfc, &iommu->cache_cfg[3]);
++ }
+ }
+
+ /*
+@@ -1120,6 +1127,16 @@ static void iommu_init_flags(struct amd_
+ iommu_feature_enable(iommu, CONTROL_COHERENT_EN);
+ }
+
++static void iommu_apply_quirks(struct amd_iommu *iommu)
++{
++ if (is_rd890_iommu(iommu->dev)) {
++ pci_write_config_dword(iommu->dev, 0xf0, iommu->cache_cfg[0]);
++ pci_write_config_dword(iommu->dev, 0xf4, iommu->cache_cfg[1]);
++ pci_write_config_dword(iommu->dev, 0xf8, iommu->cache_cfg[2]);
++ pci_write_config_dword(iommu->dev, 0xfc, iommu->cache_cfg[3]);
++ }
++}
++
+ /*
+ * This function finally enables all IOMMUs found in the system after
+ * they have been initialized
+@@ -1130,6 +1147,7 @@ static void enable_iommus(void)
+
+ for_each_iommu(iommu) {
+ iommu_disable(iommu);
++ iommu_apply_quirks(iommu);
+ iommu_init_flags(iommu);
+ iommu_set_device_table(iommu);
+ iommu_enable_command_buffer(iommu);
+--- a/include/linux/pci_ids.h
++++ b/include/linux/pci_ids.h
+@@ -393,6 +393,9 @@
+ #define PCI_DEVICE_ID_VLSI_82C147 0x0105
+ #define PCI_DEVICE_ID_VLSI_VAS96011 0x0702
+
++/* AMD RD890 Chipset */
++#define PCI_DEVICE_ID_RD890_IOMMU 0x5a23
++
+ #define PCI_VENDOR_ID_ADL 0x1005
+ #define PCI_DEVICE_ID_ADL_2301 0x2301
+