From: Greg Kroah-Hartman Date: Thu, 27 Sep 2018 19:22:32 +0000 (+0200) Subject: 4.14-stable patches X-Git-Tag: v4.18.11~2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=9e5f3f5371290f8d9af1d75fba51aa698ace7766;p=thirdparty%2Fkernel%2Fstable-queue.git 4.14-stable patches added patches: spi-fix-double-idr-allocation-with-dt-aliases.patch --- diff --git a/queue-4.14/drm-atomic-use-drm_drv_uses_atomic_modeset-for-debugfs-creation.patch b/queue-4.14/drm-atomic-use-drm_drv_uses_atomic_modeset-for-debugfs-creation.patch deleted file mode 100644 index 56c65e46d10..00000000000 --- a/queue-4.14/drm-atomic-use-drm_drv_uses_atomic_modeset-for-debugfs-creation.patch +++ /dev/null @@ -1,50 +0,0 @@ -From 3c499ea0c662e2f38aafbd4f516b08aab8cfa0e5 Mon Sep 17 00:00:00 2001 -From: Lyude Paul -Date: Mon, 17 Sep 2018 13:37:33 -0400 -Subject: drm/atomic: Use drm_drv_uses_atomic_modeset() for debugfs creation - -From: Lyude Paul - -commit 3c499ea0c662e2f38aafbd4f516b08aab8cfa0e5 upstream. - -As pointed out by Daniel Vetter, we should be usinng -drm_drv_uses_atomic_modeset() for determining whether or not we want to -make the debugfs nodes for atomic instead of checking DRIVER_ATOMIC, as -the former isn't an accurate representation of whether or not the driver -is actually using atomic modesetting internally (even though it might -not be exposing atomic capabilities). - -Signed-off-by: Lyude Paul -Cc: Daniel Vetter -Cc: stable@vger.kernel.org -Reviewed-by: Sean Paul -Link: https://patchwork.freedesktop.org/patch/msgid/20180917173733.21293-1-lyude@redhat.com -Signed-off-by: Greg Kroah-Hartman - ---- - drivers/gpu/drm/drm_atomic.c | 2 +- - drivers/gpu/drm/drm_debugfs.c | 2 +- - 2 files changed, 2 insertions(+), 2 deletions(-) - ---- a/drivers/gpu/drm/drm_atomic.c -+++ b/drivers/gpu/drm/drm_atomic.c -@@ -1748,7 +1748,7 @@ static void __drm_state_dump(struct drm_ - struct drm_connector *connector; - struct drm_connector_list_iter conn_iter; - -- if (!drm_core_check_feature(dev, DRIVER_ATOMIC)) -+ if (!drm_drv_uses_atomic_modeset(dev)) - return; - - list_for_each_entry(plane, &config->plane_list, head) { ---- a/drivers/gpu/drm/drm_debugfs.c -+++ b/drivers/gpu/drm/drm_debugfs.c -@@ -150,7 +150,7 @@ int drm_debugfs_init(struct drm_minor *m - return ret; - } - -- if (drm_core_check_feature(dev, DRIVER_ATOMIC)) { -+ if (drm_drv_uses_atomic_modeset(dev)) { - ret = drm_atomic_debugfs_init(minor); - if (ret) { - DRM_ERROR("Failed to create atomic debugfs files\n"); diff --git a/queue-4.14/series b/queue-4.14/series index 28a83343ba8..c27b39673f5 100644 --- a/queue-4.14/series +++ b/queue-4.14/series @@ -46,7 +46,6 @@ drm-nouveau-drm-nouveau-prevent-handling-acpi-hpd-events-too-early.patch drm-vc4-fix-the-no-scaling-case-on-multi-planar-yuv-formats.patch drm-udl-destroy-framebuffer-only-if-it-was-initialized.patch drm-amdgpu-add-new-polaris-pci-id.patch -drm-atomic-use-drm_drv_uses_atomic_modeset-for-debugfs-creation.patch tty-vt_ioctl-fix-potential-spectre-v1.patch ext4-check-to-make-sure-the-rename-2-s-destination-is-not-freed.patch ext4-avoid-divide-by-zero-fault-when-deleting-corrupted-inline-directories.patch @@ -61,3 +60,4 @@ pci-aardvark-size-bridges-before-resources-allocation.patch vmw_balloon-include-asm-io.h.patch iw_cxgb4-only-allow-1-flush-on-user-qps.patch tick-nohz-prevent-bogus-softirq-pending-warning.patch +spi-fix-double-idr-allocation-with-dt-aliases.patch diff --git a/queue-4.14/spi-fix-double-idr-allocation-with-dt-aliases.patch b/queue-4.14/spi-fix-double-idr-allocation-with-dt-aliases.patch new file mode 100644 index 00000000000..d3dbaa783a7 --- /dev/null +++ b/queue-4.14/spi-fix-double-idr-allocation-with-dt-aliases.patch @@ -0,0 +1,68 @@ +From 04b2d03a75652bda989de1595048f0501dc0c0a0 Mon Sep 17 00:00:00 2001 +From: Geert Uytterhoeven +Date: Tue, 21 Aug 2018 11:53:03 +0200 +Subject: spi: Fix double IDR allocation with DT aliases + +From: Geert Uytterhoeven + +commit 04b2d03a75652bda989de1595048f0501dc0c0a0 upstream. + +If the SPI bus number is provided by a DT alias, idr_alloc() is called +twice, leading to: + + WARNING: CPU: 1 PID: 1 at drivers/spi/spi.c:2179 spi_register_controller+0x11c/0x5d8 + couldn't get idr + +Fix this by moving the handling of fixed SPI bus numbers up, before the +DT handling code fills in ctlr->bus_num. + +Fixes: 1a4327fbf4554d5b ("spi: fix IDR collision on systems with both fixed and dynamic SPI bus numbers") +Signed-off-by: Geert Uytterhoeven +Tested-by: Fabio Estevam +Signed-off-by: Mark Brown +Cc: Sudip Mukherjee +Cc: Kirill Kapranov +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/spi/spi.c | 22 +++++++++++----------- + 1 file changed, 11 insertions(+), 11 deletions(-) + +--- a/drivers/spi/spi.c ++++ b/drivers/spi/spi.c +@@ -2108,8 +2108,17 @@ int spi_register_controller(struct spi_c + */ + if (ctlr->num_chipselect == 0) + return -EINVAL; +- /* allocate dynamic bus number using Linux idr */ +- if ((ctlr->bus_num < 0) && ctlr->dev.of_node) { ++ if (ctlr->bus_num >= 0) { ++ /* devices with a fixed bus num must check-in with the num */ ++ mutex_lock(&board_lock); ++ id = idr_alloc(&spi_master_idr, ctlr, ctlr->bus_num, ++ ctlr->bus_num + 1, GFP_KERNEL); ++ mutex_unlock(&board_lock); ++ if (WARN(id < 0, "couldn't get idr")) ++ return id == -ENOSPC ? -EBUSY : id; ++ ctlr->bus_num = id; ++ } else if (ctlr->dev.of_node) { ++ /* allocate dynamic bus number using Linux idr */ + id = of_alias_get_id(ctlr->dev.of_node, "spi"); + if (id >= 0) { + ctlr->bus_num = id; +@@ -2135,15 +2144,6 @@ int spi_register_controller(struct spi_c + if (WARN(id < 0, "couldn't get idr")) + return id; + ctlr->bus_num = id; +- } else { +- /* devices with a fixed bus num must check-in with the num */ +- mutex_lock(&board_lock); +- id = idr_alloc(&spi_master_idr, ctlr, ctlr->bus_num, +- ctlr->bus_num + 1, GFP_KERNEL); +- mutex_unlock(&board_lock); +- if (WARN(id < 0, "couldn't get idr")) +- return id == -ENOSPC ? -EBUSY : id; +- ctlr->bus_num = id; + } + INIT_LIST_HEAD(&ctlr->queue); + spin_lock_init(&ctlr->queue_lock);