From patchwork Thu Mar 17 16:29:37 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Magnus Damm X-Patchwork-Id: 8613151 X-Patchwork-Delegate: geert@linux-m68k.org Return-Path: X-Original-To: patchwork-linux-renesas-soc@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id F09579F44D for ; Thu, 17 Mar 2016 16:28:31 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 04A7C2026F for ; Thu, 17 Mar 2016 16:28:31 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 6222A2026C for ; Thu, 17 Mar 2016 16:28:30 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S936157AbcCQQ0R (ORCPT ); Thu, 17 Mar 2016 12:26:17 -0400 Received: from mail-pf0-f175.google.com ([209.85.192.175]:36714 "EHLO mail-pf0-f175.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S936044AbcCQQ0O (ORCPT ); Thu, 17 Mar 2016 12:26:14 -0400 Received: by mail-pf0-f175.google.com with SMTP id u190so127215278pfb.3; Thu, 17 Mar 2016 09:26:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:date:message-id:in-reply-to:references:subject; bh=9zOQydymD8A7PUDwSTnFTveTdRK//odh3Hmnb7jWUWA=; b=orBP1pRs+vel1ZW6GmbGYFeN1mljZx3APFOK9iu4bXDMIX04R1Ubwl/2M2nPYGxyRs 5gilnL65Dr/tBVWlhreviWekZuQnBn5VFW3d7AbeCSFaFgh4x2muLXz5eikL7KfW2P2M VjG77lD9sIzipRQRPSxiKHADN+Ic4swScobGV0j0pZmJ1khy0r5Ul7LWrvor6ONf2uGl w1sKUFepps39USD48SCou/NsIP19G6nwAa3bfdfFqaSx8SVem+8XK3G5e2+ibU2dAUS1 Cl1MrhySMLUHv6tQyUdHZwMYXMm1hTL462SHdgzrPeYGWBS84RNwaoMQFwFfWNwVYXRp VyMw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:date:message-id:in-reply-to :references:subject; bh=9zOQydymD8A7PUDwSTnFTveTdRK//odh3Hmnb7jWUWA=; b=DT8le+KtTirsvc/sWqNMa3OVTGizXVN5OrQD9bX1YU9M9QGqDR2hyQvYLCfPrWhIvz dbQ5F4LsRIl06Wb0FyS3hpNKH72C7XUS88OYMfyTrsDSizPx7jHeAqM7tJvtYnyuttwn Q509jm3ifptQivPVID5kZMAOuqFCnBJdLkTFajB6vLmtbrTWM/R3pW9g+ZYwBU7dmYXA B8THDqlwxhZ8GNXX2m0031p3VV6EQOUF94sNk8hjhFPewepadTJEgQOiQ6h27K+Er/dp bi/XcNjxOGqetkjwhTAULWR+3LDarpCtVd1SRAVwj2BcbBSMxpzdoklpmK7rr4Tc9lqr DzDQ== X-Gm-Message-State: AD7BkJIdze/AB63ENfMhvC1VEfjBF0Pl4FfD/zskOnnzmdQ14tqx+AIy19Gnz9KTSRJ7XA== X-Received: by 10.98.93.205 with SMTP id n74mr16132466pfj.99.1458231973990; Thu, 17 Mar 2016 09:26:13 -0700 (PDT) Received: from [127.0.0.1] (s214090.ppp.asahi-net.or.jp. [220.157.214.90]) by smtp.gmail.com with ESMTPSA id n66sm14506897pfj.39.2016.03.17.09.26.11 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 17 Mar 2016 09:26:12 -0700 (PDT) From: Magnus Damm To: iommu@lists.linux-foundation.org Cc: laurent.pinchart+renesas@ideasonboard.com, geert+renesas@glider.be, joro@8bytes.org, linux-kernel@vger.kernel.org, linux-renesas-soc@vger.kernel.org, horms+renesas@verge.net.au, Magnus Damm Date: Fri, 18 Mar 2016 01:29:37 +0900 Message-Id: <20160317162937.24104.40724.sendpatchset@little-apple> In-Reply-To: <20160317162909.24104.31682.sendpatchset@little-apple> References: <20160317162909.24104.31682.sendpatchset@little-apple> Subject: [PATCH 03/10] iommu/ipmmu-vmsa: Teach xlate() to skip disabled iommus Sender: linux-renesas-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-renesas-soc@vger.kernel.org X-Spam-Status: No, score=-6.8 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Magnus Damm Right now the ->xlate() call gets invoked even though the iommu device has status = "disabled" in DT, so make sure we skip over disabled devices. In my mind it would make sense to have this at some shared level, but I guess some users may want to configure the iommu regardless of DT state. Signed-off-by: Magnus Damm --- drivers/iommu/ipmmu-vmsa.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) --- 0017/drivers/iommu/ipmmu-vmsa.c +++ work/drivers/iommu/ipmmu-vmsa.c 2016-03-18 00:16:51.200513000 +0900 @@ -890,7 +890,13 @@ static struct iommu_group *ipmmu_device_ static int ipmmu_of_xlate_dma(struct device *dev, struct of_phandle_args *spec) { - /* dummy callback to satisfy of_iommu_configure() */ + /* If the IPMMU device is disabled in DT then return error + * to make sure the of_iommu code does not install ops + * even though the iommu device is disabled + */ + if (!of_device_is_available(spec->np)) + return -ENODEV; + return 0; } #endif