From 88abe08a7b6adcadf13378d71fa3e880d2fb520f Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Tue, 31 Jul 2012 11:20:59 -0700 Subject: [PATCH] 3.0-stable patches added patches: mmc-sdhci-pci-cafe-has-broken-card-detection.patch powerpc-add-memory-attribute-for-mfmsr.patch powerpc-fix-wrong-divisor-in-usecs_to_cputime.patch powerpc-ftrace-fix-assembly-trampoline-register-usage.patch --- ...i-pci-cafe-has-broken-card-detection.patch | 39 +++++++++ ...werpc-add-memory-attribute-for-mfmsr.patch | 32 +++++++ ...ix-wrong-divisor-in-usecs_to_cputime.patch | 84 +++++++++++++++++++ ...x-assembly-trampoline-register-usage.patch | 49 +++++++++++ queue-3.0/series | 4 + 5 files changed, 208 insertions(+) create mode 100644 queue-3.0/mmc-sdhci-pci-cafe-has-broken-card-detection.patch create mode 100644 queue-3.0/powerpc-add-memory-attribute-for-mfmsr.patch create mode 100644 queue-3.0/powerpc-fix-wrong-divisor-in-usecs_to_cputime.patch create mode 100644 queue-3.0/powerpc-ftrace-fix-assembly-trampoline-register-usage.patch create mode 100644 queue-3.0/series diff --git a/queue-3.0/mmc-sdhci-pci-cafe-has-broken-card-detection.patch b/queue-3.0/mmc-sdhci-pci-cafe-has-broken-card-detection.patch new file mode 100644 index 00000000000..5cbfa96b4e1 --- /dev/null +++ b/queue-3.0/mmc-sdhci-pci-cafe-has-broken-card-detection.patch @@ -0,0 +1,39 @@ +From 55fc05b7414274f17795cd0e8a3b1546f3649d5e Mon Sep 17 00:00:00 2001 +From: Daniel Drake +Date: Tue, 3 Jul 2012 23:13:39 +0100 +Subject: mmc: sdhci-pci: CaFe has broken card detection + +From: Daniel Drake + +commit 55fc05b7414274f17795cd0e8a3b1546f3649d5e upstream. + +At http://dev.laptop.org/ticket/11980 we have determined that the +Marvell CaFe SDHCI controller reports bad card presence during +resume. It reports that no card is present even when it is. +This is a regression -- resume worked back around 2.6.37. + +Around 400ms after resuming, a "card inserted" interrupt is +generated, at which point it starts reporting presence. + +Work around this hardware oddity by setting the +SDHCI_QUIRK_BROKEN_CARD_DETECTION flag. +Thanks to Chris Ball for helping with diagnosis. + +Signed-off-by: Daniel Drake +Signed-off-by: Chris Ball +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/mmc/host/sdhci-pci.c | 1 + + 1 file changed, 1 insertion(+) + +--- a/drivers/mmc/host/sdhci-pci.c ++++ b/drivers/mmc/host/sdhci-pci.c +@@ -140,6 +140,7 @@ static const struct sdhci_pci_fixes sdhc + static const struct sdhci_pci_fixes sdhci_cafe = { + .quirks = SDHCI_QUIRK_NO_SIMULT_VDD_AND_POWER | + SDHCI_QUIRK_NO_BUSY_IRQ | ++ SDHCI_QUIRK_BROKEN_CARD_DETECTION | + SDHCI_QUIRK_BROKEN_TIMEOUT_VAL, + }; + diff --git a/queue-3.0/powerpc-add-memory-attribute-for-mfmsr.patch b/queue-3.0/powerpc-add-memory-attribute-for-mfmsr.patch new file mode 100644 index 00000000000..f6d16d5b770 --- /dev/null +++ b/queue-3.0/powerpc-add-memory-attribute-for-mfmsr.patch @@ -0,0 +1,32 @@ +From b416c9a10baae6a177b4f9ee858b8d309542fbef Mon Sep 17 00:00:00 2001 +From: Tiejun Chen +Date: Wed, 11 Jul 2012 14:22:46 +1000 +Subject: powerpc: Add "memory" attribute for mfmsr() + +From: Tiejun Chen + +commit b416c9a10baae6a177b4f9ee858b8d309542fbef upstream. + +Add "memory" attribute in inline assembly language as a compiler +barrier to make sure 4.6.x GCC don't reorder mfmsr(). + +Signed-off-by: Tiejun Chen +Signed-off-by: Benjamin Herrenschmidt +Signed-off-by: Greg Kroah-Hartman + +--- + arch/powerpc/include/asm/reg.h | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +--- a/arch/powerpc/include/asm/reg.h ++++ b/arch/powerpc/include/asm/reg.h +@@ -1000,7 +1000,8 @@ + /* Macros for setting and retrieving special purpose registers */ + #ifndef __ASSEMBLY__ + #define mfmsr() ({unsigned long rval; \ +- asm volatile("mfmsr %0" : "=r" (rval)); rval;}) ++ asm volatile("mfmsr %0" : "=r" (rval) : \ ++ : "memory"); rval;}) + #ifdef CONFIG_PPC_BOOK3S_64 + #define __mtmsrd(v, l) asm volatile("mtmsrd %0," __stringify(l) \ + : : "r" (v) : "memory") diff --git a/queue-3.0/powerpc-fix-wrong-divisor-in-usecs_to_cputime.patch b/queue-3.0/powerpc-fix-wrong-divisor-in-usecs_to_cputime.patch new file mode 100644 index 00000000000..1d3f6c91e10 --- /dev/null +++ b/queue-3.0/powerpc-fix-wrong-divisor-in-usecs_to_cputime.patch @@ -0,0 +1,84 @@ +From 9f5072d4f63f28d30d343573830ac6c85fc0deff Mon Sep 17 00:00:00 2001 +From: Andreas Schwab +Date: Fri, 9 Dec 2011 11:35:08 +0000 +Subject: powerpc: Fix wrong divisor in usecs_to_cputime + +From: Andreas Schwab + +commit 9f5072d4f63f28d30d343573830ac6c85fc0deff upstream. + +Commit d57af9b (taskstats: use real microsecond granularity for CPU times) +renamed msecs_to_cputime to usecs_to_cputime, but failed to update all +numbers on the way. This causes nonsensical cpu idle/iowait values to be +displayed in /proc/stat (the only user of usecs_to_cputime so far). + +This also renames __cputime_msec_factor to __cputime_usec_factor, adapting +its value and using it directly in cputime_to_usecs instead of doing two +multiplications. + +Signed-off-by: Andreas Schwab +Acked-by: Anton Blanchard +Signed-off-by: Benjamin Herrenschmidt +Cc: Michal Hocko +Signed-off-by: Greg Kroah-Hartman + +--- + arch/powerpc/include/asm/cputime.h | 6 +++--- + arch/powerpc/kernel/time.c | 10 +++++----- + 2 files changed, 8 insertions(+), 8 deletions(-) + +--- a/arch/powerpc/include/asm/cputime.h ++++ b/arch/powerpc/include/asm/cputime.h +@@ -126,11 +126,11 @@ static inline u64 cputime64_to_jiffies64 + /* + * Convert cputime <-> microseconds + */ +-extern u64 __cputime_msec_factor; ++extern u64 __cputime_usec_factor; + + static inline unsigned long cputime_to_usecs(const cputime_t ct) + { +- return mulhdu(ct, __cputime_msec_factor) * USEC_PER_MSEC; ++ return mulhdu(ct, __cputime_usec_factor); + } + + static inline cputime_t usecs_to_cputime(const unsigned long us) +@@ -143,7 +143,7 @@ static inline cputime_t usecs_to_cputime + sec = us / 1000000; + if (ct) { + ct *= tb_ticks_per_sec; +- do_div(ct, 1000); ++ do_div(ct, 1000000); + } + if (sec) + ct += (cputime_t) sec * tb_ticks_per_sec; +--- a/arch/powerpc/kernel/time.c ++++ b/arch/powerpc/kernel/time.c +@@ -168,13 +168,13 @@ EXPORT_SYMBOL_GPL(ppc_tb_freq); + #ifdef CONFIG_VIRT_CPU_ACCOUNTING + /* + * Factors for converting from cputime_t (timebase ticks) to +- * jiffies, milliseconds, seconds, and clock_t (1/USER_HZ seconds). ++ * jiffies, microseconds, seconds, and clock_t (1/USER_HZ seconds). + * These are all stored as 0.64 fixed-point binary fractions. + */ + u64 __cputime_jiffies_factor; + EXPORT_SYMBOL(__cputime_jiffies_factor); +-u64 __cputime_msec_factor; +-EXPORT_SYMBOL(__cputime_msec_factor); ++u64 __cputime_usec_factor; ++EXPORT_SYMBOL(__cputime_usec_factor); + u64 __cputime_sec_factor; + EXPORT_SYMBOL(__cputime_sec_factor); + u64 __cputime_clockt_factor; +@@ -192,8 +192,8 @@ static void calc_cputime_factors(void) + + div128_by_32(HZ, 0, tb_ticks_per_sec, &res); + __cputime_jiffies_factor = res.result_low; +- div128_by_32(1000, 0, tb_ticks_per_sec, &res); +- __cputime_msec_factor = res.result_low; ++ div128_by_32(1000000, 0, tb_ticks_per_sec, &res); ++ __cputime_usec_factor = res.result_low; + div128_by_32(1, 0, tb_ticks_per_sec, &res); + __cputime_sec_factor = res.result_low; + div128_by_32(USER_HZ, 0, tb_ticks_per_sec, &res); diff --git a/queue-3.0/powerpc-ftrace-fix-assembly-trampoline-register-usage.patch b/queue-3.0/powerpc-ftrace-fix-assembly-trampoline-register-usage.patch new file mode 100644 index 00000000000..7f10db41986 --- /dev/null +++ b/queue-3.0/powerpc-ftrace-fix-assembly-trampoline-register-usage.patch @@ -0,0 +1,49 @@ +From fd5a42980e1cf327b7240adf5e7b51ea41c23437 Mon Sep 17 00:00:00 2001 +From: roger blofeld +Date: Thu, 21 Jun 2012 05:27:14 +0000 +Subject: powerpc/ftrace: Fix assembly trampoline register usage + +From: roger blofeld + +commit fd5a42980e1cf327b7240adf5e7b51ea41c23437 upstream. + +Just like the module loader, ftrace needs to be updated to use r12 +instead of r11 with newer gcc's. + +Signed-off-by: Roger Blofeld +Signed-off-by: Benjamin Herrenschmidt +Signed-off-by: Paul Gortmaker +Signed-off-by: Greg Kroah-Hartman + +--- + arch/powerpc/kernel/ftrace.c | 12 ++++++------ + 1 file changed, 6 insertions(+), 6 deletions(-) + +--- a/arch/powerpc/kernel/ftrace.c ++++ b/arch/powerpc/kernel/ftrace.c +@@ -245,9 +245,9 @@ __ftrace_make_nop(struct module *mod, + + /* + * On PPC32 the trampoline looks like: +- * 0x3d, 0x60, 0x00, 0x00 lis r11,sym@ha +- * 0x39, 0x6b, 0x00, 0x00 addi r11,r11,sym@l +- * 0x7d, 0x69, 0x03, 0xa6 mtctr r11 ++ * 0x3d, 0x80, 0x00, 0x00 lis r12,sym@ha ++ * 0x39, 0x8c, 0x00, 0x00 addi r12,r12,sym@l ++ * 0x7d, 0x89, 0x03, 0xa6 mtctr r12 + * 0x4e, 0x80, 0x04, 0x20 bctr + */ + +@@ -262,9 +262,9 @@ __ftrace_make_nop(struct module *mod, + pr_devel(" %08x %08x ", jmp[0], jmp[1]); + + /* verify that this is what we expect it to be */ +- if (((jmp[0] & 0xffff0000) != 0x3d600000) || +- ((jmp[1] & 0xffff0000) != 0x396b0000) || +- (jmp[2] != 0x7d6903a6) || ++ if (((jmp[0] & 0xffff0000) != 0x3d800000) || ++ ((jmp[1] & 0xffff0000) != 0x398c0000) || ++ (jmp[2] != 0x7d8903a6) || + (jmp[3] != 0x4e800420)) { + printk(KERN_ERR "Not a trampoline\n"); + return -EINVAL; diff --git a/queue-3.0/series b/queue-3.0/series new file mode 100644 index 00000000000..e425f5e6f05 --- /dev/null +++ b/queue-3.0/series @@ -0,0 +1,4 @@ +mmc-sdhci-pci-cafe-has-broken-card-detection.patch +powerpc-ftrace-fix-assembly-trampoline-register-usage.patch +powerpc-add-memory-attribute-for-mfmsr.patch +powerpc-fix-wrong-divisor-in-usecs_to_cputime.patch -- 2.47.3