Received: by 2002:a25:31c3:0:0:0:0:0 with SMTP id x186csp1047839ybx; Wed, 30 Oct 2019 09:04:36 -0700 (PDT) X-Google-Smtp-Source: APXvYqz/Q8IwtXmaaYtrYDI4LPjag5Zvot56MBqixxm9N6GO3xZHiW+KgaGSe/z+WTduALP1613C X-Received: by 2002:a50:d713:: with SMTP id t19mr417677edi.185.1572451476682; Wed, 30 Oct 2019 09:04:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1572451476; cv=none; d=google.com; s=arc-20160816; b=tRDchUVLJpXtRzMlkz5ullZFyg6JOVBIPu3P1jiiwGdClu9ZVaZgtCrKW7HFcJY0LS K2zO4OxJDqcQtX4vVL1pa9wVWW3vUNWUdyUxPsajo3QDfo/skCakc3FiLk+XS6v0qyiK L7cA05YIxjzb61J8VL/tiugzpngkSIGHKxTj07+2AOufqRytg8LTIY79f7KiGkeS9PP3 0p8RxIPRhx7TYnymrW+kITZ1Pqm5dibXMkMbd9aXreGuokNN9RSRmHnoDrjwQ4CyG7ly Hkf9GMihZpz59M74n1P93AphrIA/mIYejCSC9D0cBZxF4/5uoCj1EbU/CI1N6nnZpbpW CDgA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=awRjZQp4vAXxmJXe+URpekGGk7vpSvBjo+6L4daC/oY=; b=fuZYV3LpoZPCOJoQIL4DvKQqJFZnOqNZLBD9hmtFIS90fg1XGc+jYz1oH2DqBB15cg bJLHzMyDpZkIWHDit2vR6V476iR4h/geiVsfcBNr6QypQ06HLU6Lw51T5RTGf+0cPNpz Lxey4G4+JmxEpcd6V1k7Kf0a0NhG1gkCMIJdsVe9en/vh+37578qcYQ9dOUpvmZl2Ehq vkhj/vrkULwDDn5gdmLVLiaJUh7VuwwCQSlgI/CzkxUPKx8Tx58keyWzR/7Ty5kQXhsW FND+EW7cYciAaNnkiveQEHX5IUlaMD/qMFgwu5oHGy4+8plnkPPYDh3+uetH4O+I/e0c JmWw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=SrWB7Mk8; 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=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id g3si1632722ejw.13.2019.10.30.09.04.11; Wed, 30 Oct 2019 09:04:36 -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=@kernel.org header.s=default header.b=SrWB7Mk8; 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=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728648AbfJ3QA5 (ORCPT + 99 others); Wed, 30 Oct 2019 12:00:57 -0400 Received: from mail.kernel.org ([198.145.29.99]:56372 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728454AbfJ3Pyu (ORCPT ); Wed, 30 Oct 2019 11:54:50 -0400 Received: from willie-the-truck (236.31.169.217.in-addr.arpa [217.169.31.236]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 839C0217D9; Wed, 30 Oct 2019 15:54:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1572450889; bh=IlRkfmxagkpK4XTHGe5bLRKa65DPVjT3hWJACHX0Xno=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=SrWB7Mk879bug3XRPDe3MAwhVgzgOcAAesPz2M8kHTWoLEToJxvpV1alV7Y2QuXdN ICdfTmCW1N9UyKURUBhdK22PqAZIywFSU/GQMYZNTG/nTOOh1v2tYbnpqX5A2dqOW6 b02Q73I/Qd3cR0ywJqoCSkvGcEC4u1XbxHj/1Ci0= Date: Wed, 30 Oct 2019 15:54:45 +0000 From: Will Deacon To: Robin Murphy Cc: iommu@lists.linux-foundation.org, linux-kernel@vger.kernel.org, Joerg Roedel , Bjorn Helgaas , Lorenzo Pieralisi , saravanak@google.com Subject: Re: [PATCH 0/7] iommu: Permit modular builds of ARM SMMU[v3] drivers Message-ID: <20191030155444.GC19096@willie-the-truck> References: <20191030145112.19738-1-will@kernel.org> <6e457227-ca06-2998-4ffa-a58ab171ce32@arm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <6e457227-ca06-2998-4ffa-a58ab171ce32@arm.com> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Robin, On Wed, Oct 30, 2019 at 03:35:55PM +0000, Robin Murphy wrote: > On 30/10/2019 14:51, Will Deacon wrote: > > As part of the work to enable a "Generic Kernel Image" across multiple > > Android devices, there is a need to seperate shared, core kernel code > > from modular driver code that may not be needed by all SoCs. This means > > building IOMMU drivers as modules. > > > > It turns out that most of the groundwork has already been done to enable > > the ARM SMMU drivers to be 'tristate' options in drivers/iommu/Kconfig; > > with a few symbols exported from the IOMMU/PCI core, everything builds > > nicely out of the box. The one exception is support for the legacy SMMU > > DT binding, which is not in widespread use and has never worked with > > modules, so we can simply remove that when building as a module rather > > than try to paper over it with even more hacks. > > > > Obviously you need to be careful about using IOMMU drivers as modules, > > since late loading of the driver for an IOMMU serving active DMA masters > > is going to end badly in many cases. On Android, we're using device links > > to ensure that the IOMMU probes first. > > Out of curiosity, which device links are those? Clearly not the RPM links > created by the IOMMU drivers themselves... Is this some special Android > magic, or is there actually a chance of replacing all the > of_iommu_configure() machinery with something more generic? I'll admit that I haven't used them personally yet, but I'm referring to this series from Saravana [CC'd]: https://lore.kernel.org/linux-acpi/20190904211126.47518-1-saravanak@google.com/ which is currently sitting in linux-next now that we're upstreaming the "special Android magic" ;) Will