linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Sasha Levin <sashal@kernel.org>
To: linux-kernel@vger.kernel.org, stable@vger.kernel.org
Cc: Robin Murphy <robin.murphy@arm.com>,
	Russell King <rmk+kernel@armlinux.org.uk>,
	Sasha Levin <sashal@kernel.org>
Subject: [PATCH AUTOSEL 4.19 09/48] ARM: 8835/1: dma-mapping: Clear DMA ops on teardown
Date: Wed, 13 Mar 2019 15:12:11 -0400	[thread overview]
Message-ID: <20190313191250.158955-9-sashal@kernel.org> (raw)
In-Reply-To: <20190313191250.158955-1-sashal@kernel.org>

From: Robin Murphy <robin.murphy@arm.com>

[ Upstream commit fc67e6f120a388b611d94cc40baf99a5cc56b283 ]

Installing the appropriate non-IOMMU DMA ops in arm_iommu_detch_device()
serves the case where IOMMU-aware drivers choose to control their own
mapping but still make DMA API calls, however it also affects the case
when the arch code itself tears down the mapping upon driver unbinding,
where the ops now get left in place and can inhibit arch_setup_dma_ops()
on subsequent re-probe attempts.

Fix the latter case by making sure that arch_teardown_dma_ops() cleans
up whenever the ops were automatically installed by its counterpart.

Reported-by: Tobias Jakobi <tjakobi@math.uni-bielefeld.de>
Reported-by: Marek Szyprowski <m.szyprowski@samsung.com>
Fixes: 1874619a7df4 "ARM: dma-mapping: Set proper DMA ops in arm_iommu_detach_device()"
Tested-by: Tobias Jakobi <tjakobi@math.uni-bielefeld.de>
Tested-by: Thierry Reding <treding@nvidia.com>
Signed-off-by: Robin Murphy <robin.murphy@arm.com>
Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 arch/arm/mm/dma-mapping.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/arch/arm/mm/dma-mapping.c b/arch/arm/mm/dma-mapping.c
index 1cb9c0f9b5d6..8211cf45ece1 100644
--- a/arch/arm/mm/dma-mapping.c
+++ b/arch/arm/mm/dma-mapping.c
@@ -2400,4 +2400,6 @@ void arch_teardown_dma_ops(struct device *dev)
 		return;
 
 	arm_teardown_iommu_dma_ops(dev);
+	/* Let arch_setup_dma_ops() start again from scratch upon re-probe */
+	set_dma_ops(dev, NULL);
 }
-- 
2.19.1


  parent reply	other threads:[~2019-03-13 19:28 UTC|newest]

