Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp573788imm; Fri, 27 Jul 2018 02:11:29 -0700 (PDT) X-Google-Smtp-Source: AAOMgpf06NKFPjgyZXCCYZyDILqSSd+shrz3CHb7GgI0IOhtUAWToFWeZCbyRgTToUfoNojXqnuV X-Received: by 2002:a65:6109:: with SMTP id z9-v6mr5268924pgu.243.1532682689822; Fri, 27 Jul 2018 02:11:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1532682689; cv=none; d=google.com; s=arc-20160816; b=Odl4wk493pe800KNRx3nDHZ8osikd1bjhHyWSXb+zbrdfdgZP1nhWEUB9m3blMFCph eLdkStfLIHE6lcaIcxTn2YR9p9tPOkNTir2AsNFOl2IaximbXnYv/Q0wGgxLdKq7b5WK vtyP9n3Ga0+0801SRDBN1BQAyXEauet1MRpUXjXZpim5c+hGPG3Z+gqY31bope2Dn0SE OrDgqjAEAjRXlJxJWn8HKZ9bRSEA2VbrwWIo0opxzFxsZYrZ7yR3TVrPxVsweZfmIeIp mJ2oulMG+fS1LKs+AmlLPNnL4g4BqMswxoKfA53KrRDGmu2daovzeD053Rfa0n+SkEHu R4Pg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:organization:message-id:date:subject:cc:to :from:dkim-signature:arc-authentication-results; bh=TNeY392bGiyY5aE9CvPJ6VJYqlQC6q7Jgk+QLLdwvGo=; b=tIpmGYqiLZr0Sp7KwDTSuF3vdPg+jzklFW2NKnLQ0fqwkwy1a/vUlNYoHKBYaSngzy OE8tAihYYHl4ctzRXW/s2DjDQ/Wj39B+VHchT2gNoM0p+TdTolW7vDAcaW9TcroylBxB zjX0lfc+E6KnI2dMEbIaEY84aYYd3ThwehDR1WDT2dMA9LJ7Dk/nRuZpH3tzLXpbvyQ6 RXnRO2YC2vylk6+lLF4Ak1AtPHLDSLyKaiT8U+yZJsrsy+W/2hgKDoxczW3o+6BfknHd LoJyFu7udMZ+qqk4a5oN3niR81Mljf4ItRIFUdPpLwHsmpuxz+kQ/5fsfalgdcFIZRiN tVZA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass (test mode) header.i=@ideasonboard.com header.s=mail header.b=GfDdRp4h; 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 d10-v6si3250921pfg.258.2018.07.27.02.11.14; Fri, 27 Jul 2018 02:11:29 -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 (test mode) header.i=@ideasonboard.com header.s=mail header.b=GfDdRp4h; 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 S1730558AbeG0Kaj (ORCPT + 99 others); Fri, 27 Jul 2018 06:30:39 -0400 Received: from perceval.ideasonboard.com ([213.167.242.64]:49902 "EHLO perceval.ideasonboard.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729519AbeG0Kaj (ORCPT ); Fri, 27 Jul 2018 06:30:39 -0400 Received: from avalon.localnet (dfj612ybrt5fhg77mgycy-3.rev.dnainternet.fi [IPv6:2001:14ba:21f5:5b00:2e86:4862:ef6a:2804]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 1DAE491; Fri, 27 Jul 2018 11:09:39 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1532682580; bh=Z/zesk2Wz6pgE2mbG3eII58/J2AFXpYyiSkgSoETSVs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=GfDdRp4hMm3pqsctE2dIbBlY+R8bjcKfeBcoYqNBkY6Kz7gNt/F9YpWqVdBzl0ewR hfS0Is+BpxK8omWs+wVd080cnCNI/qtOt4lQ7gdX6HSnCgC/+2is88uMiLkDAQ71iM XCbIreeLIkRCIcvDj/Pd926GWnuKazdp8a7j5zcA= From: Laurent Pinchart To: Dmitry Osipenko Cc: Joerg Roedel , Laurent Pinchart , Marc Dietrich , iommu@lists.linux-foundation.org, linux-tegra@vger.kernel.org, linux-kernel@vger.kernel.org, Geert Uytterhoeven , Magnus Damm Subject: Re: [PATCH v1] iommu/ipmmu-vmsa: Don't register as BUS IOMMU if machine doesn't have IPMMU-VMSA Date: Fri, 27 Jul 2018 12:10:15 +0300 Message-ID: <2725801.tsBI9ZhLPt@avalon> Organization: Ideas on Board Oy In-Reply-To: <20180726211916.10264-1-digetx@gmail.com> References: <20180726211916.10264-1-digetx@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Dmitry, (CC'ing Geert and Magnus) Thank you for the patch. On Friday, 27 July 2018 00:19:16 EEST Dmitry Osipenko wrote: > This fixes kernel crashing on NVIDIA Tegra if kernel is compiled in > a multiplatform configuration and IPMMU-VMSA driver is enabled. > > Cc: # v3.20+ > Signed-off-by: Dmitry Osipenko > --- > drivers/iommu/ipmmu-vmsa.c | 7 +++++++ > 1 file changed, 7 insertions(+) > > diff --git a/drivers/iommu/ipmmu-vmsa.c b/drivers/iommu/ipmmu-vmsa.c > index 9e8495762bc8..78c50db9cd71 100644 > --- a/drivers/iommu/ipmmu-vmsa.c > +++ b/drivers/iommu/ipmmu-vmsa.c > @@ -1109,12 +1109,19 @@ static struct platform_driver ipmmu_driver = { > > static int __init ipmmu_init(void) > { > + struct device_node *np; > static bool setup_done; > int ret; > > if (setup_done) > return 0; > > + np = of_find_matching_node(NULL, ipmmu_of_ids); > + if (!np) > + return 0; > + > + of_node_put(np); > + While functionally correct, this will add some unnecessary overhead when iommu_init() is called from IOMMU_OF_DECLARE(). I'm OK with this fix as a temporary measure to solve your problem, but we need to address the underlying issue properly. Geert, Magnus, the ipmmu-vmsa driver is a bit of a mess. We should brush it up and start using IOMMU_OF_DECLARE() on all platforms (and eventually get rid of bus_set_iommu() completely...). Do you have plans to address this ? If not, could you please add it to your to-do list ? > ret = platform_driver_register(&ipmmu_driver); > if (ret < 0) > return ret; -- Regards, Laurent Pinchart