Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp5961719imm; Mon, 27 Aug 2018 07:22:04 -0700 (PDT) X-Google-Smtp-Source: ANB0VdaULoMY7swIYt+uqtjuJmagNEyhxjSM+vxD4litOZfZJJ6c5G9xBCAYHJhZdrizvOuW0KzY X-Received: by 2002:a63:6d4f:: with SMTP id i76-v6mr12435459pgc.215.1535379724300; Mon, 27 Aug 2018 07:22:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1535379724; cv=none; d=google.com; s=arc-20160816; b=TaIV5gmjHkGijNsrypclJRo9rHnfj1OXgWz4iG/iyF1QBtzbWaEEXrWW/LxU72iZSI VY/UXqpTqupnUY1S418aWC0FtbnOeRsUhRTmonpENrEGMQs8CNRaieH/FEV3H0Bgq9cl qO7hUpMPWdwmkf2aPEOzZAhmOUfkcC0cRKdmwYdS44cdN/mgLkh1wrRxJNjj3GDknjsp uKZ/4YdPX+LMTBQGOkGnE+1a14hSiwWPpCxDXiAIrfo5ZiGF/3gheH6Dd/sgLJBvO1Uq wk4mspfKFsUCxEeTjVkopvLESaCE0RGHvhJsPb93sBDy+ZXcZpFkhmfaQF2na+hCemAh xmHQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:arc-authentication-results; bh=q1uvPih9z65OZrIg9ihuxLYe3PjDnksk5oTUOf3CvDk=; b=p6kc5+O542BAl24TvqT9EBUBvAwXybxJrER7rp8lCPjjQqSLvpOlKzHBYsxO12vXX3 PeHP6fFl6qv/anKNnChondrx7sX92zeVbCRC8kV0yZBvXgBs+y5QWRxSfgzdXEoALSeS pGwUv6/oG33eQopgxrPyBzL7P6dvWfrhPi07bDXhlt5534OpP2IjgfP564rAl5BRsdVl 4X8x/FVbZTByO2YJ5mjmlHi77T6z4ma0668RvPU7yINF9ZTRPycDmGt6rk0y5TgdzjS3 3jn40c6ts5veVrtk3D3bbIInHUcHexVeTkHzJdv2dD3C/yo52EpkBBTMvLg977e8kNek fwpQ== 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 g2-v6si13984075plq.242.2018.08.27.07.21.47; Mon, 27 Aug 2018 07:22:04 -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 S1727427AbeH0SHb (ORCPT + 99 others); Mon, 27 Aug 2018 14:07:31 -0400 Received: from mail-vk0-f65.google.com ([209.85.213.65]:44421 "EHLO mail-vk0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727014AbeH0SHa (ORCPT ); Mon, 27 Aug 2018 14:07:30 -0400 Received: by mail-vk0-f65.google.com with SMTP id 125-v6so7613302vke.11; Mon, 27 Aug 2018 07:20:40 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=q1uvPih9z65OZrIg9ihuxLYe3PjDnksk5oTUOf3CvDk=; b=gBqy9yoDdoab4h8Kt2f08Os0STc+I3KX5+5gcmY7FPZa3rsYGPRtqdZvzol2MoKtUB k+R7FOnTOenuX78axq8IaFXtddip5U0fOjA91vnYelgk/UQ7to/eiUi0+gnBpcju+z0D NDpX55/6bLBeSqs277kIc079OmiyUtzgc2hlgmoZfsk0AiMOzpkw27waGJcPaHdtdm4z g7wcGVJM0e4GkKZ1J+dBC1P23jXMuqQ4I6egynsF9+5HXuWgKwmmAfpobX/ren98D8/4 pzEgLG0pYwABB6ZEGMY40EHjMQLNsWCBsWagEteki2PNDVzmnNyLad/xX0FOO2mbCar9 aBqA== X-Gm-Message-State: APzg51D2teCyg9ipnuiYehN7Rd/AH8GgYBV08Bfr5lnM+uWCq8SquuVV DneChB2AXUBFFyVefdLGSwcX34WWGN/ncXf7DRg= X-Received: by 2002:a1f:8948:: with SMTP id l69-v6mr8311028vkd.132.1535379639808; Mon, 27 Aug 2018 07:20:39 -0700 (PDT) MIME-Version: 1.0 References: <20180726211916.10264-1-digetx@gmail.com> <2725801.tsBI9ZhLPt@avalon> In-Reply-To: <2725801.tsBI9ZhLPt@avalon> From: Geert Uytterhoeven Date: Mon, 27 Aug 2018 16:20:26 +0200 Message-ID: Subject: Re: [PATCH v1] iommu/ipmmu-vmsa: Don't register as BUS IOMMU if machine doesn't have IPMMU-VMSA To: Laurent Pinchart Cc: digetx@gmail.com, Joerg Roedel , Laurent Pinchart , Marc Dietrich , Linux IOMMU , linux-tegra@vger.kernel.org, Linux Kernel Mailing List , Magnus Damm 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 Hi Laurent, On Fri, Jul 27, 2018 at 11:09 AM Laurent Pinchart wrote: > (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 ? On the contrary: IOMMU_OF_DECLARE() has been removed. > > > ret = platform_driver_register(&ipmmu_driver); > > if (ret < 0) > > return ret; Gr{oetje,eeting}s, Geert -- Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that. -- Linus Torvalds