From patchwork Tue Feb 16 14:14:44 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marek Szyprowski X-Patchwork-Id: 62025 Delivered-To: patch@linaro.org Received: by 10.112.43.199 with SMTP id y7csp1690043lbl; Tue, 16 Feb 2016 06:16:37 -0800 (PST) X-Received: by 10.66.141.11 with SMTP id rk11mr31614441pab.75.1455632192501; Tue, 16 Feb 2016 06:16:32 -0800 (PST) Return-Path: Received: from bombadil.infradead.org (bombadil.infradead.org. [2001:1868:205::9]) by mx.google.com with ESMTPS id tf4si51452948pab.231.2016.02.16.06.16.32 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 16 Feb 2016 06:16:32 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org designates 2001:1868:205::9 as permitted sender) client-ip=2001:1868:205::9; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org designates 2001:1868:205::9 as permitted sender) smtp.mailfrom=linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1aVgPW-0004vi-60; Tue, 16 Feb 2016 14:15:26 +0000 Received: from mailout2.w1.samsung.com ([210.118.77.12]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1aVgPB-0003Rm-IV for linux-arm-kernel@lists.infradead.org; Tue, 16 Feb 2016 14:15:06 +0000 Received: from eucpsbgm2.samsung.com (unknown [203.254.199.245]) by mailout2.w1.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTP id <0O2N00KZ28WU3V10@mailout2.w1.samsung.com> for linux-arm-kernel@lists.infradead.org; Tue, 16 Feb 2016 14:14:54 +0000 (GMT) X-AuditID: cbfec7f5-f79b16d000005389-44-56c32edd6300 Received: from eusync2.samsung.com ( [203.254.199.212]) by eucpsbgm2.samsung.com (EUCPMTA) with SMTP id B0.83.21385.DDE23C65; Tue, 16 Feb 2016 14:14:53 +0000 (GMT) Received: from amdc1339.digital.local ([106.116.147.30]) by eusync2.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTPA id <0O2N009SD8WQAL20@eusync2.samsung.com>; Tue, 16 Feb 2016 14:14:53 +0000 (GMT) From: Marek Szyprowski To: linux-arm-kernel@lists.infradead.org Subject: [PATCH] ARM64: dma-mapping: fix handling of devices registered before arch_initcall Date: Tue, 16 Feb 2016 15:14:44 +0100 Message-id: <1455632084-14666-1-git-send-email-m.szyprowski@samsung.com> X-Mailer: git-send-email 1.9.2 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFnrJJMWRmVeSWpSXmKPExsVy+t/xK7p39Q6HGbzfbmbxflkPo8Wmx9dY LdYeuctucfDDE1aLlx9PsDiweqyZt4bRY/OSeo++LasYA5ijuGxSUnMyy1KL9O0SuDJ+P+lm KbjKVjH/80z2BsZrrF2MnBwSAiYST3cdZoSwxSQu3FvP1sXIxSEksJRR4t7HJSwQThOTxIW3 j9lBqtgEDCW63naxgdgiAhoSU7pA4lwczALLGCXmLV8GlhAWiJNo3NjGAmKzCKhK7Dh6E8zm FfCQWHnrIhvEOjmJ/y9XME1g5F7AyLCKUTS1NLmgOCk910ivODG3uDQvXS85P3cTIyQAvu5g XHrM6hCjAAejEg/vBtdDYUKsiWXFlbmHGCU4mJVEeP+9AgrxpiRWVqUW5ccXleakFh9ilOZg URLnnbnrfYiQQHpiSWp2ampBahFMlomDU6qBsfSCtE75PuMZU9STbx1RqtzrL7/qQG5epuNp O91M0XUvVt63qpNcsEUyT+Hmr2+sj9zDzG8f7tivHrBO4KvqrX9bDoVHnfba5bE/7+0knhke y9kqY9ZxceiZr5b4KfPsk2yS4xn2a0JPA67VeMS0udxj1vj7n3fWkldFs033Xptyrex9mNLE BiWW4oxEQy3mouJEAI+Ebef8AQAA X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20160216_061505_784234_2DF73484 X-CRM114-Status: GOOD ( 13.75 ) X-Spam-Score: -6.9 (------) X-Spam-Report: SpamAssassin version 3.4.0 on bombadil.infradead.org summary: Content analysis details: (-6.9 points) pts rule name description ---- ---------------------- -------------------------------------------------- -5.0 RCVD_IN_DNSWL_HI RBL: Sender listed at http://www.dnswl.org/, high trust [210.118.77.12 listed in list.dnswl.org] -0.0 RCVD_IN_MSPIKE_H3 RBL: Good reputation (+3) [210.118.77.12 listed in wl.mailspike.net] -0.0 RP_MATCHES_RCVD Envelope sender domain matches handover relay domain -0.0 SPF_HELO_PASS SPF: HELO matches SPF record -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] -0.0 RCVD_IN_MSPIKE_WL Mailspike good senders X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Catalin Marinas , Will Deacon , Robin Murphy , Marek Szyprowski MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org This patch ensures that devices, which got registered before arch_initcall will be handled correctly by IOMMU-based DMA-mapping code. Signed-off-by: Marek Szyprowski --- arch/arm64/mm/dma-mapping.c | 4 ++++ 1 file changed, 4 insertions(+) -- 1.9.2 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel diff --git a/arch/arm64/mm/dma-mapping.c b/arch/arm64/mm/dma-mapping.c index 573b1e6..ce6019f 100644 --- a/arch/arm64/mm/dma-mapping.c +++ b/arch/arm64/mm/dma-mapping.c @@ -928,6 +928,10 @@ static int __init __iommu_dma_init(void) ret = register_iommu_dma_ops_notifier(&platform_bus_type); if (!ret) ret = register_iommu_dma_ops_notifier(&amba_bustype); + + /* handle devices queued before this arch_initcall */ + if (!ret) + __iommu_attach_notifier(NULL, BUS_NOTIFY_ADD_DEVICE, NULL); return ret; } arch_initcall(__iommu_dma_init);