Thread overview: 48+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-03-13 19:12 [PATCH AUTOSEL 4.19 01/48] clk: sunxi-ng: v3s: Fix TCON reset de-assert bit Sasha Levin
2019-03-13 19:12 ` [PATCH AUTOSEL 4.19 02/48] kallsyms: Handle too long symbols in kallsyms.c Sasha Levin
2019-03-13 19:12 ` [PATCH AUTOSEL 4.19 03/48] clk: sunxi: A31: Fix wrong AHB gate number Sasha Levin
2019-03-13 19:12 ` [PATCH AUTOSEL 4.19 04/48] esp: Skip TX bytes accounting when sending from a request socket Sasha Levin
2019-03-13 19:12 ` [PATCH AUTOSEL 4.19 05/48] ARM: 8824/1: fix a migrating irq bug when hotplug cpu Sasha Levin
2019-03-13 19:12 ` [PATCH AUTOSEL 4.19 06/48] bpf: only adjust gso_size on bytestream protocols Sasha Levin
2019-03-13 19:12 ` [PATCH AUTOSEL 4.19 07/48] bpf: fix lockdep false positive in stackmap Sasha Levin
2019-03-13 19:12 ` [PATCH AUTOSEL 4.19 08/48] af_key: unconditionally clone on broadcast Sasha Levin
2019-03-13 19:12 ` Sasha Levin [this message]
2019-03-13 19:12 ` [PATCH AUTOSEL 4.19 10/48] assoc_array: Fix shortcut creation Sasha Levin
2019-03-13 19:12 ` [PATCH AUTOSEL 4.19 11/48] keys: Fix dependency loop between construction record and auth key Sasha Levin
2019-03-13 19:12 ` [PATCH AUTOSEL 4.19 12/48] scsi: libiscsi: Fix race between iscsi_xmit_task and iscsi_complete_task Sasha Levin
2019-03-13 19:12 ` [PATCH AUTOSEL 4.19 13/48] net: systemport: Fix reception of BPDUs Sasha Levin
2019-03-13 19:12 ` [PATCH AUTOSEL 4.19 14/48] net: dsa: bcm_sf2: Do not assume DSA master supports WoL Sasha Levin
2019-03-13 19:12 ` [PATCH AUTOSEL 4.19 15/48] pinctrl: meson: meson8b: fix the sdxc_a data 1..3 pins Sasha Levin
2019-03-13 19:12 ` [PATCH AUTOSEL 4.19 16/48] qmi_wwan: apply SET_DTR quirk to Sierra WP7607 Sasha Levin
2019-03-13 19:12 ` [PATCH AUTOSEL 4.19 17/48] net: mv643xx_eth: disable clk on error path in mv643xx_eth_shared_probe() Sasha Levin
2019-03-13 19:12 ` [PATCH AUTOSEL 4.19 18/48] xfrm: Fix inbound traffic via XFRM interfaces across network namespaces Sasha Levin
2019-03-13 19:12 ` [PATCH AUTOSEL 4.19 19/48] mailbox: bcm-flexrm-mailbox: Fix FlexRM ring flush timeout issue Sasha Levin
2019-03-13 19:12 ` [PATCH AUTOSEL 4.19 20/48] ASoC: topology: free created components in tplg load error Sasha Levin
2019-03-13 19:12 ` [PATCH AUTOSEL 4.19 21/48] qed: Fix iWARP buffer size provided for syn packet processing Sasha Levin
2019-03-13 19:12 ` [PATCH AUTOSEL 4.19 22/48] qed: Fix iWARP syn packet mac address validation Sasha Levin
2019-03-13 19:12 ` [PATCH AUTOSEL 4.19 23/48] ARM: dts: armada-xp: fix Armada XP boards NAND description Sasha Levin
2019-03-13 19:12 ` [PATCH AUTOSEL 4.19 24/48] arm64: Relax GIC version check during early boot Sasha Levin
2019-03-13 19:12 ` [PATCH AUTOSEL 4.19 25/48] ARM: tegra: Restore DT ABI on Tegra124 Chromebooks Sasha Levin
2019-03-13 19:12 ` [PATCH AUTOSEL 4.19 26/48] net: marvell: mvneta: fix DMA debug warning Sasha Levin
2019-03-13 19:12 ` [PATCH AUTOSEL 4.19 27/48] kasan, slub: move kasan_poison_slab hook before page_address Sasha Levin
2019-03-13 19:12 ` [PATCH AUTOSEL 4.19 28/48] mm: handle lru_add_drain_all for UP properly Sasha Levin
2019-03-13 19:12 ` [PATCH AUTOSEL 4.19 29/48] tmpfs: fix link accounting when a tmpfile is linked in Sasha Levin
2019-03-13 19:12 ` [PATCH AUTOSEL 4.19 30/48] kasan, slab: fix conflicts with CONFIG_HARDENED_USERCOPY Sasha Levin
2019-03-13 19:12 ` [PATCH AUTOSEL 4.19 31/48] kasan, slab: make freelist stored without tags Sasha Levin
2019-03-13 19:12 ` [PATCH AUTOSEL 4.19 32/48] ixgbe: fix older devices that do not support IXGBE_MRQC_L3L4TXSWEN Sasha Levin
2019-03-13 19:12 ` [PATCH AUTOSEL 4.19 33/48] ARCv2: lib: memcpy: fix doing prefetchw outside of buffer Sasha Levin
2019-03-13 19:12 ` [PATCH AUTOSEL 4.19 34/48] ARC: uacces: remove lp_start, lp_end from clobber list Sasha Levin
2019-03-13 19:12 ` [PATCH AUTOSEL 4.19 35/48] ARCv2: support manual regfile save on interrupts Sasha Levin
2019-03-13 19:12 ` [PATCH AUTOSEL 4.19 36/48] ARCv2: don't assume core 0x54 has dual issue Sasha Levin
2019-03-13 19:12 ` [PATCH AUTOSEL 4.19 37/48] phonet: fix building with clang Sasha Levin
2019-03-13 19:12 ` [PATCH AUTOSEL 4.19 38/48] mac80211_hwsim: propagate genlmsg_reply return code Sasha Levin
2019-03-13 19:12 ` [PATCH AUTOSEL 4.19 39/48] bpf, lpm: fix lookup bug in map_delete_elem Sasha Levin
2019-03-13 19:12 ` [PATCH AUTOSEL 4.19 40/48] net: thunderx: make CFG_DONE message to run through generic send-ack sequence Sasha Levin
2019-03-13 19:12 ` [PATCH AUTOSEL 4.19 41/48] net: thunderx: add nicvf_send_msg_to_pf result check for set_rx_mode_task Sasha Levin
2019-03-13 19:12 ` [PATCH AUTOSEL 4.19 42/48] nfp: bpf: fix code-gen bug on BPF_ALU | BPF_XOR | BPF_K Sasha Levin
2019-03-13 19:12 ` [PATCH AUTOSEL 4.19 43/48] nfp: bpf: fix ALU32 high bits clearance bug Sasha Levin
2019-03-13 19:12 ` [PATCH AUTOSEL 4.19 44/48] bnxt_en: Fix typo in firmware message timeout logic Sasha Levin
2019-03-13 19:12 ` [PATCH AUTOSEL 4.19 45/48] bnxt_en: Wait longer for the firmware message response to complete Sasha Levin
2019-03-13 19:12 ` [PATCH AUTOSEL 4.19 46/48] mdio_bus: Fix use-after-free on device_register fails Sasha Levin
2019-03-13 19:12 ` [PATCH AUTOSEL 4.19 47/48] net: set static variable an initial value in atl2_probe() Sasha Levin
2019-03-13 19:12 ` [PATCH AUTOSEL 4.19 48/48] selftests: fib_tests: sleep after changing carrier. again Sasha Levin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190313191250.158955-9-sashal@kernel.org \
    --to=sashal@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rmk+kernel@armlinux.org.uk \
    --cc=robin.murphy@arm.com \
    --cc=stable@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).