The patch below does not apply to the 4.17-stable tree.
If someone wants it applied there, or to any other stable or longterm
tree, then please email the backport, including the original git commit
id to <stable(a)vger.kernel.org>.
thanks,
greg k-h
------------------ original commit in Linus's tree ------------------
>From 4c612add7b18844ddd733ebdcbe754520155999b Mon Sep 17 00:00:00 2001
From: Eugeniy Paltsev <Eugeniy.Paltsev(a)synopsys.com>
Date: Tue, 24 Jul 2018 17:13:02 +0300
Subject: [PATCH] ARC: dma [non IOC]: fix arc_dma_sync_single_for_(device|cpu)
ARC backend for dma_sync_single_for_(device|cpu) was broken as it was
not honoring the @dir argument and simply forcing it based on the call:
- arc_dma_sync_single_for_device(dir) assumed DMA_TO_DEVICE (cache wback)
- arc_dma_sync_single_for_cpu(dir) assumed DMA_FROM_DEVICE (cache inv)
This is not true given the DMA API programming model and has been
discussed here [1] in some detail.
Interestingly while the deficiency has been there forever, it only started
showing up after 4.17 dma common ops rework, commit a8eb92d02dd7
("arc: fix arc_dma_{map,unmap}_page") which wired up these calls under the
more commonly used dma_map_page API triggering the issue.
[1]: https://lkml.org/lkml/2018/5/18/979
Fixes: commit a8eb92d02dd7 ("arc: fix arc_dma_{map,unmap}_page")
Cc: stable(a)kernel.org # v4.17+
Signed-off-by: Eugeniy Paltsev <Eugeniy.Paltsev(a)synopsys.com>
Signed-off-by: Vineet Gupta <vgupta(a)synopsys.com>
[vgupta: reworked changelog]
diff --git a/arch/arc/mm/dma.c b/arch/arc/mm/dma.c
index 8c1071840979..ec47e6079f5d 100644
--- a/arch/arc/mm/dma.c
+++ b/arch/arc/mm/dma.c
@@ -129,14 +129,59 @@ int arch_dma_mmap(struct device *dev, struct vm_area_struct *vma,
return ret;
}
+/*
+ * Cache operations depending on function and direction argument, inspired by
+ * https://lkml.org/lkml/2018/5/18/979
+ * "dma_sync_*_for_cpu and direction=TO_DEVICE (was Re: [PATCH 02/20]
+ * dma-mapping: provide a generic dma-noncoherent implementation)"
+ *
+ * | map == for_device | unmap == for_cpu
+ * |----------------------------------------------------------------
+ * TO_DEV | writeback writeback | none none
+ * FROM_DEV | invalidate invalidate | invalidate* invalidate*
+ * BIDIR | writeback+inv writeback+inv | invalidate invalidate
+ *
+ * [*] needed for CPU speculative prefetches
+ *
+ * NOTE: we don't check the validity of direction argument as it is done in
+ * upper layer functions (in include/linux/dma-mapping.h)
+ */
+
void arch_sync_dma_for_device(struct device *dev, phys_addr_t paddr,
size_t size, enum dma_data_direction dir)
{
- dma_cache_wback(paddr, size);
+ switch (dir) {
+ case DMA_TO_DEVICE:
+ dma_cache_wback(paddr, size);
+ break;
+
+ case DMA_FROM_DEVICE:
+ dma_cache_inv(paddr, size);
+ break;
+
+ case DMA_BIDIRECTIONAL:
+ dma_cache_wback_inv(paddr, size);
+ break;
+
+ default:
+ break;
+ }
}
void arch_sync_dma_for_cpu(struct device *dev, phys_addr_t paddr,
size_t size, enum dma_data_direction dir)
{
- dma_cache_inv(paddr, size);
+ switch (dir) {
+ case DMA_TO_DEVICE:
+ break;
+
+ /* FROM_DEVICE invalidate needed if speculative CPU prefetch only */
+ case DMA_FROM_DEVICE:
+ case DMA_BIDIRECTIONAL:
+ dma_cache_inv(paddr, size);
+ break;
+
+ default:
+ break;
+ }
}
I'm announcing the release of the 4.17.13 kernel.
All users of the 4.17 kernel series must upgrade.
The updated 4.17.y git tree can be found at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git linux-4.17.y
and can be browsed at the normal kernel.org git web browser:
http://git.kernel.org/?p=linux/kernel/git/stable/linux-stable.git;a=summary
thanks,
greg k-h
------------
Makefile | 2
arch/x86/entry/entry_64.S | 18 ----
arch/x86/kernel/apic/apic.c | 3
arch/x86/kvm/vmx.c | 7 -
arch/x86/platform/efi/efi_64.c | 2
drivers/crypto/padlock-aes.c | 8 +
drivers/gpu/drm/drm_atomic_helper.c | 8 +
drivers/gpu/drm/vc4/vc4_plane.c | 3
drivers/infiniband/core/uverbs_cmd.c | 59 ++++++++++++-
drivers/net/bonding/bond_main.c | 14 ++-
drivers/net/can/usb/ems_usb.c | 1
drivers/net/ethernet/mellanox/mlx5/core/en_dcbnl.c | 2
drivers/net/ethernet/mellanox/mlx5/core/eswitch.c | 4
drivers/net/ethernet/mellanox/mlx5/core/ipoib/ipoib.c | 4
drivers/net/ethernet/stmicro/stmmac/stmmac_pci.c | 40 ++++++++-
drivers/net/wireless/broadcom/brcm80211/brcmfmac/pcie.c | 3
drivers/net/wireless/intel/iwlwifi/cfg/9000.c | 69 ++++++++++++++++
drivers/net/wireless/intel/iwlwifi/iwl-config.h | 5 +
drivers/net/wireless/intel/iwlwifi/pcie/drv.c | 22 +++++
drivers/scsi/sg.c | 1
drivers/virtio/virtio_balloon.c | 2
fs/squashfs/block.c | 2
fs/squashfs/fragment.c | 13 ++-
fs/squashfs/squashfs_fs_sb.h | 1
fs/squashfs/super.c | 5 -
fs/userfaultfd.c | 4
ipc/shm.c | 12 ++
kernel/auditsc.c | 13 ++-
mm/hugetlb.c | 7 +
net/dsa/slave.c | 6 +
net/ipv4/inet_fragment.c | 6 -
net/ipv4/ip_fragment.c | 5 +
net/netlink/af_netlink.c | 2
net/rxrpc/call_accept.c | 4
net/socket.c | 5 -
35 files changed, 308 insertions(+), 54 deletions(-)
Andy Lutomirski (1):
x86/entry/64: Remove %ebx handling from error_entry/exit
Anton Vasilyev (1):
can: ems_usb: Fix memory leak on ems_usb_disconnect()
Boris Brezillon (3):
drm/vc4: Reset ->{x, y}_scaling[1] when dealing with uniplanar formats
drm/atomic: Check old_plane_state->crtc in drm_atomic_helper_async_check()
drm/atomic: Initialize variables in drm_atomic_helper_async_check() to make gcc happy
Brijesh Singh (1):
x86/efi: Access EFI MMIO data as unencrypted when SEV is active
Eli Cohen (1):
net/mlx5e: E-Switch, Initialize eswitch only if eswitch manager
Emmanuel Grumbach (1):
iwlwifi: add more card IDs for 9000 series
Eric Dumazet (3):
bonding: avoid lockdep confusion in bond_get_stats()
inet: frag: enforce memory limits earlier
ipv4: frags: handle possible skb truesize change
Feras Daoud (1):
net/mlx5e: IPoIB, Set the netdevice sw mtu in ipoib enhanced flow
Florian Fainelli (1):
net: dsa: Do not suspend/resume closed slave_dev
Greg Kroah-Hartman (1):
Linux 4.17.13
Herbert Xu (1):
crypto: padlock-aes - Fix Nano workaround data corruption
Jack Morgenstein (1):
RDMA/uverbs: Expand primary and alt AV port checks
Jane Chu (1):
ipc/shm.c add ->pagesize function to shm_vm_ops
Jeremy Cline (3):
netlink: Fix spectre v1 gadget in netlink_create()
net: socket: fix potential spectre v1 gadget in socketcall
net: socket: Fix potential spectre v1 gadget in sock_is_registered
Jiang Biao (1):
virtio_balloon: fix another race between migration and ballooning
Jose Abreu (1):
net: stmmac: Fix WoL for PCI-based setups
Len Brown (1):
x86/apic: Future-proof the TSC_DEADLINE quirk for SKX
Linus Torvalds (2):
squashfs: more metadata hardening
squashfs: more metadata hardenings
Mike Rapoport (1):
userfaultfd: remove uffd flags from vma->vm_flags if UFFD_EVENT_FORK fails
Or Gerlitz (1):
net/mlx5e: Set port trust mode to PCP as default
Rafał Miłecki (1):
brcmfmac: fix regression in parsing NVRAM for multiple devices
Roman Kagan (1):
kvm: x86: vmx: fix vpid leak
Tony Battersby (1):
scsi: sg: fix minor memory leak in error path
Yi Wang (1):
audit: fix potential null dereference 'context->module.name'
YueHaibing (1):
rxrpc: Fix user call ID check in rxrpc_service_prealloc_one
Want to follow up the email sent last week.
Do you have needs for photo editing?
We can edit 400 images within 24 hours.
We are working on all kinds of ecommerce photos, jewelry photos, and the
portrait images.
We do cutting out and clipping path and others, and also we provide
retouching for your photos,
You can throw us a photo and we will do testing for you to check our
quality.
Thanks,
Jason
From: Alexander Usyskin <alexander.usyskin(a)intel.com>
Some of the ME clients are available only for BIOS operation and are
removed during hand off to an OS. However the removal is not instant.
A client may be visible on the client list when the mei driver requests
for enumeration, while the subsequent request for properties will be
answered with client not found error value. The default behavior
for an error is to perform client reset while this error is harmless and
the link reset should be prevented. This issue started to be visible due to
suspend/resume timing changes. Currently reported only on the Haswell
based system.
Fixes:
[33.564957] mei_me 0000:00:16.0: hbm: properties response: wrong status = 1 CLIENT_NOT_FOUND
[33.564978] mei_me 0000:00:16.0: mei_irq_read_handler ret = -71.
[33.565270] mei_me 0000:00:16.0: unexpected reset: dev_state = INIT_CLIENTS fw status = 1E000255 60002306 00000200 00004401 00000000 00000010
Cc: <stable(a)vger.kernel.org>
Reported-by: Heiner Kallweit <hkallweit1(a)gmail.com>
Signed-off-by: Alexander Usyskin <alexander.usyskin(a)intel.com>
Signed-off-by: Tomas Winkler <tomas.winkler(a)intel.com>
---
drivers/misc/mei/hbm.c | 9 ++++++---
1 file changed, 6 insertions(+), 3 deletions(-)
diff --git a/drivers/misc/mei/hbm.c b/drivers/misc/mei/hbm.c
index f15d44bda28e..fa0f8e91e86f 100644
--- a/drivers/misc/mei/hbm.c
+++ b/drivers/misc/mei/hbm.c
@@ -1244,15 +1244,18 @@ int mei_hbm_dispatch(struct mei_device *dev, struct mei_msg_hdr *hdr)
props_res = (struct hbm_props_response *)mei_msg;
- if (props_res->status) {
+ if (props_res->status == MEI_HBMS_CLIENT_NOT_FOUND) {
+ dev_dbg(dev->dev, "hbm: properties response: %d CLIENT_NOT_FOUND\n",
+ props_res->me_addr);
+ } else if (props_res->status) {
dev_err(dev->dev, "hbm: properties response: wrong status = %d %s\n",
props_res->status,
mei_hbm_status_str(props_res->status));
return -EPROTO;
+ } else {
+ mei_hbm_me_cl_add(dev, props_res);
}
- mei_hbm_me_cl_add(dev, props_res);
-
/* request property for the next client */
if (mei_hbm_prop_req(dev, props_res->me_addr + 1))
return -EIO;
--
2.14.4