]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
4.19-stable patches
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 6 Jun 2022 15:45:08 +0000 (17:45 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 6 Jun 2022 15:45:08 +0000 (17:45 +0200)
added patches:
arm64-dts-qcom-ipq8074-fix-the-sleep-clock-frequency.patch
blk-iolatency-fix-inflight-count-imbalances-and-io-hangs-on-offline.patch
docs-conf.py-cope-with-removal-of-language-none-in-sphinx-5.0.0.patch
dt-bindings-gpio-altera-correct-interrupt-cells.patch
gma500-fix-an-incorrect-null-check-on-list-iterator.patch
phy-qcom-qmp-fix-reset-controller-leak-on-probe-errors.patch
phy-qcom-qmp-fix-struct-clk-leak-on-probe-errors.patch

queue-4.19/arm64-dts-qcom-ipq8074-fix-the-sleep-clock-frequency.patch [new file with mode: 0644]
queue-4.19/blk-iolatency-fix-inflight-count-imbalances-and-io-hangs-on-offline.patch [new file with mode: 0644]
queue-4.19/docs-conf.py-cope-with-removal-of-language-none-in-sphinx-5.0.0.patch [new file with mode: 0644]
queue-4.19/dt-bindings-gpio-altera-correct-interrupt-cells.patch [new file with mode: 0644]
queue-4.19/gma500-fix-an-incorrect-null-check-on-list-iterator.patch [new file with mode: 0644]
queue-4.19/phy-qcom-qmp-fix-reset-controller-leak-on-probe-errors.patch [new file with mode: 0644]
queue-4.19/phy-qcom-qmp-fix-struct-clk-leak-on-probe-errors.patch [new file with mode: 0644]
queue-4.19/series

diff --git a/queue-4.19/arm64-dts-qcom-ipq8074-fix-the-sleep-clock-frequency.patch b/queue-4.19/arm64-dts-qcom-ipq8074-fix-the-sleep-clock-frequency.patch
new file mode 100644 (file)
index 0000000..0f521a9
--- /dev/null
@@ -0,0 +1,33 @@
+From f607dd767f5d6800ffbdce5b99ba81763b023781 Mon Sep 17 00:00:00 2001
+From: Kathiravan T <quic_kathirav@quicinc.com>
+Date: Fri, 11 Feb 2022 17:44:15 +0530
+Subject: arm64: dts: qcom: ipq8074: fix the sleep clock frequency
+
+From: Kathiravan T <quic_kathirav@quicinc.com>
+
+commit f607dd767f5d6800ffbdce5b99ba81763b023781 upstream.
+
+Sleep clock frequency should be 32768Hz. Lets fix it.
+
+Cc: stable@vger.kernel.org
+Fixes: 41dac73e243d ("arm64: dts: Add ipq8074 SoC and HK01 board support")
+Link: https://lore.kernel.org/all/e2a447f8-6024-0369-f698-2027b6edcf9e@codeaurora.org/
+Signed-off-by: Kathiravan T <quic_kathirav@quicinc.com>
+Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
+Link: https://lore.kernel.org/r/1644581655-11568-1-git-send-email-quic_kathirav@quicinc.com
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ arch/arm64/boot/dts/qcom/ipq8074.dtsi |    2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/arch/arm64/boot/dts/qcom/ipq8074.dtsi
++++ b/arch/arm64/boot/dts/qcom/ipq8074.dtsi
+@@ -490,7 +490,7 @@
+       clocks {
+               sleep_clk: sleep_clk {
+                       compatible = "fixed-clock";
+-                      clock-frequency = <32000>;
++                      clock-frequency = <32768>;
+                       #clock-cells = <0>;
+               };
diff --git a/queue-4.19/blk-iolatency-fix-inflight-count-imbalances-and-io-hangs-on-offline.patch b/queue-4.19/blk-iolatency-fix-inflight-count-imbalances-and-io-hangs-on-offline.patch
new file mode 100644 (file)
index 0000000..44cda6b
--- /dev/null
@@ -0,0 +1,323 @@
+From 8a177a36da6c54c98b8685d4f914cb3637d53c0d Mon Sep 17 00:00:00 2001
+From: Tejun Heo <tj@kernel.org>
+Date: Fri, 13 May 2022 20:55:45 -1000
+Subject: blk-iolatency: Fix inflight count imbalances and IO hangs on offline
+
+From: Tejun Heo <tj@kernel.org>
+
+commit 8a177a36da6c54c98b8685d4f914cb3637d53c0d upstream.
+
+iolatency needs to track the number of inflight IOs per cgroup. As this
+tracking can be expensive, it is disabled when no cgroup has iolatency
+configured for the device. To ensure that the inflight counters stay
+balanced, iolatency_set_limit() freezes the request_queue while manipulating
+the enabled counter, which ensures that no IO is in flight and thus all
+counters are zero.
+
+Unfortunately, iolatency_set_limit() isn't the only place where the enabled
+counter is manipulated. iolatency_pd_offline() can also dec the counter and
+trigger disabling. As this disabling happens without freezing the q, this
+can easily happen while some IOs are in flight and thus leak the counts.
+
+This can be easily demonstrated by turning on iolatency on an one empty
+cgroup while IOs are in flight in other cgroups and then removing the
+cgroup. Note that iolatency shouldn't have been enabled elsewhere in the
+system to ensure that removing the cgroup disables iolatency for the whole
+device.
+
+The following keeps flipping on and off iolatency on sda:
+
+  echo +io > /sys/fs/cgroup/cgroup.subtree_control
+  while true; do
+      mkdir -p /sys/fs/cgroup/test
+      echo '8:0 target=100000' > /sys/fs/cgroup/test/io.latency
+      sleep 1
+      rmdir /sys/fs/cgroup/test
+      sleep 1
+  done
+
+and there's concurrent fio generating direct rand reads:
+
+  fio --name test --filename=/dev/sda --direct=1 --rw=randread \
+      --runtime=600 --time_based --iodepth=256 --numjobs=4 --bs=4k
+
+while monitoring with the following drgn script:
+
+  while True:
+    for css in css_for_each_descendant_pre(prog['blkcg_root'].css.address_of_()):
+        for pos in hlist_for_each(container_of(css, 'struct blkcg', 'css').blkg_list):
+            blkg = container_of(pos, 'struct blkcg_gq', 'blkcg_node')
+            pd = blkg.pd[prog['blkcg_policy_iolatency'].plid]
+            if pd.value_() == 0:
+                continue
+            iolat = container_of(pd, 'struct iolatency_grp', 'pd')
+            inflight = iolat.rq_wait.inflight.counter.value_()
+            if inflight:
+                print(f'inflight={inflight} {disk_name(blkg.q.disk).decode("utf-8")} '
+                      f'{cgroup_path(css.cgroup).decode("utf-8")}')
+    time.sleep(1)
+
+The monitoring output looks like the following:
+
+  inflight=1 sda /user.slice
+  inflight=1 sda /user.slice
+  ...
+  inflight=14 sda /user.slice
+  inflight=13 sda /user.slice
+  inflight=17 sda /user.slice
+  inflight=15 sda /user.slice
+  inflight=18 sda /user.slice
+  inflight=17 sda /user.slice
+  inflight=20 sda /user.slice
+  inflight=19 sda /user.slice <- fio stopped, inflight stuck at 19
+  inflight=19 sda /user.slice
+  inflight=19 sda /user.slice
+
+If a cgroup with stuck inflight ends up getting throttled, the throttled IOs
+will never get issued as there's no completion event to wake it up leading
+to an indefinite hang.
+
+This patch fixes the bug by unifying enable handling into a work item which
+is automatically kicked off from iolatency_set_min_lat_nsec() which is
+called from both iolatency_set_limit() and iolatency_pd_offline() paths.
+Punting to a work item is necessary as iolatency_pd_offline() is called
+under spinlocks while freezing a request_queue requires a sleepable context.
+
+This also simplifies the code reducing LOC sans the comments and avoids the
+unnecessary freezes which were happening whenever a cgroup's latency target
+is newly set or cleared.
+
+Signed-off-by: Tejun Heo <tj@kernel.org>
+Cc: Josef Bacik <josef@toxicpanda.com>
+Cc: Liu Bo <bo.liu@linux.alibaba.com>
+Fixes: 8c772a9bfc7c ("blk-iolatency: fix IO hang due to negative inflight counter")
+Cc: stable@vger.kernel.org # v5.0+
+Link: https://lore.kernel.org/r/Yn9ScX6Nx2qIiQQi@slm.duckdns.org
+Signed-off-by: Jens Axboe <axboe@kernel.dk>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ block/blk-iolatency.c |  122 ++++++++++++++++++++++++++------------------------
+ 1 file changed, 64 insertions(+), 58 deletions(-)
+
+--- a/block/blk-iolatency.c
++++ b/block/blk-iolatency.c
+@@ -85,7 +85,17 @@ struct iolatency_grp;
+ struct blk_iolatency {
+       struct rq_qos rqos;
+       struct timer_list timer;
+-      atomic_t enabled;
++
++      /*
++       * ->enabled is the master enable switch gating the throttling logic and
++       * inflight tracking. The number of cgroups which have iolat enabled is
++       * tracked in ->enable_cnt, and ->enable is flipped on/off accordingly
++       * from ->enable_work with the request_queue frozen. For details, See
++       * blkiolatency_enable_work_fn().
++       */
++      bool enabled;
++      atomic_t enable_cnt;
++      struct work_struct enable_work;
+ };
+ static inline struct blk_iolatency *BLKIOLATENCY(struct rq_qos *rqos)
+@@ -93,11 +103,6 @@ static inline struct blk_iolatency *BLKI
+       return container_of(rqos, struct blk_iolatency, rqos);
+ }
+-static inline bool blk_iolatency_enabled(struct blk_iolatency *blkiolat)
+-{
+-      return atomic_read(&blkiolat->enabled) > 0;
+-}
+-
+ struct child_latency_info {
+       spinlock_t lock;
+@@ -402,7 +407,7 @@ static void blkcg_iolatency_throttle(str
+       struct request_queue *q = rqos->q;
+       bool issue_as_root = bio_issue_as_root_blkg(bio);
+-      if (!blk_iolatency_enabled(blkiolat))
++      if (!blkiolat->enabled)
+               return;
+       rcu_read_lock();
+@@ -559,7 +564,6 @@ static void blkcg_iolatency_done_bio(str
+       u64 window_start;
+       u64 now = ktime_to_ns(ktime_get());
+       bool issue_as_root = bio_issue_as_root_blkg(bio);
+-      bool enabled = false;
+       int inflight = 0;
+       blkg = bio->bi_blkg;
+@@ -570,8 +574,7 @@ static void blkcg_iolatency_done_bio(str
+       if (!iolat)
+               return;
+-      enabled = blk_iolatency_enabled(iolat->blkiolat);
+-      if (!enabled)
++      if (!iolat->blkiolat->enabled)
+               return;
+       while (blkg && blkg->parent) {
+@@ -609,6 +612,7 @@ static void blkcg_iolatency_exit(struct
+       struct blk_iolatency *blkiolat = BLKIOLATENCY(rqos);
+       del_timer_sync(&blkiolat->timer);
++      flush_work(&blkiolat->enable_work);
+       blkcg_deactivate_policy(rqos->q, &blkcg_policy_iolatency);
+       kfree(blkiolat);
+ }
+@@ -680,6 +684,44 @@ next:
+       rcu_read_unlock();
+ }
++/**
++ * blkiolatency_enable_work_fn - Enable or disable iolatency on the device
++ * @work: enable_work of the blk_iolatency of interest
++ *
++ * iolatency needs to keep track of the number of in-flight IOs per cgroup. This
++ * is relatively expensive as it involves walking up the hierarchy twice for
++ * every IO. Thus, if iolatency is not enabled in any cgroup for the device, we
++ * want to disable the in-flight tracking.
++ *
++ * We have to make sure that the counting is balanced - we don't want to leak
++ * the in-flight counts by disabling accounting in the completion path while IOs
++ * are in flight. This is achieved by ensuring that no IO is in flight by
++ * freezing the queue while flipping ->enabled. As this requires a sleepable
++ * context, ->enabled flipping is punted to this work function.
++ */
++static void blkiolatency_enable_work_fn(struct work_struct *work)
++{
++      struct blk_iolatency *blkiolat = container_of(work, struct blk_iolatency,
++                                                    enable_work);
++      bool enabled;
++
++      /*
++       * There can only be one instance of this function running for @blkiolat
++       * and it's guaranteed to be executed at least once after the latest
++       * ->enabled_cnt modification. Acting on the latest ->enable_cnt is
++       * sufficient.
++       *
++       * Also, we know @blkiolat is safe to access as ->enable_work is flushed
++       * in blkcg_iolatency_exit().
++       */
++      enabled = atomic_read(&blkiolat->enable_cnt);
++      if (enabled != blkiolat->enabled) {
++              blk_mq_freeze_queue(blkiolat->rqos.q);
++              blkiolat->enabled = enabled;
++              blk_mq_unfreeze_queue(blkiolat->rqos.q);
++      }
++}
++
+ int blk_iolatency_init(struct request_queue *q)
+ {
+       struct blk_iolatency *blkiolat;
+@@ -705,17 +747,15 @@ int blk_iolatency_init(struct request_qu
+       }
+       timer_setup(&blkiolat->timer, blkiolatency_timer_fn, 0);
++      INIT_WORK(&blkiolat->enable_work, blkiolatency_enable_work_fn);
+       return 0;
+ }
+-/*
+- * return 1 for enabling iolatency, return -1 for disabling iolatency, otherwise
+- * return 0.
+- */
+-static int iolatency_set_min_lat_nsec(struct blkcg_gq *blkg, u64 val)
++static void iolatency_set_min_lat_nsec(struct blkcg_gq *blkg, u64 val)
+ {
+       struct iolatency_grp *iolat = blkg_to_lat(blkg);
++      struct blk_iolatency *blkiolat = iolat->blkiolat;
+       u64 oldval = iolat->min_lat_nsec;
+       iolat->min_lat_nsec = val;
+@@ -723,13 +763,15 @@ static int iolatency_set_min_lat_nsec(st
+       iolat->cur_win_nsec = min_t(u64, iolat->cur_win_nsec,
+                                   BLKIOLATENCY_MAX_WIN_SIZE);
+-      if (!oldval && val)
+-              return 1;
++      if (!oldval && val) {
++              if (atomic_inc_return(&blkiolat->enable_cnt) == 1)
++                      schedule_work(&blkiolat->enable_work);
++      }
+       if (oldval && !val) {
+               blkcg_clear_delay(blkg);
+-              return -1;
++              if (atomic_dec_return(&blkiolat->enable_cnt) == 0)
++                      schedule_work(&blkiolat->enable_work);
+       }
+-      return 0;
+ }
+ static void iolatency_clear_scaling(struct blkcg_gq *blkg)
+@@ -762,7 +804,6 @@ static ssize_t iolatency_set_limit(struc
+       u64 lat_val = 0;
+       u64 oldval;
+       int ret;
+-      int enable = 0;
+       ret = blkg_conf_prep(blkcg, &blkcg_policy_iolatency, buf, &ctx);
+       if (ret)
+@@ -798,41 +839,12 @@ static ssize_t iolatency_set_limit(struc
+       blkg = ctx.blkg;
+       oldval = iolat->min_lat_nsec;
+-      enable = iolatency_set_min_lat_nsec(blkg, lat_val);
+-      if (enable) {
+-              if (!blk_get_queue(blkg->q)) {
+-                      ret = -ENODEV;
+-                      goto out;
+-              }
+-
+-              blkg_get(blkg);
+-      }
+-
+-      if (oldval != iolat->min_lat_nsec) {
++      iolatency_set_min_lat_nsec(blkg, lat_val);
++      if (oldval != iolat->min_lat_nsec)
+               iolatency_clear_scaling(blkg);
+-      }
+-
+       ret = 0;
+ out:
+       blkg_conf_finish(&ctx);
+-      if (ret == 0 && enable) {
+-              struct iolatency_grp *tmp = blkg_to_lat(blkg);
+-              struct blk_iolatency *blkiolat = tmp->blkiolat;
+-
+-              blk_mq_freeze_queue(blkg->q);
+-
+-              if (enable == 1)
+-                      atomic_inc(&blkiolat->enabled);
+-              else if (enable == -1)
+-                      atomic_dec(&blkiolat->enabled);
+-              else
+-                      WARN_ON_ONCE(1);
+-
+-              blk_mq_unfreeze_queue(blkg->q);
+-
+-              blkg_put(blkg);
+-              blk_put_queue(blkg->q);
+-      }
+       return ret ?: nbytes;
+ }
+@@ -932,14 +944,8 @@ static void iolatency_pd_offline(struct
+ {
+       struct iolatency_grp *iolat = pd_to_lat(pd);
+       struct blkcg_gq *blkg = lat_to_blkg(iolat);
+-      struct blk_iolatency *blkiolat = iolat->blkiolat;
+-      int ret;
+-      ret = iolatency_set_min_lat_nsec(blkg, 0);
+-      if (ret == 1)
+-              atomic_inc(&blkiolat->enabled);
+-      if (ret == -1)
+-              atomic_dec(&blkiolat->enabled);
++      iolatency_set_min_lat_nsec(blkg, 0);
+       iolatency_clear_scaling(blkg);
+ }
diff --git a/queue-4.19/docs-conf.py-cope-with-removal-of-language-none-in-sphinx-5.0.0.patch b/queue-4.19/docs-conf.py-cope-with-removal-of-language-none-in-sphinx-5.0.0.patch
new file mode 100644 (file)
index 0000000..30fb66e
--- /dev/null
@@ -0,0 +1,48 @@
+From 627f01eab93d8671d4e4afee9b148f9998d20e7c Mon Sep 17 00:00:00 2001
+From: Akira Yokosawa <akiyks@gmail.com>
+Date: Wed, 1 Jun 2022 23:34:06 +0900
+Subject: docs/conf.py: Cope with removal of language=None in Sphinx 5.0.0
+
+From: Akira Yokosawa <akiyks@gmail.com>
+
+commit 627f01eab93d8671d4e4afee9b148f9998d20e7c upstream.
+
+One of the changes in Sphinx 5.0.0 [1] says [sic]:
+
+    5.0.0 final
+
+     - #10474: language does not accept None as it value.
+       The default value of language becomes to 'en' now.
+
+[1]: https://www.sphinx-doc.org/en/master/changes.html#release-5-0-0-released-may-30-2022
+
+It results in a new warning from Sphinx 5.0.0 [sic]:
+
+    WARNING: Invalid configuration value found: 'language = None'.
+    Update your configuration to a valid langauge code. Falling
+    back to 'en' (English).
+
+Silence the warning by using 'en'.
+It works with all the Sphinx versions required for building
+kernel documentation (1.7.9 or later).
+
+Signed-off-by: Akira Yokosawa <akiyks@gmail.com>
+Link: https://lore.kernel.org/r/bd0c2ddc-2401-03cb-4526-79ca664e1cbe@gmail.com
+Cc: stable@vger.kernel.org
+Signed-off-by: Jonathan Corbet <corbet@lwn.net>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ Documentation/conf.py |    2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/Documentation/conf.py
++++ b/Documentation/conf.py
+@@ -95,7 +95,7 @@ finally:
+ #
+ # This is also used if you do content translation via gettext catalogs.
+ # Usually you set "language" from the command line for these cases.
+-language = None
++language = 'en'
+ # There are two options for replacing |today|: either, you set today to some
+ # non-false value, then it is used:
diff --git a/queue-4.19/dt-bindings-gpio-altera-correct-interrupt-cells.patch b/queue-4.19/dt-bindings-gpio-altera-correct-interrupt-cells.patch
new file mode 100644 (file)
index 0000000..56e33de
--- /dev/null
@@ -0,0 +1,40 @@
+From 3a21c3ac93aff7b4522b152399df8f6a041df56d Mon Sep 17 00:00:00 2001
+From: Dinh Nguyen <dinguyen@kernel.org>
+Date: Wed, 11 May 2022 12:54:46 -0500
+Subject: dt-bindings: gpio: altera: correct interrupt-cells
+
+From: Dinh Nguyen <dinguyen@kernel.org>
+
+commit 3a21c3ac93aff7b4522b152399df8f6a041df56d upstream.
+
+update documentation to correctly state the interrupt-cells to be 2.
+
+Cc: stable@vger.kernel.org
+Fixes: 4fd9bbc6e071 ("drivers/gpio: Altera soft IP GPIO driver devicetree binding")
+Signed-off-by: Dinh Nguyen <dinguyen@kernel.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ Documentation/devicetree/bindings/gpio/gpio-altera.txt |    5 +++--
+ 1 file changed, 3 insertions(+), 2 deletions(-)
+
+--- a/Documentation/devicetree/bindings/gpio/gpio-altera.txt
++++ b/Documentation/devicetree/bindings/gpio/gpio-altera.txt
+@@ -9,8 +9,9 @@ Required properties:
+   - The second cell is reserved and is currently unused.
+ - gpio-controller : Marks the device node as a GPIO controller.
+ - interrupt-controller: Mark the device node as an interrupt controller
+-- #interrupt-cells : Should be 1. The interrupt type is fixed in the hardware.
++- #interrupt-cells : Should be 2. The interrupt type is fixed in the hardware.
+   - The first cell is the GPIO offset number within the GPIO controller.
++  - The second cell is the interrupt trigger type and level flags.
+ - interrupts: Specify the interrupt.
+ - altr,interrupt-type: Specifies the interrupt trigger type the GPIO
+   hardware is synthesized. This field is required if the Altera GPIO controller
+@@ -38,6 +39,6 @@ gpio_altr: gpio@ff200000 {
+       altr,interrupt-type = <IRQ_TYPE_EDGE_RISING>;
+       #gpio-cells = <2>;
+       gpio-controller;
+-      #interrupt-cells = <1>;
++      #interrupt-cells = <2>;
+       interrupt-controller;
+ };
diff --git a/queue-4.19/gma500-fix-an-incorrect-null-check-on-list-iterator.patch b/queue-4.19/gma500-fix-an-incorrect-null-check-on-list-iterator.patch
new file mode 100644 (file)
index 0000000..eb50c94
--- /dev/null
@@ -0,0 +1,49 @@
+From bdef417d84536715145f6dc9cc3275c46f26295a Mon Sep 17 00:00:00 2001
+From: Xiaomeng Tong <xiam0nd.tong@gmail.com>
+Date: Sun, 27 Mar 2022 13:20:28 +0800
+Subject: gma500: fix an incorrect NULL check on list iterator
+
+From: Xiaomeng Tong <xiam0nd.tong@gmail.com>
+
+commit bdef417d84536715145f6dc9cc3275c46f26295a upstream.
+
+The bug is here:
+       return crtc;
+
+The list iterator value 'crtc' will *always* be set and non-NULL by
+list_for_each_entry(), so it is incorrect to assume that the iterator
+value will be NULL if the list is empty or no element is found.
+
+To fix the bug, return 'crtc' when found, otherwise return NULL.
+
+Cc: stable@vger.kernel.org
+fixes: 89c78134cc54d ("gma500: Add Poulsbo support")
+Signed-off-by: Xiaomeng Tong <xiam0nd.tong@gmail.com>
+Signed-off-by: Patrik Jakobsson <patrik.r.jakobsson@gmail.com>
+Link: https://patchwork.freedesktop.org/patch/msgid/20220327052028.2013-1-xiam0nd.tong@gmail.com
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ drivers/gpu/drm/gma500/psb_intel_display.c |    7 ++++---
+ 1 file changed, 4 insertions(+), 3 deletions(-)
+
+--- a/drivers/gpu/drm/gma500/psb_intel_display.c
++++ b/drivers/gpu/drm/gma500/psb_intel_display.c
+@@ -543,14 +543,15 @@ void psb_intel_crtc_init(struct drm_devi
+ struct drm_crtc *psb_intel_get_crtc_from_pipe(struct drm_device *dev, int pipe)
+ {
+-      struct drm_crtc *crtc = NULL;
++      struct drm_crtc *crtc;
+       list_for_each_entry(crtc, &dev->mode_config.crtc_list, head) {
+               struct gma_crtc *gma_crtc = to_gma_crtc(crtc);
++
+               if (gma_crtc->pipe == pipe)
+-                      break;
++                      return crtc;
+       }
+-      return crtc;
++      return NULL;
+ }
+ int gma_connector_clones(struct drm_device *dev, int type_mask)
diff --git a/queue-4.19/phy-qcom-qmp-fix-reset-controller-leak-on-probe-errors.patch b/queue-4.19/phy-qcom-qmp-fix-reset-controller-leak-on-probe-errors.patch
new file mode 100644 (file)
index 0000000..f5fb685
--- /dev/null
@@ -0,0 +1,54 @@
+From 4d2900f20edfe541f75756a00deeb2ffe7c66bc1 Mon Sep 17 00:00:00 2001
+From: Johan Hovold <johan+linaro@kernel.org>
+Date: Wed, 27 Apr 2022 08:32:42 +0200
+Subject: phy: qcom-qmp: fix reset-controller leak on probe errors
+
+From: Johan Hovold <johan+linaro@kernel.org>
+
+commit 4d2900f20edfe541f75756a00deeb2ffe7c66bc1 upstream.
+
+Make sure to release the lane reset controller in case of a late probe
+error (e.g. probe deferral).
+
+Note that due to the reset controller being defined in devicetree in
+"lane" child nodes, devm_reset_control_get_exclusive() cannot be used
+directly.
+
+Fixes: e78f3d15e115 ("phy: qcom-qmp: new qmp phy driver for qcom-chipsets")
+Cc: stable@vger.kernel.org      # 4.12
+Cc: Vivek Gautam <vivek.gautam@codeaurora.org>
+Reviewed-by: Philipp Zabel <p.zabel@pengutronix.de>
+Signed-off-by: Johan Hovold <johan+linaro@kernel.org>
+Reviewed-by: Bjorn Andersson <bjorn.andersson@linaro.org>
+Link: https://lore.kernel.org/r/20220427063243.32576-3-johan+linaro@kernel.org
+Signed-off-by: Vinod Koul <vkoul@kernel.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ drivers/phy/qualcomm/phy-qcom-qmp.c |    9 +++++++++
+ 1 file changed, 9 insertions(+)
+
+--- a/drivers/phy/qualcomm/phy-qcom-qmp.c
++++ b/drivers/phy/qualcomm/phy-qcom-qmp.c
+@@ -1426,6 +1426,11 @@ static const struct phy_ops qcom_qmp_phy
+       .owner          = THIS_MODULE,
+ };
++static void qcom_qmp_reset_control_put(void *data)
++{
++      reset_control_put(data);
++}
++
+ static
+ int qcom_qmp_phy_create(struct device *dev, struct device_node *np, int id)
+ {
+@@ -1490,6 +1495,10 @@ int qcom_qmp_phy_create(struct device *d
+                       dev_err(dev, "failed to get lane%d reset\n", id);
+                       return PTR_ERR(qphy->lane_rst);
+               }
++              ret = devm_add_action_or_reset(dev, qcom_qmp_reset_control_put,
++                                             qphy->lane_rst);
++              if (ret)
++                      return ret;
+       }
+       generic_phy = devm_phy_create(dev, np, &qcom_qmp_phy_gen_ops);
diff --git a/queue-4.19/phy-qcom-qmp-fix-struct-clk-leak-on-probe-errors.patch b/queue-4.19/phy-qcom-qmp-fix-struct-clk-leak-on-probe-errors.patch
new file mode 100644 (file)
index 0000000..9ed2b47
--- /dev/null
@@ -0,0 +1,35 @@
+From f0a4bc38a12f5a0cc5ad68670d9480e91e6a94df Mon Sep 17 00:00:00 2001
+From: Johan Hovold <johan+linaro@kernel.org>
+Date: Wed, 27 Apr 2022 08:32:41 +0200
+Subject: phy: qcom-qmp: fix struct clk leak on probe errors
+
+From: Johan Hovold <johan+linaro@kernel.org>
+
+commit f0a4bc38a12f5a0cc5ad68670d9480e91e6a94df upstream.
+
+Make sure to release the pipe clock reference in case of a late probe
+error (e.g. probe deferral).
+
+Fixes: e78f3d15e115 ("phy: qcom-qmp: new qmp phy driver for qcom-chipsets")
+Cc: stable@vger.kernel.org      # 4.12
+Cc: Vivek Gautam <vivek.gautam@codeaurora.org>
+Reviewed-by: Bjorn Andersson <bjorn.andersson@linaro.org>
+Signed-off-by: Johan Hovold <johan+linaro@kernel.org>
+Link: https://lore.kernel.org/r/20220427063243.32576-2-johan+linaro@kernel.org
+Signed-off-by: Vinod Koul <vkoul@kernel.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ drivers/phy/qualcomm/phy-qcom-qmp.c |    2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/drivers/phy/qualcomm/phy-qcom-qmp.c
++++ b/drivers/phy/qualcomm/phy-qcom-qmp.c
+@@ -1468,7 +1468,7 @@ int qcom_qmp_phy_create(struct device *d
+        * all phys that don't need this.
+        */
+       snprintf(prop_name, sizeof(prop_name), "pipe%d", id);
+-      qphy->pipe_clk = of_clk_get_by_name(np, prop_name);
++      qphy->pipe_clk = devm_get_clk_from_child(dev, np, prop_name);
+       if (IS_ERR(qphy->pipe_clk)) {
+               if (qmp->cfg->type == PHY_TYPE_PCIE ||
+                   qmp->cfg->type == PHY_TYPE_USB3) {
index aaa6a2ca9a79a4530a20bf865432e5afd4e33043..14d343cf5fc23847fd44201007d984ca886501ab 100644 (file)
@@ -177,3 +177,10 @@ hugetlb-fix-huge_pmd_unshare-address-update.patch
 rtl818x-prevent-using-not-initialized-queues.patch
 asoc-rt5514-fix-event-generation-for-dsp-voice-wake-up-control.patch
 carl9170-tx-fix-an-incorrect-use-of-list-iterator.patch
+gma500-fix-an-incorrect-null-check-on-list-iterator.patch
+arm64-dts-qcom-ipq8074-fix-the-sleep-clock-frequency.patch
+phy-qcom-qmp-fix-struct-clk-leak-on-probe-errors.patch
+docs-conf.py-cope-with-removal-of-language-none-in-sphinx-5.0.0.patch
+dt-bindings-gpio-altera-correct-interrupt-cells.patch
+blk-iolatency-fix-inflight-count-imbalances-and-io-hangs-on-offline.patch
+phy-qcom-qmp-fix-reset-controller-leak-on-probe-errors.patch