From: Greg Kroah-Hartman Date: Mon, 16 Mar 2020 11:41:12 +0000 (+0100) Subject: 5.4-stable patches X-Git-Tag: v4.19.111~39 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=79d7d9eb352e0743c45a1ca59f543e8f8cd159d9;p=thirdparty%2Fkernel%2Fstable-queue.git 5.4-stable patches added patches: cifs_atomic_open-fix-double-put-on-late-allocation-failure.patch drm-i915-be-more-solid-in-checking-the-alignment.patch drm-i915-defer-semaphore-priority-bumping-to-a-workqueue.patch drm-i915-gt-close-race-between-cacheline_retire-and-free.patch ktest-add-timeout-for-ssh-sync-testing.patch mmc-sdhci-pci-gli-enable-msi-interrupt-for-gl975x.patch pinctrl-falcon-fix-syntax-error.patch --- diff --git a/queue-5.4/cifs_atomic_open-fix-double-put-on-late-allocation-failure.patch b/queue-5.4/cifs_atomic_open-fix-double-put-on-late-allocation-failure.patch new file mode 100644 index 00000000000..f99d7ca3e1f --- /dev/null +++ b/queue-5.4/cifs_atomic_open-fix-double-put-on-late-allocation-failure.patch @@ -0,0 +1,67 @@ +From d9a9f4849fe0c9d560851ab22a85a666cddfdd24 Mon Sep 17 00:00:00 2001 +From: Al Viro +Date: Thu, 12 Mar 2020 18:25:20 -0400 +Subject: cifs_atomic_open(): fix double-put on late allocation failure + +From: Al Viro + +commit d9a9f4849fe0c9d560851ab22a85a666cddfdd24 upstream. + +several iterations of ->atomic_open() calling conventions ago, we +used to need fput() if ->atomic_open() failed at some point after +successful finish_open(). Now (since 2016) it's not needed - +struct file carries enough state to make fput() work regardless +of the point in struct file lifecycle and discarding it on +failure exits in open() got unified. Unfortunately, I'd missed +the fact that we had an instance of ->atomic_open() (cifs one) +that used to need that fput(), as well as the stale comment in +finish_open() demanding such late failure handling. Trivially +fixed... + +Fixes: fe9ec8291fca "do_last(): take fput() on error after opening to out:" +Cc: stable@kernel.org # v4.7+ +Signed-off-by: Al Viro +Signed-off-by: Greg Kroah-Hartman + +--- + Documentation/filesystems/porting.rst | 8 ++++++++ + fs/cifs/dir.c | 1 - + fs/open.c | 3 --- + 3 files changed, 8 insertions(+), 4 deletions(-) + +--- a/Documentation/filesystems/porting.rst ++++ b/Documentation/filesystems/porting.rst +@@ -850,3 +850,11 @@ business doing so. + d_alloc_pseudo() is internal-only; uses outside of alloc_file_pseudo() are + very suspect (and won't work in modules). Such uses are very likely to + be misspelled d_alloc_anon(). ++ ++--- ++ ++**mandatory** ++ ++[should've been added in 2016] stale comment in finish_open() nonwithstanding, ++failure exits in ->atomic_open() instances should *NOT* fput() the file, ++no matter what. Everything is handled by the caller. +--- a/fs/cifs/dir.c ++++ b/fs/cifs/dir.c +@@ -560,7 +560,6 @@ cifs_atomic_open(struct inode *inode, st + if (server->ops->close) + server->ops->close(xid, tcon, &fid); + cifs_del_pending_open(&open); +- fput(file); + rc = -ENOMEM; + } + +--- a/fs/open.c ++++ b/fs/open.c +@@ -860,9 +860,6 @@ cleanup_file: + * the return value of d_splice_alias(), then the caller needs to perform dput() + * on it after finish_open(). + * +- * On successful return @file is a fully instantiated open file. After this, if +- * an error occurs in ->atomic_open(), it needs to clean up with fput(). +- * + * Returns zero on success or -errno if the open failed. + */ + int finish_open(struct file *file, struct dentry *dentry, diff --git a/queue-5.4/drm-i915-be-more-solid-in-checking-the-alignment.patch b/queue-5.4/drm-i915-be-more-solid-in-checking-the-alignment.patch new file mode 100644 index 00000000000..79d545d276c --- /dev/null +++ b/queue-5.4/drm-i915-be-more-solid-in-checking-the-alignment.patch @@ -0,0 +1,53 @@ +From 1d61c5d711a2dc0b978ae905535edee9601f9449 Mon Sep 17 00:00:00 2001 +From: Matthew Auld +Date: Thu, 5 Mar 2020 20:35:34 +0000 +Subject: drm/i915: be more solid in checking the alignment + +From: Matthew Auld + +commit 1d61c5d711a2dc0b978ae905535edee9601f9449 upstream. + +The alignment is u64, and yet is_power_of_2() assumes unsigned long, +which might give different results between 32b and 64b kernel. + +Signed-off-by: Matthew Auld +Cc: Chris Wilson +Reviewed-by: Chris Wilson +Signed-off-by: Chris Wilson +Link: https://patchwork.freedesktop.org/patch/msgid/20200305203534.210466-1-matthew.auld@intel.com +Cc: stable@vger.kernel.org +(cherry picked from commit 2920516b2f719546f55079bc39a7fe409d9e80ab) +Signed-off-by: Jani Nikula +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c | 3 ++- + drivers/gpu/drm/i915/i915_utils.h | 5 +++++ + 2 files changed, 7 insertions(+), 1 deletion(-) + +--- a/drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c ++++ b/drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c +@@ -439,7 +439,8 @@ eb_validate_vma(struct i915_execbuffer * + if (unlikely(entry->flags & eb->invalid_flags)) + return -EINVAL; + +- if (unlikely(entry->alignment && !is_power_of_2(entry->alignment))) ++ if (unlikely(entry->alignment && ++ !is_power_of_2_u64(entry->alignment))) + return -EINVAL; + + /* +--- a/drivers/gpu/drm/i915/i915_utils.h ++++ b/drivers/gpu/drm/i915/i915_utils.h +@@ -233,6 +233,11 @@ static inline u64 ptr_to_u64(const void + __idx; \ + }) + ++static inline bool is_power_of_2_u64(u64 n) ++{ ++ return (n != 0 && ((n & (n - 1)) == 0)); ++} ++ + static inline void __list_del_many(struct list_head *head, + struct list_head *first) + { diff --git a/queue-5.4/drm-i915-defer-semaphore-priority-bumping-to-a-workqueue.patch b/queue-5.4/drm-i915-defer-semaphore-priority-bumping-to-a-workqueue.patch new file mode 100644 index 00000000000..f98f35e912f --- /dev/null +++ b/queue-5.4/drm-i915-defer-semaphore-priority-bumping-to-a-workqueue.patch @@ -0,0 +1,124 @@ +From 14a0d527a479eb2cb6067f9e5e163e1bf35db2a9 Mon Sep 17 00:00:00 2001 +From: Chris Wilson +Date: Tue, 10 Mar 2020 10:17:20 +0000 +Subject: drm/i915: Defer semaphore priority bumping to a workqueue + +From: Chris Wilson + +commit 14a0d527a479eb2cb6067f9e5e163e1bf35db2a9 upstream. + +Since the semaphore fence may be signaled from inside an interrupt +handler from inside a request holding its request->lock, we cannot then +enter into the engine->active.lock for processing the semaphore priority +bump as we may traverse our call tree and end up on another held +request. + +CPU 0: +[ 2243.218864] _raw_spin_lock_irqsave+0x9a/0xb0 +[ 2243.218867] i915_schedule_bump_priority+0x49/0x80 [i915] +[ 2243.218869] semaphore_notify+0x6d/0x98 [i915] +[ 2243.218871] __i915_sw_fence_complete+0x61/0x420 [i915] +[ 2243.218874] ? kmem_cache_free+0x211/0x290 +[ 2243.218876] i915_sw_fence_complete+0x58/0x80 [i915] +[ 2243.218879] dma_i915_sw_fence_wake+0x3e/0x80 [i915] +[ 2243.218881] signal_irq_work+0x571/0x690 [i915] +[ 2243.218883] irq_work_run_list+0xd7/0x120 +[ 2243.218885] irq_work_run+0x1d/0x50 +[ 2243.218887] smp_irq_work_interrupt+0x21/0x30 +[ 2243.218889] irq_work_interrupt+0xf/0x20 + +CPU 1: +[ 2242.173107] _raw_spin_lock+0x8f/0xa0 +[ 2242.173110] __i915_request_submit+0x64/0x4a0 [i915] +[ 2242.173112] __execlists_submission_tasklet+0x8ee/0x2120 [i915] +[ 2242.173114] ? i915_sched_lookup_priolist+0x1e3/0x2b0 [i915] +[ 2242.173117] execlists_submit_request+0x2e8/0x2f0 [i915] +[ 2242.173119] submit_notify+0x8f/0xc0 [i915] +[ 2242.173121] __i915_sw_fence_complete+0x61/0x420 [i915] +[ 2242.173124] ? _raw_spin_unlock_irqrestore+0x39/0x40 +[ 2242.173137] i915_sw_fence_complete+0x58/0x80 [i915] +[ 2242.173140] i915_sw_fence_commit+0x16/0x20 [i915] + +Closes: https://gitlab.freedesktop.org/drm/intel/issues/1318 +Fixes: b7404c7ecb38 ("drm/i915: Bump ready tasks ahead of busywaits") +Signed-off-by: Chris Wilson +Cc: Tvrtko Ursulin +Cc: # v5.2+ +Reviewed-by: Tvrtko Ursulin +Link: https://patchwork.freedesktop.org/patch/msgid/20200310101720.9944-1-chris@chris-wilson.co.uk +(cherry picked from commit 209df10bb4536c81c2540df96c02cd079435357f) +Signed-off-by: Jani Nikula +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/gpu/drm/i915/i915_request.c | 22 +++++++++++++++++----- + drivers/gpu/drm/i915/i915_request.h | 2 ++ + 2 files changed, 19 insertions(+), 5 deletions(-) + +--- a/drivers/gpu/drm/i915/i915_request.c ++++ b/drivers/gpu/drm/i915/i915_request.c +@@ -560,19 +560,31 @@ submit_notify(struct i915_sw_fence *fenc + return NOTIFY_DONE; + } + ++static void irq_semaphore_cb(struct irq_work *wrk) ++{ ++ struct i915_request *rq = ++ container_of(wrk, typeof(*rq), semaphore_work); ++ ++ i915_schedule_bump_priority(rq, I915_PRIORITY_NOSEMAPHORE); ++ i915_request_put(rq); ++} ++ + static int __i915_sw_fence_call + semaphore_notify(struct i915_sw_fence *fence, enum i915_sw_fence_notify state) + { +- struct i915_request *request = +- container_of(fence, typeof(*request), semaphore); ++ struct i915_request *rq = container_of(fence, typeof(*rq), semaphore); + + switch (state) { + case FENCE_COMPLETE: +- i915_schedule_bump_priority(request, I915_PRIORITY_NOSEMAPHORE); ++ if (!(READ_ONCE(rq->sched.attr.priority) & I915_PRIORITY_NOSEMAPHORE)) { ++ i915_request_get(rq); ++ init_irq_work(&rq->semaphore_work, irq_semaphore_cb); ++ irq_work_queue(&rq->semaphore_work); ++ } + break; + + case FENCE_FREE: +- i915_request_put(request); ++ i915_request_put(rq); + break; + } + +@@ -1215,9 +1227,9 @@ void __i915_request_queue(struct i915_re + * decide whether to preempt the entire chain so that it is ready to + * run at the earliest possible convenience. + */ +- i915_sw_fence_commit(&rq->semaphore); + if (attr && rq->engine->schedule) + rq->engine->schedule(rq, attr); ++ i915_sw_fence_commit(&rq->semaphore); + i915_sw_fence_commit(&rq->submit); + } + +--- a/drivers/gpu/drm/i915/i915_request.h ++++ b/drivers/gpu/drm/i915/i915_request.h +@@ -26,6 +26,7 @@ + #define I915_REQUEST_H + + #include ++#include + #include + + #include "gt/intel_context_types.h" +@@ -147,6 +148,7 @@ struct i915_request { + }; + struct list_head execute_cb; + struct i915_sw_fence semaphore; ++ struct irq_work semaphore_work; + + /* + * A list of everyone we wait upon, and everyone who waits upon us. diff --git a/queue-5.4/drm-i915-gt-close-race-between-cacheline_retire-and-free.patch b/queue-5.4/drm-i915-gt-close-race-between-cacheline_retire-and-free.patch new file mode 100644 index 00000000000..e5626128bcf --- /dev/null +++ b/queue-5.4/drm-i915-gt-close-race-between-cacheline_retire-and-free.patch @@ -0,0 +1,50 @@ +From 8ea6bb8e4d47e07518e5dba4f5cb77e210f0df82 Mon Sep 17 00:00:00 2001 +From: Chris Wilson +Date: Fri, 6 Mar 2020 15:46:47 +0000 +Subject: drm/i915/gt: Close race between cacheline_retire and free + +From: Chris Wilson + +commit 8ea6bb8e4d47e07518e5dba4f5cb77e210f0df82 upstream. + +If the cacheline may still be busy, atomically mark it for future +release, and only if we can determine that it will never be used again, +immediately free it. + +Closes: https://gitlab.freedesktop.org/drm/intel/issues/1392 +Fixes: ebece7539242 ("drm/i915: Keep timeline HWSP allocated until idle across the system") +Signed-off-by: Chris Wilson +Cc: Tvrtko Ursulin +Cc: Mika Kuoppala +Cc: Matthew Auld +Reviewed-by: Mika Kuoppala +Cc: # v5.2+ +Link: https://patchwork.freedesktop.org/patch/msgid/20200306154647.3528345-1-chris@chris-wilson.co.uk +(cherry picked from commit 2d4bd971f5baa51418625f379a69f5d58b5a0450) +Signed-off-by: Jani Nikula +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/gpu/drm/i915/gt/intel_timeline.c | 8 ++++++-- + 1 file changed, 6 insertions(+), 2 deletions(-) + +--- a/drivers/gpu/drm/i915/gt/intel_timeline.c ++++ b/drivers/gpu/drm/i915/gt/intel_timeline.c +@@ -197,11 +197,15 @@ static void cacheline_release(struct int + + static void cacheline_free(struct intel_timeline_cacheline *cl) + { ++ if (!i915_active_acquire_if_busy(&cl->active)) { ++ __idle_cacheline_free(cl); ++ return; ++ } ++ + GEM_BUG_ON(ptr_test_bit(cl->vaddr, CACHELINE_FREE)); + cl->vaddr = ptr_set_bit(cl->vaddr, CACHELINE_FREE); + +- if (i915_active_is_idle(&cl->active)) +- __idle_cacheline_free(cl); ++ i915_active_release(&cl->active); + } + + int intel_timeline_init(struct intel_timeline *timeline, diff --git a/queue-5.4/ktest-add-timeout-for-ssh-sync-testing.patch b/queue-5.4/ktest-add-timeout-for-ssh-sync-testing.patch new file mode 100644 index 00000000000..e98149bc608 --- /dev/null +++ b/queue-5.4/ktest-add-timeout-for-ssh-sync-testing.patch @@ -0,0 +1,36 @@ +From 4d00fc477a2ce8b6d2b09fb34ef9fe9918e7d434 Mon Sep 17 00:00:00 2001 +From: "Steven Rostedt (VMware)" +Date: Mon, 9 Mar 2020 16:00:11 -0400 +Subject: ktest: Add timeout for ssh sync testing + +From: Steven Rostedt (VMware) + +commit 4d00fc477a2ce8b6d2b09fb34ef9fe9918e7d434 upstream. + +Before rebooting the box, a "ssh sync" is called to the test machine to see +if it is alive or not. But if the test machine is in a partial state, that +ssh may never actually finish, and the ktest test hangs. + +Add a 10 second timeout to the sync test, which will fail after 10 seconds +and then cause the test to reboot the test machine. + +Cc: stable@vger.kernel.org +Fixes: 6474ace999edd ("ktest.pl: Powercycle the box on reboot if no connection can be made") +Signed-off-by: Steven Rostedt (VMware) +Signed-off-by: Greg Kroah-Hartman + +--- + tools/testing/ktest/ktest.pl | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/tools/testing/ktest/ktest.pl ++++ b/tools/testing/ktest/ktest.pl +@@ -1383,7 +1383,7 @@ sub reboot { + + } else { + # Make sure everything has been written to disk +- run_ssh("sync"); ++ run_ssh("sync", 10); + + if (defined($time)) { + start_monitor; diff --git a/queue-5.4/mmc-sdhci-pci-gli-enable-msi-interrupt-for-gl975x.patch b/queue-5.4/mmc-sdhci-pci-gli-enable-msi-interrupt-for-gl975x.patch new file mode 100644 index 00000000000..db39cbd9097 --- /dev/null +++ b/queue-5.4/mmc-sdhci-pci-gli-enable-msi-interrupt-for-gl975x.patch @@ -0,0 +1,68 @@ +From 31e43f31890ca6e909b27dcb539252b46aa465da Mon Sep 17 00:00:00 2001 +From: Ben Chuang +Date: Wed, 19 Feb 2020 17:29:00 +0800 +Subject: mmc: sdhci-pci-gli: Enable MSI interrupt for GL975x + +From: Ben Chuang + +commit 31e43f31890ca6e909b27dcb539252b46aa465da upstream. + +Enable MSI interrupt for GL9750/GL9755. Some platforms +do not support PCI INTx and devices can not work without +interrupt. Like messages below: + +[ 4.487132] sdhci-pci 0000:01:00.0: SDHCI controller found [17a0:9755] (rev 0) +[ 4.487198] ACPI BIOS Error (bug): Could not resolve symbol [\_SB.PCI0.PBR2._PRT.APS2], AE_NOT_FOUND (20190816/psargs-330) +[ 4.487397] ACPI Error: Aborting method \_SB.PCI0.PBR2._PRT due to previous error (AE_NOT_FOUND) (20190816/psparse-529) +[ 4.487707] pcieport 0000:00:01.3: can't derive routing for PCI INT A +[ 4.487709] sdhci-pci 0000:01:00.0: PCI INT A: no GSI + +Signed-off-by: Ben Chuang +Tested-by: Raul E Rangel +Fixes: e51df6ce668a ("mmc: host: sdhci-pci: Add Genesys Logic GL975x support") +Cc: stable@vger.kernel.org +Link: https://lore.kernel.org/r/20200219092900.9151-1-benchuanggli@gmail.com +Signed-off-by: Ulf Hansson +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/mmc/host/sdhci-pci-gli.c | 17 +++++++++++++++++ + 1 file changed, 17 insertions(+) + +--- a/drivers/mmc/host/sdhci-pci-gli.c ++++ b/drivers/mmc/host/sdhci-pci-gli.c +@@ -262,10 +262,26 @@ static int gl9750_execute_tuning(struct + return 0; + } + ++static void gli_pcie_enable_msi(struct sdhci_pci_slot *slot) ++{ ++ int ret; ++ ++ ret = pci_alloc_irq_vectors(slot->chip->pdev, 1, 1, ++ PCI_IRQ_MSI | PCI_IRQ_MSIX); ++ if (ret < 0) { ++ pr_warn("%s: enable PCI MSI failed, error=%d\n", ++ mmc_hostname(slot->host->mmc), ret); ++ return; ++ } ++ ++ slot->host->irq = pci_irq_vector(slot->chip->pdev, 0); ++} ++ + static int gli_probe_slot_gl9750(struct sdhci_pci_slot *slot) + { + struct sdhci_host *host = slot->host; + ++ gli_pcie_enable_msi(slot); + slot->host->mmc->caps2 |= MMC_CAP2_NO_SDIO; + sdhci_enable_v4_mode(host); + +@@ -276,6 +292,7 @@ static int gli_probe_slot_gl9755(struct + { + struct sdhci_host *host = slot->host; + ++ gli_pcie_enable_msi(slot); + slot->host->mmc->caps2 |= MMC_CAP2_NO_SDIO; + sdhci_enable_v4_mode(host); + diff --git a/queue-5.4/pinctrl-falcon-fix-syntax-error.patch b/queue-5.4/pinctrl-falcon-fix-syntax-error.patch new file mode 100644 index 00000000000..a975918d407 --- /dev/null +++ b/queue-5.4/pinctrl-falcon-fix-syntax-error.patch @@ -0,0 +1,34 @@ +From d62e7fbea4951c124a24176da0c7bf3003ec53d4 Mon Sep 17 00:00:00 2001 +From: Mathias Kresin +Date: Thu, 5 Mar 2020 19:22:45 +0100 +Subject: pinctrl: falcon: fix syntax error + +From: Mathias Kresin + +commit d62e7fbea4951c124a24176da0c7bf3003ec53d4 upstream. + +Add the missing semicolon after of_node_put to get the file compiled. + +Fixes: f17d2f54d36d ("pinctrl: falcon: Add of_node_put() before return") +Cc: stable@vger.kernel.org # v5.4+ +Signed-off-by: Mathias Kresin +Link: https://lore.kernel.org/r/20200305182245.9636-1-dev@kresin.me +Acked-by: Thomas Langer +Signed-off-by: Linus Walleij +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/pinctrl/pinctrl-falcon.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/drivers/pinctrl/pinctrl-falcon.c ++++ b/drivers/pinctrl/pinctrl-falcon.c +@@ -451,7 +451,7 @@ static int pinctrl_falcon_probe(struct p + falcon_info.clk[*bank] = clk_get(&ppdev->dev, NULL); + if (IS_ERR(falcon_info.clk[*bank])) { + dev_err(&ppdev->dev, "failed to get clock\n"); +- of_node_put(np) ++ of_node_put(np); + return PTR_ERR(falcon_info.clk[*bank]); + } + falcon_info.membase[*bank] = devm_ioremap_resource(&pdev->dev, diff --git a/queue-5.4/series b/queue-5.4/series index bc930811116..e38678a6a3e 100644 --- a/queue-5.4/series +++ b/queue-5.4/series @@ -67,3 +67,10 @@ netfilter-xt_recent-recent_seq_next-should-increase-position-index.patch netfilter-x_tables-xt_mttg_seq_next-should-increase-position-index.patch workqueue-don-t-use-wq_select_unbound_cpu-for-bound-works.patch drm-amd-display-remove-duplicated-assignment-to-grph_obj_type.patch +drm-i915-be-more-solid-in-checking-the-alignment.patch +drm-i915-defer-semaphore-priority-bumping-to-a-workqueue.patch +drm-i915-gt-close-race-between-cacheline_retire-and-free.patch +mmc-sdhci-pci-gli-enable-msi-interrupt-for-gl975x.patch +pinctrl-falcon-fix-syntax-error.patch +ktest-add-timeout-for-ssh-sync-testing.patch +cifs_atomic_open-fix-double-put-on-late-allocation-failure.patch