Received: by 10.213.65.68 with SMTP id h4csp2177813imn; Sun, 8 Apr 2018 21:47:10 -0700 (PDT) X-Google-Smtp-Source: AIpwx4+DJVCqq6JaabYdk3+KmvND7QjlTjkFP48ywU7iblYNpKAqMmO7ZbJ7M4/TWMuj/MzW6NSy X-Received: by 2002:a17:902:24c7:: with SMTP id l7-v6mr36817856plg.320.1523249230512; Sun, 08 Apr 2018 21:47:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523249230; cv=none; d=google.com; s=arc-20160816; b=YYl4WypLVgyh8Fsxu6HskXe22BMXZXWpk8VrkjZfj1p0l2t9Twyei6pIymaafu1oz2 QFW5s/x2IAzVRApVEWATPPN3kUrX+AKwumF2+6vwk9vJTUVR1DjRfay0fA3M5yUPtVjR Oc8G1tlyV/AhvpBtLzoMZLRv/eOU1ZPlh71pG3Esk6TJ4zcGueNDDO2q2ryyy7TAXtbZ ezZTskbF6TSTtU1BlZgNTbgNPyIlL2LVrDBRNQUWFMVPgducEUHnUywcFXfYifd5NWMN pnpelJeT1H76mg6nYX12TazYdTukQ8HQeV6220p6pDRuTFIvBjN7NYvyUdJZgehiGy+2 11Xw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:content-transfer-encoding :spamdiagnosticmetadata:spamdiagnosticoutput:content-language :accept-language:in-reply-to:references:message-id:date:thread-index :thread-topic:subject:cc:to:from:dkim-signature :arc-authentication-results; bh=tiAHAELgC+UZxkzcQctYIREiWGkTCqch6zAd9X/GPo4=; b=w+GCcthe3LRbgH4cgCQxFxih4SLwUG4q8zUWc5MzsXr668arb5EorzL5pcpxK/umBO q7cCE6D0eP6r2jJVJIeCAHmdcW2Dxp4j29pBYlwnG1oqA1xEVAGepHAJXzlf0rJ+PlQw Y5thBGStHjSSXxqMnnB7AIioBBeb9slv1jH1ThtKsh1cZ3tOHz1fuzxR81v3xjMiMFFC xp/RR/qeu5k+f4+oiQ6mjeiQhxbGXJRP5gqrJLmIpH+B/BMem+3Sp0l2Z+engK0H6Os5 bgKMwHp9pvcBn/w44CzjAe0wbv2Gsd8AmPFtkmhiNCpjbriyevJMIpFMEbi73PfkNWVc tkfg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@microsoft.com header.s=selector1 header.b=jyE6XNji; 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; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=microsoft.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f32-v6si16945859plf.415.2018.04.08.21.46.33; Sun, 08 Apr 2018 21:47:10 -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; dkim=pass header.i=@microsoft.com header.s=selector1 header.b=jyE6XNji; 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; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=microsoft.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753258AbeDIARw (ORCPT + 99 others); Sun, 8 Apr 2018 20:17:52 -0400 Received: from mail-bl2nam02on0136.outbound.protection.outlook.com ([104.47.38.136]:51875 "EHLO NAM02-BL2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1753181AbeDIARq (ORCPT ); Sun, 8 Apr 2018 20:17:46 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=tiAHAELgC+UZxkzcQctYIREiWGkTCqch6zAd9X/GPo4=; b=jyE6XNjizSbcCQ5JGE6OwEUSXr/xCzLUbINfL0I8k1NMAv8L06KrbEm1Bx4cRlN6zMqW9BZiB/Vzjp6kgFmQlDNG44UKkg1/cSBmPqjswSBV4WEYLKuppZVmvZNcCORRiKnd/jBbOhjle1Jb+ESnNQUZ7rXTvhr0nlY5y0rT5kc= Received: from DM5PR2101MB1032.namprd21.prod.outlook.com (52.132.128.13) by DM5PR2101MB1048.namprd21.prod.outlook.com (52.132.128.17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.696.0; Mon, 9 Apr 2018 00:17:42 +0000 Received: from DM5PR2101MB1032.namprd21.prod.outlook.com ([fe80::8109:aef0:a777:7059]) by DM5PR2101MB1032.namprd21.prod.outlook.com ([fe80::8109:aef0:a777:7059%2]) with mapi id 15.20.0696.003; Mon, 9 Apr 2018 00:17:42 +0000 From: Sasha Levin To: "stable@vger.kernel.org" , "linux-kernel@vger.kernel.org" CC: Robin Murphy , Joerg Roedel , Sasha Levin Subject: [PATCH AUTOSEL for 4.15 033/189] iommu/exynos: Don't unconditionally steal bus ops Thread-Topic: [PATCH AUTOSEL for 4.15 033/189] iommu/exynos: Don't unconditionally steal bus ops Thread-Index: AQHTz5gbLMV3/hptckWs7xQRnYURzg== Date: Mon, 9 Apr 2018 00:17:12 +0000 Message-ID: <20180409001637.162453-33-alexander.levin@microsoft.com> References: <20180409001637.162453-1-alexander.levin@microsoft.com> In-Reply-To: <20180409001637.162453-1-alexander.levin@microsoft.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [52.168.54.252] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1;DM5PR2101MB1048;7:TYnoqXk/V8f3N8AB26WoqmHTL+aaNx98l0gt9B+t7KZD0Efvka0t1IdEmkYXY7Zja6MlLbmXS6xTyppnbM7mYrwO0oHcvREAAkvUgkiExQlUAuDpCaWqiJ7D8VmcwPDU2P3FOKBHqXWmJabU8hESNceB32r6DhiTBnQLFoBPAA67FpW/7ulWWIPqiq/XJvJ9+tF8H0cbRPLz5rFxE/z1mMh92Az+dBrMOJIZUNoO9CVr3uJrOaQdX272231aRvWY;20:dFUOvs9HX5ZlWg7qKwE3GF6GugaAA6RVm0nvrU99oaugPbxwoc1S2fuLHPzUVk5WpSkv8ZXQNRaJDNRI1OqTrW4WIGURbz1CW8Ifn66dUWF+iKpa5AUvam2Ld3+yWFqJZtFxz73o6LEuGiCgFlRQGMuHkVEEX3o6QURSKCd77nc= x-ms-office365-filtering-ht: Tenant X-MS-Office365-Filtering-Correlation-Id: 28d1b077-d08a-4af5-74b4-08d59daf4fa2 x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:(7020095)(4652020)(48565401081)(5600026)(4604075)(3008032)(4534165)(4627221)(201703031133081)(201702281549075)(2017052603328)(7193020);SRVR:DM5PR2101MB1048; x-ms-traffictypediagnostic: DM5PR2101MB1048: authentication-results: spf=none (sender IP is ) smtp.mailfrom=Alexander.Levin@microsoft.com; x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:(28532068793085)(180628864354917)(89211679590171)(7411616537696); x-exchange-antispam-report-cfa-test: BCL:0;PCL:0;RULEID:(8211001083)(61425038)(6040522)(2401047)(5005006)(8121501046)(93006095)(93001095)(3231221)(944501327)(52105095)(3002001)(10201501046)(6055026)(61426038)(61427038)(6041310)(20161123558120)(20161123562045)(20161123560045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123564045)(6072148)(201708071742011);SRVR:DM5PR2101MB1048;BCL:0;PCL:0;RULEID:;SRVR:DM5PR2101MB1048; x-forefront-prvs: 0637FCE711 x-forefront-antispam-report: SFV:NSPM;SFS:(10019020)(366004)(39380400002)(376002)(39860400002)(346002)(396003)(189003)(199004)(86362001)(1076002)(575784001)(99286004)(6116002)(110136005)(3846002)(54906003)(22452003)(3280700002)(105586002)(2906002)(76176011)(4326008)(6512007)(6436002)(6486002)(3660700001)(6666003)(7736002)(86612001)(25786009)(2900100001)(14454004)(97736004)(53936002)(107886003)(68736007)(102836004)(36756003)(6506007)(26005)(186003)(106356001)(305945005)(5250100002)(72206003)(478600001)(2501003)(10290500003)(81166006)(5660300001)(8676002)(66066001)(316002)(81156014)(2616005)(10090500001)(11346002)(446003)(476003)(8936002)(486006)(22906009)(217873001);DIR:OUT;SFP:1102;SCL:1;SRVR:DM5PR2101MB1048;H:DM5PR2101MB1032.namprd21.prod.outlook.com;FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;MX:1;A:1; received-spf: None (protection.outlook.com: microsoft.com does not designate permitted sender hosts) x-microsoft-antispam-message-info: tcoZ1gZAHUShxkg9V6bjrRq6W8S9pB7TNIrP57fdk5TlSzCYCKHF0M88XdbuLJVj9Gcg4px+DFrY4hU9BphTS9YRKU0mEUBjccdrApllkZvzuAF+SLJwFr2OwDIxXINww8V+6T+cZ2Aa6/eWEDXqFQpSmozo+NFhnTW1375M72zQgXY8ZuY4TD1SR9CDkeL7l4jbmXCGo8wbpAijJxhnh4/gOyVTzOvetMXFgG0qdpjCjRSsDOQTj466+iCWFybF9l8FyBZzm0SxFyECWvi4EL97s0c8S4OsflLXYDeE6ZIoHO+kazXM5bpjcWwokTkN5aSxF9DOdVfv38dNcQpsT4BxRW3yUMqeg1VT2Wj6DMCCKLylnYEUcH2b+1ywh0yQXrZLS7mhurfsBeAKN4CKpfyD23H/0PF7h6ayJad9rgk= spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: microsoft.com X-MS-Exchange-CrossTenant-Network-Message-Id: 28d1b077-d08a-4af5-74b4-08d59daf4fa2 X-MS-Exchange-CrossTenant-originalarrivaltime: 09 Apr 2018 00:17:12.6050 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 72f988bf-86f1-41af-91ab-2d7cd011db47 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR2101MB1048 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 registrat= ion code") Signed-off-by: Robin Murphy Acked-by: Marek Szyprowski Signed-off-by: Joerg Roedel Signed-off-by: Sasha Levin --- drivers/iommu/exynos-iommu.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/drivers/iommu/exynos-iommu.c b/drivers/iommu/exynos-iommu.c index 79c45650f8de..736d4552d96f 100644 --- a/drivers/iommu/exynos-iommu.c +++ b/drivers/iommu/exynos-iommu.c @@ -1353,8 +1353,15 @@ static const struct iommu_ops exynos_iommu_ops =3D { =20 static int __init exynos_iommu_init(void) { + struct device_node *np; int ret; =20 + np =3D of_find_matching_node(NULL, sysmmu_of_match); + if (!np) + return 0; + + of_node_put(np); + lv2table_kmem_cache =3D kmem_cache_create("exynos-iommu-lv2table", LV2TABLE_SIZE, LV2TABLE_SIZE, 0, NULL); if (!lv2table_kmem_cache) { --=20 2.15.1