Received: by 10.192.165.148 with SMTP id m20csp571635imm; Wed, 25 Apr 2018 04:28:44 -0700 (PDT) X-Google-Smtp-Source: AIpwx4+RJPBn/u4mCaz7H2P0qXP3Wjv3YTvrGwavfHH7k+Vl1U6/m1K5CezFQjRMHvwULLnFuw0F X-Received: by 2002:a17:902:6086:: with SMTP id s6-v6mr28552381plj.307.1524655724795; Wed, 25 Apr 2018 04:28:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524655724; cv=none; d=google.com; s=arc-20160816; b=kKpc+ZVBWDJ5dB6ltE/fkJ6nJMIy3nbfE/smqASOKri5IdZTdRlik0Es/5FSf7rhF1 aUQzSdgBCRAG8/v4T+cu+4yz32eaY51lC9cs3SZgUUZ0tduJ0JJO/RQodbnc19wowUmf dPzjgrCVuCr0Eys+Av3Zk9YB4iDVBqSNf8B/8MB1JqKcuS9GRC+KZkYwWkjHns17BBja P4sQCcFpkYT3qUj9AZyR8j+5Sj4/bQ4WnY52Et4vYDxdXS6Fev+ri9HedpPYf8LaWwgQ sdvy6o33vSyOLv2kyWlfensJso2Cmuqod0WeSO+5NgLM1E3HDMN6x+em2zDW/K0xbnX1 Xq5w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=ZYzpp95qcYRCoGnQFwu/QVSO6bimwrWdi88lR0nVQLU=; b=I+fVfbBBrUfcADyhPEpfZ/wwFNXtJiTkYe3hUQlpmEUG38Nz5hSz2XIUf+G6TkeDQ0 ylQtXulsEvpU3EBx9bSZ/h3lgqHXqU11D/2OMMk6RoESWMbgK2wSZvhqNWkKOk8aohip ROR2Xq36WGlTl4lDDO9X4ENVwUIHoCiYLXci9lAZ5I3ksBhMmynVCkDwiJqt4tevOcUI sFV7vdyE14dXVpy+Wn+H2hXy9gdFdcnKlif+Nh7/dQxMBPpUJv3v85k9FxKETOt6Fzu7 b9n/h9tLqydXCa69VfVkihVxyR3QGGx69E5ReGkvUbivKO7oKZkZ1777F1lrt4sNXIsq yHOw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id t14-v6si311371plm.3.2018.04.25.04.28.29; Wed, 25 Apr 2018 04:28:44 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753443AbeDYKil (ORCPT + 99 others); Wed, 25 Apr 2018 06:38:41 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:51500 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752938AbeDYKie (ORCPT ); Wed, 25 Apr 2018 06:38:34 -0400 Received: from localhost (LFbn-1-12247-202.w90-92.abo.wanadoo.fr [90.92.61.202]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id 306EE30; Wed, 25 Apr 2018 10:38:34 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Robin Murphy , Marek Szyprowski , Joerg Roedel , Sasha Levin Subject: [PATCH 4.14 043/183] iommu/exynos: Dont unconditionally steal bus ops Date: Wed, 25 Apr 2018 12:34:23 +0200 Message-Id: <20180425103244.298982923@linuxfoundation.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180425103242.532713678@linuxfoundation.org> References: <20180425103242.532713678@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.14-stable review patch. If anyone has any objections, please let me know. ------------------ From: Robin Murphy [ Upstream commit dc98b8480d8a68c2ce9aa28b9f0d714fd258bc0b ] Removing the early device registration hook overlooked the fact that it only ran conditionally on a compatible device being present in the DT. With exynos_iommu_init() now running as an unconditional initcall, problems arise on non-Exynos systems when other IOMMU drivers find themselves unable to install their ops on the platform bus, or at worst the Exynos ops get called with someone else's domain and all hell breaks loose. The global ops/cache setup could probably all now be triggered from the first IOMMU probe, as with dma_dev assigment, but for the time being the simplest fix is to resurrect the logic from commit a7b67cd5d9af ("iommu/exynos: Play nice in multi-platform builds") to explicitly check the DT for the presence of an Exynos IOMMU before trying anything. Fixes: 928055a01b3f ("iommu/exynos: Remove custom platform device registration code") Signed-off-by: Robin Murphy Acked-by: Marek Szyprowski Signed-off-by: Joerg Roedel Signed-off-by: Sasha Levin Signed-off-by: Greg Kroah-Hartman --- drivers/iommu/exynos-iommu.c | 7 +++++++ 1 file changed, 7 insertions(+) --- a/drivers/iommu/exynos-iommu.c +++ b/drivers/iommu/exynos-iommu.c @@ -1344,8 +1344,15 @@ static const struct iommu_ops exynos_iom static int __init exynos_iommu_init(void) { + struct device_node *np; int ret; + np = of_find_matching_node(NULL, sysmmu_of_match); + if (!np) + return 0; + + of_node_put(np); + lv2table_kmem_cache = kmem_cache_create("exynos-iommu-lv2table", LV2TABLE_SIZE, LV2TABLE_SIZE, 0, NULL); if (!lv2table_kmem_cache) {