From e0a44d98b19880575334efd57095f29400f74af6 Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Thu, 17 Feb 2011 19:14:11 -0800 Subject: [PATCH] .37 patches --- ...dd-missing-frac-fb-div-flag-for-dce4.patch | 51 ++++++++++++++ ...te-map_count-in-mac-partition-tables.patch | 66 +++++++++++++++++++ ...ror-code-when-alloc_image_page-fails.patch | 47 +++++++++++++ queue-2.6.37/series | 4 ++ ...timer-irq-affinity-for-secondary-cpu.patch | 47 +++++++++++++ 5 files changed, 215 insertions(+) create mode 100644 queue-2.6.37/drm-radeon-kms-add-missing-frac-fb-div-flag-for-dce4.patch create mode 100644 queue-2.6.37/fs-partitions-validate-map_count-in-mac-partition-tables.patch create mode 100644 queue-2.6.37/pm-hibernate-return-error-code-when-alloc_image_page-fails.patch create mode 100644 queue-2.6.37/x86-mrst-set-correct-apb-timer-irq-affinity-for-secondary-cpu.patch diff --git a/queue-2.6.37/drm-radeon-kms-add-missing-frac-fb-div-flag-for-dce4.patch b/queue-2.6.37/drm-radeon-kms-add-missing-frac-fb-div-flag-for-dce4.patch new file mode 100644 index 00000000000..b3dfdc28575 --- /dev/null +++ b/queue-2.6.37/drm-radeon-kms-add-missing-frac-fb-div-flag-for-dce4.patch @@ -0,0 +1,51 @@ +From 9f4283f49f0a96a64c5a45fe56f0f8c942885eef Mon Sep 17 00:00:00 2001 +From: Alex Deucher +Date: Wed, 16 Feb 2011 21:17:04 -0500 +Subject: drm/radeon/kms: add missing frac fb div flag for dce4+ + +From: Alex Deucher + +commit 9f4283f49f0a96a64c5a45fe56f0f8c942885eef upstream. + +The fixed ref/post dividers are set by the AdjustPll table +rather than the ss info table on dce4+. Make sure we enable +the fractional feedback dividers when using a fixed post +or ref divider on them as well. + +Fixes: +https://bugzilla.kernel.org/show_bug.cgi?id=29272 + +Signed-off-by: Alex Deucher +Signed-off-by: Dave Airlie +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/gpu/drm/radeon/atombios_crtc.c | 4 +++- + 1 file changed, 3 insertions(+), 1 deletion(-) + +--- a/drivers/gpu/drm/radeon/atombios_crtc.c ++++ b/drivers/gpu/drm/radeon/atombios_crtc.c +@@ -533,9 +533,9 @@ static u32 atombios_adjust_pll(struct dr + + /* use recommended ref_div for ss */ + if (radeon_encoder->devices & (ATOM_DEVICE_LCD_SUPPORT)) { +- pll->flags |= RADEON_PLL_PREFER_MINM_OVER_MAXP; + if (ss_enabled) { + if (ss->refdiv) { ++ pll->flags |= RADEON_PLL_PREFER_MINM_OVER_MAXP; + pll->flags |= RADEON_PLL_USE_REF_DIV; + pll->reference_div = ss->refdiv; + if (ASIC_IS_AVIVO(rdev)) +@@ -650,10 +650,12 @@ static u32 atombios_adjust_pll(struct dr + index, (uint32_t *)&args); + adjusted_clock = le32_to_cpu(args.v3.sOutput.ulDispPllFreq) * 10; + if (args.v3.sOutput.ucRefDiv) { ++ pll->flags |= RADEON_PLL_USE_FRAC_FB_DIV; + pll->flags |= RADEON_PLL_USE_REF_DIV; + pll->reference_div = args.v3.sOutput.ucRefDiv; + } + if (args.v3.sOutput.ucPostDiv) { ++ pll->flags |= RADEON_PLL_USE_FRAC_FB_DIV; + pll->flags |= RADEON_PLL_USE_POST_DIV; + pll->post_div = args.v3.sOutput.ucPostDiv; + } diff --git a/queue-2.6.37/fs-partitions-validate-map_count-in-mac-partition-tables.patch b/queue-2.6.37/fs-partitions-validate-map_count-in-mac-partition-tables.patch new file mode 100644 index 00000000000..d22c3d1a1c2 --- /dev/null +++ b/queue-2.6.37/fs-partitions-validate-map_count-in-mac-partition-tables.patch @@ -0,0 +1,66 @@ +From fa7ea87a057958a8b7926c1a60a3ca6d696328ed Mon Sep 17 00:00:00 2001 +From: Timo Warns +Date: Thu, 17 Feb 2011 22:27:40 +0100 +Subject: fs/partitions: Validate map_count in Mac partition tables + +From: Timo Warns + +commit fa7ea87a057958a8b7926c1a60a3ca6d696328ed upstream. + +Validate number of blocks in map and remove redundant variable. + +Signed-off-by: Timo Warns +Signed-off-by: Linus Torvalds +Signed-off-by: Greg Kroah-Hartman + +--- + fs/partitions/mac.c | 17 +++++++++-------- + 1 file changed, 9 insertions(+), 8 deletions(-) + +--- a/fs/partitions/mac.c ++++ b/fs/partitions/mac.c +@@ -29,10 +29,9 @@ static inline void mac_fix_string(char * + + int mac_partition(struct parsed_partitions *state) + { +- int slot = 1; + Sector sect; + unsigned char *data; +- int blk, blocks_in_map; ++ int slot, blocks_in_map; + unsigned secsize; + #ifdef CONFIG_PPC_PMAC + int found_root = 0; +@@ -59,10 +58,14 @@ int mac_partition(struct parsed_partitio + put_dev_sector(sect); + return 0; /* not a MacOS disk */ + } +- strlcat(state->pp_buf, " [mac]", PAGE_SIZE); + blocks_in_map = be32_to_cpu(part->map_count); +- for (blk = 1; blk <= blocks_in_map; ++blk) { +- int pos = blk * secsize; ++ if (blocks_in_map < 0 || blocks_in_map >= DISK_MAX_PARTS) { ++ put_dev_sector(sect); ++ return 0; ++ } ++ strlcat(state->pp_buf, " [mac]", PAGE_SIZE); ++ for (slot = 1; slot <= blocks_in_map; ++slot) { ++ int pos = slot * secsize; + put_dev_sector(sect); + data = read_part_sector(state, pos/512, §); + if (!data) +@@ -113,13 +116,11 @@ int mac_partition(struct parsed_partitio + } + + if (goodness > found_root_goodness) { +- found_root = blk; ++ found_root = slot; + found_root_goodness = goodness; + } + } + #endif /* CONFIG_PPC_PMAC */ +- +- ++slot; + } + #ifdef CONFIG_PPC_PMAC + if (found_root_goodness) diff --git a/queue-2.6.37/pm-hibernate-return-error-code-when-alloc_image_page-fails.patch b/queue-2.6.37/pm-hibernate-return-error-code-when-alloc_image_page-fails.patch new file mode 100644 index 00000000000..6742073436a --- /dev/null +++ b/queue-2.6.37/pm-hibernate-return-error-code-when-alloc_image_page-fails.patch @@ -0,0 +1,47 @@ +From 2e725a065b0153f0c449318da1923a120477633d Mon Sep 17 00:00:00 2001 +From: Stanislaw Gruszka +Date: Sat, 12 Feb 2011 21:06:51 +0100 +Subject: PM / Hibernate: Return error code when alloc_image_page() fails + +From: Stanislaw Gruszka + +commit 2e725a065b0153f0c449318da1923a120477633d upstream. + +Currently we return 0 in swsusp_alloc() when alloc_image_page() fails. +Fix that. Also remove unneeded "error" variable since the only +useful value of error is -ENOMEM. + +[rjw: Fixed up the changelog and changed subject.] + +Signed-off-by: Stanislaw Gruszka +Signed-off-by: Rafael J. Wysocki +Signed-off-by: Greg Kroah-Hartman + +--- + kernel/power/snapshot.c | 7 ++----- + 1 file changed, 2 insertions(+), 5 deletions(-) + +--- a/kernel/power/snapshot.c ++++ b/kernel/power/snapshot.c +@@ -1519,11 +1519,8 @@ static int + swsusp_alloc(struct memory_bitmap *orig_bm, struct memory_bitmap *copy_bm, + unsigned int nr_pages, unsigned int nr_highmem) + { +- int error = 0; +- + if (nr_highmem > 0) { +- error = get_highmem_buffer(PG_ANY); +- if (error) ++ if (get_highmem_buffer(PG_ANY)) + goto err_out; + if (nr_highmem > alloc_highmem) { + nr_highmem -= alloc_highmem; +@@ -1546,7 +1543,7 @@ swsusp_alloc(struct memory_bitmap *orig_ + + err_out: + swsusp_free(); +- return error; ++ return -ENOMEM; + } + + asmlinkage int swsusp_save(void) diff --git a/queue-2.6.37/series b/queue-2.6.37/series index 16769152e86..b00e8083465 100644 --- a/queue-2.6.37/series +++ b/queue-2.6.37/series @@ -32,3 +32,7 @@ acpi-wakeup-enable-button-gpes-unconditionally-during-initialization.patch nfsd-correctly-handle-return-value-from-nfsd_map_name_to_.patch x86-hotplug-fix-powersavings-with-offlined-cores-on-amd.patch s390-remove-task_show_regs.patch +x86-mrst-set-correct-apb-timer-irq-affinity-for-secondary-cpu.patch +pm-hibernate-return-error-code-when-alloc_image_page-fails.patch +drm-radeon-kms-add-missing-frac-fb-div-flag-for-dce4.patch +fs-partitions-validate-map_count-in-mac-partition-tables.patch diff --git a/queue-2.6.37/x86-mrst-set-correct-apb-timer-irq-affinity-for-secondary-cpu.patch b/queue-2.6.37/x86-mrst-set-correct-apb-timer-irq-affinity-for-secondary-cpu.patch new file mode 100644 index 00000000000..85cd33843d7 --- /dev/null +++ b/queue-2.6.37/x86-mrst-set-correct-apb-timer-irq-affinity-for-secondary-cpu.patch @@ -0,0 +1,47 @@ +From jacob.jun.pan@linux.intel.com Thu Feb 17 19:06:50 2011 +From: jacob.jun.pan@linux.intel.com +Date: Thu, 17 Feb 2011 16:58:21 -0800 +Subject: x86, mrst: Set correct APB timer IRQ affinity for secondary cpu +To: , +Cc: "H. Peter Anvin" , Jacob Pan +Message-ID: <1297990701-12440-1-git-send-email-jacob.jun.pan@linux.intel.com> + +From: Jacob Pan + +This is a backport for 2.6.37 stable. The original commit ID is +6550904ddbc3c286798a87edf95eeebcc62bc58a + +Offlining the secondary CPU causes the timer irq affinity to be set to +CPU 0. When the secondary CPU is back online again, the wrong irq +affinity will be used. + +This patch ensures secondary per CPU timer always has the correct +IRQ affinity when enabled. + +Signed-off-by: Jacob Pan +LKML-Reference: <1294963604-18111-1-git-send-email-jacob.jun.pan@linux.intel.com> +Signed-off-by: H. Peter Anvin +Signed-off-by: Greg Kroah-Hartman + +--- + arch/x86/kernel/apb_timer.c | 8 +++++--- + 1 file changed, 5 insertions(+), 3 deletions(-) + +--- a/arch/x86/kernel/apb_timer.c ++++ b/arch/x86/kernel/apb_timer.c +@@ -313,10 +313,12 @@ static void apbt_setup_irq(struct apbt_d + if (adev->irq == 0) + return; + ++ irq_modify_status(adev->irq, 0, IRQ_MOVE_PCNTXT); ++ irq_set_affinity(adev->irq, cpumask_of(adev->cpu)); ++ /* APB timer irqs are set up as mp_irqs, timer is edge type */ ++ __set_irq_handler(adev->irq, handle_edge_irq, 0, "edge"); ++ + if (system_state == SYSTEM_BOOTING) { +- irq_modify_status(adev->irq, 0, IRQ_MOVE_PCNTXT); +- /* APB timer irqs are set up as mp_irqs, timer is edge type */ +- __set_irq_handler(adev->irq, handle_edge_irq, 0, "edge"); + if (request_irq(adev->irq, apbt_interrupt_handler, + IRQF_TIMER | IRQF_DISABLED | IRQF_NOBALANCING, + adev->name, adev)) { -- 2.47.3