From: Sasha Levin Date: Sat, 25 Apr 2020 23:30:20 +0000 (-0400) Subject: Fixes for 4.14 X-Git-Tag: v4.19.119~45 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=643067c688b22491ac8ad70cba2dbb66fafbd22c;p=thirdparty%2Fkernel%2Fstable-queue.git Fixes for 4.14 Signed-off-by: Sasha Levin --- diff --git a/queue-4.14/asoc-intel-atom-take-the-drv-lock-mutex-before-calli.patch b/queue-4.14/asoc-intel-atom-take-the-drv-lock-mutex-before-calli.patch new file mode 100644 index 00000000000..0af46dc488b --- /dev/null +++ b/queue-4.14/asoc-intel-atom-take-the-drv-lock-mutex-before-calli.patch @@ -0,0 +1,43 @@ +From dfc17ab64cd8d205f49be14976e5508c8a15b8b4 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Thu, 2 Apr 2020 20:53:57 +0200 +Subject: ASoC: Intel: atom: Take the drv->lock mutex before calling + sst_send_slot_map() + +From: Hans de Goede + +[ Upstream commit 81630dc042af998b9f58cd8e2c29dab9777ea176 ] + +sst_send_slot_map() uses sst_fill_and_send_cmd_unlocked() because in some +places it is called with the drv->lock mutex already held. + +So it must always be called with the mutex locked. This commit adds missing +locking in the sst_set_be_modules() code-path. + +Fixes: 24c8d14192cc ("ASoC: Intel: mrfld: add DSP core controls") +Signed-off-by: Hans de Goede +Acked-by: Pierre-Louis Bossart +Link: https://lore.kernel.org/r/20200402185359.3424-1-hdegoede@redhat.com +Signed-off-by: Mark Brown +Signed-off-by: Sasha Levin +--- + sound/soc/intel/atom/sst-atom-controls.c | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/sound/soc/intel/atom/sst-atom-controls.c b/sound/soc/intel/atom/sst-atom-controls.c +index 6044b3bbb1211..999eb3ba78672 100644 +--- a/sound/soc/intel/atom/sst-atom-controls.c ++++ b/sound/soc/intel/atom/sst-atom-controls.c +@@ -974,7 +974,9 @@ static int sst_set_be_modules(struct snd_soc_dapm_widget *w, + dev_dbg(c->dev, "Enter: widget=%s\n", w->name); + + if (SND_SOC_DAPM_EVENT_ON(event)) { ++ mutex_lock(&drv->lock); + ret = sst_send_slot_map(drv); ++ mutex_unlock(&drv->lock); + if (ret) + return ret; + ret = sst_send_pipe_module_params(w, k); +-- +2.20.1 + diff --git a/queue-4.14/ceph-don-t-skip-updating-wanted-caps-when-cap-is-sta.patch b/queue-4.14/ceph-don-t-skip-updating-wanted-caps-when-cap-is-sta.patch new file mode 100644 index 00000000000..4678bb7ecc7 --- /dev/null +++ b/queue-4.14/ceph-don-t-skip-updating-wanted-caps-when-cap-is-sta.patch @@ -0,0 +1,49 @@ +From c1c2f7aa0e53905c42c889908f65f1ef4edafc08 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Tue, 10 Mar 2020 19:34:20 +0800 +Subject: ceph: don't skip updating wanted caps when cap is stale + +From: Yan, Zheng + +[ Upstream commit 0aa971b6fd3f92afef6afe24ef78d9bb14471519 ] + +1. try_get_cap_refs() fails to get caps and finds that mds_wanted + does not include what it wants. It returns -ESTALE. +2. ceph_get_caps() calls ceph_renew_caps(). ceph_renew_caps() finds + that inode has cap, so it calls ceph_check_caps(). +3. ceph_check_caps() finds that issued caps (without checking if it's + stale) already includes caps wanted by open file, so it skips + updating wanted caps. + +Above events can cause an infinite loop inside ceph_get_caps(). + +Signed-off-by: "Yan, Zheng" +Reviewed-by: Jeff Layton +Signed-off-by: Ilya Dryomov +Signed-off-by: Sasha Levin +--- + fs/ceph/caps.c | 8 ++++++-- + 1 file changed, 6 insertions(+), 2 deletions(-) + +diff --git a/fs/ceph/caps.c b/fs/ceph/caps.c +index c3a3ee74e2d84..1b5a50848b5be 100644 +--- a/fs/ceph/caps.c ++++ b/fs/ceph/caps.c +@@ -1863,8 +1863,12 @@ retry_locked: + } + + /* want more caps from mds? */ +- if (want & ~(cap->mds_wanted | cap->issued)) +- goto ack; ++ if (want & ~cap->mds_wanted) { ++ if (want & ~(cap->mds_wanted | cap->issued)) ++ goto ack; ++ if (!__cap_is_valid(cap)) ++ goto ack; ++ } + + /* things we might delay */ + if ((cap->issued & ~retain) == 0 && +-- +2.20.1 + diff --git a/queue-4.14/ceph-return-ceph_mdsc_do_request-errors-from-__get_p.patch b/queue-4.14/ceph-return-ceph_mdsc_do_request-errors-from-__get_p.patch new file mode 100644 index 00000000000..d6e95a163bb --- /dev/null +++ b/queue-4.14/ceph-return-ceph_mdsc_do_request-errors-from-__get_p.patch @@ -0,0 +1,40 @@ +From 6d3223eafda5fa920713b4a821089d15a1e2e628 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Fri, 6 Mar 2020 09:34:20 +0800 +Subject: ceph: return ceph_mdsc_do_request() errors from __get_parent() + +From: Qiujun Huang + +[ Upstream commit c6d50296032f0b97473eb2e274dc7cc5d0173847 ] + +Return the error returned by ceph_mdsc_do_request(). Otherwise, +r_target_inode ends up being NULL this ends up returning ENOENT +regardless of the error. + +Signed-off-by: Qiujun Huang +Reviewed-by: Jeff Layton +Signed-off-by: Ilya Dryomov +Signed-off-by: Sasha Levin +--- + fs/ceph/export.c | 5 +++++ + 1 file changed, 5 insertions(+) + +diff --git a/fs/ceph/export.c b/fs/ceph/export.c +index 3c59ad180ef0b..4cfe1154d4c72 100644 +--- a/fs/ceph/export.c ++++ b/fs/ceph/export.c +@@ -151,6 +151,11 @@ static struct dentry *__get_parent(struct super_block *sb, + + req->r_num_caps = 1; + err = ceph_mdsc_do_request(mdsc, NULL, req); ++ if (err) { ++ ceph_mdsc_put_request(req); ++ return ERR_PTR(err); ++ } ++ + inode = req->r_target_inode; + if (inode) + ihold(inode); +-- +2.20.1 + diff --git a/queue-4.14/ipc-util.c-sysvipc_find_ipc-should-increase-position.patch b/queue-4.14/ipc-util.c-sysvipc_find_ipc-should-increase-position.patch new file mode 100644 index 00000000000..3ead98f1024 --- /dev/null +++ b/queue-4.14/ipc-util.c-sysvipc_find_ipc-should-increase-position.patch @@ -0,0 +1,52 @@ +From 6149a53fd09d9c54b26644a6fca2a95186d1a90f Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Fri, 10 Apr 2020 14:34:13 -0700 +Subject: ipc/util.c: sysvipc_find_ipc() should increase position index + +From: Vasily Averin + +[ Upstream commit 89163f93c6f969da5811af5377cc10173583123b ] + +If seq_file .next function does not change position index, read after +some lseek can generate unexpected output. + +https://bugzilla.kernel.org/show_bug.cgi?id=206283 +Signed-off-by: Vasily Averin +Signed-off-by: Andrew Morton +Acked-by: Waiman Long +Cc: Davidlohr Bueso +Cc: Manfred Spraul +Cc: Al Viro +Cc: Ingo Molnar +Cc: NeilBrown +Cc: Peter Oberparleiter +Cc: Steven Rostedt +Link: http://lkml.kernel.org/r/b7a20945-e315-8bb0-21e6-3875c14a8494@virtuozzo.com +Signed-off-by: Linus Torvalds +Signed-off-by: Sasha Levin +--- + ipc/util.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/ipc/util.c b/ipc/util.c +index 79b30eee32cd8..7989f5e532198 100644 +--- a/ipc/util.c ++++ b/ipc/util.c +@@ -750,13 +750,13 @@ static struct kern_ipc_perm *sysvipc_find_ipc(struct ipc_ids *ids, loff_t pos, + total++; + } + ++ *new_pos = pos + 1; + if (total >= ids->in_use) + return NULL; + + for (; pos < IPCMNI; pos++) { + ipc = idr_find(&ids->ipcs_idr, pos); + if (ipc != NULL) { +- *new_pos = pos + 1; + rcu_read_lock(); + ipc_lock_object(ipc); + return ipc; +-- +2.20.1 + diff --git a/queue-4.14/kernel-gcov-fs.c-gcov_seq_next-should-increase-posit.patch b/queue-4.14/kernel-gcov-fs.c-gcov_seq_next-should-increase-posit.patch new file mode 100644 index 00000000000..1fdc028e655 --- /dev/null +++ b/queue-4.14/kernel-gcov-fs.c-gcov_seq_next-should-increase-posit.patch @@ -0,0 +1,48 @@ +From f976ae481c1278df97dc13949feb4f7d28ad2bc5 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Fri, 10 Apr 2020 14:34:10 -0700 +Subject: kernel/gcov/fs.c: gcov_seq_next() should increase position index + +From: Vasily Averin + +[ Upstream commit f4d74ef6220c1eda0875da30457bef5c7111ab06 ] + +If seq_file .next function does not change position index, read after +some lseek can generate unexpected output. + +https://bugzilla.kernel.org/show_bug.cgi?id=206283 +Signed-off-by: Vasily Averin +Signed-off-by: Andrew Morton +Acked-by: Peter Oberparleiter +Cc: Al Viro +Cc: Davidlohr Bueso +Cc: Ingo Molnar +Cc: Manfred Spraul +Cc: NeilBrown +Cc: Steven Rostedt +Cc: Waiman Long +Link: http://lkml.kernel.org/r/f65c6ee7-bd00-f910-2f8a-37cc67e4ff88@virtuozzo.com +Signed-off-by: Linus Torvalds +Signed-off-by: Sasha Levin +--- + kernel/gcov/fs.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/kernel/gcov/fs.c b/kernel/gcov/fs.c +index 6e40ff6be083d..291e0797125b6 100644 +--- a/kernel/gcov/fs.c ++++ b/kernel/gcov/fs.c +@@ -109,9 +109,9 @@ static void *gcov_seq_next(struct seq_file *seq, void *data, loff_t *pos) + { + struct gcov_iterator *iter = data; + ++ (*pos)++; + if (gcov_iter_next(iter)) + return NULL; +- (*pos)++; + + return iter; + } +-- +2.20.1 + diff --git a/queue-4.14/pci-aspm-allow-re-enabling-clock-pm.patch b/queue-4.14/pci-aspm-allow-re-enabling-clock-pm.patch new file mode 100644 index 00000000000..75aa7cfbe54 --- /dev/null +++ b/queue-4.14/pci-aspm-allow-re-enabling-clock-pm.patch @@ -0,0 +1,74 @@ +From d1b613a1966b0f831071b5f1f25b81c7b024818f Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Sat, 5 Oct 2019 14:03:57 +0200 +Subject: PCI/ASPM: Allow re-enabling Clock PM + +From: Heiner Kallweit + +[ Upstream commit 35efea32b26f9aacc99bf07e0d2cdfba2028b099 ] + +Previously Clock PM could not be re-enabled after being disabled by +pci_disable_link_state() because clkpm_capable was reset. Change this by +adding a clkpm_disable field similar to aspm_disable. + +Link: https://lore.kernel.org/r/4e8a66db-7d53-4a66-c26c-f0037ffaa705@gmail.com +Signed-off-by: Heiner Kallweit +Signed-off-by: Bjorn Helgaas +Signed-off-by: Sasha Levin +--- + drivers/pci/pcie/aspm.c | 18 +++++++++++------- + 1 file changed, 11 insertions(+), 7 deletions(-) + +diff --git a/drivers/pci/pcie/aspm.c b/drivers/pci/pcie/aspm.c +index 6f58767b5190f..400031622b761 100644 +--- a/drivers/pci/pcie/aspm.c ++++ b/drivers/pci/pcie/aspm.c +@@ -80,6 +80,7 @@ struct pcie_link_state { + u32 clkpm_capable:1; /* Clock PM capable? */ + u32 clkpm_enabled:1; /* Current Clock PM state */ + u32 clkpm_default:1; /* Default Clock PM state by BIOS */ ++ u32 clkpm_disable:1; /* Clock PM disabled */ + + /* Exit latencies */ + struct aspm_latency latency_up; /* Upstream direction exit latency */ +@@ -177,8 +178,11 @@ static void pcie_set_clkpm_nocheck(struct pcie_link_state *link, int enable) + + static void pcie_set_clkpm(struct pcie_link_state *link, int enable) + { +- /* Don't enable Clock PM if the link is not Clock PM capable */ +- if (!link->clkpm_capable) ++ /* ++ * Don't enable Clock PM if the link is not Clock PM capable ++ * or Clock PM is disabled ++ */ ++ if (!link->clkpm_capable || link->clkpm_disable) + enable = 0; + /* Need nothing if the specified equals to current state */ + if (link->clkpm_enabled == enable) +@@ -208,7 +212,8 @@ static void pcie_clkpm_cap_init(struct pcie_link_state *link, int blacklist) + } + link->clkpm_enabled = enabled; + link->clkpm_default = enabled; +- link->clkpm_capable = (blacklist) ? 0 : capable; ++ link->clkpm_capable = capable; ++ link->clkpm_disable = blacklist ? 1 : 0; + } + + static bool pcie_retrain_link(struct pcie_link_state *link) +@@ -1052,10 +1057,9 @@ static void __pci_disable_link_state(struct pci_dev *pdev, int state, bool sem) + link->aspm_disable |= ASPM_STATE_L1; + pcie_config_aspm_link(link, policy_to_aspm_state(link)); + +- if (state & PCIE_LINK_STATE_CLKPM) { +- link->clkpm_capable = 0; +- pcie_set_clkpm(link, 0); +- } ++ if (state & PCIE_LINK_STATE_CLKPM) ++ link->clkpm_disable = 1; ++ pcie_set_clkpm(link, policy_to_clkpm_state(link)); + mutex_unlock(&aspm_lock); + if (sem) + up_read(&pci_bus_sem); +-- +2.20.1 + diff --git a/queue-4.14/perf-core-disable-page-faults-when-getting-phys-addr.patch b/queue-4.14/perf-core-disable-page-faults-when-getting-phys-addr.patch new file mode 100644 index 00000000000..c26982c8a0a --- /dev/null +++ b/queue-4.14/perf-core-disable-page-faults-when-getting-phys-addr.patch @@ -0,0 +1,71 @@ +From 3eb0230c49c1d2837b743c04930ded77ff922c9a Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Tue, 7 Apr 2020 16:14:27 +0200 +Subject: perf/core: Disable page faults when getting phys address + +From: Jiri Olsa + +[ Upstream commit d3296fb372bf7497b0e5d0478c4e7a677ec6f6e9 ] + +We hit following warning when running tests on kernel +compiled with CONFIG_DEBUG_ATOMIC_SLEEP=y: + + WARNING: CPU: 19 PID: 4472 at mm/gup.c:2381 __get_user_pages_fast+0x1a4/0x200 + CPU: 19 PID: 4472 Comm: dummy Not tainted 5.6.0-rc6+ #3 + RIP: 0010:__get_user_pages_fast+0x1a4/0x200 + ... + Call Trace: + perf_prepare_sample+0xff1/0x1d90 + perf_event_output_forward+0xe8/0x210 + __perf_event_overflow+0x11a/0x310 + __intel_pmu_pebs_event+0x657/0x850 + intel_pmu_drain_pebs_nhm+0x7de/0x11d0 + handle_pmi_common+0x1b2/0x650 + intel_pmu_handle_irq+0x17b/0x370 + perf_event_nmi_handler+0x40/0x60 + nmi_handle+0x192/0x590 + default_do_nmi+0x6d/0x150 + do_nmi+0x2f9/0x3c0 + nmi+0x8e/0xd7 + +While __get_user_pages_fast() is IRQ-safe, it calls access_ok(), +which warns on: + + WARN_ON_ONCE(!in_task() && !pagefault_disabled()) + +Peter suggested disabling page faults around __get_user_pages_fast(), +which gets rid of the warning in access_ok() call. + +Suggested-by: Peter Zijlstra +Signed-off-by: Jiri Olsa +Signed-off-by: Peter Zijlstra (Intel) +Signed-off-by: Ingo Molnar +Link: https://lkml.kernel.org/r/20200407141427.3184722-1-jolsa@kernel.org +Signed-off-by: Sasha Levin +--- + kernel/events/core.c | 9 ++++++--- + 1 file changed, 6 insertions(+), 3 deletions(-) + +diff --git a/kernel/events/core.c b/kernel/events/core.c +index 845c8a1a9d30a..c16ce11049de3 100644 +--- a/kernel/events/core.c ++++ b/kernel/events/core.c +@@ -6119,9 +6119,12 @@ static u64 perf_virt_to_phys(u64 virt) + * Try IRQ-safe __get_user_pages_fast first. + * If failed, leave phys_addr as 0. + */ +- if ((current->mm != NULL) && +- (__get_user_pages_fast(virt, 1, 0, &p) == 1)) +- phys_addr = page_to_phys(p) + virt % PAGE_SIZE; ++ if (current->mm != NULL) { ++ pagefault_disable(); ++ if (__get_user_pages_fast(virt, 1, 0, &p) == 1) ++ phys_addr = page_to_phys(p) + virt % PAGE_SIZE; ++ pagefault_enable(); ++ } + + if (p) + put_page(p); +-- +2.20.1 + diff --git a/queue-4.14/pwm-bcm2835-dynamically-allocate-base.patch b/queue-4.14/pwm-bcm2835-dynamically-allocate-base.patch new file mode 100644 index 00000000000..125bb339449 --- /dev/null +++ b/queue-4.14/pwm-bcm2835-dynamically-allocate-base.patch @@ -0,0 +1,42 @@ +From 89349b59a5850c00502918c662fd262210ffca72 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Mon, 3 Feb 2020 13:35:35 -0800 +Subject: pwm: bcm2835: Dynamically allocate base +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +From: Florian Fainelli + +[ Upstream commit 2c25b07e5ec119cab609e41407a1fb3fa61442f5 ] + +The newer 2711 and 7211 chips have two PWM controllers and failure to +dynamically allocate the PWM base would prevent the second PWM +controller instance being probed for succeeding with an -EEXIST error +from alloc_pwms(). + +Fixes: e5a06dc5ac1f ("pwm: Add BCM2835 PWM driver") +Signed-off-by: Florian Fainelli +Acked-by: Uwe Kleine-König +Reviewed-by: Nicolas Saenz Julienne +Signed-off-by: Thierry Reding +Signed-off-by: Sasha Levin +--- + drivers/pwm/pwm-bcm2835.c | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/drivers/pwm/pwm-bcm2835.c b/drivers/pwm/pwm-bcm2835.c +index db001cba937fd..e340ad79a1ec9 100644 +--- a/drivers/pwm/pwm-bcm2835.c ++++ b/drivers/pwm/pwm-bcm2835.c +@@ -166,6 +166,7 @@ static int bcm2835_pwm_probe(struct platform_device *pdev) + + pc->chip.dev = &pdev->dev; + pc->chip.ops = &bcm2835_pwm_ops; ++ pc->chip.base = -1; + pc->chip.npwm = 2; + pc->chip.of_xlate = of_pwm_xlate_with_flags; + pc->chip.of_pwm_n_cells = 3; +-- +2.20.1 + diff --git a/queue-4.14/pwm-rcar-fix-late-runtime-pm-enablement.patch b/queue-4.14/pwm-rcar-fix-late-runtime-pm-enablement.patch new file mode 100644 index 00000000000..8b346fd0e07 --- /dev/null +++ b/queue-4.14/pwm-rcar-fix-late-runtime-pm-enablement.patch @@ -0,0 +1,66 @@ +From bbb21754c00640c6396bb61feef3e522f84d7da9 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Mon, 16 Mar 2020 11:32:14 +0100 +Subject: pwm: rcar: Fix late Runtime PM enablement +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +From: Geert Uytterhoeven + +[ Upstream commit 1451a3eed24b5fd6a604683f0b6995e0e7e16c79 ] + +Runtime PM should be enabled before calling pwmchip_add(), as PWM users +can appear immediately after the PWM chip has been added. +Likewise, Runtime PM should be disabled after the removal of the PWM +chip. + +Fixes: ed6c1476bf7f16d5 ("pwm: Add support for R-Car PWM Timer") +Signed-off-by: Geert Uytterhoeven +Reviewed-by: Uwe Kleine-König +Reviewed-by: Laurent Pinchart +Signed-off-by: Thierry Reding +Signed-off-by: Sasha Levin +--- + drivers/pwm/pwm-rcar.c | 10 +++++++--- + 1 file changed, 7 insertions(+), 3 deletions(-) + +diff --git a/drivers/pwm/pwm-rcar.c b/drivers/pwm/pwm-rcar.c +index 0fcf94ffad321..c298bec25a90a 100644 +--- a/drivers/pwm/pwm-rcar.c ++++ b/drivers/pwm/pwm-rcar.c +@@ -236,24 +236,28 @@ static int rcar_pwm_probe(struct platform_device *pdev) + rcar_pwm->chip.base = -1; + rcar_pwm->chip.npwm = 1; + ++ pm_runtime_enable(&pdev->dev); ++ + ret = pwmchip_add(&rcar_pwm->chip); + if (ret < 0) { + dev_err(&pdev->dev, "failed to register PWM chip: %d\n", ret); ++ pm_runtime_disable(&pdev->dev); + return ret; + } + +- pm_runtime_enable(&pdev->dev); +- + return 0; + } + + static int rcar_pwm_remove(struct platform_device *pdev) + { + struct rcar_pwm_chip *rcar_pwm = platform_get_drvdata(pdev); ++ int ret; ++ ++ ret = pwmchip_remove(&rcar_pwm->chip); + + pm_runtime_disable(&pdev->dev); + +- return pwmchip_remove(&rcar_pwm->chip); ++ return ret; + } + + static const struct of_device_id rcar_pwm_of_table[] = { +-- +2.20.1 + diff --git a/queue-4.14/pwm-renesas-tpu-fix-late-runtime-pm-enablement.patch b/queue-4.14/pwm-renesas-tpu-fix-late-runtime-pm-enablement.patch new file mode 100644 index 00000000000..2a85228fd73 --- /dev/null +++ b/queue-4.14/pwm-renesas-tpu-fix-late-runtime-pm-enablement.patch @@ -0,0 +1,63 @@ +From ace5ab52f9c2838a245b2b3ae04c78c7a821f06d Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Mon, 16 Mar 2020 11:32:15 +0100 +Subject: pwm: renesas-tpu: Fix late Runtime PM enablement + +From: Geert Uytterhoeven + +[ Upstream commit d5a3c7a4536e1329a758e14340efd0e65252bd3d ] + +Runtime PM should be enabled before calling pwmchip_add(), as PWM users +can appear immediately after the PWM chip has been added. +Likewise, Runtime PM should always be disabled after the removal of the +PWM chip, even if the latter failed. + +Fixes: 99b82abb0a35b073 ("pwm: Add Renesas TPU PWM driver") +Signed-off-by: Geert Uytterhoeven +Signed-off-by: Thierry Reding +Signed-off-by: Sasha Levin +--- + drivers/pwm/pwm-renesas-tpu.c | 9 ++++----- + 1 file changed, 4 insertions(+), 5 deletions(-) + +diff --git a/drivers/pwm/pwm-renesas-tpu.c b/drivers/pwm/pwm-renesas-tpu.c +index 29267d12fb4c9..9c7962f2f0aa4 100644 +--- a/drivers/pwm/pwm-renesas-tpu.c ++++ b/drivers/pwm/pwm-renesas-tpu.c +@@ -423,16 +423,17 @@ static int tpu_probe(struct platform_device *pdev) + tpu->chip.base = -1; + tpu->chip.npwm = TPU_CHANNEL_MAX; + ++ pm_runtime_enable(&pdev->dev); ++ + ret = pwmchip_add(&tpu->chip); + if (ret < 0) { + dev_err(&pdev->dev, "failed to register PWM chip\n"); ++ pm_runtime_disable(&pdev->dev); + return ret; + } + + dev_info(&pdev->dev, "TPU PWM %d registered\n", tpu->pdev->id); + +- pm_runtime_enable(&pdev->dev); +- + return 0; + } + +@@ -442,12 +443,10 @@ static int tpu_remove(struct platform_device *pdev) + int ret; + + ret = pwmchip_remove(&tpu->chip); +- if (ret) +- return ret; + + pm_runtime_disable(&pdev->dev); + +- return 0; ++ return ret; + } + + #ifdef CONFIG_OF +-- +2.20.1 + diff --git a/queue-4.14/s390-cio-avoid-duplicated-add-uevents.patch b/queue-4.14/s390-cio-avoid-duplicated-add-uevents.patch new file mode 100644 index 00000000000..bc7bf80007e --- /dev/null +++ b/queue-4.14/s390-cio-avoid-duplicated-add-uevents.patch @@ -0,0 +1,65 @@ +From 42a5623c03ff32b5b0c743a9dce49757e5140774 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Fri, 27 Mar 2020 13:45:02 +0100 +Subject: s390/cio: avoid duplicated 'ADD' uevents + +From: Cornelia Huck + +[ Upstream commit 05ce3e53f375295c2940390b2b429e506e07655c ] + +The common I/O layer delays the ADD uevent for subchannels and +delegates generating this uevent to the individual subchannel +drivers. The io_subchannel driver will do so when the associated +ccw_device has been registered -- but unconditionally, so more +ADD uevents will be generated if a subchannel has been unbound +from the io_subchannel driver and later rebound. + +To fix this, only generate the ADD event if uevents were still +suppressed for the device. + +Fixes: fa1a8c23eb7d ("s390: cio: Delay uevents for subchannels") +Message-Id: <20200327124503.9794-2-cohuck@redhat.com> +Reported-by: Boris Fiuczynski +Reviewed-by: Peter Oberparleiter +Reviewed-by: Boris Fiuczynski +Signed-off-by: Cornelia Huck +Signed-off-by: Vasily Gorbik +Signed-off-by: Sasha Levin +--- + drivers/s390/cio/device.c | 13 +++++++++---- + 1 file changed, 9 insertions(+), 4 deletions(-) + +diff --git a/drivers/s390/cio/device.c b/drivers/s390/cio/device.c +index e5c32f4b5287e..d2203cd178138 100644 +--- a/drivers/s390/cio/device.c ++++ b/drivers/s390/cio/device.c +@@ -828,8 +828,10 @@ static void io_subchannel_register(struct ccw_device *cdev) + * Now we know this subchannel will stay, we can throw + * our delayed uevent. + */ +- dev_set_uevent_suppress(&sch->dev, 0); +- kobject_uevent(&sch->dev.kobj, KOBJ_ADD); ++ if (dev_get_uevent_suppress(&sch->dev)) { ++ dev_set_uevent_suppress(&sch->dev, 0); ++ kobject_uevent(&sch->dev.kobj, KOBJ_ADD); ++ } + /* make it known to the system */ + ret = ccw_device_add(cdev); + if (ret) { +@@ -1037,8 +1039,11 @@ static int io_subchannel_probe(struct subchannel *sch) + * Throw the delayed uevent for the subchannel, register + * the ccw_device and exit. + */ +- dev_set_uevent_suppress(&sch->dev, 0); +- kobject_uevent(&sch->dev.kobj, KOBJ_ADD); ++ if (dev_get_uevent_suppress(&sch->dev)) { ++ /* should always be the case for the console */ ++ dev_set_uevent_suppress(&sch->dev, 0); ++ kobject_uevent(&sch->dev.kobj, KOBJ_ADD); ++ } + cdev = sch_get_cdev(sch); + rc = ccw_device_add(cdev); + if (rc) { +-- +2.20.1 + diff --git a/queue-4.14/scsi-iscsi-report-unbind-session-event-when-the-targ.patch b/queue-4.14/scsi-iscsi-report-unbind-session-event-when-the-targ.patch new file mode 100644 index 00000000000..a6e342b6838 --- /dev/null +++ b/queue-4.14/scsi-iscsi-report-unbind-session-event-when-the-targ.patch @@ -0,0 +1,61 @@ +From 6ac699a31f9eb93c1038aa1941688bdbd1af5b58 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Tue, 24 Mar 2020 15:58:50 +0800 +Subject: scsi: iscsi: Report unbind session event when the target has been + removed + +From: Wu Bo + +[ Upstream commit 13e60d3ba287d96eeaf1deaadba51f71578119a3 ] + +If the daemon is restarted or crashes while logging out of a session, the +unbind session event sent by the kernel is not processed and is lost. When +the daemon starts again, the session can't be unbound because the daemon is +waiting for the event message. However, the kernel has already logged out +and the event will not be resent. + +When iscsid restart is complete, logout session reports error: + +Logging out of session [sid: 6, target: iqn.xxxxx, portal: xx.xx.xx.xx,3260] +iscsiadm: Could not logout of [sid: 6, target: iscsiadm -m node iqn.xxxxx, portal: xx.xx.xx.xx,3260]. +iscsiadm: initiator reported error (9 - internal error) +iscsiadm: Could not logout of all requested sessions + +Make sure the unbind event is emitted. + +[mkp: commit desc and applied by hand since patch was mangled] + +Link: https://lore.kernel.org/r/4eab1771-2cb3-8e79-b31c-923652340e99@huawei.com +Reviewed-by: Lee Duncan +Signed-off-by: Wu Bo +Signed-off-by: Martin K. Petersen +Signed-off-by: Sasha Levin +--- + drivers/scsi/scsi_transport_iscsi.c | 4 +++- + 1 file changed, 3 insertions(+), 1 deletion(-) + +diff --git a/drivers/scsi/scsi_transport_iscsi.c b/drivers/scsi/scsi_transport_iscsi.c +index aecb563a2b4e3..9589015234693 100644 +--- a/drivers/scsi/scsi_transport_iscsi.c ++++ b/drivers/scsi/scsi_transport_iscsi.c +@@ -2010,7 +2010,7 @@ static void __iscsi_unbind_session(struct work_struct *work) + if (session->target_id == ISCSI_MAX_TARGET) { + spin_unlock_irqrestore(&session->lock, flags); + mutex_unlock(&ihost->mutex); +- return; ++ goto unbind_session_exit; + } + + target_id = session->target_id; +@@ -2022,6 +2022,8 @@ static void __iscsi_unbind_session(struct work_struct *work) + ida_simple_remove(&iscsi_sess_ida, target_id); + + scsi_remove_target(&session->dev); ++ ++unbind_session_exit: + iscsi_session_event(session, ISCSI_KEVENT_UNBIND_SESSION); + ISCSI_DBG_TRANS_SESSION(session, "Completed target removal\n"); + } +-- +2.20.1 + diff --git a/queue-4.14/scsi-lpfc-fix-kasan-slab-out-of-bounds-error-in-lpfc.patch b/queue-4.14/scsi-lpfc-fix-kasan-slab-out-of-bounds-error-in-lpfc.patch new file mode 100644 index 00000000000..c170fc6750e --- /dev/null +++ b/queue-4.14/scsi-lpfc-fix-kasan-slab-out-of-bounds-error-in-lpfc.patch @@ -0,0 +1,62 @@ +From b457177ad843bc00081f06f2664bc0ef1ea9b728 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Sun, 22 Mar 2020 11:12:53 -0700 +Subject: scsi: lpfc: Fix kasan slab-out-of-bounds error in lpfc_unreg_login + +From: James Smart + +[ Upstream commit 38503943c89f0bafd9e3742f63f872301d44cbea ] + +The following kasan bug was called out: + + BUG: KASAN: slab-out-of-bounds in lpfc_unreg_login+0x7c/0xc0 [lpfc] + Read of size 2 at addr ffff889fc7c50a22 by task lpfc_worker_3/6676 + ... + Call Trace: + dump_stack+0x96/0xe0 + ? lpfc_unreg_login+0x7c/0xc0 [lpfc] + print_address_description.constprop.6+0x1b/0x220 + ? lpfc_unreg_login+0x7c/0xc0 [lpfc] + ? lpfc_unreg_login+0x7c/0xc0 [lpfc] + __kasan_report.cold.9+0x37/0x7c + ? lpfc_unreg_login+0x7c/0xc0 [lpfc] + kasan_report+0xe/0x20 + lpfc_unreg_login+0x7c/0xc0 [lpfc] + lpfc_sli_def_mbox_cmpl+0x334/0x430 [lpfc] + ... + +When processing the completion of a "Reg Rpi" login mailbox command in +lpfc_sli_def_mbox_cmpl, a call may be made to lpfc_unreg_login. The vpi is +extracted from the completing mailbox context and passed as an input for +the next. However, the vpi stored in the mailbox command context is an +absolute vpi, which for SLI4 represents both base + offset. When used with +a non-zero base component, (function id > 0) this results in an +out-of-range access beyond the allocated phba->vpi_ids array. + +Fix by subtracting the function's base value to get an accurate vpi number. + +Link: https://lore.kernel.org/r/20200322181304.37655-2-jsmart2021@gmail.com +Signed-off-by: James Smart +Signed-off-by: Dick Kennedy +Signed-off-by: Martin K. Petersen +Signed-off-by: Sasha Levin +--- + drivers/scsi/lpfc/lpfc_sli.c | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/drivers/scsi/lpfc/lpfc_sli.c b/drivers/scsi/lpfc/lpfc_sli.c +index d8e0ba68879c3..480d2d467f7a6 100644 +--- a/drivers/scsi/lpfc/lpfc_sli.c ++++ b/drivers/scsi/lpfc/lpfc_sli.c +@@ -2271,6 +2271,8 @@ lpfc_sli_def_mbox_cmpl(struct lpfc_hba *phba, LPFC_MBOXQ_t *pmb) + !pmb->u.mb.mbxStatus) { + rpi = pmb->u.mb.un.varWords[0]; + vpi = pmb->u.mb.un.varRegLogin.vpi; ++ if (phba->sli_rev == LPFC_SLI_REV4) ++ vpi -= phba->sli4_hba.max_cfg_param.vpi_base; + lpfc_unreg_login(phba, vpi, rpi, pmb); + pmb->vport = vport; + pmb->mbox_cmpl = lpfc_sli_def_mbox_cmpl; +-- +2.20.1 + diff --git a/queue-4.14/selftests-kmod-fix-handling-test-numbers-above-9.patch b/queue-4.14/selftests-kmod-fix-handling-test-numbers-above-9.patch new file mode 100644 index 00000000000..f32ae310c04 --- /dev/null +++ b/queue-4.14/selftests-kmod-fix-handling-test-numbers-above-9.patch @@ -0,0 +1,64 @@ +From 8c24f2dc84da5e25450035ba38264554b8dfab40 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Fri, 10 Apr 2020 14:33:53 -0700 +Subject: selftests: kmod: fix handling test numbers above 9 + +From: Eric Biggers + +[ Upstream commit 6d573a07528308eb77ec072c010819c359bebf6e ] + +get_test_count() and get_test_enabled() were broken for test numbers +above 9 due to awk interpreting a field specification like '$0010' as +octal rather than decimal. Fix it by stripping the leading zeroes. + +Signed-off-by: Eric Biggers +Signed-off-by: Andrew Morton +Acked-by: Luis Chamberlain +Cc: Alexei Starovoitov +Cc: Greg Kroah-Hartman +Cc: Jeff Vander Stoep +Cc: Jessica Yu +Cc: Kees Cook +Cc: NeilBrown +Link: http://lkml.kernel.org/r/20200318230515.171692-5-ebiggers@kernel.org +Signed-off-by: Linus Torvalds +Signed-off-by: Sasha Levin +--- + tools/testing/selftests/kmod/kmod.sh | 13 +++++++++---- + 1 file changed, 9 insertions(+), 4 deletions(-) + +diff --git a/tools/testing/selftests/kmod/kmod.sh b/tools/testing/selftests/kmod/kmod.sh +index 7956ea3be6675..eed5d5b81226b 100755 +--- a/tools/testing/selftests/kmod/kmod.sh ++++ b/tools/testing/selftests/kmod/kmod.sh +@@ -502,18 +502,23 @@ function test_num() + fi + } + +-function get_test_count() ++function get_test_data() + { + test_num $1 +- TEST_DATA=$(echo $ALL_TESTS | awk '{print $'$1'}') ++ local field_num=$(echo $1 | sed 's/^0*//') ++ echo $ALL_TESTS | awk '{print $'$field_num'}' ++} ++ ++function get_test_count() ++{ ++ TEST_DATA=$(get_test_data $1) + LAST_TWO=${TEST_DATA#*:*} + echo ${LAST_TWO%:*} + } + + function get_test_enabled() + { +- test_num $1 +- TEST_DATA=$(echo $ALL_TESTS | awk '{print $'$1'}') ++ TEST_DATA=$(get_test_data $1) + echo ${TEST_DATA#*:*:} + } + +-- +2.20.1 + diff --git a/queue-4.14/series b/queue-4.14/series index ff3ee4510ef..83acaae5b55 100644 --- a/queue-4.14/series +++ b/queue-4.14/series @@ -5,3 +5,18 @@ keys-fix-the-use-of-the-c-keyword-private-in-uapi-linux-keyctl.h.patch drm-msm-use-the-correct-dma_sync-calls-harder.patch crypto-mxs-dcp-make-symbols-sha1_null_hash-and-sha256_null_hash-static.patch vti4-removed-duplicate-log-message.patch +watchdog-reset-last_hw_keepalive-time-at-start.patch +scsi-lpfc-fix-kasan-slab-out-of-bounds-error-in-lpfc.patch +ceph-return-ceph_mdsc_do_request-errors-from-__get_p.patch +ceph-don-t-skip-updating-wanted-caps-when-cap-is-sta.patch +pwm-rcar-fix-late-runtime-pm-enablement.patch +scsi-iscsi-report-unbind-session-event-when-the-targ.patch +asoc-intel-atom-take-the-drv-lock-mutex-before-calli.patch +kernel-gcov-fs.c-gcov_seq_next-should-increase-posit.patch +selftests-kmod-fix-handling-test-numbers-above-9.patch +ipc-util.c-sysvipc_find_ipc-should-increase-position.patch +s390-cio-avoid-duplicated-add-uevents.patch +pwm-renesas-tpu-fix-late-runtime-pm-enablement.patch +pwm-bcm2835-dynamically-allocate-base.patch +perf-core-disable-page-faults-when-getting-phys-addr.patch +pci-aspm-allow-re-enabling-clock-pm.patch diff --git a/queue-4.14/watchdog-reset-last_hw_keepalive-time-at-start.patch b/queue-4.14/watchdog-reset-last_hw_keepalive-time-at-start.patch new file mode 100644 index 00000000000..d5ee848454a --- /dev/null +++ b/queue-4.14/watchdog-reset-last_hw_keepalive-time-at-start.patch @@ -0,0 +1,42 @@ +From 38512b0bffc1ce550e5ead6ee1b463bc12425b06 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Thu, 12 Mar 2020 11:58:06 +0200 +Subject: watchdog: reset last_hw_keepalive time at start + +From: Tero Kristo + +[ Upstream commit 982bb70517aef2225bad1d802887b733db492cc0 ] + +Currently the watchdog core does not initialize the last_hw_keepalive +time during watchdog startup. This will cause the watchdog to be pinged +immediately if enough time has passed from the system boot-up time, and +some types of watchdogs like K3 RTI does not like this. + +To avoid the issue, setup the last_hw_keepalive time during watchdog +startup. + +Signed-off-by: Tero Kristo +Reviewed-by: Guenter Roeck +Link: https://lore.kernel.org/r/20200302200426.6492-3-t-kristo@ti.com +Signed-off-by: Guenter Roeck +Signed-off-by: Wim Van Sebroeck +Signed-off-by: Sasha Levin +--- + drivers/watchdog/watchdog_dev.c | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/drivers/watchdog/watchdog_dev.c b/drivers/watchdog/watchdog_dev.c +index b30fb637ae947..52e03f1c76e38 100644 +--- a/drivers/watchdog/watchdog_dev.c ++++ b/drivers/watchdog/watchdog_dev.c +@@ -245,6 +245,7 @@ static int watchdog_start(struct watchdog_device *wdd) + if (err == 0) { + set_bit(WDOG_ACTIVE, &wdd->status); + wd_data->last_keepalive = started_at; ++ wd_data->last_hw_keepalive = started_at; + watchdog_update_worker(wdd); + } + +-- +2.20.1 +