--- /dev/null
+From 61dd98fad58f945ed720ba132681acb58fcee015 Mon Sep 17 00:00:00 2001
+From: Adam Jackson <ajax@redhat.com>
+Date: Thu, 13 May 2010 14:55:28 -0400
+Subject: drm/edid: Fix 1024x768@85Hz
+
+From: Adam Jackson <ajax@redhat.com>
+
+commit 61dd98fad58f945ed720ba132681acb58fcee015 upstream.
+
+Having hsync both start and end on pixel 1072 ain't gonna work very
+well. Matches the X server's list.
+
+Signed-off-by: Adam Jackson <ajax@redhat.com>
+Tested-By: Michael Tokarev <mjt@tls.msk.ru>
+Signed-off-by: Dave Airlie <airlied@redhat.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+
+---
+ drivers/gpu/drm/drm_edid.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/drivers/gpu/drm/drm_edid.c
++++ b/drivers/gpu/drm/drm_edid.c
+@@ -335,7 +335,7 @@ static struct drm_display_mode drm_dmt_m
+ DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC) },
+ /* 1024x768@85Hz */
+ { DRM_MODE("1024x768", DRM_MODE_TYPE_DRIVER, 94500, 1024, 1072,
+- 1072, 1376, 0, 768, 769, 772, 808, 0,
++ 1168, 1376, 0, 768, 769, 772, 808, 0,
+ DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC) },
+ /* 1152x864@75Hz */
+ { DRM_MODE("1152x864", DRM_MODE_TYPE_DRIVER, 108000, 1152, 1216,
--- /dev/null
+From fb8b5a39b6310379d7b54c0c7113703a8eaf4a57 Mon Sep 17 00:00:00 2001
+From: Zhao Yakui <yakui.zhao@intel.com>
+Date: Wed, 7 Apr 2010 17:11:19 +0800
+Subject: drm/i915: Configure the TV sense state correctly on GM45 to make TV detection reliable
+
+From: Zhao Yakui <yakui.zhao@intel.com>
+
+commit fb8b5a39b6310379d7b54c0c7113703a8eaf4a57 upstream.
+
+The TV detection logic is not reliable on the Cantiga platform.
+Sometimes the TV will be misdetected as the following two cases:
+- TV is misdetected on some laptops. e.g. There is no TV connector
+port or no TV is attached. But the TV is shown as connected.
+- TV connector type is misdetected. e.g. the component TV is
+attached, but the TV is shown as S-video type.
+
+According to the hardware requirement, the TV sense state bits of TV DAC
+register should be cleared to zero on Cantiga platfrom.
+
+https://bugzilla.kernel.org/show_bug.cgi?id=14792
+
+Signed-off-by: Zhao Yakui <yakui.zhao@intel.com>
+Tested-by: Santi <santi@agolina.net>
+Signed-off-by: Zhenyu Wang <zhenyuw@linux.intel.com>
+Signed-off-by: Eric Anholt <eric@anholt.net>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+
+---
+ drivers/gpu/drm/i915/intel_tv.c | 9 +++++++++
+ 1 file changed, 9 insertions(+)
+
+--- a/drivers/gpu/drm/i915/intel_tv.c
++++ b/drivers/gpu/drm/i915/intel_tv.c
+@@ -1399,6 +1399,15 @@ intel_tv_detect_type (struct drm_crtc *c
+ DAC_A_0_7_V |
+ DAC_B_0_7_V |
+ DAC_C_0_7_V);
++
++ /*
++ * The TV sense state should be cleared to zero on cantiga platform. Otherwise
++ * the TV is misdetected. This is hardware requirement.
++ */
++ if (IS_GM45(dev))
++ tv_dac &= ~(TVDAC_STATE_CHG_EN | TVDAC_A_SENSE_CTL |
++ TVDAC_B_SENSE_CTL | TVDAC_C_SENSE_CTL);
++
+ I915_WRITE(TV_CTL, tv_ctl);
+ I915_WRITE(TV_DAC, tv_dac);
+ intel_wait_for_vblank(dev);
--- /dev/null
+From 1ff26a3604d0292988d4cade0e49ba9918dbfd46 Mon Sep 17 00:00:00 2001
+From: Alex Deucher <alexdeucher@gmail.com>
+Date: Tue, 18 May 2010 00:23:15 -0400
+Subject: drm/radeon/kms/atom: fix typo in LVDS panel info parsing
+
+From: Alex Deucher <alexdeucher@gmail.com>
+
+commit 1ff26a3604d0292988d4cade0e49ba9918dbfd46 upstream.
+
+Fixes LVDS issues on some laptops; notably laptops with
+2048x1536 panels.
+
+Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
+Signed-off-by: Dave Airlie <airlied@redhat.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+
+---
+ drivers/gpu/drm/radeon/radeon_atombios.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/drivers/gpu/drm/radeon/radeon_atombios.c
++++ b/drivers/gpu/drm/radeon/radeon_atombios.c
+@@ -1173,7 +1173,7 @@ struct radeon_encoder_atom_dig *radeon_a
+ lvds->native_mode.vtotal = lvds->native_mode.vdisplay +
+ le16_to_cpu(lvds_info->info.sLCDTiming.usVBlanking_Time);
+ lvds->native_mode.vsync_start = lvds->native_mode.vdisplay +
+- le16_to_cpu(lvds_info->info.sLCDTiming.usVSyncWidth);
++ le16_to_cpu(lvds_info->info.sLCDTiming.usVSyncOffset);
+ lvds->native_mode.vsync_end = lvds->native_mode.vsync_start +
+ le16_to_cpu(lvds_info->info.sLCDTiming.usVSyncWidth);
+ lvds->panel_pwr_delay =
--- /dev/null
+From 45737447ed160faaba036c0709226bf9057f7b72 Mon Sep 17 00:00:00 2001
+From: Alex Deucher <alexdeucher@gmail.com>
+Date: Thu, 20 May 2010 11:26:11 -0400
+Subject: drm/radeon/kms: don't default display priority to high on rs4xx
+
+From: Alex Deucher <alexdeucher@gmail.com>
+
+commit 45737447ed160faaba036c0709226bf9057f7b72 upstream.
+
+Seems to cause issues with the sound hardware. Fixes kernel
+bug 15982:
+https://bugzilla.kernel.org/show_bug.cgi?id=15982
+
+Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
+Signed-off-by: Dave Airlie <airlied@redhat.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+
+---
+ drivers/gpu/drm/radeon/radeon_display.c | 5 ++++-
+ 1 file changed, 4 insertions(+), 1 deletion(-)
+
+--- a/drivers/gpu/drm/radeon/radeon_display.c
++++ b/drivers/gpu/drm/radeon/radeon_display.c
+@@ -978,8 +978,11 @@ void radeon_update_display_priority(stru
+ /* set display priority to high for r3xx, rv515 chips
+ * this avoids flickering due to underflow to the
+ * display controllers during heavy acceleration.
++ * Don't force high on rs4xx igp chips as it seems to
++ * affect the sound card. See kernel bug 15982.
+ */
+- if (ASIC_IS_R300(rdev) || (rdev->family == CHIP_RV515))
++ if ((ASIC_IS_R300(rdev) || (rdev->family == CHIP_RV515)) &&
++ !(rdev->flags & RADEON_IS_IGP))
+ rdev->disp_priority = 2;
+ else
+ rdev->disp_priority = 0;
--- /dev/null
+From 10b06122afcc78468bd1d009633cb71e528acdc5 Mon Sep 17 00:00:00 2001
+From: Jerome Glisse <jglisse@redhat.com>
+Date: Fri, 21 May 2010 18:48:54 +0200
+Subject: drm/radeon/kms: release AGP bridge at suspend
+
+From: Jerome Glisse <jglisse@redhat.com>
+
+commit 10b06122afcc78468bd1d009633cb71e528acdc5 upstream.
+
+I think it's good to release the AGP bridge at suspend
+and reacquire it at resume. Also fix :
+https://bugzilla.kernel.org/show_bug.cgi?id=15969
+
+Signed-off-by: Jerome Glisse <jglisse@redhat.com>
+Signed-off-by: Dave Airlie <airlied@redhat.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+
+---
+ drivers/gpu/drm/radeon/radeon.h | 1 +
+ drivers/gpu/drm/radeon/radeon_agp.c | 5 +++++
+ drivers/gpu/drm/radeon/radeon_device.c | 2 ++
+ 3 files changed, 8 insertions(+)
+
+--- a/drivers/gpu/drm/radeon/radeon.h
++++ b/drivers/gpu/drm/radeon/radeon.h
+@@ -566,6 +566,7 @@ typedef int (*radeon_packet3_check_t)(st
+ */
+ int radeon_agp_init(struct radeon_device *rdev);
+ void radeon_agp_resume(struct radeon_device *rdev);
++void radeon_agp_suspend(struct radeon_device *rdev);
+ void radeon_agp_fini(struct radeon_device *rdev);
+
+
+--- a/drivers/gpu/drm/radeon/radeon_agp.c
++++ b/drivers/gpu/drm/radeon/radeon_agp.c
+@@ -270,3 +270,8 @@ void radeon_agp_fini(struct radeon_devic
+ }
+ #endif
+ }
++
++void radeon_agp_suspend(struct radeon_device *rdev)
++{
++ radeon_agp_fini(rdev);
++}
+--- a/drivers/gpu/drm/radeon/radeon_device.c
++++ b/drivers/gpu/drm/radeon/radeon_device.c
+@@ -748,6 +748,8 @@ int radeon_suspend_kms(struct drm_device
+ /* evict remaining vram memory */
+ radeon_bo_evict_vram(rdev);
+
++ radeon_agp_suspend(rdev);
++
+ pci_save_state(dev->pdev);
+ if (state.event == PM_EVENT_SUSPEND) {
+ /* Shut down the device */
--- /dev/null
+From 2bfcc0fc698d550689ef020c73b2d977b73e728c Mon Sep 17 00:00:00 2001
+From: Alex Deucher <alexdeucher@gmail.com>
+Date: Tue, 18 May 2010 19:26:46 -0400
+Subject: drm/radeon/kms: reset ddc_bus in object header parsing
+
+From: Alex Deucher <alexdeucher@gmail.com>
+
+commit 2bfcc0fc698d550689ef020c73b2d977b73e728c upstream.
+
+Some LVDS connectors don't have a ddc bus, so reset the
+ddc bus to invalid before parsing the next connector
+to avoid using stale ddc bus data. Should fix
+fdo bug 28164.
+
+Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
+Signed-off-by: Dave Airlie <airlied@redhat.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+
+---
+ drivers/gpu/drm/radeon/radeon_atombios.c | 5 ++---
+ 1 file changed, 2 insertions(+), 3 deletions(-)
+
+--- a/drivers/gpu/drm/radeon/radeon_atombios.c
++++ b/drivers/gpu/drm/radeon/radeon_atombios.c
+@@ -530,6 +530,8 @@ bool radeon_get_atom_connector_info_from
+ }
+
+ /* look up gpio for ddc, hpd */
++ ddc_bus.valid = false;
++ hpd.hpd = RADEON_HPD_NONE;
+ if ((le16_to_cpu(path->usDeviceTag) &
+ (ATOM_DEVICE_TV_SUPPORT | ATOM_DEVICE_CV_SUPPORT)) == 0) {
+ for (j = 0; j < con_obj->ucNumberOfObjects; j++) {
+@@ -585,9 +587,6 @@ bool radeon_get_atom_connector_info_from
+ break;
+ }
+ }
+- } else {
+- hpd.hpd = RADEON_HPD_NONE;
+- ddc_bus.valid = false;
+ }
+
+ /* needed for aux chan transactions */
--- /dev/null
+From 637a99022fb119b90fb281715d13172f0394fc12 Mon Sep 17 00:00:00 2001
+From: Jeff Mahoney <jeffm@suse.com>
+Date: Wed, 17 Mar 2010 10:55:51 +0000
+Subject: powerpc: Fix handling of strncmp with zero len
+
+From: Jeff Mahoney <jeffm@suse.com>
+
+commit 637a99022fb119b90fb281715d13172f0394fc12 upstream.
+
+Commit 0119536c, which added the assembly version of strncmp to
+powerpc, mentions that it adds two instructions to the version from
+boot/string.S to allow it to handle len=0. Unfortunately, it doesn't
+always return 0 when that is the case. The length is passed in r5, but
+the return value is passed back in r3. In certain cases, this will
+happen to work. Otherwise it will pass back the address of the first
+string as the return value.
+
+This patch lifts the len <= 0 handling code from memcpy to handle that
+case.
+
+Reported by: Christian_Sellars@symantec.com
+Signed-off-by: Jeff Mahoney <jeffm@suse.com>
+Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+
+---
+ arch/powerpc/lib/string.S | 4 +++-
+ 1 file changed, 3 insertions(+), 1 deletion(-)
+
+--- a/arch/powerpc/lib/string.S
++++ b/arch/powerpc/lib/string.S
+@@ -71,7 +71,7 @@ _GLOBAL(strcmp)
+
+ _GLOBAL(strncmp)
+ PPC_LCMPI r5,0
+- beqlr
++ ble- 2f
+ mtctr r5
+ addi r5,r3,-1
+ addi r4,r4,-1
+@@ -82,6 +82,8 @@ _GLOBAL(strncmp)
+ beqlr 1
+ bdnzt eq,1b
+ blr
++2: li r3,0
++ blr
+
+ _GLOBAL(strlen)
+ addi r4,r3,-1
--- /dev/null
+From 55052eeca6d71d76f7c3f156c0501814d8e5e6d3 Mon Sep 17 00:00:00 2001
+From: Benjamin Herrenschmidt <benh@kernel.crashing.org>
+Date: Wed, 7 Apr 2010 14:39:36 +1000
+Subject: powerpc: Fix ioremap_flags() with book3e pte definition
+
+From: Benjamin Herrenschmidt <benh@kernel.crashing.org>
+
+commit 55052eeca6d71d76f7c3f156c0501814d8e5e6d3 upstream.
+
+We can't just clear the user read permission in book3e pte, because
+that will also clear supervisor read permission. This surely isn't
+desired. Fix the problem by adding the supervisor read back.
+
+BenH: Slightly simplified the ifdef and applied to ppc64 too
+
+Signed-off-by: Li Yang <leoli@freescale.com>
+Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
+Cc: Kumar Gala <galak@kernel.crashing.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+
+---
+ arch/powerpc/mm/pgtable_32.c | 8 ++++++++
+ arch/powerpc/mm/pgtable_64.c | 8 ++++++++
+ 2 files changed, 16 insertions(+)
+
+--- a/arch/powerpc/mm/pgtable_32.c
++++ b/arch/powerpc/mm/pgtable_32.c
+@@ -146,6 +146,14 @@ ioremap_flags(phys_addr_t addr, unsigned
+ /* we don't want to let _PAGE_USER and _PAGE_EXEC leak out */
+ flags &= ~(_PAGE_USER | _PAGE_EXEC);
+
++#ifdef _PAGE_BAP_SR
++ /* _PAGE_USER contains _PAGE_BAP_SR on BookE using the new PTE format
++ * which means that we just cleared supervisor access... oops ;-) This
++ * restores it
++ */
++ flags |= _PAGE_BAP_SR;
++#endif
++
+ return __ioremap_caller(addr, size, flags, __builtin_return_address(0));
+ }
+ EXPORT_SYMBOL(ioremap_flags);
+--- a/arch/powerpc/mm/pgtable_64.c
++++ b/arch/powerpc/mm/pgtable_64.c
+@@ -265,6 +265,14 @@ void __iomem * ioremap_flags(phys_addr_t
+ /* we don't want to let _PAGE_USER and _PAGE_EXEC leak out */
+ flags &= ~(_PAGE_USER | _PAGE_EXEC);
+
++#ifdef _PAGE_BAP_SR
++ /* _PAGE_USER contains _PAGE_BAP_SR on BookE using the new PTE format
++ * which means that we just cleared supervisor access... oops ;-) This
++ * restores it
++ */
++ flags |= _PAGE_BAP_SR;
++#endif
++
+ if (ppc_md.ioremap)
+ return ppc_md.ioremap(addr, size, flags, caller);
+ return __ioremap_caller(addr, size, flags, caller);
--- /dev/null
+From 78e2e68a2b79f394b7cd61e07987a8a89af907f7 Mon Sep 17 00:00:00 2001
+From: Li Yang <leoli@freescale.com>
+Date: Fri, 7 May 2010 16:38:34 +0800
+Subject: powerpc/fsl-booke: Fix InstructionTLBError execute permission check
+
+From: Li Yang <leoli@freescale.com>
+
+commit 78e2e68a2b79f394b7cd61e07987a8a89af907f7 upstream.
+
+In CONFIG_PTE_64BIT the PTE format has unique permission bits for user
+and supervisor execute. However on !CONFIG_PTE_64BIT we overload the
+supervisor bit to imply user execute with _PAGE_USER set. This allows
+us to use the same permission check mask for user or supervisor code on
+!CONFIG_PTE_64BIT.
+
+However, on CONFIG_PTE_64BIT we map _PAGE_EXEC to _PAGE_BAP_UX so we
+need a different permission mask based on the fault coming from a kernel
+address or user space.
+
+Without unique permission masks we see issues like the following with
+modules:
+
+Unable to handle kernel paging request for instruction fetch
+Faulting instruction address: 0xf938d040
+Oops: Kernel access of bad area, sig: 11 [#1]
+
+Signed-off-by: Li Yang <leoli@freescale.com>
+Signed-off-by: Jin Qing <b24347@freescale.com>
+Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+
+---
+ arch/powerpc/kernel/head_fsl_booke.S | 13 ++++++++++---
+ 1 file changed, 10 insertions(+), 3 deletions(-)
+
+--- a/arch/powerpc/kernel/head_fsl_booke.S
++++ b/arch/powerpc/kernel/head_fsl_booke.S
+@@ -639,6 +639,13 @@ interrupt_base:
+ rlwinm r12,r12,0,16,1
+ mtspr SPRN_MAS1,r12
+
++ /* Make up the required permissions for kernel code */
++#ifdef CONFIG_PTE_64BIT
++ li r13,_PAGE_PRESENT | _PAGE_BAP_SX
++ oris r13,r13,_PAGE_ACCESSED@h
++#else
++ li r13,_PAGE_PRESENT | _PAGE_ACCESSED | _PAGE_EXEC
++#endif
+ b 4f
+
+ /* Get the PGD for the current thread */
+@@ -646,15 +653,15 @@ interrupt_base:
+ mfspr r11,SPRN_SPRG_THREAD
+ lwz r11,PGDIR(r11)
+
+-4:
+- /* Make up the required permissions */
++ /* Make up the required permissions for user code */
+ #ifdef CONFIG_PTE_64BIT
+- li r13,_PAGE_PRESENT | _PAGE_EXEC
++ li r13,_PAGE_PRESENT | _PAGE_BAP_UX
+ oris r13,r13,_PAGE_ACCESSED@h
+ #else
+ li r13,_PAGE_PRESENT | _PAGE_ACCESSED | _PAGE_EXEC
+ #endif
+
++4:
+ FIND_PTE
+ andc. r13,r13,r11 /* Check permission */
+
--- /dev/null
+From 78f622377f7d31d988db350a43c5689dd5f31876 Mon Sep 17 00:00:00 2001
+From: Kumar Gala <galak@kernel.crashing.org>
+Date: Thu, 13 May 2010 14:38:21 -0500
+Subject: powerpc/fsl-booke: Move loadcam_entry back to asm code to fix SMP ftrace
+
+From: Kumar Gala <galak@kernel.crashing.org>
+
+commit 78f622377f7d31d988db350a43c5689dd5f31876 upstream.
+
+When we build with ftrace enabled its possible that loadcam_entry would
+have used the stack pointer (even though the code doesn't need it). We
+call loadcam_entry in __secondary_start before the stack is setup. To
+ensure that loadcam_entry doesn't use the stack pointer the easiest
+solution is to just have it in asm code.
+
+Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+
+---
+ arch/powerpc/kernel/asm-offsets.c | 8 ++++++++
+ arch/powerpc/mm/fsl_booke_mmu.c | 25 +++----------------------
+ arch/powerpc/mm/mmu_decl.h | 8 ++++++++
+ arch/powerpc/mm/tlb_nohash_low.S | 28 ++++++++++++++++++++++++++++
+ 4 files changed, 47 insertions(+), 22 deletions(-)
+
+--- a/arch/powerpc/kernel/asm-offsets.c
++++ b/arch/powerpc/kernel/asm-offsets.c
+@@ -447,6 +447,14 @@ int main(void)
+ DEFINE(PGD_T_LOG2, PGD_T_LOG2);
+ DEFINE(PTE_T_LOG2, PTE_T_LOG2);
+ #endif
++#ifdef CONFIG_FSL_BOOKE
++ DEFINE(TLBCAM_SIZE, sizeof(struct tlbcam));
++ DEFINE(TLBCAM_MAS0, offsetof(struct tlbcam, MAS0));
++ DEFINE(TLBCAM_MAS1, offsetof(struct tlbcam, MAS1));
++ DEFINE(TLBCAM_MAS2, offsetof(struct tlbcam, MAS2));
++ DEFINE(TLBCAM_MAS3, offsetof(struct tlbcam, MAS3));
++ DEFINE(TLBCAM_MAS7, offsetof(struct tlbcam, MAS7));
++#endif
+
+ #ifdef CONFIG_KVM_EXIT_TIMING
+ DEFINE(VCPU_TIMING_EXIT_TBU, offsetof(struct kvm_vcpu,
+--- a/arch/powerpc/mm/fsl_booke_mmu.c
++++ b/arch/powerpc/mm/fsl_booke_mmu.c
+@@ -2,7 +2,7 @@
+ * Modifications by Kumar Gala (galak@kernel.crashing.org) to support
+ * E500 Book E processors.
+ *
+- * Copyright 2004 Freescale Semiconductor, Inc
++ * Copyright 2004,2010 Freescale Semiconductor, Inc.
+ *
+ * This file contains the routines for initializing the MMU
+ * on the 4xx series of chips.
+@@ -56,19 +56,13 @@
+
+ unsigned int tlbcam_index;
+
+-#define NUM_TLBCAMS (64)
+
+ #if defined(CONFIG_LOWMEM_CAM_NUM_BOOL) && (CONFIG_LOWMEM_CAM_NUM >= NUM_TLBCAMS)
+ #error "LOWMEM_CAM_NUM must be less than NUM_TLBCAMS"
+ #endif
+
+-struct tlbcam {
+- u32 MAS0;
+- u32 MAS1;
+- unsigned long MAS2;
+- u32 MAS3;
+- u32 MAS7;
+-} TLBCAM[NUM_TLBCAMS];
++#define NUM_TLBCAMS (64)
++struct tlbcam TLBCAM[NUM_TLBCAMS];
+
+ struct tlbcamrange {
+ unsigned long start;
+@@ -109,19 +103,6 @@ unsigned long p_mapped_by_tlbcam(phys_ad
+ return 0;
+ }
+
+-void loadcam_entry(int idx)
+-{
+- mtspr(SPRN_MAS0, TLBCAM[idx].MAS0);
+- mtspr(SPRN_MAS1, TLBCAM[idx].MAS1);
+- mtspr(SPRN_MAS2, TLBCAM[idx].MAS2);
+- mtspr(SPRN_MAS3, TLBCAM[idx].MAS3);
+-
+- if (mmu_has_feature(MMU_FTR_BIG_PHYS))
+- mtspr(SPRN_MAS7, TLBCAM[idx].MAS7);
+-
+- asm volatile("isync;tlbwe;isync" : : : "memory");
+-}
+-
+ /*
+ * Set up one of the I/D BAT (block address translation) register pairs.
+ * The parameters are not checked; in particular size must be a power
+--- a/arch/powerpc/mm/mmu_decl.h
++++ b/arch/powerpc/mm/mmu_decl.h
+@@ -149,7 +149,15 @@ extern unsigned long mmu_mapin_ram(unsig
+ extern void MMU_init_hw(void);
+ extern unsigned long mmu_mapin_ram(unsigned long top);
+ extern void adjust_total_lowmem(void);
++extern void loadcam_entry(unsigned int index);
+
++struct tlbcam {
++ u32 MAS0;
++ u32 MAS1;
++ unsigned long MAS2;
++ u32 MAS3;
++ u32 MAS7;
++};
+ #elif defined(CONFIG_PPC32)
+ /* anything 32-bit except 4xx or 8xx */
+ extern void MMU_init_hw(void);
+--- a/arch/powerpc/mm/tlb_nohash_low.S
++++ b/arch/powerpc/mm/tlb_nohash_low.S
+@@ -271,3 +271,31 @@ _GLOBAL(set_context)
+ #else
+ #error Unsupported processor type !
+ #endif
++
++#if defined(CONFIG_FSL_BOOKE)
++/*
++ * extern void loadcam_entry(unsigned int index)
++ *
++ * Load TLBCAM[index] entry in to the L2 CAM MMU
++ */
++_GLOBAL(loadcam_entry)
++ LOAD_REG_ADDR(r4, TLBCAM)
++ mulli r5,r3,TLBCAM_SIZE
++ add r3,r5,r4
++ lwz r4,TLBCAM_MAS0(r3)
++ mtspr SPRN_MAS0,r4
++ lwz r4,TLBCAM_MAS1(r3)
++ mtspr SPRN_MAS1,r4
++ PPC_LL r4,TLBCAM_MAS2(r3)
++ mtspr SPRN_MAS2,r4
++ lwz r4,TLBCAM_MAS3(r3)
++ mtspr SPRN_MAS3,r4
++BEGIN_MMU_FTR_SECTION
++ lwz r4,TLBCAM_MAS7(r3)
++ mtspr SPRN_MAS7,r4
++END_MMU_FTR_SECTION_IFSET(MMU_FTR_BIG_PHYS)
++ isync
++ tlbwe
++ isync
++ blr
++#endif
--- /dev/null
+From 238c1a78c957f3dc7cb848b161dcf4805793ed56 Mon Sep 17 00:00:00 2001
+From: Denis Kirjanov <dkirjanov@hera.kernel.org>
+Date: Tue, 1 Jun 2010 15:43:34 -0400
+Subject: powerpc/oprofile: fix potential buffer overrun in op_model_cell.c
+
+From: Denis Kirjanov <dkirjanov@hera.kernel.org>
+
+commit 238c1a78c957f3dc7cb848b161dcf4805793ed56 upstream.
+
+Fix potential initial_lfsr buffer overrun.
+Writing past the end of the buffer could happen when index == ENTRIES
+
+Signed-off-by: Denis Kirjanov <dkirjanov@kernel.org>
+Signed-off-by: Robert Richter <robert.richter@amd.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+
+---
+ arch/powerpc/oprofile/op_model_cell.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/arch/powerpc/oprofile/op_model_cell.c
++++ b/arch/powerpc/oprofile/op_model_cell.c
+@@ -1077,7 +1077,7 @@ static int calculate_lfsr(int n)
+ index = ENTRIES-1;
+
+ /* make sure index is valid */
+- if ((index > ENTRIES) || (index < 0))
++ if ((index >= ENTRIES) || (index < 0))
+ index = ENTRIES-1;
+
+ return initial_lfsr[index];
--- /dev/null
+From f8b67691828321f5c85bb853283aa101ae673130 Mon Sep 17 00:00:00 2001
+From: Michael Neuling <mikey@neuling.org>
+Date: Wed, 28 Apr 2010 13:39:41 +0000
+Subject: powerpc/pseries: Make query_cpu_stopped callable outside hotplug cpu
+
+From: Michael Neuling <mikey@neuling.org>
+
+commit f8b67691828321f5c85bb853283aa101ae673130 upstream.
+
+This moves query_cpu_stopped() out of the hotplug cpu code and into
+smp.c so it can called in other places and renames it to
+smp_query_cpu_stopped().
+
+It also cleans up the return values by adding some #defines
+
+Signed-off-by: Michael Neuling <mikey@neuling.org>
+Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+
+---
+ arch/powerpc/platforms/pseries/hotplug-cpu.c | 30 +++---------------------
+ arch/powerpc/platforms/pseries/plpar_wrappers.h | 8 ++++++
+ arch/powerpc/platforms/pseries/smp.c | 22 +++++++++++++++++
+ 3 files changed, 34 insertions(+), 26 deletions(-)
+
+--- a/arch/powerpc/platforms/pseries/hotplug-cpu.c
++++ b/arch/powerpc/platforms/pseries/hotplug-cpu.c
+@@ -154,30 +154,6 @@ static void pseries_mach_cpu_die(void)
+ for(;;);
+ }
+
+-static int qcss_tok; /* query-cpu-stopped-state token */
+-
+-/* Get state of physical CPU.
+- * Return codes:
+- * 0 - The processor is in the RTAS stopped state
+- * 1 - stop-self is in progress
+- * 2 - The processor is not in the RTAS stopped state
+- * -1 - Hardware Error
+- * -2 - Hardware Busy, Try again later.
+- */
+-static int query_cpu_stopped(unsigned int pcpu)
+-{
+- int cpu_status, status;
+-
+- status = rtas_call(qcss_tok, 1, 2, &cpu_status, pcpu);
+- if (status != 0) {
+- printk(KERN_ERR
+- "RTAS query-cpu-stopped-state failed: %i\n", status);
+- return status;
+- }
+-
+- return cpu_status;
+-}
+-
+ static int pseries_cpu_disable(void)
+ {
+ int cpu = smp_processor_id();
+@@ -224,8 +200,9 @@ static void pseries_cpu_die(unsigned int
+ } else if (get_preferred_offline_state(cpu) == CPU_STATE_OFFLINE) {
+
+ for (tries = 0; tries < 25; tries++) {
+- cpu_status = query_cpu_stopped(pcpu);
+- if (cpu_status == 0 || cpu_status == -1)
++ cpu_status = smp_query_cpu_stopped(pcpu);
++ if (cpu_status == QCSS_STOPPED ||
++ cpu_status == QCSS_HARDWARE_ERROR)
+ break;
+ cpu_relax();
+ }
+@@ -388,6 +365,7 @@ static int __init pseries_cpu_hotplug_in
+ struct device_node *np;
+ const char *typep;
+ int cpu;
++ int qcss_tok;
+
+ for_each_node_by_name(np, "interrupt-controller") {
+ typep = of_get_property(np, "compatible", NULL);
+--- a/arch/powerpc/platforms/pseries/plpar_wrappers.h
++++ b/arch/powerpc/platforms/pseries/plpar_wrappers.h
+@@ -4,6 +4,14 @@
+ #include <asm/hvcall.h>
+ #include <asm/page.h>
+
++/* Get state of physical CPU from query_cpu_stopped */
++int smp_query_cpu_stopped(unsigned int pcpu);
++#define QCSS_STOPPED 0
++#define QCSS_STOPPING 1
++#define QCSS_NOT_STOPPED 2
++#define QCSS_HARDWARE_ERROR -1
++#define QCSS_HARDWARE_BUSY -2
++
+ static inline long poll_pending(void)
+ {
+ return plpar_hcall_norets(H_POLL_PENDING);
+--- a/arch/powerpc/platforms/pseries/smp.c
++++ b/arch/powerpc/platforms/pseries/smp.c
+@@ -57,6 +57,28 @@
+ */
+ static cpumask_t of_spin_map;
+
++/* Query where a cpu is now. Return codes #defined in plpar_wrappers.h */
++int smp_query_cpu_stopped(unsigned int pcpu)
++{
++ int cpu_status, status;
++ int qcss_tok = rtas_token("query-cpu-stopped-state");
++
++ if (qcss_tok == RTAS_UNKNOWN_SERVICE) {
++ printk(KERN_INFO "Firmware doesn't support "
++ "query-cpu-stopped-state\n");
++ return QCSS_HARDWARE_ERROR;
++ }
++
++ status = rtas_call(qcss_tok, 1, 2, &cpu_status, pcpu);
++ if (status != 0) {
++ printk(KERN_ERR
++ "RTAS query-cpu-stopped-state failed: %i\n", status);
++ return status;
++ }
++
++ return cpu_status;
++}
++
+ /**
+ * smp_startup_cpu() - start the given cpu
+ *
--- /dev/null
+From aef40e87d866355ffd279ab21021de733242d0d5 Mon Sep 17 00:00:00 2001
+From: Michael Neuling <mikey@neuling.org>
+Date: Wed, 28 Apr 2010 13:39:41 +0000
+Subject: powerpc/pseries: Only call start-cpu when a CPU is stopped
+
+From: Michael Neuling <mikey@neuling.org>
+
+commit aef40e87d866355ffd279ab21021de733242d0d5 upstream.
+
+Currently we always call start-cpu irrespective of if the CPU is
+stopped or not. Unfortunatley on POWER7, firmware seems to not like
+start-cpu being called when a cpu already been started. This was not
+the case on POWER6 and earlier.
+
+This patch checks to see if the CPU is stopped or not via an
+query-cpu-stopped-state call, and only calls start-cpu on CPUs which
+are stopped.
+
+This fixes a bug with kexec on POWER7 on PHYP where only the primary
+thread would make it to the second kernel.
+
+Reported-by: Ankita Garg <ankita@linux.vnet.ibm.com>
+Signed-off-by: Michael Neuling <mikey@neuling.org>
+Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+
+---
+ arch/powerpc/platforms/pseries/smp.c | 6 ++++++
+ 1 file changed, 6 insertions(+)
+
+--- a/arch/powerpc/platforms/pseries/smp.c
++++ b/arch/powerpc/platforms/pseries/smp.c
+@@ -82,6 +82,12 @@ static inline int __devinit smp_startup_
+
+ pcpu = get_hard_smp_processor_id(lcpu);
+
++ /* Check to see if the CPU out of FW already for kexec */
++ if (smp_query_cpu_stopped(pcpu) == QCSS_NOT_STOPPED){
++ cpu_set(lcpu, of_spin_map);
++ return 1;
++ }
++
+ /* Fixup atomic count: it exited inside IRQ handler. */
+ task_thread_info(paca[lcpu].__current)->preempt_count = 0;
+
can-fix-sja1000-command-register-writes-on-smp-systems.patch
pci-quirks-disable-msi-on-amd-rs4xx-internal-gfx-bridges.patch
pci-disable-msi-for-mcp55-on-p5n32-e-sli.patch
+drm-radeon-kms-don-t-default-display-priority-to-high-on-rs4xx.patch
+drm-edid-fix-1024x768-85hz.patch
+drm-radeon-kms-reset-ddc_bus-in-object-header-parsing.patch
+drm-radeon-kms-atom-fix-typo-in-lvds-panel-info-parsing.patch
+drm-i915-configure-the-tv-sense-state-correctly-on-gm45-to-make-tv-detection-reliable.patch
+drm-radeon-kms-release-agp-bridge-at-suspend.patch
+powerpc-fix-handling-of-strncmp-with-zero-len.patch
+powerpc-pseries-only-call-start-cpu-when-a-cpu-is-stopped.patch
+powerpc-pseries-make-query_cpu_stopped-callable-outside-hotplug-cpu.patch
+powerpc-fix-ioremap_flags-with-book3e-pte-definition.patch
+powerpc-fsl-booke-fix-instructiontlberror-execute-permission-check.patch
+powerpc-fsl-booke-move-loadcam_entry-back-to-asm-code-to-fix-smp-ftrace.patch
+powerpc-oprofile-fix-potential-buffer-overrun-in-op_model_cell.c.patch
+writeback-disable-periodic-old-data-writeback-for-dirty_writeback_centisecs.patch
--- /dev/null
+From 69b62d01ec44fe0d505d89917392347732135a4d Mon Sep 17 00:00:00 2001
+From: Jens Axboe <jens.axboe@oracle.com>
+Date: Mon, 17 May 2010 12:51:03 +0200
+Subject: writeback: disable periodic old data writeback for !dirty_writeback_centisecs
+
+From: Jens Axboe <jens.axboe@oracle.com>
+
+commit 69b62d01ec44fe0d505d89917392347732135a4d upstream.
+
+Prior to 2.6.32, setting /proc/sys/vm/dirty_writeback_centisecs disabled
+periodic dirty writeback from kupdate. This got broken and now causes
+excessive sys CPU usage if set to zero, as we'll keep beating on
+schedule().
+
+Reported-by: Justin Maggard <jmaggard10@gmail.com>
+Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+
+---
+ fs/fs-writeback.c | 14 ++++++++++++--
+ 1 file changed, 12 insertions(+), 2 deletions(-)
+
+--- a/fs/fs-writeback.c
++++ b/fs/fs-writeback.c
+@@ -852,6 +852,12 @@ static long wb_check_old_data_flush(stru
+ unsigned long expired;
+ long nr_pages;
+
++ /*
++ * When set to zero, disable periodic writeback
++ */
++ if (!dirty_writeback_interval)
++ return 0;
++
+ expired = wb->last_old_flush +
+ msecs_to_jiffies(dirty_writeback_interval * 10);
+ if (time_before(jiffies, expired))
+@@ -947,8 +953,12 @@ int bdi_writeback_task(struct bdi_writeb
+ break;
+ }
+
+- wait_jiffies = msecs_to_jiffies(dirty_writeback_interval * 10);
+- schedule_timeout_interruptible(wait_jiffies);
++ if (dirty_writeback_interval) {
++ wait_jiffies = msecs_to_jiffies(dirty_writeback_interval * 10);
++ schedule_timeout_interruptible(wait_jiffies);
++ } else
++ schedule();
++
+ try_to_freeze();
+ }
+