--- /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
+@@ -379,8 +379,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);
usb-musb-gadget-restart-request-on-clearing-endpoint-halt.patch
oprofile-add-support-for-intel-cpu-family-6-model-29.patch
rdma-cxgb3-turn-off-rx-coalescing-for-iwarp-connections.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
--- /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
+@@ -1688,6 +1688,7 @@ static void __unmap_single(struct amd_io
+ size_t size,
+ int dir)
+ {
++ dma_addr_t flush_addr;
+ dma_addr_t i, start;
+ unsigned int pages;
+
+@@ -1695,6 +1696,7 @@ static void __unmap_single(struct amd_io
+ (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;
+@@ -1709,7 +1711,7 @@ static void __unmap_single(struct amd_io
+ dma_ops_free_addresses(dma_dom, dma_addr, pages);
+
+ if (amd_iommu_unmap_flush || dma_dom->need_flush) {
+- iommu_flush_pages(iommu, dma_dom->domain.id, dma_addr, size);
++ iommu_flush_pages(iommu, dma_dom->domain.id, 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
+@@ -305,6 +305,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
+@@ -639,29 +639,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
+@@ -1089,6 +1069,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
+@@ -1099,6 +1103,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_types.h | 15 +++++++++++++++
+ arch/x86/kernel/amd_iommu_init.c | 18 ++++++++++++++++++
+ include/linux/pci_ids.h | 3 +++
+ 3 files changed, 36 insertions(+)
+
+--- a/arch/x86/include/asm/amd_iommu_types.h
++++ b/arch/x86/include/asm/amd_iommu_types.h
+@@ -351,6 +351,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];
+ };
+
+ /*
+@@ -472,4 +481,10 @@ static inline void amd_iommu_stats_init(
+ /* some function prototypes */
+ extern void amd_iommu_reset_cmd_buffer(struct amd_iommu *iommu);
+
++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_TYPES_H */
+--- a/arch/x86/kernel/amd_iommu_init.c
++++ b/arch/x86/kernel/amd_iommu_init.c
+@@ -622,6 +622,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]);
++ }
+ }
+
+ /*
+@@ -1093,6 +1100,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
+@@ -1103,6 +1120,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
+