From: Greg Kroah-Hartman Date: Tue, 19 Oct 2010 23:33:52 +0000 (-0700) Subject: .33 stuff X-Git-Tag: v2.6.27.55~20 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=478062802a662ab3f89431ff2cecf4f5f79adeb2;p=thirdparty%2Fkernel%2Fstable-queue.git .33 stuff ignore --- diff --git a/queue-2.6.33/mmc-sdhci-s3c-fix-null-ptr-access-in-sdhci_s3c_remove.patch b/queue-2.6.33/mmc-sdhci-s3c-fix-null-ptr-access-in-sdhci_s3c_remove.patch new file mode 100644 index 00000000000..a8a4681b878 --- /dev/null +++ b/queue-2.6.33/mmc-sdhci-s3c-fix-null-ptr-access-in-sdhci_s3c_remove.patch @@ -0,0 +1,38 @@ +From 9320f7cbbdd5febf013b0e91db29189724057738 Mon Sep 17 00:00:00 2001 +From: Marek Szyprowski +Date: Thu, 23 Sep 2010 16:22:05 +0200 +Subject: mmc: sdhci-s3c: fix NULL ptr access in sdhci_s3c_remove + +From: Marek Szyprowski + +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 +Signed-off-by: Kyungmin Park +Signed-off-by: Andrew Morton +Signed-off-by: Chris Ball +Signed-off-by: Greg Kroah-Hartman + +--- + 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); diff --git a/queue-2.6.33/series b/queue-2.6.33/series index f98ce04b903..d618cf1df82 100644 --- a/queue-2.6.33/series +++ b/queue-2.6.33/series @@ -6,3 +6,9 @@ alsa-prevent-heap-corruption-in-snd_ctl_new.patch alsa-rawmidi-fix-oops-use-after-free-when-unloading-a-driver-module.patch usb-fix-bug-in-initialization-of-interface-minor-numbers.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 diff --git a/queue-2.6.33/tracing-x86-don-t-use-mcount-in-kvmclock.c.patch b/queue-2.6.33/tracing-x86-don-t-use-mcount-in-kvmclock.c.patch new file mode 100644 index 00000000000..2044a9a4b87 --- /dev/null +++ b/queue-2.6.33/tracing-x86-don-t-use-mcount-in-kvmclock.c.patch @@ -0,0 +1,34 @@ +From 258af47479980d8238a04568b94a4e55aa1cb537 Mon Sep 17 00:00:00 2001 +From: Steven Rostedt +Date: Wed, 22 Sep 2010 22:22:25 -0400 +Subject: tracing/x86: Don't use mcount in kvmclock.c + +From: Steven Rostedt + +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 +Cc: Avi Kivity +Signed-off-by: Steven Rostedt +Signed-off-by: Greg Kroah-Hartman + +--- + 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 diff --git a/queue-2.6.33/tracing-x86-don-t-use-mcount-in-pvclock.c.patch b/queue-2.6.33/tracing-x86-don-t-use-mcount-in-pvclock.c.patch new file mode 100644 index 00000000000..aedcd015b78 --- /dev/null +++ b/queue-2.6.33/tracing-x86-don-t-use-mcount-in-pvclock.c.patch @@ -0,0 +1,34 @@ +From 9ecd4e1689208afe9b059a5ce1333acb2f42c4d2 Mon Sep 17 00:00:00 2001 +From: Jeremy Fitzhardinge +Date: Wed, 22 Sep 2010 17:07:27 -0700 +Subject: tracing/x86: Don't use mcount in pvclock.c + +From: Jeremy Fitzhardinge + +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 +LKML-Reference: <4C9A9A3F.4040201@goop.org> +Signed-off-by: Steven Rostedt +Signed-off-by: Greg Kroah-Hartman + +--- + 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 diff --git a/queue-2.6.33/x86-amd-iommu-fix-rounding-bug-in-__unmap_single.patch b/queue-2.6.33/x86-amd-iommu-fix-rounding-bug-in-__unmap_single.patch new file mode 100644 index 00000000000..64252dcb22d --- /dev/null +++ b/queue-2.6.33/x86-amd-iommu-fix-rounding-bug-in-__unmap_single.patch @@ -0,0 +1,51 @@ +From 04e0463e088b41060c08c255eb0d3278a504f094 Mon Sep 17 00:00:00 2001 +From: Joerg Roedel +Date: Thu, 23 Sep 2010 16:12:48 +0200 +Subject: x86/amd-iommu: Fix rounding-bug in __unmap_single + +From: Joerg Roedel + +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 +Signed-off-by: Greg Kroah-Hartman + +--- + 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 +@@ -1885,6 +1885,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; + +@@ -1892,6 +1893,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; +@@ -1906,7 +1908,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; + } + } diff --git a/queue-2.6.33/x86-amd-iommu-set-iommu-configuration-flags-in-enable-loop.patch b/queue-2.6.33/x86-amd-iommu-set-iommu-configuration-flags-in-enable-loop.patch new file mode 100644 index 00000000000..7a501b4be6d --- /dev/null +++ b/queue-2.6.33/x86-amd-iommu-set-iommu-configuration-flags-in-enable-loop.patch @@ -0,0 +1,107 @@ +From e9bf51971157e367aabfc111a8219db010f69cd4 Mon Sep 17 00:00:00 2001 +From: Joerg Roedel +Date: Mon, 20 Sep 2010 14:33:07 +0200 +Subject: x86/amd-iommu: Set iommu configuration flags in enable-loop + +From: Joerg Roedel + +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 +Signed-off-by: Greg Kroah-Hartman + +--- + 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 +@@ -331,6 +331,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 +@@ -645,29 +645,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 +@@ -1109,6 +1089,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 +@@ -1119,6 +1123,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); diff --git a/queue-2.6.33/x86-amd-iommu-work-around-s3-bios-bug.patch b/queue-2.6.33/x86-amd-iommu-work-around-s3-bios-bug.patch new file mode 100644 index 00000000000..ba89e3c83c6 --- /dev/null +++ b/queue-2.6.33/x86-amd-iommu-work-around-s3-bios-bug.patch @@ -0,0 +1,113 @@ +From 4c894f47bb49284008073d351c0ddaac8860864e Mon Sep 17 00:00:00 2001 +From: Joerg Roedel +Date: Thu, 23 Sep 2010 15:15:19 +0200 +Subject: x86/amd-iommu: Work around S3 BIOS bug + +From: Joerg Roedel + +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 +Signed-off-by: Greg Kroah-Hartman + +--- + 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 +@@ -377,6 +377,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 +@@ -628,6 +628,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]); ++ } + } + + /* +@@ -1113,6 +1120,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 +@@ -1123,6 +1140,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 +