From df46e0d6cde26f61b0f23055c2f52c7d3764c96a Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Tue, 10 Jul 2012 16:56:39 -0700 Subject: [PATCH] 3.4-stable patches added patches: acpi-add-a-quirk-for-amilo-pro-v2030-to-ignore-the-timer-overriding.patch acpi-apei-avoid-too-much-error-reporting-in-runtime.patch acpi_pad-fix-power_saving-thread-deadlock.patch acpi-video-still-use-acpi-backlight-control-if-_dos-doesn-t-exist.patch btrfs-run-delayed-directory-updates-during-log-replay.patch drm-edid-don-t-return-stack-garbage-from-supports_rb.patch drm-i915-fix-edp-blank-screen-after-s3-resume-on-hp-desktops.patch drm-nouveau-fbcon-using-nv_two_heads-is-not-a-good-idea.patch drm-radeon-fix-vm-page-table-setup-on-si.patch --- ...v2030-to-ignore-the-timer-overriding.patch | 44 +++++++ ...-too-much-error-reporting-in-runtime.patch | 124 ++++++++++++++++++ ...klight-control-if-_dos-doesn-t-exist.patch | 39 ++++++ ...pad-fix-power_saving-thread-deadlock.patch | 64 +++++++++ ...-directory-updates-during-log-replay.patch | 54 ++++++++ ...eturn-stack-garbage-from-supports_rb.patch | 34 +++++ ...creen-after-s3-resume-on-hp-desktops.patch | 43 ++++++ ...sing-nv_two_heads-is-not-a-good-idea.patch | 40 ++++++ ...radeon-fix-vm-page-table-setup-on-si.patch | 80 +++++++++++ queue-3.4/series | 9 ++ 10 files changed, 531 insertions(+) create mode 100644 queue-3.4/acpi-add-a-quirk-for-amilo-pro-v2030-to-ignore-the-timer-overriding.patch create mode 100644 queue-3.4/acpi-apei-avoid-too-much-error-reporting-in-runtime.patch create mode 100644 queue-3.4/acpi-video-still-use-acpi-backlight-control-if-_dos-doesn-t-exist.patch create mode 100644 queue-3.4/acpi_pad-fix-power_saving-thread-deadlock.patch create mode 100644 queue-3.4/btrfs-run-delayed-directory-updates-during-log-replay.patch create mode 100644 queue-3.4/drm-edid-don-t-return-stack-garbage-from-supports_rb.patch create mode 100644 queue-3.4/drm-i915-fix-edp-blank-screen-after-s3-resume-on-hp-desktops.patch create mode 100644 queue-3.4/drm-nouveau-fbcon-using-nv_two_heads-is-not-a-good-idea.patch create mode 100644 queue-3.4/drm-radeon-fix-vm-page-table-setup-on-si.patch diff --git a/queue-3.4/acpi-add-a-quirk-for-amilo-pro-v2030-to-ignore-the-timer-overriding.patch b/queue-3.4/acpi-add-a-quirk-for-amilo-pro-v2030-to-ignore-the-timer-overriding.patch new file mode 100644 index 00000000000..7d5c548c391 --- /dev/null +++ b/queue-3.4/acpi-add-a-quirk-for-amilo-pro-v2030-to-ignore-the-timer-overriding.patch @@ -0,0 +1,44 @@ +From f6b54f083cc66cf9b11d2120d8df3c2ad4e0836d Mon Sep 17 00:00:00 2001 +From: Feng Tang +Date: Mon, 4 Jun 2012 15:00:06 +0800 +Subject: ACPI: Add a quirk for "AMILO PRO V2030" to ignore the timer overriding + +From: Feng Tang + +commit f6b54f083cc66cf9b11d2120d8df3c2ad4e0836d upstream. + +This is the 2nd part of fix for kernel bugzilla 40002: + "IRQ 0 assigned to VGA" +https://bugzilla.kernel.org/show_bug.cgi?id=40002 + +The root cause is the buggy FW, whose ACPI tables assign the GSI 16 +to 2 irqs 0 and 16(VGA), and the VGA is the right owner of GSI 16. +So add a quirk to ignore the irq0 overriding GSI 16 for the +FUJITSU SIEMENS AMILO PRO V2030 platform will solve this issue. + +Reported-and-tested-by: Szymon Kowalczyk +Signed-off-by: Feng Tang +Signed-off-by: Len Brown +Signed-off-by: Greg Kroah-Hartman + +--- + arch/x86/kernel/acpi/boot.c | 8 ++++++++ + 1 file changed, 8 insertions(+) + +--- a/arch/x86/kernel/acpi/boot.c ++++ b/arch/x86/kernel/acpi/boot.c +@@ -1473,6 +1473,14 @@ static struct dmi_system_id __initdata a + DMI_MATCH(DMI_PRODUCT_NAME, "HP Compaq 6715b"), + }, + }, ++ { ++ .callback = dmi_ignore_irq0_timer_override, ++ .ident = "FUJITSU SIEMENS", ++ .matches = { ++ DMI_MATCH(DMI_SYS_VENDOR, "FUJITSU SIEMENS"), ++ DMI_MATCH(DMI_PRODUCT_NAME, "AMILO PRO V2030"), ++ }, ++ }, + {} + }; + diff --git a/queue-3.4/acpi-apei-avoid-too-much-error-reporting-in-runtime.patch b/queue-3.4/acpi-apei-avoid-too-much-error-reporting-in-runtime.patch new file mode 100644 index 00000000000..1ea621021d4 --- /dev/null +++ b/queue-3.4/acpi-apei-avoid-too-much-error-reporting-in-runtime.patch @@ -0,0 +1,124 @@ +From 34ddeb035d704eafdcdb3cbc781894300136c3c4 Mon Sep 17 00:00:00 2001 +From: Huang Ying +Date: Tue, 12 Jun 2012 11:20:19 +0800 +Subject: ACPI, APEI, Avoid too much error reporting in runtime + +From: Huang Ying + +commit 34ddeb035d704eafdcdb3cbc781894300136c3c4 upstream. + +This patch fixed the following bug. + +https://bugzilla.kernel.org/show_bug.cgi?id=43282 + +This is caused by a firmware bug checking (checking generic address +register provided by firmware) in runtime. The checking should be +done in address mapping time instead of runtime to avoid too much +error reporting in runtime. + +Reported-by: Pawel Sikora +Signed-off-by: Huang Ying +Tested-by: Jean Delvare +Signed-off-by: Len Brown +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/acpi/apei/apei-base.c | 17 +++++++++++++++-- + drivers/acpi/apei/apei-internal.h | 9 +++++++++ + drivers/acpi/apei/ghes.c | 6 +++--- + 3 files changed, 27 insertions(+), 5 deletions(-) + +--- a/drivers/acpi/apei/apei-base.c ++++ b/drivers/acpi/apei/apei-base.c +@@ -243,7 +243,7 @@ static int pre_map_gar_callback(struct a + u8 ins = entry->instruction; + + if (ctx->ins_table[ins].flags & APEI_EXEC_INS_ACCESS_REGISTER) +- return acpi_os_map_generic_address(&entry->register_region); ++ return apei_map_generic_address(&entry->register_region); + + return 0; + } +@@ -276,7 +276,7 @@ static int post_unmap_gar_callback(struc + u8 ins = entry->instruction; + + if (ctx->ins_table[ins].flags & APEI_EXEC_INS_ACCESS_REGISTER) +- acpi_os_unmap_generic_address(&entry->register_region); ++ apei_unmap_generic_address(&entry->register_region); + + return 0; + } +@@ -606,6 +606,19 @@ static int apei_check_gar(struct acpi_ge + return 0; + } + ++int apei_map_generic_address(struct acpi_generic_address *reg) ++{ ++ int rc; ++ u32 access_bit_width; ++ u64 address; ++ ++ rc = apei_check_gar(reg, &address, &access_bit_width); ++ if (rc) ++ return rc; ++ return acpi_os_map_generic_address(reg); ++} ++EXPORT_SYMBOL_GPL(apei_map_generic_address); ++ + /* read GAR in interrupt (including NMI) or process context */ + int apei_read(u64 *val, struct acpi_generic_address *reg) + { +--- a/drivers/acpi/apei/apei-internal.h ++++ b/drivers/acpi/apei/apei-internal.h +@@ -7,6 +7,8 @@ + #define APEI_INTERNAL_H + + #include ++#include ++#include + + struct apei_exec_context; + +@@ -68,6 +70,13 @@ static inline int apei_exec_run_optional + /* IP has been set in instruction function */ + #define APEI_EXEC_SET_IP 1 + ++int apei_map_generic_address(struct acpi_generic_address *reg); ++ ++static inline void apei_unmap_generic_address(struct acpi_generic_address *reg) ++{ ++ acpi_os_unmap_generic_address(reg); ++} ++ + int apei_read(u64 *val, struct acpi_generic_address *reg); + int apei_write(u64 val, struct acpi_generic_address *reg); + +--- a/drivers/acpi/apei/ghes.c ++++ b/drivers/acpi/apei/ghes.c +@@ -301,7 +301,7 @@ static struct ghes *ghes_new(struct acpi + if (!ghes) + return ERR_PTR(-ENOMEM); + ghes->generic = generic; +- rc = acpi_os_map_generic_address(&generic->error_status_address); ++ rc = apei_map_generic_address(&generic->error_status_address); + if (rc) + goto err_free; + error_block_length = generic->error_block_length; +@@ -321,7 +321,7 @@ static struct ghes *ghes_new(struct acpi + return ghes; + + err_unmap: +- acpi_os_unmap_generic_address(&generic->error_status_address); ++ apei_unmap_generic_address(&generic->error_status_address); + err_free: + kfree(ghes); + return ERR_PTR(rc); +@@ -330,7 +330,7 @@ err_free: + static void ghes_fini(struct ghes *ghes) + { + kfree(ghes->estatus); +- acpi_os_unmap_generic_address(&ghes->generic->error_status_address); ++ apei_unmap_generic_address(&ghes->generic->error_status_address); + } + + enum { diff --git a/queue-3.4/acpi-video-still-use-acpi-backlight-control-if-_dos-doesn-t-exist.patch b/queue-3.4/acpi-video-still-use-acpi-backlight-control-if-_dos-doesn-t-exist.patch new file mode 100644 index 00000000000..6a8856b710d --- /dev/null +++ b/queue-3.4/acpi-video-still-use-acpi-backlight-control-if-_dos-doesn-t-exist.patch @@ -0,0 +1,39 @@ +From b03738430c7537d5f87948e0b35d8aaf2688c6b4 Mon Sep 17 00:00:00 2001 +From: Zhang Rui +Date: Wed, 20 Jun 2012 09:48:43 +0800 +Subject: ACPI video: Still use ACPI backlight control if _DOS doesn't exist + +From: Zhang Rui + +commit b03738430c7537d5f87948e0b35d8aaf2688c6b4 upstream. + +This fixes a regression in 3.4-rc1 caused by commit +ea9f8856bd6d4ed45885b06a338f7362cd6c60e5 +(ACPI video: Harden video bus adding.) + +Some platforms don't have _DOS control method, but the ACPI +backlight still works. +We should not invoke _DOS for these platforms. + +https://bugzilla.kernel.org/show_bug.cgi?id=43168 + +Cc: Igor Murzov +Signed-off-by: Zhang Rui +Signed-off-by: Len Brown +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/acpi/video.c | 2 ++ + 1 file changed, 2 insertions(+) + +--- a/drivers/acpi/video.c ++++ b/drivers/acpi/video.c +@@ -558,6 +558,8 @@ acpi_video_bus_DOS(struct acpi_video_bus + union acpi_object arg0 = { ACPI_TYPE_INTEGER }; + struct acpi_object_list args = { 1, &arg0 }; + ++ if (!video->cap._DOS) ++ return 0; + + if (bios_flag < 0 || bios_flag > 3 || lcd_flag < 0 || lcd_flag > 1) + return -EINVAL; diff --git a/queue-3.4/acpi_pad-fix-power_saving-thread-deadlock.patch b/queue-3.4/acpi_pad-fix-power_saving-thread-deadlock.patch new file mode 100644 index 00000000000..c4d42678318 --- /dev/null +++ b/queue-3.4/acpi_pad-fix-power_saving-thread-deadlock.patch @@ -0,0 +1,64 @@ +From 5f1601261050251a5ca293378b492a69d590dacb Mon Sep 17 00:00:00 2001 +From: Stuart Hayes +Date: Wed, 13 Jun 2012 16:10:45 -0500 +Subject: acpi_pad: fix power_saving thread deadlock + +From: Stuart Hayes + +commit 5f1601261050251a5ca293378b492a69d590dacb upstream. + +The acpi_pad driver can get stuck in destroy_power_saving_task() +waiting for kthread_stop() to stop a power_saving thread. The problem +is that the isolated_cpus_lock mutex is owned when +destroy_power_saving_task() calls kthread_stop(), which waits for a +power_saving thread to end, and the power_saving thread tries to +acquire the isolated_cpus_lock when it calls round_robin_cpu(). This +patch fixes the issue by making round_robin_cpu() use its own mutex. + +https://bugzilla.kernel.org/show_bug.cgi?id=42981 + +Signed-off-by: Stuart Hayes +Signed-off-by: Len Brown +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/acpi/acpi_pad.c | 7 ++++--- + 1 file changed, 4 insertions(+), 3 deletions(-) + +--- a/drivers/acpi/acpi_pad.c ++++ b/drivers/acpi/acpi_pad.c +@@ -36,6 +36,7 @@ + #define ACPI_PROCESSOR_AGGREGATOR_DEVICE_NAME "Processor Aggregator" + #define ACPI_PROCESSOR_AGGREGATOR_NOTIFY 0x80 + static DEFINE_MUTEX(isolated_cpus_lock); ++static DEFINE_MUTEX(round_robin_lock); + + static unsigned long power_saving_mwait_eax; + +@@ -107,7 +108,7 @@ static void round_robin_cpu(unsigned int + if (!alloc_cpumask_var(&tmp, GFP_KERNEL)) + return; + +- mutex_lock(&isolated_cpus_lock); ++ mutex_lock(&round_robin_lock); + cpumask_clear(tmp); + for_each_cpu(cpu, pad_busy_cpus) + cpumask_or(tmp, tmp, topology_thread_cpumask(cpu)); +@@ -116,7 +117,7 @@ static void round_robin_cpu(unsigned int + if (cpumask_empty(tmp)) + cpumask_andnot(tmp, cpu_online_mask, pad_busy_cpus); + if (cpumask_empty(tmp)) { +- mutex_unlock(&isolated_cpus_lock); ++ mutex_unlock(&round_robin_lock); + return; + } + for_each_cpu(cpu, tmp) { +@@ -131,7 +132,7 @@ static void round_robin_cpu(unsigned int + tsk_in_cpu[tsk_index] = preferred_cpu; + cpumask_set_cpu(preferred_cpu, pad_busy_cpus); + cpu_weight[preferred_cpu]++; +- mutex_unlock(&isolated_cpus_lock); ++ mutex_unlock(&round_robin_lock); + + set_cpus_allowed_ptr(current, cpumask_of(preferred_cpu)); + } diff --git a/queue-3.4/btrfs-run-delayed-directory-updates-during-log-replay.patch b/queue-3.4/btrfs-run-delayed-directory-updates-during-log-replay.patch new file mode 100644 index 00000000000..f902a9c3e6d --- /dev/null +++ b/queue-3.4/btrfs-run-delayed-directory-updates-during-log-replay.patch @@ -0,0 +1,54 @@ +From b6305567e7d31b0bec1b8cb9ec0cadd7f7086f5f Mon Sep 17 00:00:00 2001 +From: Chris Mason +Date: Mon, 2 Jul 2012 15:29:53 -0400 +Subject: Btrfs: run delayed directory updates during log replay + +From: Chris Mason + +commit b6305567e7d31b0bec1b8cb9ec0cadd7f7086f5f upstream. + +While we are resolving directory modifications in the +tree log, we are triggering delayed metadata updates to +the filesystem btrees. + +This commit forces the delayed updates to run so the +replay code can find any modifications done. It stops +us from crashing because the directory deleltion replay +expects items to be removed immediately from the tree. + +Signed-off-by: Chris Mason +Signed-off-by: Greg Kroah-Hartman + +--- + fs/btrfs/tree-log.c | 6 ++++++ + 1 file changed, 6 insertions(+) + +--- a/fs/btrfs/tree-log.c ++++ b/fs/btrfs/tree-log.c +@@ -690,6 +690,8 @@ static noinline int drop_one_dir_item(st + kfree(name); + + iput(inode); ++ ++ btrfs_run_delayed_items(trans, root); + return ret; + } + +@@ -895,6 +897,7 @@ again: + ret = btrfs_unlink_inode(trans, root, dir, + inode, victim_name, + victim_name_len); ++ btrfs_run_delayed_items(trans, root); + } + kfree(victim_name); + ptr = (unsigned long)(victim_ref + 1) + victim_name_len; +@@ -1475,6 +1478,9 @@ again: + ret = btrfs_unlink_inode(trans, root, dir, inode, + name, name_len); + BUG_ON(ret); ++ ++ btrfs_run_delayed_items(trans, root); ++ + kfree(name); + iput(inode); + diff --git a/queue-3.4/drm-edid-don-t-return-stack-garbage-from-supports_rb.patch b/queue-3.4/drm-edid-don-t-return-stack-garbage-from-supports_rb.patch new file mode 100644 index 00000000000..1d7a71d25fe --- /dev/null +++ b/queue-3.4/drm-edid-don-t-return-stack-garbage-from-supports_rb.patch @@ -0,0 +1,34 @@ +From b196a4980ff7bb54db478e2a408dc8b12be15304 Mon Sep 17 00:00:00 2001 +From: Daniel Vetter +Date: Tue, 19 Jun 2012 11:33:06 +0200 +Subject: drm/edid: don't return stack garbage from supports_rb + +From: Daniel Vetter + +commit b196a4980ff7bb54db478e2a408dc8b12be15304 upstream. + +We need to initialize this to false, because the is_rb callback only +ever sets it to true. + +Noticed while reading through the code. + +Signed-Off-by: Daniel Vetter +Reviewed-by: Adam Jackson +Signed-off-by: Dave Airlie +Signed-off-by: Greg Kroah-Hartman + +--- + 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 +@@ -574,7 +574,7 @@ static bool + drm_monitor_supports_rb(struct edid *edid) + { + if (edid->revision >= 4) { +- bool ret; ++ bool ret = false; + drm_for_each_detailed_block((u8 *)edid, is_rb, &ret); + return ret; + } diff --git a/queue-3.4/drm-i915-fix-edp-blank-screen-after-s3-resume-on-hp-desktops.patch b/queue-3.4/drm-i915-fix-edp-blank-screen-after-s3-resume-on-hp-desktops.patch new file mode 100644 index 00000000000..febfa95f86d --- /dev/null +++ b/queue-3.4/drm-i915-fix-edp-blank-screen-after-s3-resume-on-hp-desktops.patch @@ -0,0 +1,43 @@ +From 6db65cbb941f9d433659bdad02b307f6d94465df Mon Sep 17 00:00:00 2001 +From: Takashi Iwai +Date: Thu, 21 Jun 2012 15:30:41 +0200 +Subject: drm/i915: Fix eDP blank screen after S3 resume on HP desktops + +From: Takashi Iwai + +commit 6db65cbb941f9d433659bdad02b307f6d94465df upstream. + +This patch fixes the problem on some HP desktop machines with eDP +which give blank screens after S3 resume. + +It turned out that BLC_PWM_CPU_CTL must be written after +BLC_PWM_CPU_CTL2. Otherwise it doesn't take effect on these +SNB machines. + +Tested with 3.5-rc3 kernel. + +Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=49233 + +Signed-off-by: Takashi Iwai +Signed-off-by: Daniel Vetter +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/gpu/drm/i915/i915_suspend.c | 5 ++++- + 1 file changed, 4 insertions(+), 1 deletion(-) + +--- a/drivers/gpu/drm/i915/i915_suspend.c ++++ b/drivers/gpu/drm/i915/i915_suspend.c +@@ -740,8 +740,11 @@ static void i915_restore_display(struct + if (HAS_PCH_SPLIT(dev)) { + I915_WRITE(BLC_PWM_PCH_CTL1, dev_priv->saveBLC_PWM_CTL); + I915_WRITE(BLC_PWM_PCH_CTL2, dev_priv->saveBLC_PWM_CTL2); +- I915_WRITE(BLC_PWM_CPU_CTL, dev_priv->saveBLC_CPU_PWM_CTL); ++ /* NOTE: BLC_PWM_CPU_CTL must be written after BLC_PWM_CPU_CTL2; ++ * otherwise we get blank eDP screen after S3 on some machines ++ */ + I915_WRITE(BLC_PWM_CPU_CTL2, dev_priv->saveBLC_CPU_PWM_CTL2); ++ I915_WRITE(BLC_PWM_CPU_CTL, dev_priv->saveBLC_CPU_PWM_CTL); + I915_WRITE(PCH_PP_ON_DELAYS, dev_priv->savePP_ON_DELAYS); + I915_WRITE(PCH_PP_OFF_DELAYS, dev_priv->savePP_OFF_DELAYS); + I915_WRITE(PCH_PP_DIVISOR, dev_priv->savePP_DIVISOR); diff --git a/queue-3.4/drm-nouveau-fbcon-using-nv_two_heads-is-not-a-good-idea.patch b/queue-3.4/drm-nouveau-fbcon-using-nv_two_heads-is-not-a-good-idea.patch new file mode 100644 index 00000000000..53bb78732cc --- /dev/null +++ b/queue-3.4/drm-nouveau-fbcon-using-nv_two_heads-is-not-a-good-idea.patch @@ -0,0 +1,40 @@ +From 9bd0c15fcfb42f6245447c53347d65ad9e72080b Mon Sep 17 00:00:00 2001 +From: Ben Skeggs +Date: Tue, 26 Jun 2012 12:12:30 +1000 +Subject: drm/nouveau/fbcon: using nv_two_heads is not a good idea + +From: Ben Skeggs + +commit 9bd0c15fcfb42f6245447c53347d65ad9e72080b upstream. + +nv_two_heads() was never meant to be used outside of pre-nv50 code. The +code checks for >= NV_10 for 2 CRTCs, then downgrades a few specific +chipsets to 1 CRTC based on (pci_device & 0x0ff0). + +The breakage example seen is on GTX 560Ti, with a pciid of 0x1200, which +gets detected as an NV20 (0x020x) with 1 CRTC by nv_two_heads(), causing +memory corruption because there's actually 2 CRTCs.. + +This switches fbcon to use the CRTC count directly from the mode_config +structure, which will also fix the same issue on Kepler boards which have +4 CRTCs. + +Signed-off-by: Ben Skeggs +Signed-off-by: Dave Airlie +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/gpu/drm/nouveau/nouveau_fbcon.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/drivers/gpu/drm/nouveau/nouveau_fbcon.c ++++ b/drivers/gpu/drm/nouveau/nouveau_fbcon.c +@@ -497,7 +497,7 @@ int nouveau_fbcon_init(struct drm_device + nfbdev->helper.funcs = &nouveau_fbcon_helper_funcs; + + ret = drm_fb_helper_init(dev, &nfbdev->helper, +- nv_two_heads(dev) ? 2 : 1, 4); ++ dev->mode_config.num_crtc, 4); + if (ret) { + kfree(nfbdev); + return ret; diff --git a/queue-3.4/drm-radeon-fix-vm-page-table-setup-on-si.patch b/queue-3.4/drm-radeon-fix-vm-page-table-setup-on-si.patch new file mode 100644 index 00000000000..34071c8edd7 --- /dev/null +++ b/queue-3.4/drm-radeon-fix-vm-page-table-setup-on-si.patch @@ -0,0 +1,80 @@ +From c21b328ea8c7c71cd2daf50557db440bbaa7ef55 Mon Sep 17 00:00:00 2001 +From: Alex Deucher +Date: Thu, 28 Jun 2012 17:53:07 -0400 +Subject: drm/radeon: fix VM page table setup on SI + +From: Alex Deucher + +commit c21b328ea8c7c71cd2daf50557db440bbaa7ef55 upstream. + +Cayman and trinity allow for variable sized VM page +tables, but SI requires that all page tables be the +same size. The current code assumes variablely sized +VM page tables so SI may end up with part of each page +table overlapping with other memory which could end +up being interpreted by the VM hw as garbage. + +Change the code to better accomodate SI. Allocate enough +space for at least 2 full page tables and always set +last_pfn to max_pfn on SI so each VM is backed by a full +page table. This limits us to only 2 VMs active at any +given time on SI. This will be rectified and the code can +be reunified once we move to two level page tables. + +Signed-off-by: Alex Deucher +Reviewed-by: Jerome Glisse +Signed-off-by: Dave Airlie +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/gpu/drm/radeon/radeon_gart.c | 13 +++++++++++-- + drivers/gpu/drm/radeon/si.c | 4 ++-- + 2 files changed, 13 insertions(+), 4 deletions(-) + +--- a/drivers/gpu/drm/radeon/radeon_gart.c ++++ b/drivers/gpu/drm/radeon/radeon_gart.c +@@ -289,8 +289,9 @@ int radeon_vm_manager_init(struct radeon + rdev->vm_manager.enabled = false; + + /* mark first vm as always in use, it's the system one */ ++ /* allocate enough for 2 full VM pts */ + r = radeon_sa_bo_manager_init(rdev, &rdev->vm_manager.sa_manager, +- rdev->vm_manager.max_pfn * 8, ++ rdev->vm_manager.max_pfn * 8 * 2, + RADEON_GEM_DOMAIN_VRAM); + if (r) { + dev_err(rdev->dev, "failed to allocate vm bo (%dKB)\n", +@@ -635,7 +636,15 @@ int radeon_vm_init(struct radeon_device + mutex_init(&vm->mutex); + INIT_LIST_HEAD(&vm->list); + INIT_LIST_HEAD(&vm->va); +- vm->last_pfn = 0; ++ /* SI requires equal sized PTs for all VMs, so always set ++ * last_pfn to max_pfn. cayman allows variable sized ++ * pts so we can grow then as needed. Once we switch ++ * to two level pts we can unify this again. ++ */ ++ if (rdev->family >= CHIP_TAHITI) ++ vm->last_pfn = rdev->vm_manager.max_pfn; ++ else ++ vm->last_pfn = 0; + /* map the ib pool buffer at 0 in virtual address space, set + * read only + */ +--- a/drivers/gpu/drm/radeon/si.c ++++ b/drivers/gpu/drm/radeon/si.c +@@ -2527,12 +2527,12 @@ int si_pcie_gart_enable(struct radeon_de + WREG32(0x15DC, 0); + + /* empty context1-15 */ +- /* FIXME start with 1G, once using 2 level pt switch to full ++ /* FIXME start with 4G, once using 2 level pt switch to full + * vm size space + */ + /* set vm size, must be a multiple of 4 */ + WREG32(VM_CONTEXT1_PAGE_TABLE_START_ADDR, 0); +- WREG32(VM_CONTEXT1_PAGE_TABLE_END_ADDR, (1 << 30) / RADEON_GPU_PAGE_SIZE); ++ WREG32(VM_CONTEXT1_PAGE_TABLE_END_ADDR, rdev->vm_manager.max_pfn); + for (i = 1; i < 16; i++) { + if (i < 8) + WREG32(VM_CONTEXT0_PAGE_TABLE_BASE_ADDR + (i << 2), diff --git a/queue-3.4/series b/queue-3.4/series index 9a9362e1afd..6825112e0b8 100644 --- a/queue-3.4/series +++ b/queue-3.4/series @@ -67,3 +67,12 @@ ath9k-fix-dynamic-wep-related-regression.patch ath9k-enable-serialize_regmode-for-non-pcie-ar9287.patch asoc-wm2200-add-missing-bclk-rate.patch asoc-tlv320aic3x-fix-codec-pll-configure-bug.patch +btrfs-run-delayed-directory-updates-during-log-replay.patch +drm-edid-don-t-return-stack-garbage-from-supports_rb.patch +drm-nouveau-fbcon-using-nv_two_heads-is-not-a-good-idea.patch +drm-i915-fix-edp-blank-screen-after-s3-resume-on-hp-desktops.patch +drm-radeon-fix-vm-page-table-setup-on-si.patch +acpi-video-still-use-acpi-backlight-control-if-_dos-doesn-t-exist.patch +acpi_pad-fix-power_saving-thread-deadlock.patch +acpi-apei-avoid-too-much-error-reporting-in-runtime.patch +acpi-add-a-quirk-for-amilo-pro-v2030-to-ignore-the-timer-overriding.patch -- 2.47.3