From 4bc5d68aef41edebde9c6443ea29f69745d53fd1 Mon Sep 17 00:00:00 2001 From: Sasha Levin Date: Thu, 16 Apr 2020 08:44:21 -0400 Subject: [PATCH] Fixes for 4.14 Signed-off-by: Sasha Levin --- ...te-xts-sector-size-for-large-input-l.patch | 66 +++++++++++++ ...duplicate-nr_rnd_zones-increase-in-d.patch | 41 ++++++++ ...learing-payload-state-on-topology-di.patch | 94 ++++++++++++++++++ ...eserved-manipulation-from-drm_pci_al.patch | 98 +++++++++++++++++++ ...ow-the-maxactive-number-on-kprobe_ev.patch | 42 ++++++++ ...pmi-fix-hung-processes-in-__get_guid.patch | 72 ++++++++++++++ ...-unnecessary-parentheses-and-simplif.patch | 56 +++++++++++ ...e-avoid-creating-duplicate-tlb1-entr.patch | 80 +++++++++++++++ queue-4.14/series | 8 ++ 9 files changed, 557 insertions(+) create mode 100644 queue-4.14/crypto-caam-update-xts-sector-size-for-large-input-l.patch create mode 100644 queue-4.14/dm-zoned-remove-duplicate-nr_rnd_zones-increase-in-d.patch create mode 100644 queue-4.14/drm-dp_mst-fix-clearing-payload-state-on-topology-di.patch create mode 100644 queue-4.14/drm-remove-pagereserved-manipulation-from-drm_pci_al.patch create mode 100644 queue-4.14/ftrace-kprobe-show-the-maxactive-number-on-kprobe_ev.patch create mode 100644 queue-4.14/ipmi-fix-hung-processes-in-__get_guid.patch create mode 100644 queue-4.14/misc-echo-remove-unnecessary-parentheses-and-simplif.patch create mode 100644 queue-4.14/powerpc-fsl_booke-avoid-creating-duplicate-tlb1-entr.patch diff --git a/queue-4.14/crypto-caam-update-xts-sector-size-for-large-input-l.patch b/queue-4.14/crypto-caam-update-xts-sector-size-for-large-input-l.patch new file mode 100644 index 00000000000..5dcf8e7dd82 --- /dev/null +++ b/queue-4.14/crypto-caam-update-xts-sector-size-for-large-input-l.patch @@ -0,0 +1,66 @@ +From 6671a73549b3ba49e72a686807a57f5ded8c679e Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Fri, 28 Feb 2020 12:46:48 +0200 +Subject: crypto: caam - update xts sector size for large input length +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +From: Andrei Botila + +[ Upstream commit 3f142b6a7b573bde6cff926f246da05652c61eb4 ] + +Since in the software implementation of XTS-AES there is +no notion of sector every input length is processed the same way. +CAAM implementation has the notion of sector which causes different +results between the software implementation and the one in CAAM +for input lengths bigger than 512 bytes. +Increase sector size to maximum value on 16 bits. + +Fixes: c6415a6016bf ("crypto: caam - add support for acipher xts(aes)") +Cc: # v4.12+ +Signed-off-by: Andrei Botila +Reviewed-by: Horia Geantă +Signed-off-by: Herbert Xu +Signed-off-by: Sasha Levin +--- + drivers/crypto/caam/caamalg_desc.c | 16 ++++++++++++++-- + 1 file changed, 14 insertions(+), 2 deletions(-) + +diff --git a/drivers/crypto/caam/caamalg_desc.c b/drivers/crypto/caam/caamalg_desc.c +index b23c7b72525c0..a3d507fb9ea5a 100644 +--- a/drivers/crypto/caam/caamalg_desc.c ++++ b/drivers/crypto/caam/caamalg_desc.c +@@ -1280,7 +1280,13 @@ EXPORT_SYMBOL(cnstr_shdsc_ablkcipher_givencap); + */ + void cnstr_shdsc_xts_ablkcipher_encap(u32 * const desc, struct alginfo *cdata) + { +- __be64 sector_size = cpu_to_be64(512); ++ /* ++ * Set sector size to a big value, practically disabling ++ * sector size segmentation in xts implementation. We cannot ++ * take full advantage of this HW feature with existing ++ * crypto API / dm-crypt SW architecture. ++ */ ++ __be64 sector_size = cpu_to_be64(BIT(15)); + u32 *key_jump_cmd; + + init_sh_desc(desc, HDR_SHARE_SERIAL | HDR_SAVECTX); +@@ -1332,7 +1338,13 @@ EXPORT_SYMBOL(cnstr_shdsc_xts_ablkcipher_encap); + */ + void cnstr_shdsc_xts_ablkcipher_decap(u32 * const desc, struct alginfo *cdata) + { +- __be64 sector_size = cpu_to_be64(512); ++ /* ++ * Set sector size to a big value, practically disabling ++ * sector size segmentation in xts implementation. We cannot ++ * take full advantage of this HW feature with existing ++ * crypto API / dm-crypt SW architecture. ++ */ ++ __be64 sector_size = cpu_to_be64(BIT(15)); + u32 *key_jump_cmd; + + init_sh_desc(desc, HDR_SHARE_SERIAL | HDR_SAVECTX); +-- +2.20.1 + diff --git a/queue-4.14/dm-zoned-remove-duplicate-nr_rnd_zones-increase-in-d.patch b/queue-4.14/dm-zoned-remove-duplicate-nr_rnd_zones-increase-in-d.patch new file mode 100644 index 00000000000..3fe18fd91c9 --- /dev/null +++ b/queue-4.14/dm-zoned-remove-duplicate-nr_rnd_zones-increase-in-d.patch @@ -0,0 +1,41 @@ +From 4cce4729fc39c97b5feb4db0343acfbf87f7b2fd Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Tue, 24 Mar 2020 21:22:45 +0800 +Subject: dm zoned: remove duplicate nr_rnd_zones increase in dmz_init_zone() + +From: Bob Liu + +[ Upstream commit b8fdd090376a7a46d17db316638fe54b965c2fb0 ] + +zmd->nr_rnd_zones was increased twice by mistake. The other place it +is increased in dmz_init_zone() is the only one needed: + +1131 zmd->nr_useable_zones++; +1132 if (dmz_is_rnd(zone)) { +1133 zmd->nr_rnd_zones++; + ^^^ +Fixes: 3b1a94c88b79 ("dm zoned: drive-managed zoned block device target") +Cc: stable@vger.kernel.org +Signed-off-by: Bob Liu +Reviewed-by: Damien Le Moal +Signed-off-by: Mike Snitzer +Signed-off-by: Sasha Levin +--- + drivers/md/dm-zoned-metadata.c | 1 - + 1 file changed, 1 deletion(-) + +diff --git a/drivers/md/dm-zoned-metadata.c b/drivers/md/dm-zoned-metadata.c +index e3b67b145027b..4d658a0c60258 100644 +--- a/drivers/md/dm-zoned-metadata.c ++++ b/drivers/md/dm-zoned-metadata.c +@@ -1105,7 +1105,6 @@ static int dmz_init_zone(struct dmz_metadata *zmd, struct dm_zone *zone, + + if (blkz->type == BLK_ZONE_TYPE_CONVENTIONAL) { + set_bit(DMZ_RND, &zone->flags); +- zmd->nr_rnd_zones++; + } else if (blkz->type == BLK_ZONE_TYPE_SEQWRITE_REQ || + blkz->type == BLK_ZONE_TYPE_SEQWRITE_PREF) { + set_bit(DMZ_SEQ, &zone->flags); +-- +2.20.1 + diff --git a/queue-4.14/drm-dp_mst-fix-clearing-payload-state-on-topology-di.patch b/queue-4.14/drm-dp_mst-fix-clearing-payload-state-on-topology-di.patch new file mode 100644 index 00000000000..6d0cc579b99 --- /dev/null +++ b/queue-4.14/drm-dp_mst-fix-clearing-payload-state-on-topology-di.patch @@ -0,0 +1,94 @@ +From 825c132ebaa165e5923dcb916279f1839a125bd1 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Wed, 22 Jan 2020 14:43:20 -0500 +Subject: drm/dp_mst: Fix clearing payload state on topology disable +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +From: Lyude Paul + +[ Upstream commit 8732fe46b20c951493bfc4dba0ad08efdf41de81 ] + +The issues caused by: + +commit 64e62bdf04ab ("drm/dp_mst: Remove VCPI while disabling topology +mgr") + +Prompted me to take a closer look at how we clear the payload state in +general when disabling the topology, and it turns out there's actually +two subtle issues here. + +The first is that we're not grabbing &mgr.payload_lock when clearing the +payloads in drm_dp_mst_topology_mgr_set_mst(). Seeing as the canonical +lock order is &mgr.payload_lock -> &mgr.lock (because we always want +&mgr.lock to be the inner-most lock so topology validation always +works), this makes perfect sense. It also means that -technically- there +could be racing between someone calling +drm_dp_mst_topology_mgr_set_mst() to disable the topology, along with a +modeset occurring that's modifying the payload state at the same time. + +The second is the more obvious issue that Wayne Lin discovered, that +we're not clearing proposed_payloads when disabling the topology. + +I actually can't see any obvious places where the racing caused by the +first issue would break something, and it could be that some of our +higher-level locks already prevent this by happenstance, but better safe +then sorry. So, let's make it so that drm_dp_mst_topology_mgr_set_mst() +first grabs &mgr.payload_lock followed by &mgr.lock so that we never +race when modifying the payload state. Then, we also clear +proposed_payloads to fix the original issue of enabling a new topology +with a dirty payload state. This doesn't clear any of the drm_dp_vcpi +structures, but those are getting destroyed along with the ports anyway. + +Changes since v1: +* Use sizeof(mgr->payloads[0])/sizeof(mgr->proposed_vcpis[0]) instead - + vsyrjala + +Cc: Sean Paul +Cc: Wayne Lin +Cc: Ville Syrjälä +Cc: stable@vger.kernel.org # v4.4+ +Signed-off-by: Lyude Paul +Reviewed-by: Ville Syrjälä +Link: https://patchwork.freedesktop.org/patch/msgid/20200122194321.14953-1-lyude@redhat.com +Signed-off-by: Sasha Levin +--- + drivers/gpu/drm/drm_dp_mst_topology.c | 7 ++++++- + 1 file changed, 6 insertions(+), 1 deletion(-) + +diff --git a/drivers/gpu/drm/drm_dp_mst_topology.c b/drivers/gpu/drm/drm_dp_mst_topology.c +index f0d819fc16cd7..db0e9ce57e29a 100644 +--- a/drivers/gpu/drm/drm_dp_mst_topology.c ++++ b/drivers/gpu/drm/drm_dp_mst_topology.c +@@ -2038,6 +2038,7 @@ int drm_dp_mst_topology_mgr_set_mst(struct drm_dp_mst_topology_mgr *mgr, bool ms + int ret = 0; + struct drm_dp_mst_branch *mstb = NULL; + ++ mutex_lock(&mgr->payload_lock); + mutex_lock(&mgr->lock); + if (mst_state == mgr->mst_state) + goto out_unlock; +@@ -2096,7 +2097,10 @@ int drm_dp_mst_topology_mgr_set_mst(struct drm_dp_mst_topology_mgr *mgr, bool ms + /* this can fail if the device is gone */ + drm_dp_dpcd_writeb(mgr->aux, DP_MSTM_CTRL, 0); + ret = 0; +- memset(mgr->payloads, 0, mgr->max_payloads * sizeof(struct drm_dp_payload)); ++ memset(mgr->payloads, 0, ++ mgr->max_payloads * sizeof(mgr->payloads[0])); ++ memset(mgr->proposed_vcpis, 0, ++ mgr->max_payloads * sizeof(mgr->proposed_vcpis[0])); + mgr->payload_mask = 0; + set_bit(0, &mgr->payload_mask); + mgr->vcpi_mask = 0; +@@ -2104,6 +2108,7 @@ int drm_dp_mst_topology_mgr_set_mst(struct drm_dp_mst_topology_mgr *mgr, bool ms + + out_unlock: + mutex_unlock(&mgr->lock); ++ mutex_unlock(&mgr->payload_lock); + if (mstb) + drm_dp_put_mst_branch_device(mstb); + return ret; +-- +2.20.1 + diff --git a/queue-4.14/drm-remove-pagereserved-manipulation-from-drm_pci_al.patch b/queue-4.14/drm-remove-pagereserved-manipulation-from-drm_pci_al.patch new file mode 100644 index 00000000000..c1ed787cd1d --- /dev/null +++ b/queue-4.14/drm-remove-pagereserved-manipulation-from-drm_pci_al.patch @@ -0,0 +1,98 @@ +From 764002bc5ff22c28745e4aaa2e4b20927ae4679d Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Sun, 2 Feb 2020 17:16:31 +0000 +Subject: drm: Remove PageReserved manipulation from drm_pci_alloc + +From: Chris Wilson + +[ Upstream commit ea36ec8623f56791c6ff6738d0509b7920f85220 ] + +drm_pci_alloc/drm_pci_free are very thin wrappers around the core dma +facilities, and we have no special reason within the drm layer to behave +differently. In particular, since + +commit de09d31dd38a50fdce106c15abd68432eebbd014 +Author: Kirill A. Shutemov +Date: Fri Jan 15 16:51:42 2016 -0800 + + page-flags: define PG_reserved behavior on compound pages + + As far as I can see there's no users of PG_reserved on compound pages. + Let's use PF_NO_COMPOUND here. + +it has been illegal to combine GFP_COMP with SetPageReserved, so lets +stop doing both and leave the dma layer to its own devices. + +Reported-by: Taketo Kabe +Bug: https://gitlab.freedesktop.org/drm/intel/issues/1027 +Fixes: de09d31dd38a ("page-flags: define PG_reserved behavior on compound pages") +Signed-off-by: Chris Wilson +Cc: # v4.5+ +Reviewed-by: Alex Deucher +Link: https://patchwork.freedesktop.org/patch/msgid/20200202171635.4039044-1-chris@chris-wilson.co.uk +Signed-off-by: Sasha Levin +--- + drivers/gpu/drm/drm_pci.c | 25 ++----------------------- + 1 file changed, 2 insertions(+), 23 deletions(-) + +diff --git a/drivers/gpu/drm/drm_pci.c b/drivers/gpu/drm/drm_pci.c +index 1235c9877d6f1..2078d7706a67b 100644 +--- a/drivers/gpu/drm/drm_pci.c ++++ b/drivers/gpu/drm/drm_pci.c +@@ -46,8 +46,6 @@ + drm_dma_handle_t *drm_pci_alloc(struct drm_device * dev, size_t size, size_t align) + { + drm_dma_handle_t *dmah; +- unsigned long addr; +- size_t sz; + + /* pci_alloc_consistent only guarantees alignment to the smallest + * PAGE_SIZE order which is greater than or equal to the requested size. +@@ -61,22 +59,13 @@ drm_dma_handle_t *drm_pci_alloc(struct drm_device * dev, size_t size, size_t ali + return NULL; + + dmah->size = size; +- dmah->vaddr = dma_alloc_coherent(&dev->pdev->dev, size, &dmah->busaddr, GFP_KERNEL | __GFP_COMP); ++ dmah->vaddr = dma_alloc_coherent(&dev->pdev->dev, size, &dmah->busaddr, GFP_KERNEL); + + if (dmah->vaddr == NULL) { + kfree(dmah); + return NULL; + } + +- memset(dmah->vaddr, 0, size); +- +- /* XXX - Is virt_to_page() legal for consistent mem? */ +- /* Reserve */ +- for (addr = (unsigned long)dmah->vaddr, sz = size; +- sz > 0; addr += PAGE_SIZE, sz -= PAGE_SIZE) { +- SetPageReserved(virt_to_page((void *)addr)); +- } +- + return dmah; + } + +@@ -89,19 +78,9 @@ EXPORT_SYMBOL(drm_pci_alloc); + */ + void __drm_legacy_pci_free(struct drm_device * dev, drm_dma_handle_t * dmah) + { +- unsigned long addr; +- size_t sz; +- +- if (dmah->vaddr) { +- /* XXX - Is virt_to_page() legal for consistent mem? */ +- /* Unreserve */ +- for (addr = (unsigned long)dmah->vaddr, sz = dmah->size; +- sz > 0; addr += PAGE_SIZE, sz -= PAGE_SIZE) { +- ClearPageReserved(virt_to_page((void *)addr)); +- } ++ if (dmah->vaddr) + dma_free_coherent(&dev->pdev->dev, dmah->size, dmah->vaddr, + dmah->busaddr); +- } + } + + /** +-- +2.20.1 + diff --git a/queue-4.14/ftrace-kprobe-show-the-maxactive-number-on-kprobe_ev.patch b/queue-4.14/ftrace-kprobe-show-the-maxactive-number-on-kprobe_ev.patch new file mode 100644 index 00000000000..a731e7a816a --- /dev/null +++ b/queue-4.14/ftrace-kprobe-show-the-maxactive-number-on-kprobe_ev.patch @@ -0,0 +1,42 @@ +From 08012ac092a9bb62dab45fa01a3030a08e3aaa36 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Tue, 24 Mar 2020 16:34:48 +0900 +Subject: ftrace/kprobe: Show the maxactive number on kprobe_events + +From: Masami Hiramatsu + +[ Upstream commit 6a13a0d7b4d1171ef9b80ad69abc37e1daa941b3 ] + +Show maxactive parameter on kprobe_events. +This allows user to save the current configuration and +restore it without losing maxactive parameter. + +Link: http://lkml.kernel.org/r/4762764a-6df7-bc93-ed60-e336146dce1f@gmail.com +Link: http://lkml.kernel.org/r/158503528846.22706.5549974121212526020.stgit@devnote2 + +Cc: stable@vger.kernel.org +Fixes: 696ced4fb1d76 ("tracing/kprobes: expose maxactive for kretprobe in kprobe_events") +Reported-by: Taeung Song +Signed-off-by: Masami Hiramatsu +Signed-off-by: Steven Rostedt (VMware) +Signed-off-by: Sasha Levin +--- + kernel/trace/trace_kprobe.c | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/kernel/trace/trace_kprobe.c b/kernel/trace/trace_kprobe.c +index ea20274a105ae..d66aed6e9c75f 100644 +--- a/kernel/trace/trace_kprobe.c ++++ b/kernel/trace/trace_kprobe.c +@@ -877,6 +877,8 @@ static int probes_seq_show(struct seq_file *m, void *v) + int i; + + seq_putc(m, trace_kprobe_is_return(tk) ? 'r' : 'p'); ++ if (trace_kprobe_is_return(tk) && tk->rp.maxactive) ++ seq_printf(m, "%d", tk->rp.maxactive); + seq_printf(m, ":%s/%s", tk->tp.call.class->system, + trace_event_name(&tk->tp.call)); + +-- +2.20.1 + diff --git a/queue-4.14/ipmi-fix-hung-processes-in-__get_guid.patch b/queue-4.14/ipmi-fix-hung-processes-in-__get_guid.patch new file mode 100644 index 00000000000..9a2413c7266 --- /dev/null +++ b/queue-4.14/ipmi-fix-hung-processes-in-__get_guid.patch @@ -0,0 +1,72 @@ +From 10a9865268d8ce0d2e7159510934683d14baf681 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Fri, 3 Apr 2020 17:04:08 +0800 +Subject: ipmi: fix hung processes in __get_guid() + +From: Wen Yang + +[ Upstream commit 32830a0534700f86366f371b150b17f0f0d140d7 ] + +The wait_event() function is used to detect command completion. +When send_guid_cmd() returns an error, smi_send() has not been +called to send data. Therefore, wait_event() should not be used +on the error path, otherwise it will cause the following warning: + +[ 1361.588808] systemd-udevd D 0 1501 1436 0x00000004 +[ 1361.588813] ffff883f4b1298c0 0000000000000000 ffff883f4b188000 ffff887f7e3d9f40 +[ 1361.677952] ffff887f64bd4280 ffffc90037297a68 ffffffff8173ca3b ffffc90000000010 +[ 1361.767077] 00ffc90037297ad0 ffff887f7e3d9f40 0000000000000286 ffff883f4b188000 +[ 1361.856199] Call Trace: +[ 1361.885578] [] ? __schedule+0x23b/0x780 +[ 1361.951406] [] schedule+0x36/0x80 +[ 1362.010979] [] get_guid+0x118/0x150 [ipmi_msghandler] +[ 1362.091281] [] ? prepare_to_wait_event+0x100/0x100 +[ 1362.168533] [] ipmi_register_smi+0x405/0x940 [ipmi_msghandler] +[ 1362.258337] [] try_smi_init+0x529/0x950 [ipmi_si] +[ 1362.334521] [] ? std_irq_setup+0xd0/0xd0 [ipmi_si] +[ 1362.411701] [] init_ipmi_si+0x492/0x9e0 [ipmi_si] +[ 1362.487917] [] ? ipmi_pci_probe+0x280/0x280 [ipmi_si] +[ 1362.568219] [] do_one_initcall+0x50/0x180 +[ 1362.636109] [] ? kmem_cache_alloc_trace+0x142/0x190 +[ 1362.714330] [] do_init_module+0x5f/0x200 +[ 1362.781208] [] load_module+0x1898/0x1de0 +[ 1362.848069] [] ? __symbol_put+0x60/0x60 +[ 1362.913886] [] ? security_kernel_post_read_file+0x6b/0x80 +[ 1362.998514] [] SYSC_finit_module+0xe5/0x120 +[ 1363.068463] [] ? SYSC_finit_module+0xe5/0x120 +[ 1363.140513] [] SyS_finit_module+0xe/0x10 +[ 1363.207364] [] do_syscall_64+0x74/0x180 + +Fixes: 50c812b2b951 ("[PATCH] ipmi: add full sysfs support") +Signed-off-by: Wen Yang +Cc: Corey Minyard +Cc: Arnd Bergmann +Cc: Greg Kroah-Hartman +Cc: openipmi-developer@lists.sourceforge.net +Cc: linux-kernel@vger.kernel.org +Cc: stable@vger.kernel.org # 2.6.17- +Message-Id: <20200403090408.58745-1-wenyang@linux.alibaba.com> +Signed-off-by: Corey Minyard +Signed-off-by: Sasha Levin +--- + drivers/char/ipmi/ipmi_msghandler.c | 4 +++- + 1 file changed, 3 insertions(+), 1 deletion(-) + +diff --git a/drivers/char/ipmi/ipmi_msghandler.c b/drivers/char/ipmi/ipmi_msghandler.c +index c82d9fd2f05af..f72a272eeb9b2 100644 +--- a/drivers/char/ipmi/ipmi_msghandler.c ++++ b/drivers/char/ipmi/ipmi_msghandler.c +@@ -2647,7 +2647,9 @@ get_guid(ipmi_smi_t intf) + if (rv) + /* Send failed, no GUID available. */ + intf->bmc->guid_set = 0; +- wait_event(intf->waitq, intf->bmc->guid_set != 2); ++ else ++ wait_event(intf->waitq, intf->bmc->guid_set != 2); ++ + intf->null_user_handler = NULL; + } + +-- +2.20.1 + diff --git a/queue-4.14/misc-echo-remove-unnecessary-parentheses-and-simplif.patch b/queue-4.14/misc-echo-remove-unnecessary-parentheses-and-simplif.patch new file mode 100644 index 00000000000..1553333fe45 --- /dev/null +++ b/queue-4.14/misc-echo-remove-unnecessary-parentheses-and-simplif.patch @@ -0,0 +1,56 @@ +From eb2b9cdc34dc8b813e18fba692ae18928d625788 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Fri, 14 Sep 2018 23:43:37 -0700 +Subject: misc: echo: Remove unnecessary parentheses and simplify check for + zero + +From: Nathan Chancellor + +[ Upstream commit 85dc2c65e6c975baaf36ea30f2ccc0a36a8c8add ] + +Clang warns when multiple pairs of parentheses are used for a single +conditional statement. + +drivers/misc/echo/echo.c:384:27: warning: equality comparison with +extraneous parentheses [-Wparentheses-equality] + if ((ec->nonupdate_dwell == 0)) { + ~~~~~~~~~~~~~~~~~~~~^~~~ +drivers/misc/echo/echo.c:384:27: note: remove extraneous parentheses +around the comparison to silence this warning + if ((ec->nonupdate_dwell == 0)) { + ~ ^ ~ +drivers/misc/echo/echo.c:384:27: note: use '=' to turn this equality +comparison into an assignment + if ((ec->nonupdate_dwell == 0)) { + ^~ + = +1 warning generated. + +Remove them and while we're at it, simplify the zero check as '!var' is +used more than 'var == 0'. + +Reported-by: Nick Desaulniers +Signed-off-by: Nathan Chancellor +Reviewed-by: Nick Desaulniers +Signed-off-by: Greg Kroah-Hartman +Signed-off-by: Sasha Levin +--- + drivers/misc/echo/echo.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/drivers/misc/echo/echo.c b/drivers/misc/echo/echo.c +index 9597e9523cac4..fff13176f9b8b 100644 +--- a/drivers/misc/echo/echo.c ++++ b/drivers/misc/echo/echo.c +@@ -454,7 +454,7 @@ int16_t oslec_update(struct oslec_state *ec, int16_t tx, int16_t rx) + */ + ec->factor = 0; + ec->shift = 0; +- if ((ec->nonupdate_dwell == 0)) { ++ if (!ec->nonupdate_dwell) { + int p, logp, shift; + + /* Determine: +-- +2.20.1 + diff --git a/queue-4.14/powerpc-fsl_booke-avoid-creating-duplicate-tlb1-entr.patch b/queue-4.14/powerpc-fsl_booke-avoid-creating-duplicate-tlb1-entr.patch new file mode 100644 index 00000000000..a9465b1a5fd --- /dev/null +++ b/queue-4.14/powerpc-fsl_booke-avoid-creating-duplicate-tlb1-entr.patch @@ -0,0 +1,80 @@ +From 7a58377dfffaf2e00ca61ca4d116b2ba270bd9cd Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Thu, 23 Jan 2020 11:19:25 +0000 +Subject: powerpc/fsl_booke: Avoid creating duplicate tlb1 entry + +From: Laurentiu Tudor + +[ Upstream commit aa4113340ae6c2811e046f08c2bc21011d20a072 ] + +In the current implementation, the call to loadcam_multi() is wrapped +between switch_to_as1() and restore_to_as0() calls so, when it tries +to create its own temporary AS=1 TLB1 entry, it ends up duplicating +the existing one created by switch_to_as1(). Add a check to skip +creating the temporary entry if already running in AS=1. + +Fixes: d9e1831a4202 ("powerpc/85xx: Load all early TLB entries at once") +Cc: stable@vger.kernel.org # v4.4+ +Signed-off-by: Laurentiu Tudor +Acked-by: Scott Wood +Signed-off-by: Michael Ellerman +Link: https://lore.kernel.org/r/20200123111914.2565-1-laurentiu.tudor@nxp.com +Signed-off-by: Sasha Levin +--- + arch/powerpc/mm/tlb_nohash_low.S | 12 +++++++++++- + 1 file changed, 11 insertions(+), 1 deletion(-) + +diff --git a/arch/powerpc/mm/tlb_nohash_low.S b/arch/powerpc/mm/tlb_nohash_low.S +index 048b8e9f44928..63964af9a162e 100644 +--- a/arch/powerpc/mm/tlb_nohash_low.S ++++ b/arch/powerpc/mm/tlb_nohash_low.S +@@ -400,7 +400,7 @@ _GLOBAL(set_context) + * extern void loadcam_entry(unsigned int index) + * + * Load TLBCAM[index] entry in to the L2 CAM MMU +- * Must preserve r7, r8, r9, and r10 ++ * Must preserve r7, r8, r9, r10 and r11 + */ + _GLOBAL(loadcam_entry) + mflr r5 +@@ -436,6 +436,10 @@ END_MMU_FTR_SECTION_IFSET(MMU_FTR_BIG_PHYS) + */ + _GLOBAL(loadcam_multi) + mflr r8 ++ /* Don't switch to AS=1 if already there */ ++ mfmsr r11 ++ andi. r11,r11,MSR_IS ++ bne 10f + + /* + * Set up temporary TLB entry that is the same as what we're +@@ -461,6 +465,7 @@ _GLOBAL(loadcam_multi) + mtmsr r6 + isync + ++10: + mr r9,r3 + add r10,r3,r4 + 2: bl loadcam_entry +@@ -469,6 +474,10 @@ _GLOBAL(loadcam_multi) + mr r3,r9 + blt 2b + ++ /* Don't return to AS=0 if we were in AS=1 at function start */ ++ andi. r11,r11,MSR_IS ++ bne 3f ++ + /* Return to AS=0 and clear the temporary entry */ + mfmsr r6 + rlwinm. r6,r6,0,~(MSR_IS|MSR_DS) +@@ -484,6 +493,7 @@ _GLOBAL(loadcam_multi) + tlbwe + isync + ++3: + mtlr r8 + blr + #endif +-- +2.20.1 + diff --git a/queue-4.14/series b/queue-4.14/series index 5ffc4bebb5c..406ba5571ca 100644 --- a/queue-4.14/series +++ b/queue-4.14/series @@ -94,3 +94,11 @@ powerpc-add-attributes-for-setjmp-longjmp.patch powerpc-make-setjmp-longjmp-signature-standard.patch btrfs-fix-crash-during-unmount-due-to-race-with-dela.patch btrfs-use-nofs-allocations-for-running-delayed-items.patch +dm-zoned-remove-duplicate-nr_rnd_zones-increase-in-d.patch +crypto-caam-update-xts-sector-size-for-large-input-l.patch +drm-dp_mst-fix-clearing-payload-state-on-topology-di.patch +drm-remove-pagereserved-manipulation-from-drm_pci_al.patch +ftrace-kprobe-show-the-maxactive-number-on-kprobe_ev.patch +ipmi-fix-hung-processes-in-__get_guid.patch +powerpc-fsl_booke-avoid-creating-duplicate-tlb1-entr.patch +misc-echo-remove-unnecessary-parentheses-and-simplif.patch -- 2.47.3