From: Greg Kroah-Hartman Date: Tue, 18 Oct 2022 12:50:31 +0000 (+0200) Subject: drop drm-vc4-txp-protect-device-resources.patch X-Git-Tag: v6.0.3~70 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=354cdb64f6f40bd0a674ac8e35d09c4e57e9f769;p=thirdparty%2Fkernel%2Fstable-queue.git drop drm-vc4-txp-protect-device-resources.patch Not needed --- diff --git a/queue-5.15/drm-vc4-txp-protect-device-resources.patch b/queue-5.15/drm-vc4-txp-protect-device-resources.patch deleted file mode 100644 index 0a0c2e90ddb..00000000000 --- a/queue-5.15/drm-vc4-txp-protect-device-resources.patch +++ /dev/null @@ -1,120 +0,0 @@ -From b2f42f8ce53abc75f7d10ea49e0e18f869194443 Mon Sep 17 00:00:00 2001 -From: Sasha Levin -Date: Mon, 11 Jul 2022 19:39:23 +0200 -Subject: drm/vc4: txp: Protect device resources - -From: Maxime Ripard - -[ Upstream commit b7345c9799da578c150fde3072446e4049c39c41 ] - -Our current code now mixes some resources whose lifetime are tied to the -device (clocks, IO mappings, etc.) and some that are tied to the DRM device -(encoder, bridge). - -The device one will be freed at unbind time, but the DRM one will only be -freed when the last user of the DRM device closes its file handle. - -So we end up with a time window during which we can call the encoder hooks, -but we don't have access to the underlying resources and device. - -Let's protect all those sections with drm_dev_enter() and drm_dev_exit() so -that we bail out if we are during that window. - -Acked-by: Thomas Zimmermann -Signed-off-by: Maxime Ripard -Link: https://lore.kernel.org/r/20220711173939.1132294-54-maxime@cerno.tech -Stable-dep-of: 84dfc46594b0 ("drm/panel: use 'select' for Ili9341 panel driver helpers") -Signed-off-by: Sasha Levin ---- - drivers/gpu/drm/vc4/vc4_txp.c | 25 +++++++++++++++++++++++++ - 1 file changed, 25 insertions(+) - -diff --git a/drivers/gpu/drm/vc4/vc4_txp.c b/drivers/gpu/drm/vc4/vc4_txp.c -index 82beb8c159f2..e2b6eb437e98 100644 ---- a/drivers/gpu/drm/vc4/vc4_txp.c -+++ b/drivers/gpu/drm/vc4/vc4_txp.c -@@ -15,6 +15,7 @@ - - #include - #include -+#include - #include - #include - #include -@@ -275,6 +276,7 @@ static int vc4_txp_connector_atomic_check(struct drm_connector *conn, - static void vc4_txp_connector_atomic_commit(struct drm_connector *conn, - struct drm_atomic_state *state) - { -+ struct drm_device *drm = conn->dev; - struct drm_connector_state *conn_state = drm_atomic_get_new_connector_state(state, - conn); - struct vc4_txp *txp = connector_to_vc4_txp(conn); -@@ -282,6 +284,7 @@ static void vc4_txp_connector_atomic_commit(struct drm_connector *conn, - struct drm_display_mode *mode; - struct drm_framebuffer *fb; - u32 ctrl; -+ int idx; - int i; - - if (WARN_ON(!conn_state->writeback_job)) -@@ -311,6 +314,9 @@ static void vc4_txp_connector_atomic_commit(struct drm_connector *conn, - */ - ctrl |= TXP_ALPHA_INVERT; - -+ if (!drm_dev_enter(drm, &idx)) -+ return; -+ - gem = drm_fb_cma_get_gem_obj(fb, 0); - TXP_WRITE(TXP_DST_PTR, gem->paddr + fb->offsets[0]); - TXP_WRITE(TXP_DST_PITCH, fb->pitches[0]); -@@ -321,6 +327,8 @@ static void vc4_txp_connector_atomic_commit(struct drm_connector *conn, - TXP_WRITE(TXP_DST_CTRL, ctrl); - - drm_writeback_queue_job(&txp->connector, conn_state); -+ -+ drm_dev_exit(idx); - } - - static const struct drm_connector_helper_funcs vc4_txp_connector_helper_funcs = { -@@ -353,7 +361,12 @@ static const struct drm_connector_funcs vc4_txp_connector_funcs = { - - static void vc4_txp_encoder_disable(struct drm_encoder *encoder) - { -+ struct drm_device *drm = encoder->dev; - struct vc4_txp *txp = encoder_to_vc4_txp(encoder); -+ int idx; -+ -+ if (!drm_dev_enter(drm, &idx)) -+ return; - - if (TXP_READ(TXP_DST_CTRL) & TXP_BUSY) { - unsigned long timeout = jiffies + msecs_to_jiffies(1000); -@@ -368,6 +381,8 @@ static void vc4_txp_encoder_disable(struct drm_encoder *encoder) - } - - TXP_WRITE(TXP_DST_CTRL, TXP_POWERDOWN); -+ -+ drm_dev_exit(idx); - } - - static const struct drm_encoder_helper_funcs vc4_txp_encoder_helper_funcs = { -@@ -452,6 +467,16 @@ static irqreturn_t vc4_txp_interrupt(int irq, void *data) - struct vc4_txp *txp = data; - struct vc4_crtc *vc4_crtc = &txp->base; - -+ /* -+ * We don't need to protect the register access using -+ * drm_dev_enter() there because the interrupt handler lifetime -+ * is tied to the device itself, and not to the DRM device. -+ * -+ * So when the device will be gone, one of the first thing we -+ * will be doing will be to unregister the interrupt handler, -+ * and then unregister the DRM device. drm_dev_enter() would -+ * thus always succeed if we are here. -+ */ - TXP_WRITE(TXP_DST_CTRL, TXP_READ(TXP_DST_CTRL) & ~TXP_EI); - vc4_crtc_handle_vblank(vc4_crtc); - drm_writeback_signal_completion(&txp->connector, 0); --- -2.35.1 - diff --git a/queue-5.15/series b/queue-5.15/series index 730b5f29209..feeb943fee2 100644 --- a/queue-5.15/series +++ b/queue-5.15/series @@ -233,7 +233,6 @@ asoc-tas2764-drop-conflicting-set_bias_level-power-s.patch asoc-tas2764-fix-mute-unmute.patch platform-x86-msi-laptop-fix-old-ec-check-for-backlig.patch platform-x86-msi-laptop-fix-resource-cleanup.patch -drm-vc4-txp-protect-device-resources.patch platform-chrome-cros_ec_typec-correct-alt-mode-index.patch drm-amdgpu-add-missing-pci_disable_device-in-amdgpu_.patch drm-bridge-megachips-fix-a-null-pointer-dereference-.patch diff --git a/queue-5.19/drm-vc4-txp-protect-device-resources.patch b/queue-5.19/drm-vc4-txp-protect-device-resources.patch deleted file mode 100644 index c8f479bfa88..00000000000 --- a/queue-5.19/drm-vc4-txp-protect-device-resources.patch +++ /dev/null @@ -1,120 +0,0 @@ -From 1c61fad57e773675290342698d815fd0fb0debff Mon Sep 17 00:00:00 2001 -From: Sasha Levin -Date: Mon, 11 Jul 2022 19:39:23 +0200 -Subject: drm/vc4: txp: Protect device resources - -From: Maxime Ripard - -[ Upstream commit b7345c9799da578c150fde3072446e4049c39c41 ] - -Our current code now mixes some resources whose lifetime are tied to the -device (clocks, IO mappings, etc.) and some that are tied to the DRM device -(encoder, bridge). - -The device one will be freed at unbind time, but the DRM one will only be -freed when the last user of the DRM device closes its file handle. - -So we end up with a time window during which we can call the encoder hooks, -but we don't have access to the underlying resources and device. - -Let's protect all those sections with drm_dev_enter() and drm_dev_exit() so -that we bail out if we are during that window. - -Acked-by: Thomas Zimmermann -Signed-off-by: Maxime Ripard -Link: https://lore.kernel.org/r/20220711173939.1132294-54-maxime@cerno.tech -Stable-dep-of: 84dfc46594b0 ("drm/panel: use 'select' for Ili9341 panel driver helpers") -Signed-off-by: Sasha Levin ---- - drivers/gpu/drm/vc4/vc4_txp.c | 25 +++++++++++++++++++++++++ - 1 file changed, 25 insertions(+) - -diff --git a/drivers/gpu/drm/vc4/vc4_txp.c b/drivers/gpu/drm/vc4/vc4_txp.c -index 3579d487402e..acc72fe1e113 100644 ---- a/drivers/gpu/drm/vc4/vc4_txp.c -+++ b/drivers/gpu/drm/vc4/vc4_txp.c -@@ -15,6 +15,7 @@ - - #include - #include -+#include - #include - #include - #include -@@ -275,6 +276,7 @@ static int vc4_txp_connector_atomic_check(struct drm_connector *conn, - static void vc4_txp_connector_atomic_commit(struct drm_connector *conn, - struct drm_atomic_state *state) - { -+ struct drm_device *drm = conn->dev; - struct drm_connector_state *conn_state = drm_atomic_get_new_connector_state(state, - conn); - struct vc4_txp *txp = connector_to_vc4_txp(conn); -@@ -282,6 +284,7 @@ static void vc4_txp_connector_atomic_commit(struct drm_connector *conn, - struct drm_display_mode *mode; - struct drm_framebuffer *fb; - u32 ctrl; -+ int idx; - int i; - - if (WARN_ON(!conn_state->writeback_job)) -@@ -311,6 +314,9 @@ static void vc4_txp_connector_atomic_commit(struct drm_connector *conn, - */ - ctrl |= TXP_ALPHA_INVERT; - -+ if (!drm_dev_enter(drm, &idx)) -+ return; -+ - gem = drm_fb_cma_get_gem_obj(fb, 0); - TXP_WRITE(TXP_DST_PTR, gem->paddr + fb->offsets[0]); - TXP_WRITE(TXP_DST_PITCH, fb->pitches[0]); -@@ -321,6 +327,8 @@ static void vc4_txp_connector_atomic_commit(struct drm_connector *conn, - TXP_WRITE(TXP_DST_CTRL, ctrl); - - drm_writeback_queue_job(&txp->connector, conn_state); -+ -+ drm_dev_exit(idx); - } - - static const struct drm_connector_helper_funcs vc4_txp_connector_helper_funcs = { -@@ -353,7 +361,12 @@ static const struct drm_connector_funcs vc4_txp_connector_funcs = { - - static void vc4_txp_encoder_disable(struct drm_encoder *encoder) - { -+ struct drm_device *drm = encoder->dev; - struct vc4_txp *txp = encoder_to_vc4_txp(encoder); -+ int idx; -+ -+ if (!drm_dev_enter(drm, &idx)) -+ return; - - if (TXP_READ(TXP_DST_CTRL) & TXP_BUSY) { - unsigned long timeout = jiffies + msecs_to_jiffies(1000); -@@ -368,6 +381,8 @@ static void vc4_txp_encoder_disable(struct drm_encoder *encoder) - } - - TXP_WRITE(TXP_DST_CTRL, TXP_POWERDOWN); -+ -+ drm_dev_exit(idx); - } - - static const struct drm_encoder_helper_funcs vc4_txp_encoder_helper_funcs = { -@@ -452,6 +467,16 @@ static irqreturn_t vc4_txp_interrupt(int irq, void *data) - struct vc4_txp *txp = data; - struct vc4_crtc *vc4_crtc = &txp->base; - -+ /* -+ * We don't need to protect the register access using -+ * drm_dev_enter() there because the interrupt handler lifetime -+ * is tied to the device itself, and not to the DRM device. -+ * -+ * So when the device will be gone, one of the first thing we -+ * will be doing will be to unregister the interrupt handler, -+ * and then unregister the DRM device. drm_dev_enter() would -+ * thus always succeed if we are here. -+ */ - TXP_WRITE(TXP_DST_CTRL, TXP_READ(TXP_DST_CTRL) & ~TXP_EI); - vc4_crtc_handle_vblank(vc4_crtc); - drm_writeback_signal_completion(&txp->connector, 0); --- -2.35.1 - diff --git a/queue-5.19/series b/queue-5.19/series index daf0d3a04c4..87923ded0bc 100644 --- a/queue-5.19/series +++ b/queue-5.19/series @@ -320,7 +320,6 @@ asoc-tas2764-drop-conflicting-set_bias_level-power-s.patch asoc-tas2764-fix-mute-unmute.patch platform-x86-msi-laptop-fix-old-ec-check-for-backlig.patch platform-x86-msi-laptop-fix-resource-cleanup.patch -drm-vc4-txp-protect-device-resources.patch platform-chrome-cros_ec_typec-correct-alt-mode-index.patch drm-amdgpu-add-missing-pci_disable_device-in-amdgpu_.patch drm-bridge-megachips-fix-a-null-pointer-dereference-.patch diff --git a/queue-6.0/drm-vc4-txp-protect-device-resources.patch b/queue-6.0/drm-vc4-txp-protect-device-resources.patch deleted file mode 100644 index 34dccf16c10..00000000000 --- a/queue-6.0/drm-vc4-txp-protect-device-resources.patch +++ /dev/null @@ -1,120 +0,0 @@ -From 89ec9d5fb2c26c5d5cfa6f6e908aade485cec799 Mon Sep 17 00:00:00 2001 -From: Sasha Levin -Date: Mon, 11 Jul 2022 19:39:23 +0200 -Subject: drm/vc4: txp: Protect device resources - -From: Maxime Ripard - -[ Upstream commit b7345c9799da578c150fde3072446e4049c39c41 ] - -Our current code now mixes some resources whose lifetime are tied to the -device (clocks, IO mappings, etc.) and some that are tied to the DRM device -(encoder, bridge). - -The device one will be freed at unbind time, but the DRM one will only be -freed when the last user of the DRM device closes its file handle. - -So we end up with a time window during which we can call the encoder hooks, -but we don't have access to the underlying resources and device. - -Let's protect all those sections with drm_dev_enter() and drm_dev_exit() so -that we bail out if we are during that window. - -Acked-by: Thomas Zimmermann -Signed-off-by: Maxime Ripard -Link: https://lore.kernel.org/r/20220711173939.1132294-54-maxime@cerno.tech -Stable-dep-of: fcfd3e5fb2f0 ("drm/lcdif: Clean up headers") -Signed-off-by: Sasha Levin ---- - drivers/gpu/drm/vc4/vc4_txp.c | 25 +++++++++++++++++++++++++ - 1 file changed, 25 insertions(+) - -diff --git a/drivers/gpu/drm/vc4/vc4_txp.c b/drivers/gpu/drm/vc4/vc4_txp.c -index d20b0bc51a18..a6724f15b107 100644 ---- a/drivers/gpu/drm/vc4/vc4_txp.c -+++ b/drivers/gpu/drm/vc4/vc4_txp.c -@@ -15,6 +15,7 @@ - - #include - #include -+#include - #include - #include - #include -@@ -276,6 +277,7 @@ static int vc4_txp_connector_atomic_check(struct drm_connector *conn, - static void vc4_txp_connector_atomic_commit(struct drm_connector *conn, - struct drm_atomic_state *state) - { -+ struct drm_device *drm = conn->dev; - struct drm_connector_state *conn_state = drm_atomic_get_new_connector_state(state, - conn); - struct vc4_txp *txp = connector_to_vc4_txp(conn); -@@ -283,6 +285,7 @@ static void vc4_txp_connector_atomic_commit(struct drm_connector *conn, - struct drm_display_mode *mode; - struct drm_framebuffer *fb; - u32 ctrl; -+ int idx; - int i; - - if (WARN_ON(!conn_state->writeback_job)) -@@ -312,6 +315,9 @@ static void vc4_txp_connector_atomic_commit(struct drm_connector *conn, - */ - ctrl |= TXP_ALPHA_INVERT; - -+ if (!drm_dev_enter(drm, &idx)) -+ return; -+ - gem = drm_fb_cma_get_gem_obj(fb, 0); - TXP_WRITE(TXP_DST_PTR, gem->paddr + fb->offsets[0]); - TXP_WRITE(TXP_DST_PITCH, fb->pitches[0]); -@@ -322,6 +328,8 @@ static void vc4_txp_connector_atomic_commit(struct drm_connector *conn, - TXP_WRITE(TXP_DST_CTRL, ctrl); - - drm_writeback_queue_job(&txp->connector, conn_state); -+ -+ drm_dev_exit(idx); - } - - static const struct drm_connector_helper_funcs vc4_txp_connector_helper_funcs = { -@@ -354,7 +362,12 @@ static const struct drm_connector_funcs vc4_txp_connector_funcs = { - - static void vc4_txp_encoder_disable(struct drm_encoder *encoder) - { -+ struct drm_device *drm = encoder->dev; - struct vc4_txp *txp = encoder_to_vc4_txp(encoder); -+ int idx; -+ -+ if (!drm_dev_enter(drm, &idx)) -+ return; - - if (TXP_READ(TXP_DST_CTRL) & TXP_BUSY) { - unsigned long timeout = jiffies + msecs_to_jiffies(1000); -@@ -369,6 +382,8 @@ static void vc4_txp_encoder_disable(struct drm_encoder *encoder) - } - - TXP_WRITE(TXP_DST_CTRL, TXP_POWERDOWN); -+ -+ drm_dev_exit(idx); - } - - static const struct drm_encoder_helper_funcs vc4_txp_encoder_helper_funcs = { -@@ -453,6 +468,16 @@ static irqreturn_t vc4_txp_interrupt(int irq, void *data) - struct vc4_txp *txp = data; - struct vc4_crtc *vc4_crtc = &txp->base; - -+ /* -+ * We don't need to protect the register access using -+ * drm_dev_enter() there because the interrupt handler lifetime -+ * is tied to the device itself, and not to the DRM device. -+ * -+ * So when the device will be gone, one of the first thing we -+ * will be doing will be to unregister the interrupt handler, -+ * and then unregister the DRM device. drm_dev_enter() would -+ * thus always succeed if we are here. -+ */ - TXP_WRITE(TXP_DST_CTRL, TXP_READ(TXP_DST_CTRL) & ~TXP_EI); - vc4_crtc_handle_vblank(vc4_crtc); - drm_writeback_signal_completion(&txp->connector, 0); --- -2.35.1 - diff --git a/queue-6.0/series b/queue-6.0/series index 8249d04a2b0..2c01d414498 100644 --- a/queue-6.0/series +++ b/queue-6.0/series @@ -366,7 +366,6 @@ drm-msm-make-.remove-and-.shutdown-hw-shutdown-consi.patch platform-chrome-fix-double-free-in-chromeos_laptop_p.patch platform-chrome-fix-memory-corruption-in-ioctl.patch drm-i915-dg2-bump-up-cdclk-for-dg2.patch -drm-vc4-txp-protect-device-resources.patch drm-virtio-fix-same-context-optimization.patch asoc-soc-pcm.c-call-__soc_pcm_close-in-soc_pcm_close.patch asoc-tas2764-allow-mono-streams.patch