]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
5.15-stable patches
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 24 Jan 2022 11:37:53 +0000 (12:37 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 24 Jan 2022 11:37:53 +0000 (12:37 +0100)
added patches:
block-fix-async_depth-sysfs-interface-for-mq-deadline.patch
block-fix-fsync-always-failed-if-once-failed.patch
drm-vc4-crtc-copy-assigned-channel-to-the-crtc.patch
drm-vc4-crtc-drop-feed_txp-from-state.patch
drm-vc4-fix-non-blocking-commit-getting-stuck-forever.patch
powerpc-cell-fix-clang-wimplicit-fallthrough-warning.patch
powerpc-fsl-dts-enable-wa-for-erratum-a-009885-on-fman3l-mdio-buses.patch

queue-5.15/block-fix-async_depth-sysfs-interface-for-mq-deadline.patch [new file with mode: 0644]
queue-5.15/block-fix-fsync-always-failed-if-once-failed.patch [new file with mode: 0644]
queue-5.15/drm-vc4-crtc-copy-assigned-channel-to-the-crtc.patch [new file with mode: 0644]
queue-5.15/drm-vc4-crtc-drop-feed_txp-from-state.patch [new file with mode: 0644]
queue-5.15/drm-vc4-fix-non-blocking-commit-getting-stuck-forever.patch [new file with mode: 0644]
queue-5.15/powerpc-cell-fix-clang-wimplicit-fallthrough-warning.patch [new file with mode: 0644]
queue-5.15/powerpc-fsl-dts-enable-wa-for-erratum-a-009885-on-fman3l-mdio-buses.patch [new file with mode: 0644]
queue-5.15/series

diff --git a/queue-5.15/block-fix-async_depth-sysfs-interface-for-mq-deadline.patch b/queue-5.15/block-fix-async_depth-sysfs-interface-for-mq-deadline.patch
new file mode 100644 (file)
index 0000000..1b0dccb
--- /dev/null
@@ -0,0 +1,43 @@
+From 46cdc45acb089c811d9a54fd50af33b96e5fae9d Mon Sep 17 00:00:00 2001
+From: Jens Axboe <axboe@kernel.dk>
+Date: Thu, 20 Jan 2022 10:28:13 -0700
+Subject: block: fix async_depth sysfs interface for mq-deadline
+
+From: Jens Axboe <axboe@kernel.dk>
+
+commit 46cdc45acb089c811d9a54fd50af33b96e5fae9d upstream.
+
+A previous commit added this feature, but it inadvertently used the wrong
+variable to show/store the setting from/to, victimized by copy/paste. Fix
+it up so that the async_depth sysfs interface reads and writes from the
+right setting.
+
+Fixes: 07757588e507 ("block/mq-deadline: Reserve 25% of scheduler tags for synchronous requests")
+Link: https://bugzilla.kernel.org/show_bug.cgi?id=215485
+Reviewed-by: Bart Van Assche <bvanassche@acm.org>
+Signed-off-by: Jens Axboe <axboe@kernel.dk>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ block/mq-deadline.c |    4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+--- a/block/mq-deadline.c
++++ b/block/mq-deadline.c
+@@ -811,7 +811,7 @@ SHOW_JIFFIES(deadline_read_expire_show,
+ SHOW_JIFFIES(deadline_write_expire_show, dd->fifo_expire[DD_WRITE]);
+ SHOW_INT(deadline_writes_starved_show, dd->writes_starved);
+ SHOW_INT(deadline_front_merges_show, dd->front_merges);
+-SHOW_INT(deadline_async_depth_show, dd->front_merges);
++SHOW_INT(deadline_async_depth_show, dd->async_depth);
+ SHOW_INT(deadline_fifo_batch_show, dd->fifo_batch);
+ #undef SHOW_INT
+ #undef SHOW_JIFFIES
+@@ -840,7 +840,7 @@ STORE_JIFFIES(deadline_read_expire_store
+ STORE_JIFFIES(deadline_write_expire_store, &dd->fifo_expire[DD_WRITE], 0, INT_MAX);
+ STORE_INT(deadline_writes_starved_store, &dd->writes_starved, INT_MIN, INT_MAX);
+ STORE_INT(deadline_front_merges_store, &dd->front_merges, 0, 1);
+-STORE_INT(deadline_async_depth_store, &dd->front_merges, 1, INT_MAX);
++STORE_INT(deadline_async_depth_store, &dd->async_depth, 1, INT_MAX);
+ STORE_INT(deadline_fifo_batch_store, &dd->fifo_batch, 0, INT_MAX);
+ #undef STORE_FUNCTION
+ #undef STORE_INT
diff --git a/queue-5.15/block-fix-fsync-always-failed-if-once-failed.patch b/queue-5.15/block-fix-fsync-always-failed-if-once-failed.patch
new file mode 100644 (file)
index 0000000..f74140d
--- /dev/null
@@ -0,0 +1,62 @@
+From 8a7518931baa8ea023700987f3db31cb0a80610b Mon Sep 17 00:00:00 2001
+From: Ye Bin <yebin10@huawei.com>
+Date: Mon, 29 Nov 2021 09:26:59 +0800
+Subject: block: Fix fsync always failed if once failed
+
+From: Ye Bin <yebin10@huawei.com>
+
+commit 8a7518931baa8ea023700987f3db31cb0a80610b upstream.
+
+We do test with inject error fault base on v4.19, after test some time we found
+sync /dev/sda always failed.
+[root@localhost] sync /dev/sda
+sync: error syncing '/dev/sda': Input/output error
+
+scsi log as follows:
+[19069.812296] sd 0:0:0:0: [sda] tag#64 Send: scmd 0x00000000d03a0b6b
+[19069.812302] sd 0:0:0:0: [sda] tag#64 CDB: Synchronize Cache(10) 35 00 00 00 00 00 00 00 00 00
+[19069.812533] sd 0:0:0:0: [sda] tag#64 Done: SUCCESS Result: hostbyte=DID_OK driverbyte=DRIVER_OK
+[19069.812536] sd 0:0:0:0: [sda] tag#64 CDB: Synchronize Cache(10) 35 00 00 00 00 00 00 00 00 00
+[19069.812539] sd 0:0:0:0: [sda] tag#64 scsi host busy 1 failed 0
+[19069.812542] sd 0:0:0:0: Notifying upper driver of completion (result 0)
+[19069.812546] sd 0:0:0:0: [sda] tag#64 sd_done: completed 0 of 0 bytes
+[19069.812549] sd 0:0:0:0: [sda] tag#64 0 sectors total, 0 bytes done.
+[19069.812564] print_req_error: I/O error, dev sda, sector 0
+
+ftrace log as follows:
+ rep-306069 [007] .... 19654.923315: block_bio_queue: 8,0 FWS 0 + 0 [rep]
+ rep-306069 [007] .... 19654.923333: block_getrq: 8,0 FWS 0 + 0 [rep]
+ kworker/7:1H-250   [007] .... 19654.923352: block_rq_issue: 8,0 FF 0 () 0 + 0 [kworker/7:1H]
+ <idle>-0     [007] ..s. 19654.923562: block_rq_complete: 8,0 FF () 18446744073709551615 + 0 [0]
+ <idle>-0     [007] d.s. 19654.923576: block_rq_complete: 8,0 WS () 0 + 0 [-5]
+
+As 8d6996630c03 introduce 'fq->rq_status', this data only update when 'flush_rq'
+reference count isn't zero. If flush request once failed and record error code
+in 'fq->rq_status'. If there is no chance to update 'fq->rq_status',then do fsync
+will always failed.
+To address this issue reset 'fq->rq_status' after return error code to upper layer.
+
+Fixes: 8d6996630c03("block: fix null pointer dereference in blk_mq_rq_timed_out()")
+Signed-off-by: Ye Bin <yebin10@huawei.com>
+Reviewed-by: Ming Lei <ming.lei@redhat.com>
+Link: https://lore.kernel.org/r/20211129012659.1553733-1-yebin10@huawei.com
+Signed-off-by: Jens Axboe <axboe@kernel.dk>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ block/blk-flush.c |    4 +++-
+ 1 file changed, 3 insertions(+), 1 deletion(-)
+
+--- a/block/blk-flush.c
++++ b/block/blk-flush.c
+@@ -235,8 +235,10 @@ static void flush_end_io(struct request
+        * avoiding use-after-free.
+        */
+       WRITE_ONCE(flush_rq->state, MQ_RQ_IDLE);
+-      if (fq->rq_status != BLK_STS_OK)
++      if (fq->rq_status != BLK_STS_OK) {
+               error = fq->rq_status;
++              fq->rq_status = BLK_STS_OK;
++      }
+       if (!q->elevator) {
+               flush_rq->tag = BLK_MQ_NO_TAG;
diff --git a/queue-5.15/drm-vc4-crtc-copy-assigned-channel-to-the-crtc.patch b/queue-5.15/drm-vc4-crtc-copy-assigned-channel-to-the-crtc.patch
new file mode 100644 (file)
index 0000000..3d293d1
--- /dev/null
@@ -0,0 +1,110 @@
+From eeb6ab4639590130d25670204ab7b6011333d685 Mon Sep 17 00:00:00 2001
+From: Maxime Ripard <maxime@cerno.tech>
+Date: Mon, 25 Oct 2021 16:11:07 +0200
+Subject: drm/vc4: crtc: Copy assigned channel to the CRTC
+
+From: Maxime Ripard <maxime@cerno.tech>
+
+commit eeb6ab4639590130d25670204ab7b6011333d685 upstream.
+
+Accessing the crtc->state pointer from outside the modesetting context
+is not allowed. We thus need to copy whatever we need from the KMS state
+to our structure in order to access it.
+
+In VC4, a number of users of that pointers have crept in over the years,
+and the previous commits removed them all but the HVS channel a CRTC has
+been assigned.
+
+Let's move this channel in struct vc4_crtc at atomic_begin() time, drop
+it from our private state structure, and remove our use of crtc->state
+from our vblank handler entirely.
+
+Link: https://lore.kernel.org/all/YWgteNaNeaS9uWDe@phenom.ffwll.local/
+Link: https://lore.kernel.org/r/20211025141113.702757-4-maxime@cerno.tech
+Fixes: 87ebcd42fb7b ("drm/vc4: crtc: Assign output to channel automatically")
+Acked-by: Daniel Vetter <daniel.vetter@ffwll.ch>
+Signed-off-by: Maxime Ripard <maxime@cerno.tech>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ drivers/gpu/drm/vc4/vc4_crtc.c |    4 ++--
+ drivers/gpu/drm/vc4/vc4_drv.h  |    9 +++++++++
+ drivers/gpu/drm/vc4/vc4_hvs.c  |   12 ++++++++++++
+ drivers/gpu/drm/vc4/vc4_txp.c  |    1 +
+ 4 files changed, 24 insertions(+), 2 deletions(-)
+
+--- a/drivers/gpu/drm/vc4/vc4_crtc.c
++++ b/drivers/gpu/drm/vc4/vc4_crtc.c
+@@ -708,8 +708,7 @@ static void vc4_crtc_handle_page_flip(st
+       struct drm_crtc *crtc = &vc4_crtc->base;
+       struct drm_device *dev = crtc->dev;
+       struct vc4_dev *vc4 = to_vc4_dev(dev);
+-      struct vc4_crtc_state *vc4_state = to_vc4_crtc_state(crtc->state);
+-      u32 chan = vc4_state->assigned_channel;
++      u32 chan = vc4_crtc->current_hvs_channel;
+       unsigned long flags;
+       spin_lock_irqsave(&dev->event_lock, flags);
+@@ -955,6 +954,7 @@ static const struct drm_crtc_funcs vc4_c
+ static const struct drm_crtc_helper_funcs vc4_crtc_helper_funcs = {
+       .mode_valid = vc4_crtc_mode_valid,
+       .atomic_check = vc4_crtc_atomic_check,
++      .atomic_begin = vc4_hvs_atomic_begin,
+       .atomic_flush = vc4_hvs_atomic_flush,
+       .atomic_enable = vc4_crtc_atomic_enable,
+       .atomic_disable = vc4_crtc_atomic_disable,
+--- a/drivers/gpu/drm/vc4/vc4_drv.h
++++ b/drivers/gpu/drm/vc4/vc4_drv.h
+@@ -514,6 +514,14 @@ struct vc4_crtc {
+        * handler to have access to that value.
+        */
+       unsigned int current_dlist;
++
++      /**
++       * @current_hvs_channel: HVS channel currently assigned to the
++       * CRTC. Protected by @irq_lock, and copied in
++       * vc4_hvs_atomic_begin() for the CRTC interrupt handler to have
++       * access to that value.
++       */
++      unsigned int current_hvs_channel;
+ };
+ static inline struct vc4_crtc *
+@@ -926,6 +934,7 @@ extern struct platform_driver vc4_hvs_dr
+ void vc4_hvs_stop_channel(struct drm_device *dev, unsigned int output);
+ int vc4_hvs_get_fifo_from_output(struct drm_device *dev, unsigned int output);
+ int vc4_hvs_atomic_check(struct drm_crtc *crtc, struct drm_atomic_state *state);
++void vc4_hvs_atomic_begin(struct drm_crtc *crtc, struct drm_atomic_state *state);
+ void vc4_hvs_atomic_enable(struct drm_crtc *crtc, struct drm_atomic_state *state);
+ void vc4_hvs_atomic_disable(struct drm_crtc *crtc, struct drm_atomic_state *state);
+ void vc4_hvs_atomic_flush(struct drm_crtc *crtc, struct drm_atomic_state *state);
+--- a/drivers/gpu/drm/vc4/vc4_hvs.c
++++ b/drivers/gpu/drm/vc4/vc4_hvs.c
+@@ -393,6 +393,18 @@ static void vc4_hvs_update_dlist(struct
+       spin_unlock_irqrestore(&vc4_crtc->irq_lock, flags);
+ }
++void vc4_hvs_atomic_begin(struct drm_crtc *crtc,
++                        struct drm_atomic_state *state)
++{
++      struct vc4_crtc *vc4_crtc = to_vc4_crtc(crtc);
++      struct vc4_crtc_state *vc4_state = to_vc4_crtc_state(crtc->state);
++      unsigned long flags;
++
++      spin_lock_irqsave(&vc4_crtc->irq_lock, flags);
++      vc4_crtc->current_hvs_channel = vc4_state->assigned_channel;
++      spin_unlock_irqrestore(&vc4_crtc->irq_lock, flags);
++}
++
+ void vc4_hvs_atomic_enable(struct drm_crtc *crtc,
+                          struct drm_atomic_state *state)
+ {
+--- a/drivers/gpu/drm/vc4/vc4_txp.c
++++ b/drivers/gpu/drm/vc4/vc4_txp.c
+@@ -435,6 +435,7 @@ static void vc4_txp_atomic_disable(struc
+ static const struct drm_crtc_helper_funcs vc4_txp_crtc_helper_funcs = {
+       .atomic_check   = vc4_txp_atomic_check,
++      .atomic_begin   = vc4_hvs_atomic_begin,
+       .atomic_flush   = vc4_hvs_atomic_flush,
+       .atomic_enable  = vc4_txp_atomic_enable,
+       .atomic_disable = vc4_txp_atomic_disable,
diff --git a/queue-5.15/drm-vc4-crtc-drop-feed_txp-from-state.patch b/queue-5.15/drm-vc4-crtc-drop-feed_txp-from-state.patch
new file mode 100644 (file)
index 0000000..6315229
--- /dev/null
@@ -0,0 +1,148 @@
+From a16c66401fd831f70a02d33e9bcaac585637c29f Mon Sep 17 00:00:00 2001
+From: Maxime Ripard <maxime@cerno.tech>
+Date: Mon, 25 Oct 2021 16:11:05 +0200
+Subject: drm/vc4: crtc: Drop feed_txp from state
+
+From: Maxime Ripard <maxime@cerno.tech>
+
+commit a16c66401fd831f70a02d33e9bcaac585637c29f upstream.
+
+Accessing the crtc->state pointer from outside the modesetting context
+is not allowed. We thus need to copy whatever we need from the KMS state
+to our structure in order to access it.
+
+In VC4, a number of users of that pointers have crept in over the years,
+the first one being whether or not the downstream controller of the
+pixelvalve is our writeback controller.
+
+Fortunately for us, Since commit 39fcb2808376 ("drm/vc4: txp: Turn the
+TXP into a CRTC of its own") this is no longer something that can change
+from one commit to the other and is hardcoded.
+
+Let's set this flag in struct vc4_crtc if we happen to be the TXP, and
+drop the flag from our private state structure.
+
+Link: https://lore.kernel.org/all/YWgteNaNeaS9uWDe@phenom.ffwll.local/
+Link: https://lore.kernel.org/r/20211025141113.702757-2-maxime@cerno.tech
+Fixes: 008095e065a8 ("drm/vc4: Add support for the transposer block")
+Acked-by: Daniel Vetter <daniel.vetter@ffwll.ch>
+Signed-off-by: Maxime Ripard <maxime@cerno.tech>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ drivers/gpu/drm/vc4/vc4_crtc.c |    3 +--
+ drivers/gpu/drm/vc4/vc4_drv.h  |    6 +++++-
+ drivers/gpu/drm/vc4/vc4_hvs.c  |    7 +++----
+ drivers/gpu/drm/vc4/vc4_kms.c  |    3 ++-
+ drivers/gpu/drm/vc4/vc4_txp.c  |    3 +--
+ 5 files changed, 12 insertions(+), 10 deletions(-)
+
+--- a/drivers/gpu/drm/vc4/vc4_crtc.c
++++ b/drivers/gpu/drm/vc4/vc4_crtc.c
+@@ -715,7 +715,7 @@ static void vc4_crtc_handle_page_flip(st
+       spin_lock_irqsave(&dev->event_lock, flags);
+       if (vc4_crtc->event &&
+           (vc4_state->mm.start == HVS_READ(SCALER_DISPLACTX(chan)) ||
+-           vc4_state->feed_txp)) {
++           vc4_crtc->feeds_txp)) {
+               drm_crtc_send_vblank_event(crtc, vc4_crtc->event);
+               vc4_crtc->event = NULL;
+               drm_crtc_vblank_put(crtc);
+@@ -893,7 +893,6 @@ struct drm_crtc_state *vc4_crtc_duplicat
+               return NULL;
+       old_vc4_state = to_vc4_crtc_state(crtc->state);
+-      vc4_state->feed_txp = old_vc4_state->feed_txp;
+       vc4_state->margins = old_vc4_state->margins;
+       vc4_state->assigned_channel = old_vc4_state->assigned_channel;
+--- a/drivers/gpu/drm/vc4/vc4_drv.h
++++ b/drivers/gpu/drm/vc4/vc4_drv.h
+@@ -495,6 +495,11 @@ struct vc4_crtc {
+       struct drm_pending_vblank_event *event;
+       struct debugfs_regset32 regset;
++
++      /**
++       * @feeds_txp: True if the CRTC feeds our writeback controller.
++       */
++      bool feeds_txp;
+ };
+ static inline struct vc4_crtc *
+@@ -521,7 +526,6 @@ struct vc4_crtc_state {
+       struct drm_crtc_state base;
+       /* Dlist area for this CRTC configuration. */
+       struct drm_mm_node mm;
+-      bool feed_txp;
+       bool txp_armed;
+       unsigned int assigned_channel;
+--- a/drivers/gpu/drm/vc4/vc4_hvs.c
++++ b/drivers/gpu/drm/vc4/vc4_hvs.c
+@@ -375,7 +375,7 @@ static void vc4_hvs_update_dlist(struct
+               spin_lock_irqsave(&dev->event_lock, flags);
+-              if (!vc4_state->feed_txp || vc4_state->txp_armed) {
++              if (!vc4_crtc->feeds_txp || vc4_state->txp_armed) {
+                       vc4_crtc->event = crtc->state->event;
+                       crtc->state->event = NULL;
+               }
+@@ -395,10 +395,9 @@ void vc4_hvs_atomic_enable(struct drm_cr
+ {
+       struct drm_device *dev = crtc->dev;
+       struct vc4_dev *vc4 = to_vc4_dev(dev);
+-      struct drm_crtc_state *new_crtc_state = drm_atomic_get_new_crtc_state(state, crtc);
+-      struct vc4_crtc_state *vc4_state = to_vc4_crtc_state(new_crtc_state);
+       struct drm_display_mode *mode = &crtc->state->adjusted_mode;
+-      bool oneshot = vc4_state->feed_txp;
++      struct vc4_crtc *vc4_crtc = to_vc4_crtc(crtc);
++      bool oneshot = vc4_crtc->feeds_txp;
+       vc4_hvs_update_dlist(crtc);
+       vc4_hvs_init_channel(vc4, crtc, mode, oneshot);
+--- a/drivers/gpu/drm/vc4/vc4_kms.c
++++ b/drivers/gpu/drm/vc4/vc4_kms.c
+@@ -233,6 +233,7 @@ static void vc4_hvs_pv_muxing_commit(str
+       unsigned int i;
+       for_each_new_crtc_in_state(state, crtc, crtc_state, i) {
++              struct vc4_crtc *vc4_crtc = to_vc4_crtc(crtc);
+               struct vc4_crtc_state *vc4_state = to_vc4_crtc_state(crtc_state);
+               u32 dispctrl;
+               u32 dsp3_mux;
+@@ -253,7 +254,7 @@ static void vc4_hvs_pv_muxing_commit(str
+                * TXP IP, and we need to disable the FIFO2 -> pixelvalve1
+                * route.
+                */
+-              if (vc4_state->feed_txp)
++              if (vc4_crtc->feeds_txp)
+                       dsp3_mux = VC4_SET_FIELD(3, SCALER_DISPCTRL_DSP3_MUX);
+               else
+                       dsp3_mux = VC4_SET_FIELD(2, SCALER_DISPCTRL_DSP3_MUX);
+--- a/drivers/gpu/drm/vc4/vc4_txp.c
++++ b/drivers/gpu/drm/vc4/vc4_txp.c
+@@ -391,7 +391,6 @@ static int vc4_txp_atomic_check(struct d
+ {
+       struct drm_crtc_state *crtc_state = drm_atomic_get_new_crtc_state(state,
+                                                                         crtc);
+-      struct vc4_crtc_state *vc4_state = to_vc4_crtc_state(crtc_state);
+       int ret;
+       ret = vc4_hvs_atomic_check(crtc, state);
+@@ -399,7 +398,6 @@ static int vc4_txp_atomic_check(struct d
+               return ret;
+       crtc_state->no_vblank = true;
+-      vc4_state->feed_txp = true;
+       return 0;
+ }
+@@ -482,6 +480,7 @@ static int vc4_txp_bind(struct device *d
+       vc4_crtc->pdev = pdev;
+       vc4_crtc->data = &vc4_txp_crtc_data;
++      vc4_crtc->feeds_txp = true;
+       txp->pdev = pdev;
diff --git a/queue-5.15/drm-vc4-fix-non-blocking-commit-getting-stuck-forever.patch b/queue-5.15/drm-vc4-fix-non-blocking-commit-getting-stuck-forever.patch
new file mode 100644 (file)
index 0000000..0e09fa4
--- /dev/null
@@ -0,0 +1,141 @@
+From 0c250c150c74a90db298bf2a8bcd0a1dabed2e2f Mon Sep 17 00:00:00 2001
+From: Maxime Ripard <maxime@cerno.tech>
+Date: Mon, 25 Oct 2021 16:11:06 +0200
+Subject: drm/vc4: Fix non-blocking commit getting stuck forever
+
+From: Maxime Ripard <maxime@cerno.tech>
+
+commit 0c250c150c74a90db298bf2a8bcd0a1dabed2e2f upstream.
+
+In some situation, we can end up being stuck on a non-blocking that went
+through properly.
+
+The situation that seems to trigger it reliably is to first start a
+non-blocking commit, and then right after, and before we had any vblank
+interrupt), start a blocking commit.
+
+This will lead to the first commit workqueue to be scheduled, setup the
+display, while the second commit is waiting for the first one to be
+completed.
+
+The vblank interrupt will then be raised, vc4_crtc_handle_vblank() will
+run and will compare the active dlist in the HVS channel to the one
+associated with the crtc->state.
+
+However, at that point, the second commit is waiting using
+drm_atomic_helper_wait_for_dependencies that occurs after
+drm_atomic_helper_swap_state has been called, so crtc->state points to
+the second commit state. vc4_crtc_handle_vblank() will compare the two
+dlist addresses and since they don't match will ignore the interrupt.
+
+The vblank event will never be reported, and the first and second commit
+will wait for the first commit completion until they timeout.
+
+The underlying reason is that it was never safe to do so. Indeed,
+accessing the ->state pointer access synchronization is based on
+ownership guarantees that can only occur within the functions and hooks
+defined as part of the KMS framework, and obviously the irq handler
+isn't one of them. The rework to move to generic helpers only uncovered
+the underlying issue.
+
+However, since the code path between
+drm_atomic_helper_wait_for_dependencies() and
+drm_atomic_helper_wait_for_vblanks() is serialised and we can't get two
+commits in that path at the same time, we can work around this issue by
+setting a variable associated to struct drm_crtc to the dlist we expect,
+and then using it from the vc4_crtc_handle_vblank() function.
+
+Since that state is shared with the modesetting path, we also need to
+introduce a spinlock to protect the code shared between the interrupt
+handler and the modesetting path, protecting only our new variable for
+now.
+
+Link: https://lore.kernel.org/all/YWgteNaNeaS9uWDe@phenom.ffwll.local/
+Link: https://lore.kernel.org/r/20211025141113.702757-3-maxime@cerno.tech
+Fixes: 56d1fe0979dc ("drm/vc4: Make pageflip completion handling more robust.")
+Acked-by: Daniel Vetter <daniel.vetter@ffwll.ch>
+Signed-off-by: Maxime Ripard <maxime@cerno.tech>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ drivers/gpu/drm/vc4/vc4_crtc.c |    5 ++++-
+ drivers/gpu/drm/vc4/vc4_drv.h  |   14 ++++++++++++++
+ drivers/gpu/drm/vc4/vc4_hvs.c  |    7 +++++--
+ 3 files changed, 23 insertions(+), 3 deletions(-)
+
+--- a/drivers/gpu/drm/vc4/vc4_crtc.c
++++ b/drivers/gpu/drm/vc4/vc4_crtc.c
+@@ -713,8 +713,9 @@ static void vc4_crtc_handle_page_flip(st
+       unsigned long flags;
+       spin_lock_irqsave(&dev->event_lock, flags);
++      spin_lock(&vc4_crtc->irq_lock);
+       if (vc4_crtc->event &&
+-          (vc4_state->mm.start == HVS_READ(SCALER_DISPLACTX(chan)) ||
++          (vc4_crtc->current_dlist == HVS_READ(SCALER_DISPLACTX(chan)) ||
+            vc4_crtc->feeds_txp)) {
+               drm_crtc_send_vblank_event(crtc, vc4_crtc->event);
+               vc4_crtc->event = NULL;
+@@ -728,6 +729,7 @@ static void vc4_crtc_handle_page_flip(st
+                */
+               vc4_hvs_unmask_underrun(dev, chan);
+       }
++      spin_unlock(&vc4_crtc->irq_lock);
+       spin_unlock_irqrestore(&dev->event_lock, flags);
+ }
+@@ -1127,6 +1129,7 @@ int vc4_crtc_init(struct drm_device *drm
+               return PTR_ERR(primary_plane);
+       }
++      spin_lock_init(&vc4_crtc->irq_lock);
+       drm_crtc_init_with_planes(drm, crtc, primary_plane, NULL,
+                                 crtc_funcs, NULL);
+       drm_crtc_helper_add(crtc, crtc_helper_funcs);
+--- a/drivers/gpu/drm/vc4/vc4_drv.h
++++ b/drivers/gpu/drm/vc4/vc4_drv.h
+@@ -500,6 +500,20 @@ struct vc4_crtc {
+        * @feeds_txp: True if the CRTC feeds our writeback controller.
+        */
+       bool feeds_txp;
++
++      /**
++       * @irq_lock: Spinlock protecting the resources shared between
++       * the atomic code and our vblank handler.
++       */
++      spinlock_t irq_lock;
++
++      /**
++       * @current_dlist: Start offset of the display list currently
++       * set in the HVS for that CRTC. Protected by @irq_lock, and
++       * copied in vc4_hvs_update_dlist() for the CRTC interrupt
++       * handler to have access to that value.
++       */
++      unsigned int current_dlist;
+ };
+ static inline struct vc4_crtc *
+--- a/drivers/gpu/drm/vc4/vc4_hvs.c
++++ b/drivers/gpu/drm/vc4/vc4_hvs.c
+@@ -365,10 +365,9 @@ static void vc4_hvs_update_dlist(struct
+       struct vc4_dev *vc4 = to_vc4_dev(dev);
+       struct vc4_crtc *vc4_crtc = to_vc4_crtc(crtc);
+       struct vc4_crtc_state *vc4_state = to_vc4_crtc_state(crtc->state);
++      unsigned long flags;
+       if (crtc->state->event) {
+-              unsigned long flags;
+-
+               crtc->state->event->pipe = drm_crtc_index(crtc);
+               WARN_ON(drm_crtc_vblank_get(crtc) != 0);
+@@ -388,6 +387,10 @@ static void vc4_hvs_update_dlist(struct
+               HVS_WRITE(SCALER_DISPLISTX(vc4_state->assigned_channel),
+                         vc4_state->mm.start);
+       }
++
++      spin_lock_irqsave(&vc4_crtc->irq_lock, flags);
++      vc4_crtc->current_dlist = vc4_state->mm.start;
++      spin_unlock_irqrestore(&vc4_crtc->irq_lock, flags);
+ }
+ void vc4_hvs_atomic_enable(struct drm_crtc *crtc,
diff --git a/queue-5.15/powerpc-cell-fix-clang-wimplicit-fallthrough-warning.patch b/queue-5.15/powerpc-cell-fix-clang-wimplicit-fallthrough-warning.patch
new file mode 100644 (file)
index 0000000..6166615
--- /dev/null
@@ -0,0 +1,47 @@
+From e89257e28e844f5d1d39081bb901d9f1183a7705 Mon Sep 17 00:00:00 2001
+From: Anders Roxell <anders.roxell@linaro.org>
+Date: Tue, 7 Dec 2021 12:02:28 +0100
+Subject: powerpc/cell: Fix clang -Wimplicit-fallthrough warning
+
+From: Anders Roxell <anders.roxell@linaro.org>
+
+commit e89257e28e844f5d1d39081bb901d9f1183a7705 upstream.
+
+Clang warns:
+
+arch/powerpc/platforms/cell/pervasive.c:81:2: error: unannotated fall-through between switch labels
+        case SRR1_WAKEEE:
+        ^
+arch/powerpc/platforms/cell/pervasive.c:81:2: note: insert 'break;' to avoid fall-through
+        case SRR1_WAKEEE:
+        ^
+        break;
+1 error generated.
+
+Clang is more pedantic than GCC, which does not warn when failing
+through to a case that is just break or return. Clang's version is more
+in line with the kernel's own stance in deprecated.rst. Add athe missing
+break to silence the warning.
+
+Fixes: 6e83985b0f6e ("powerpc/cbe: Do not process external or decremeter interrupts from sreset")
+Reported-by: Naresh Kamboju <naresh.kamboju@linaro.org>
+Signed-off-by: Anders Roxell <anders.roxell@linaro.org>
+Reviewed-by: Nathan Chancellor <nathan@kernel.org>
+Reviewed-by: Arnd Bergmann <arnd@arndb.de>
+Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
+Link: https://lore.kernel.org/r/20211207110228.698956-1-anders.roxell@linaro.org
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ arch/powerpc/platforms/cell/pervasive.c |    1 +
+ 1 file changed, 1 insertion(+)
+
+--- a/arch/powerpc/platforms/cell/pervasive.c
++++ b/arch/powerpc/platforms/cell/pervasive.c
+@@ -78,6 +78,7 @@ static int cbe_system_reset_exception(st
+       switch (regs->msr & SRR1_WAKEMASK) {
+       case SRR1_WAKEDEC:
+               set_dec(1);
++              break;
+       case SRR1_WAKEEE:
+               /*
+                * Handle these when interrupts get re-enabled and we take
diff --git a/queue-5.15/powerpc-fsl-dts-enable-wa-for-erratum-a-009885-on-fman3l-mdio-buses.patch b/queue-5.15/powerpc-fsl-dts-enable-wa-for-erratum-a-009885-on-fman3l-mdio-buses.patch
new file mode 100644 (file)
index 0000000..49f1f30
--- /dev/null
@@ -0,0 +1,38 @@
+From 0d375d610fa96524e2ee2b46830a46a7bfa92a9f Mon Sep 17 00:00:00 2001
+From: Tobias Waldekranz <tobias@waldekranz.com>
+Date: Tue, 18 Jan 2022 22:50:52 +0100
+Subject: powerpc/fsl/dts: Enable WA for erratum A-009885 on fman3l MDIO buses
+
+From: Tobias Waldekranz <tobias@waldekranz.com>
+
+commit 0d375d610fa96524e2ee2b46830a46a7bfa92a9f upstream.
+
+This block is used in (at least) T1024 and T1040, including their
+variants like T1023 etc.
+
+Fixes: d55ad2967d89 ("powerpc/mpc85xx: Create dts components for the FSL QorIQ DPAA FMan")
+Signed-off-by: Tobias Waldekranz <tobias@waldekranz.com>
+Signed-off-by: Jakub Kicinski <kuba@kernel.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ arch/powerpc/boot/dts/fsl/qoriq-fman3l-0.dtsi |    2 ++
+ 1 file changed, 2 insertions(+)
+
+--- a/arch/powerpc/boot/dts/fsl/qoriq-fman3l-0.dtsi
++++ b/arch/powerpc/boot/dts/fsl/qoriq-fman3l-0.dtsi
+@@ -79,6 +79,7 @@ fman0: fman@400000 {
+               #size-cells = <0>;
+               compatible = "fsl,fman-memac-mdio", "fsl,fman-xmdio";
+               reg = <0xfc000 0x1000>;
++              fsl,erratum-a009885;
+       };
+       xmdio0: mdio@fd000 {
+@@ -86,6 +87,7 @@ fman0: fman@400000 {
+               #size-cells = <0>;
+               compatible = "fsl,fman-memac-mdio", "fsl,fman-xmdio";
+               reg = <0xfd000 0x1000>;
++              fsl,erratum-a009885;
+       };
+ };
index c563ee0c6e9cc3b535f67421337a8616109bd4a5..bd4f9e9dee666d8291e27ac453bd23a8a77c22a8 100644 (file)
@@ -753,3 +753,10 @@ rdma-hns-modify-the-mapping-attribute-of-doorbell-to-device.patch
 rdma-rxe-fix-a-typo-in-opcode-name.patch
 dmaengine-stm32-mdma-fix-stm32_mdma_ctbr_tsel_mask.patch
 revert-net-mlx5-add-retry-mechanism-to-the-command-entry-index-allocation.patch
+powerpc-cell-fix-clang-wimplicit-fallthrough-warning.patch
+powerpc-fsl-dts-enable-wa-for-erratum-a-009885-on-fman3l-mdio-buses.patch
+block-fix-async_depth-sysfs-interface-for-mq-deadline.patch
+block-fix-fsync-always-failed-if-once-failed.patch
+drm-vc4-crtc-drop-feed_txp-from-state.patch
+drm-vc4-fix-non-blocking-commit-getting-stuck-forever.patch
+drm-vc4-crtc-copy-assigned-channel-to-the-crtc.patch