From: Greg Kroah-Hartman Date: Sun, 8 May 2016 16:26:33 +0000 (+0200) Subject: 4.5-stable patches X-Git-Tag: v3.14.69~7 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=35ec24733dd905f3c534185ce97694c69378ac2f;p=thirdparty%2Fkernel%2Fstable-queue.git 4.5-stable patches added patches: drm-amdgpu-make-sure-vertical-front-porch-is-at-least-1.patch drm-amdgpu-set-metadata-pointer-to-null-after-freeing.patch drm-i915-avoid-stalling-on-pending-flips-for-legacy-cursor-updates.patch drm-radeon-make-sure-vertical-front-porch-is-at-least-1.patch gpu-ipu-v3-fix-imx-ipuv3-crtc-module-autoloading.patch iio-ak8975-fix-maybe-uninitialized-warning.patch iio-ak8975-fix-null-pointer-exception-on-early-interrupt.patch --- diff --git a/queue-4.5/drm-amdgpu-make-sure-vertical-front-porch-is-at-least-1.patch b/queue-4.5/drm-amdgpu-make-sure-vertical-front-porch-is-at-least-1.patch new file mode 100644 index 00000000000..2ab8c293456 --- /dev/null +++ b/queue-4.5/drm-amdgpu-make-sure-vertical-front-porch-is-at-least-1.patch @@ -0,0 +1,31 @@ +From 0126d4b9a516256f2432ca0dc78ab293a8255378 Mon Sep 17 00:00:00 2001 +From: Alex Deucher +Date: Mon, 2 May 2016 18:54:39 -0400 +Subject: drm/amdgpu: make sure vertical front porch is at least 1 + +From: Alex Deucher + +commit 0126d4b9a516256f2432ca0dc78ab293a8255378 upstream. + +hw doesn't like a 0 value. + +Signed-off-by: Alex Deucher +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/gpu/drm/amd/amdgpu/atombios_encoders.c | 4 ++++ + 1 file changed, 4 insertions(+) + +--- a/drivers/gpu/drm/amd/amdgpu/atombios_encoders.c ++++ b/drivers/gpu/drm/amd/amdgpu/atombios_encoders.c +@@ -298,6 +298,10 @@ bool amdgpu_atombios_encoder_mode_fixup( + && (mode->crtc_vsync_start < (mode->crtc_vdisplay + 2))) + adjusted_mode->crtc_vsync_start = adjusted_mode->crtc_vdisplay + 2; + ++ /* vertical FP must be at least 1 */ ++ if (mode->crtc_vsync_start == mode->crtc_vdisplay) ++ adjusted_mode->crtc_vsync_start++; ++ + /* get the native mode for scaling */ + if (amdgpu_encoder->active_device & (ATOM_DEVICE_LCD_SUPPORT)) + amdgpu_panel_mode_fixup(encoder, adjusted_mode); diff --git a/queue-4.5/drm-amdgpu-set-metadata-pointer-to-null-after-freeing.patch b/queue-4.5/drm-amdgpu-set-metadata-pointer-to-null-after-freeing.patch new file mode 100644 index 00000000000..b709bba8caa --- /dev/null +++ b/queue-4.5/drm-amdgpu-set-metadata-pointer-to-null-after-freeing.patch @@ -0,0 +1,38 @@ +From 0092d3edcb23fcdb8cbe4159ba94a534290ff982 Mon Sep 17 00:00:00 2001 +From: Dave Airlie +Date: Tue, 3 May 2016 12:44:29 +1000 +Subject: drm/amdgpu: set metadata pointer to NULL after freeing. +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +From: Dave Airlie + +commit 0092d3edcb23fcdb8cbe4159ba94a534290ff982 upstream. + +Without this there was a double free of the metadata, +which ended up freeing the fd table for me here, and taking +out the machine more often than not. + +I reproduced with X.org + modesetting DDX + latest llvm/mesa, +also required using dri3. + +Reviewed-by: Christian König +Signed-off-by: Dave Airlie +Signed-off-by: Alex Deucher +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/gpu/drm/amd/amdgpu/amdgpu_object.c | 1 + + 1 file changed, 1 insertion(+) + +--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c ++++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c +@@ -540,6 +540,7 @@ int amdgpu_bo_set_metadata (struct amdgp + if (!metadata_size) { + if (bo->metadata_size) { + kfree(bo->metadata); ++ bo->metadata = NULL; + bo->metadata_size = 0; + } + return 0; diff --git a/queue-4.5/drm-i915-avoid-stalling-on-pending-flips-for-legacy-cursor-updates.patch b/queue-4.5/drm-i915-avoid-stalling-on-pending-flips-for-legacy-cursor-updates.patch new file mode 100644 index 00000000000..e8879dcbbc1 --- /dev/null +++ b/queue-4.5/drm-i915-avoid-stalling-on-pending-flips-for-legacy-cursor-updates.patch @@ -0,0 +1,49 @@ +From 7ac7d19f808697abe6658c64c96868f728273f9c Mon Sep 17 00:00:00 2001 +From: Chris Wilson +Date: Sun, 17 Apr 2016 20:42:46 +0100 +Subject: drm/i915: Avoid stalling on pending flips for legacy cursor updates +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +From: Chris Wilson + +commit 7ac7d19f808697abe6658c64c96868f728273f9c upstream. + +The legacy cursor ioctl expects to be asynchronous with respect to other +screen updates, in particular page flips. As X updates the cursor from a +signal context, if the cursor blocks then it will stall both the input +and output chains causing bad stuttering and horrible UX. + +Reported-and-tested-by: Rafael Ristovski +Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=94980 +Fixes: 5008e874edd34 ("drm/i915: Make wait_for_flips interruptible.") +Suggested-by: Maarten Lankhorst +Signed-off-by: Chris Wilson +Cc: Maarten Lankhorst +Cc: Ville Syrjälä +Cc: Daniel Vetter +Cc: Jani Nikula +Link: http://patchwork.freedesktop.org/patch/msgid/1460922166-20292-1-git-send-email-chris@chris-wilson.co.uk +Acked-by: Daniel Vetter +Reviewed-by: Maarten Lankhorst +(cherry picked from commit acf4e84d6167317ff21be5c03e1ea76ea5783701) +Signed-off-by: Jani Nikula +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/gpu/drm/i915/intel_display.c | 3 +++ + 1 file changed, 3 insertions(+) + +--- a/drivers/gpu/drm/i915/intel_display.c ++++ b/drivers/gpu/drm/i915/intel_display.c +@@ -13429,6 +13429,9 @@ static int intel_atomic_prepare_commit(s + } + + for_each_crtc_in_state(state, crtc, crtc_state, i) { ++ if (state->legacy_cursor_update) ++ continue; ++ + ret = intel_crtc_wait_for_pending_flips(crtc); + if (ret) + return ret; diff --git a/queue-4.5/drm-radeon-make-sure-vertical-front-porch-is-at-least-1.patch b/queue-4.5/drm-radeon-make-sure-vertical-front-porch-is-at-least-1.patch new file mode 100644 index 00000000000..c9fe3e9e9a5 --- /dev/null +++ b/queue-4.5/drm-radeon-make-sure-vertical-front-porch-is-at-least-1.patch @@ -0,0 +1,31 @@ +From 3104b8128d4d646a574ed9d5b17c7d10752cd70b Mon Sep 17 00:00:00 2001 +From: Alex Deucher +Date: Mon, 2 May 2016 18:53:27 -0400 +Subject: drm/radeon: make sure vertical front porch is at least 1 + +From: Alex Deucher + +commit 3104b8128d4d646a574ed9d5b17c7d10752cd70b upstream. + +hw doesn't like a 0 value. + +Signed-off-by: Alex Deucher +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/gpu/drm/radeon/atombios_encoders.c | 4 ++++ + 1 file changed, 4 insertions(+) + +--- a/drivers/gpu/drm/radeon/atombios_encoders.c ++++ b/drivers/gpu/drm/radeon/atombios_encoders.c +@@ -310,6 +310,10 @@ static bool radeon_atom_mode_fixup(struc + && (mode->crtc_vsync_start < (mode->crtc_vdisplay + 2))) + adjusted_mode->crtc_vsync_start = adjusted_mode->crtc_vdisplay + 2; + ++ /* vertical FP must be at least 1 */ ++ if (mode->crtc_vsync_start == mode->crtc_vdisplay) ++ adjusted_mode->crtc_vsync_start++; ++ + /* get the native mode for scaling */ + if (radeon_encoder->active_device & (ATOM_DEVICE_LCD_SUPPORT)) { + radeon_panel_mode_fixup(encoder, adjusted_mode); diff --git a/queue-4.5/gpu-ipu-v3-fix-imx-ipuv3-crtc-module-autoloading.patch b/queue-4.5/gpu-ipu-v3-fix-imx-ipuv3-crtc-module-autoloading.patch new file mode 100644 index 00000000000..9d25cf1180b --- /dev/null +++ b/queue-4.5/gpu-ipu-v3-fix-imx-ipuv3-crtc-module-autoloading.patch @@ -0,0 +1,49 @@ +From 503fe87bd0a8346ba9d8b7f49115dcd0a4185226 Mon Sep 17 00:00:00 2001 +From: Philipp Zabel +Date: Wed, 27 Apr 2016 10:17:51 +0200 +Subject: gpu: ipu-v3: Fix imx-ipuv3-crtc module autoloading + +From: Philipp Zabel + +commit 503fe87bd0a8346ba9d8b7f49115dcd0a4185226 upstream. + +If of_node is set before calling platform_device_add, the driver core +will try to use of: modalias matching, which fails because the device +tree nodes don't have a compatible property set. This patch fixes +imx-ipuv3-crtc module autoloading by setting the of_node property only +after the platform modalias is set. + +Fixes: 304e6be652e2 ("gpu: ipu-v3: Assign of_node of child platform devices to corresponding ports") +Reported-by: Dennis Gilmore +Signed-off-by: Philipp Zabel +Tested-By: Dennis Gilmore +Signed-off-by: Dave Airlie +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/gpu/ipu-v3/ipu-common.c | 7 ++++++- + 1 file changed, 6 insertions(+), 1 deletion(-) + +--- a/drivers/gpu/ipu-v3/ipu-common.c ++++ b/drivers/gpu/ipu-v3/ipu-common.c +@@ -1068,7 +1068,6 @@ static int ipu_add_client_devices(struct + goto err_register; + } + +- pdev->dev.of_node = of_node; + pdev->dev.parent = dev; + + ret = platform_device_add_data(pdev, ®->pdata, +@@ -1079,6 +1078,12 @@ static int ipu_add_client_devices(struct + platform_device_put(pdev); + goto err_register; + } ++ ++ /* ++ * Set of_node only after calling platform_device_add. Otherwise ++ * the platform:imx-ipuv3-crtc modalias won't be used. ++ */ ++ pdev->dev.of_node = of_node; + } + + return 0; diff --git a/queue-4.5/iio-ak8975-fix-maybe-uninitialized-warning.patch b/queue-4.5/iio-ak8975-fix-maybe-uninitialized-warning.patch new file mode 100644 index 00000000000..0c400f64ee2 --- /dev/null +++ b/queue-4.5/iio-ak8975-fix-maybe-uninitialized-warning.patch @@ -0,0 +1,43 @@ +From 05be8d4101d960bad271d32b4f6096af1ccb1534 Mon Sep 17 00:00:00 2001 +From: Richard Leitner +Date: Tue, 5 Apr 2016 15:03:48 +0200 +Subject: iio: ak8975: fix maybe-uninitialized warning +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +From: Richard Leitner + +commit 05be8d4101d960bad271d32b4f6096af1ccb1534 upstream. + +If i2c_device_id *id is NULL and acpi_match_device returns NULL too, +then chipset may be unitialized when accessing &ak_def_array[chipset] in +ak8975_probe. Therefore initialize chipset to AK_MAX_TYPE, which will +return an error when not changed. + +This patch fixes the following maybe-uninitialized warning: + +drivers/iio/magnetometer/ak8975.c: In function ‘ak8975_probe’: +drivers/iio/magnetometer/ak8975.c:788:14: warning: ‘chipset’ may be used +uninitialized in this function [-Wmaybe-uninitialized] + data->def = &ak_def_array[chipset]; + +Signed-off-by: Richard Leitner +Signed-off-by: Jonathan Cameron +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/iio/magnetometer/ak8975.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/drivers/iio/magnetometer/ak8975.c ++++ b/drivers/iio/magnetometer/ak8975.c +@@ -732,7 +732,7 @@ static int ak8975_probe(struct i2c_clien + int eoc_gpio; + int err; + const char *name = NULL; +- enum asahi_compass_chipset chipset; ++ enum asahi_compass_chipset chipset = AK_MAX_TYPE; + + /* Grab and set up the supplied GPIO. */ + if (client->dev.platform_data) diff --git a/queue-4.5/iio-ak8975-fix-null-pointer-exception-on-early-interrupt.patch b/queue-4.5/iio-ak8975-fix-null-pointer-exception-on-early-interrupt.patch new file mode 100644 index 00000000000..aedf7f6b83f --- /dev/null +++ b/queue-4.5/iio-ak8975-fix-null-pointer-exception-on-early-interrupt.patch @@ -0,0 +1,72 @@ +From 07d2390e36ee5b3265e9cc8305f2a106c8721e16 Mon Sep 17 00:00:00 2001 +From: Krzysztof Kozlowski +Date: Mon, 4 Apr 2016 14:54:59 +0900 +Subject: iio: ak8975: Fix NULL pointer exception on early interrupt + +From: Krzysztof Kozlowski + +commit 07d2390e36ee5b3265e9cc8305f2a106c8721e16 upstream. + +In certain probe conditions the interrupt came right after registering +the handler causing a NULL pointer exception because of uninitialized +waitqueue: + +$ udevadm trigger +i2c-gpio i2c-gpio-1: using pins 143 (SDA) and 144 (SCL) +i2c-gpio i2c-gpio-3: using pins 53 (SDA) and 52 (SCL) +Unable to handle kernel NULL pointer dereference at virtual address 00000000 +pgd = e8b38000 +[00000000] *pgd=00000000 +Internal error: Oops: 5 [#1] SMP ARM +Modules linked in: snd_soc_i2s(+) i2c_gpio(+) snd_soc_idma snd_soc_s3c_dma snd_soc_core snd_pcm_dmaengine snd_pcm snd_timer snd soundcore ac97_bus spi_s3c64xx pwm_samsung dwc2 exynos_adc phy_exynos_usb2 exynosdrm exynos_rng rng_core rtc_s3c +CPU: 0 PID: 717 Comm: data-provider-m Not tainted 4.6.0-rc1-next-20160401-00011-g1b8d87473b9e-dirty #101 +Hardware name: SAMSUNG EXYNOS (Flattened Device Tree) +(...) +(__wake_up_common) from [] (__wake_up+0x38/0x4c) +(__wake_up) from [] (ak8975_irq_handler+0x28/0x30) +(ak8975_irq_handler) from [] (handle_irq_event_percpu+0x88/0x140) +(handle_irq_event_percpu) from [] (handle_irq_event+0x44/0x68) +(handle_irq_event) from [] (handle_edge_irq+0xf0/0x19c) +(handle_edge_irq) from [] (generic_handle_irq+0x24/0x34) +(generic_handle_irq) from [] (exynos_eint_gpio_irq+0x50/0x68) +(exynos_eint_gpio_irq) from [] (handle_irq_event_percpu+0x88/0x140) +(handle_irq_event_percpu) from [] (handle_irq_event+0x44/0x68) +(handle_irq_event) from [] (handle_fasteoi_irq+0xb4/0x194) +(handle_fasteoi_irq) from [] (generic_handle_irq+0x24/0x34) +(generic_handle_irq) from [] (__handle_domain_irq+0x5c/0xb4) +(__handle_domain_irq) from [] (gic_handle_irq+0x54/0x94) +(gic_handle_irq) from [] (__irq_usr+0x50/0x80) + +The bug was reproduced on exynos4412-trats2 (with a max77693 device also +using i2c-gpio) after building max77693 as a module. + +Fixes: 94a6d5cf7caa ("iio:ak8975 Implement data ready interrupt handling") +Signed-off-by: Krzysztof Kozlowski +Tested-by: Gregor Boirie +Signed-off-by: Jonathan Cameron +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/iio/magnetometer/ak8975.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +--- a/drivers/iio/magnetometer/ak8975.c ++++ b/drivers/iio/magnetometer/ak8975.c +@@ -462,6 +462,8 @@ static int ak8975_setup_irq(struct ak897 + int rc; + int irq; + ++ init_waitqueue_head(&data->data_ready_queue); ++ clear_bit(0, &data->flags); + if (client->irq) + irq = client->irq; + else +@@ -477,8 +479,6 @@ static int ak8975_setup_irq(struct ak897 + return rc; + } + +- init_waitqueue_head(&data->data_ready_queue); +- clear_bit(0, &data->flags); + data->eoc_irq = irq; + + return rc; diff --git a/queue-4.5/series b/queue-4.5/series index 75163b5c225..c313f713931 100644 --- a/queue-4.5/series +++ b/queue-4.5/series @@ -73,3 +73,10 @@ usb-serial-cp210x-add-straizona-focusers-device-ids.patch revert-usb-pm-allow-usb-devices-to-remain-runtime-suspended-when-sleeping.patch nvmem-mxs-ocotp-fix-buffer-overflow-in-read.patch drivers-hv-vmbus-fix-signaling-logic-in-hv_need_to_signal_on_read.patch +gpu-ipu-v3-fix-imx-ipuv3-crtc-module-autoloading.patch +drm-amdgpu-make-sure-vertical-front-porch-is-at-least-1.patch +drm-amdgpu-set-metadata-pointer-to-null-after-freeing.patch +iio-ak8975-fix-null-pointer-exception-on-early-interrupt.patch +iio-ak8975-fix-maybe-uninitialized-warning.patch +drm-radeon-make-sure-vertical-front-porch-is-at-least-1.patch +drm-i915-avoid-stalling-on-pending-flips-for-legacy-cursor-updates.patch