Received: by 10.213.65.68 with SMTP id h4csp2132638imn; Sun, 8 Apr 2018 20:32:02 -0700 (PDT) X-Google-Smtp-Source: AIpwx4+QUvgum+aq3i1bCtxsqyxLI5gj9VNxZQ+CqEwV1mzJ0eULb1o98mirtXOlQWb9kpKwwKJa X-Received: by 2002:a17:902:4003:: with SMTP id b3-v6mr38032247pld.15.1523244722187; Sun, 08 Apr 2018 20:32:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523244722; cv=none; d=google.com; s=arc-20160816; b=BzaUXXIKHnNBP0T4flUMVGTTyI8rayGRMlQKAi47wukaNwgopz/uQZp/xded02zdTN mJHoqN5jY9oxkrHXeXLFA+Hgj1N6iCnZztDfeTsw5DVQi7FThGiheyfVgUuf2xAdqtmQ HR1LPvtZ4bA3OvP2mG5CGPnYWc0yCjNQPsLA6ikTRRiM4KPFZqSCs6QFznwoQWMZcniY ++2fcmOihcuHwwwoGd3ZVLT/0vgTR38fwXiucUcQbrBNQjzHhvXEiUjRwBOhfOJoK9cZ 1jrFZ/uFbmKgYos5Nl+IH1GBZzJ4zA05dMOWnSAIyVXwlFxs7evFAAeLlpVNrTq/qnCA AJYw== 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=Pp7r0ETXRkUEgZRBZYGu0M6ZTm+p+m+GvZpIZ2Lu3Hk=; b=oGrbEMElnKE78MbcE3KfDeEbvNrZM7OECVwgWw7haK32lzz+Vkj5Pl5NqGPg7vn6gx yc5D0EOEVbODZ7HslwFSfME5ScJb295adE3i1RNRmnV3bxZVRD2DRsCGBhRx2cYbxgkK dWnYBDyqo1+Pxk4QNmMyXM/gexNaf4MkcVo3oO33qKubwCo5qUBFm7w3Cj/y/Sz1y7+b 9G58PiURm4FnEUwM95jBkWDNmDhitImn9vkbMx2cFNw/uMaUXQdIx+JixqizmRSvXm5C fV+bQ2GyhXTlfIcFy54myNoHSOAMfKayj0hZ83PiV/qccr/WVLup/D+sKpG/0lLN4cpF WHBw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@microsoft.com header.s=selector1 header.b=BDvDS/2Z; 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 82si11950532pfz.394.2018.04.08.20.31.25; Sun, 08 Apr 2018 20:32:02 -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=BDvDS/2Z; 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 S1753384AbeDIDYV (ORCPT + 99 others); Sun, 8 Apr 2018 23:24:21 -0400 Received: from mail-sn1nam01on0122.outbound.protection.outlook.com ([104.47.32.122]:20813 "EHLO NAM01-SN1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1754713AbeDIAWq (ORCPT ); Sun, 8 Apr 2018 20:22: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=Pp7r0ETXRkUEgZRBZYGu0M6ZTm+p+m+GvZpIZ2Lu3Hk=; b=BDvDS/2Zr2o9aw3MSEJrN6mJQ9cqVb3cbrr9bBHteSfTDWge94t8/n7aA/6/Rqht5xcxQOqE5j0mNNfnPZulbnad0hzuaXjqE4u3DDVFsDChu7JIQBqmqM2XV5sUqrWigNjGoJ6xXGJUk2MO4hFVVIjJUK7X/nRcK6pZOIg0YA0= Received: from DM5PR2101MB1032.namprd21.prod.outlook.com (52.132.128.13) by DM5PR2101MB0966.namprd21.prod.outlook.com (52.132.133.24) 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:22: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:22: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.14 029/161] iommu/exynos: Don't unconditionally steal bus ops Thread-Topic: [PATCH AUTOSEL for 4.14 029/161] iommu/exynos: Don't unconditionally steal bus ops Thread-Index: AQHTz5iC24o1od6AeUS4b4q7HepoDg== Date: Mon, 9 Apr 2018 00:20:06 +0000 Message-ID: <20180409001936.162706-29-alexander.levin@microsoft.com> References: <20180409001936.162706-1-alexander.levin@microsoft.com> In-Reply-To: <20180409001936.162706-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;DM5PR2101MB0966;7:ewGY3/yR83dlaKcc2/EJQpU1RxzcFH9HXpxGMPM14aI/pV98XOrQfGy6CBHLXl0n+4UNR2/PIh9f+DzuPB8bjM3ug9xwZTzTFeQqvAg581p9bNHLzvs6HAFPemXIW8yHZWM4QPWeM0vduamwSxCo0fziW1+55+oihnBieW21IdlPtxmMh7DIaQZQx48Wk0Zt8uZLE8kxi6G/9nZfDBx1NvQxNuqXPjk1tQhWakIlVba1MRzpJdLMe7Yoaemwx4Yk;20:1qGlotD5PZbKKds/+nb2qYHReA8JKF2OOTbBfXdQH5Gp0P+whtDmcp0AX6nye+iaUL/79zBvwxjoxU0WhyIE8uMzhy9kFySXplkXBVQW8C/KgpaL90zdJAMCxeusSuLtBl9ISVZ9voOaHt5rj5jwHITItoUXxMwGknz09jza6QI= x-ms-office365-filtering-ht: Tenant X-MS-Office365-Filtering-Correlation-Id: 23cac41d-a425-48b3-0c6a-08d59db002c3 x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:(7020095)(4652020)(48565401081)(5600026)(4604075)(3008032)(4534165)(4627221)(201703031133081)(201702281549075)(2017052603328)(7193020);SRVR:DM5PR2101MB0966; x-ms-traffictypediagnostic: DM5PR2101MB0966: 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:DM5PR2101MB0966;BCL:0;PCL:0;RULEID:;SRVR:DM5PR2101MB0966; x-forefront-prvs: 0637FCE711 x-forefront-antispam-report: SFV:NSPM;SFS:(10019020)(376002)(346002)(39860400002)(39380400002)(396003)(366004)(199004)(189003)(6512007)(316002)(6436002)(186003)(6666003)(2900100001)(8936002)(486006)(6486002)(6506007)(10290500003)(81166006)(22452003)(25786009)(1076002)(81156014)(53936002)(106356001)(10090500001)(5250100002)(107886003)(102836004)(76176011)(8676002)(66066001)(2501003)(446003)(476003)(36756003)(99286004)(575784001)(478600001)(86362001)(72206003)(2616005)(68736007)(5660300001)(305945005)(3846002)(6116002)(26005)(86612001)(14454004)(97736004)(3660700001)(4326008)(2906002)(110136005)(54906003)(3280700002)(105586002)(7736002)(11346002)(22906009)(217873001);DIR:OUT;SFP:1102;SCL:1;SRVR:DM5PR2101MB0966;H:DM5PR2101MB1032.namprd21.prod.outlook.com;FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;A:1;MX:1; received-spf: None (protection.outlook.com: microsoft.com does not designate permitted sender hosts) x-microsoft-antispam-message-info: a/+TYa3N5Je0Hnz9yPOHAOA8nEte1OAMX6SMYBP/AIYENN0hHYjJjUUdDspr4olnZbzj9X2wg5Ox4LhE7d5BSNtD0T9bfC9OVulVJ1YwfW6x0awPpXwroRmGcehCBviYHivpFo9VUQrERoMYarF6un5JuLbWSctIWoby7uJyaifUqZxxOwhAib7OcMYwsH15BQfOEGKnv45wGnlAtttWA8yGHzPdl1FiU1aVvrQ0ATsHqKiLzjw03O7XVcPTHEFZ9ewJ7wDR8+3qQoFV8ioWEDtO4MDxFJ8XSOM2KZf9cbA10583IXvhtxjHeIDiR9YcICQ3AQLgGaSWMXhAbhJgf/0TXMEXc3QPRFAWyOz4sPUqODz74j9SV3PoDdhDk4ylGZeqqv3foOoK3a36DsZ6e0jSKW+wdUGQGO2CW2nYM0o= 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: 23cac41d-a425-48b3-0c6a-08d59db002c3 X-MS-Exchange-CrossTenant-originalarrivaltime: 09 Apr 2018 00:20:06.0822 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 72f988bf-86f1-41af-91ab-2d7cd011db47 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR2101MB0966 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 25c2c75f5332..13485a40dd46 100644 --- a/drivers/iommu/exynos-iommu.c +++ b/drivers/iommu/exynos-iommu.c @@ -1344,8 +1344,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