From patchwork Fri Aug 29 15:54:26 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Will Deacon X-Patchwork-Id: 36313 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-pd0-f199.google.com (mail-pd0-f199.google.com [209.85.192.199]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id E23032054E for ; Fri, 29 Aug 2014 15:57:01 +0000 (UTC) Received: by mail-pd0-f199.google.com with SMTP id v10sf6266876pde.6 for ; Fri, 29 Aug 2014 08:57:01 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:from:to:subject:date:message-id :in-reply-to:references:cc:precedence:list-id:list-unsubscribe :list-archive:list-post:list-help:list-subscribe:mime-version:sender :errors-to:x-original-sender:x-original-authentication-results :mailing-list:content-type:content-transfer-encoding; bh=vUecOSJ9Mt9M5+/pIQF1IRnEGhuqGJPv5KhlYXqJ92s=; b=m9PhQhXCUeLt3B4Cnc47683j2wKodbYJeeBliRjr2l2ZFVySxjf7VskreVRECU7/Os F/j7HIyqTMKcNTCCpoMFz3tB9VGWSynV2yDze7xn5OdzUoJ6YdpAFX4rRtKA/x1J9lZQ PqewNq9vXH2Q0LYUl3qcXr19nNXmPenq5M4BQ+SQlTA4BYuavI7qJHs1O7rqIvlzDnBP /Ia10oJNB2JcK/1aAP5U6nyRNvD7U61vhjzviTuAJy23YZrwzfwW5tjHuMauoJ1SVb+c tVLwk8JI1r5PbiICH8ZeeXLQK/Epmeo9XTm8yE+EIxROqkxtCYXV7QPifv7IEH4U9h8L iMww== X-Gm-Message-State: ALoCoQk20UqXvHKhQjsDPJVQYqHifjqpURoc6nZPSySIQz67WWLONLjW3H2iORiL4zjLmhHdAsYt X-Received: by 10.66.150.197 with SMTP id uk5mr2955177pab.41.1409327819671; Fri, 29 Aug 2014 08:56:59 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.21.200 with SMTP id 66ls1093458qgl.75.gmail; Fri, 29 Aug 2014 08:56:59 -0700 (PDT) X-Received: by 10.220.114.66 with SMTP id d2mr9801431vcq.27.1409327819515; Fri, 29 Aug 2014 08:56:59 -0700 (PDT) Received: from mail-vc0-f169.google.com (mail-vc0-f169.google.com [209.85.220.169]) by mx.google.com with ESMTPS id jh10si533646vdb.10.2014.08.29.08.56.59 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 29 Aug 2014 08:56:59 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.220.169 as permitted sender) client-ip=209.85.220.169; Received: by mail-vc0-f169.google.com with SMTP id hq11so2684129vcb.14 for ; Fri, 29 Aug 2014 08:56:59 -0700 (PDT) X-Received: by 10.220.97.5 with SMTP id j5mr11193210vcn.16.1409327819422; Fri, 29 Aug 2014 08:56:59 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.221.45.67 with SMTP id uj3csp37873vcb; Fri, 29 Aug 2014 08:56:58 -0700 (PDT) X-Received: by 10.70.5.33 with SMTP id p1mr17044880pdp.134.1409327818648; Fri, 29 Aug 2014 08:56:58 -0700 (PDT) Received: from bombadil.infradead.org (bombadil.infradead.org. [2001:1868:205::9]) by mx.google.com with ESMTPS id rk12si420843pab.216.2014.08.29.08.56.55 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 29 Aug 2014 08:56:55 -0700 (PDT) Received-SPF: none (google.com: linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org does not designate permitted sender hosts) client-ip=2001:1868:205::9; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1XNOWS-0003NF-F4; Fri, 29 Aug 2014 15:55:32 +0000 Received: from cam-admin0.cambridge.arm.com ([217.140.96.50]) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1XNOVi-0000QQ-4c; Fri, 29 Aug 2014 15:54:46 +0000 Received: from edgewater-inn.cambridge.arm.com (edgewater-inn.cambridge.arm.com [10.1.203.34]) by cam-admin0.cambridge.arm.com (8.12.6/8.12.6) with ESMTP id s7TFsAwo008641; Fri, 29 Aug 2014 16:54:10 +0100 (BST) Received: by edgewater-inn.cambridge.arm.com (Postfix, from userid 1000) id BED9E1AE067B; Fri, 29 Aug 2014 16:54:31 +0100 (BST) From: Will Deacon To: linux-arm-kernel@lists.infradead.org, iommu@lists.linux-foundation.org Subject: [RFC PATCH 3/7] iommu: add new iommu_ops callback for adding a device with a set of IDs Date: Fri, 29 Aug 2014 16:54:26 +0100 Message-Id: <1409327670-3495-4-git-send-email-will.deacon@arm.com> X-Mailer: git-send-email 2.1.0 In-Reply-To: <1409327670-3495-1-git-send-email-will.deacon@arm.com> References: <1409327670-3495-1-git-send-email-will.deacon@arm.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20140829_085446_559985_0F74C78B X-CRM114-Status: UNSURE ( 9.62 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -5.0 (-----) X-Spam-Report: SpamAssassin version 3.4.0 on bombadil.infradead.org summary: Content analysis details: (-5.0 points) pts rule name description ---- ---------------------- -------------------------------------------------- -5.0 RCVD_IN_DNSWL_HI RBL: Sender listed at http://www.dnswl.org/, high trust [217.140.96.50 listed in list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record 0.0 RP_MATCHES_RCVD Envelope sender domain matches handover relay domain Cc: jroedel@suse.de, arnd@arndb.de, Will Deacon , thierry.reding@gmail.com, laurent.pinchart@ideasonboard.com, Varun.Sethi@freescale.com, dwmw2@infradead.org, hdoyu@nvidia.com X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: , List-Help: , List-Subscribe: , MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: will.deacon@arm.com X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.220.169 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 This patch adds a new function to the iommu_ops structure to allow a device to be added to a specific IOMMU instance along with a set of opaque IDs that are used internally by the IOMMU for identifying and configuring translations. Signed-off-by: Will Deacon --- include/linux/iommu.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/include/linux/iommu.h b/include/linux/iommu.h index 20f9a527922a..3dd1b99c4542 100644 --- a/include/linux/iommu.h +++ b/include/linux/iommu.h @@ -114,6 +114,8 @@ struct iommu_ops { int (*domain_has_cap)(struct iommu_domain *domain, unsigned long cap); int (*add_device)(struct device *dev); + int (*add_device_master_ids)(struct device *dev, int count, u32 *ids, + void *data); void (*remove_device)(struct device *dev); int (*device_group)(struct device *dev, unsigned int *groupid); int (*domain_get_attr)(struct iommu_domain *domain,