From patchwork Fri May 11 19:06:15 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jean-Philippe Brucker X-Patchwork-Id: 10394931 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 0E11660348 for ; Fri, 11 May 2018 19:08:54 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id EE16F28F8B for ; Fri, 11 May 2018 19:08:53 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E2BCE28F95; Fri, 11 May 2018 19:08:53 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=BAYES_00, MAILING_LIST_MULTI, RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 676DC28F8B for ; Fri, 11 May 2018 19:08:53 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id B9C486B0696; Fri, 11 May 2018 15:08:51 -0400 (EDT) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id B253C6B0697; Fri, 11 May 2018 15:08:51 -0400 (EDT) X-Original-To: int-list-linux-mm@kvack.org X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 9EF046B0698; Fri, 11 May 2018 15:08:51 -0400 (EDT) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from mail-oi0-f72.google.com (mail-oi0-f72.google.com [209.85.218.72]) by kanga.kvack.org (Postfix) with ESMTP id 7039C6B0696 for ; Fri, 11 May 2018 15:08:51 -0400 (EDT) Received: by mail-oi0-f72.google.com with SMTP id a18-v6so3476856oiy.14 for ; Fri, 11 May 2018 12:08:51 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-original-authentication-results:x-gm-message-state:from:to:cc :subject:date:message-id:in-reply-to:references; bh=aFbW0xkK+X1D41+2wsq/Cmi7vw9npvriDoKdW5yToQk=; b=Yl/wa+fzHCKDMqVkdMc5vzXIO1Au1vU3oJSOGs0XolnZB80K9j1X9KC85JxdgTBtQh yLu6QSKI2vQq8TPtgPre6oXTtFLmYtGUEgfzKjOJ8JsxUMziM8PJw39/k4VAVStbRQL2 Hl888EbuqHEvWMhlWJh/q7s9Jb6ap//KZLVePgwZk/ECBUjqdZA1F5E2H+04DDAs0auY PpQ/2hjwDshkgESYmK8PVvL2SZsZJkg3Yn2zGC1MwlE0x5m33IYanxpKmdiiFqYqUWzQ v8Z2TP/2AhMGoDEZcnw4NpYHqcatC8jOhYUSaZz4yqY3a5uogNpRwFU1onZ7t7ppv459 LIBg== X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of jean-philippe.brucker@arm.com designates 217.140.101.70 as permitted sender) smtp.mailfrom=jean-philippe.brucker@arm.com X-Gm-Message-State: ALKqPwdDROl/Y4OrSSu66Pwd0JcNIp2cBQTx3Yg81sZ/02ktt7KEwYoI JwO4N0HIjouH5XmtolwLXNNOVpjGC3hRlpdQPqZ2Ct6EL9n4iIRQGMxzMy+mi2LFmmFH5CQ+TBd I7kfQSsybiD99AZVS+CGhuQELyJFmm8A1O3Ip9Jr7pynvojQkXujPn+evfEGRCCNr0A== X-Received: by 2002:aca:c207:: with SMTP id s7-v6mr22389oif.3.1526065731248; Fri, 11 May 2018 12:08:51 -0700 (PDT) X-Google-Smtp-Source: AB8JxZrjw6QNki4oW3nNcPbc1kXDN1XKotVLteTTjcCYRpUvGbXs+jpdJHlNQj2dH3xOPfJggvmx X-Received: by 2002:aca:c207:: with SMTP id s7-v6mr22350oif.3.1526065730446; Fri, 11 May 2018 12:08:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1526065730; cv=none; d=google.com; s=arc-20160816; b=ZiFi4JKYC33D+a7AoxD52DdA3GuFDxEVoISQM4oEJoSbWdV/Zqb66+m11uIl+sLVRk j/e+spbccbAgIZ6RS3JbohJeKkqb1nTe4tXjuOYsOmmK855v+RCs65xCHIsmT9xWkTev /kziKXgUWfykL5XWa+zWChh/vbYhK5eV2vqrWvqqfIdeePxodp4/E6BYrT0C6kFGFN8G odJxj/1r7QN8BnepYe/F4F8BVNGxgAg34xEAw4VSfU35fcgT/EynU4/2f5Nof1exHs+m FjXKrPkb2S8F0cQT00/+luiYJdJtVU88sLVFg5a1ddEteLOEs72na7jNAzyEOdEct1VQ MKsQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=references:in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=aFbW0xkK+X1D41+2wsq/Cmi7vw9npvriDoKdW5yToQk=; b=J/FZ7tL/PkwoDVksc7Pl4uIOlBNeEM9aUT/a2JOFGPpLQiIpGAfWYTWfWnzLn4rECy MtC88872KOJVX4Oq7hOlp5k++LAz6lPlhOCTJDOtUZi2MvHAfhvOiDDRDzrFhsdbBzj2 hq4LG6vLA8AqAgRfffwtzPa9aoHTOmeHS/kJRrPmUMrNQMYJYvqc/5VocHG62RRPyoXe m+JLV3QSF6e1JhQ/yTXc7pXstNe4ftCILNf2SSS4KxdXU12/hL9vVH804QpnbmG39+wb EGnZa+9sfe44oIONAp6slom5kt3MPWHtI/UZTJYq8ubVaIpwZbscz0ar1JKpji8ngvIw ZU/w== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of jean-philippe.brucker@arm.com designates 217.140.101.70 as permitted sender) smtp.mailfrom=jean-philippe.brucker@arm.com Received: from foss.arm.com (foss.arm.com. [217.140.101.70]) by mx.google.com with ESMTP id k13-v6si1260792oiy.146.2018.05.11.12.08.50 for ; Fri, 11 May 2018 12:08:50 -0700 (PDT) Received-SPF: pass (google.com: domain of jean-philippe.brucker@arm.com designates 217.140.101.70 as permitted sender) client-ip=217.140.101.70; Authentication-Results: mx.google.com; spf=pass (google.com: domain of jean-philippe.brucker@arm.com designates 217.140.101.70 as permitted sender) smtp.mailfrom=jean-philippe.brucker@arm.com Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id D194219E8; Fri, 11 May 2018 12:08:49 -0700 (PDT) Received: from ostrya.cambridge.arm.com (ostrya.cambridge.arm.com [10.1.210.33]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 4D3973F23C; Fri, 11 May 2018 12:08:44 -0700 (PDT) From: Jean-Philippe Brucker To: linux-arm-kernel@lists.infradead.org, linux-pci@vger.kernel.org, linux-acpi@vger.kernel.org, devicetree@vger.kernel.org, iommu@lists.linux-foundation.org, kvm@vger.kernel.org, linux-mm@kvack.org Cc: joro@8bytes.org, will.deacon@arm.com, robin.murphy@arm.com, alex.williamson@redhat.com, tn@semihalf.com, liubo95@huawei.com, thunder.leizhen@huawei.com, xieyisheng1@huawei.com, xuzaibo@huawei.com, ilias.apalodimas@linaro.org, jonathan.cameron@huawei.com, liudongdong3@huawei.com, shunyong.yang@hxt-semitech.com, nwatters@codeaurora.org, okaya@codeaurora.org, jcrouse@codeaurora.org, rfranz@cavium.com, dwmw2@infradead.org, jacob.jun.pan@linux.intel.com, yi.l.liu@intel.com, ashok.raj@intel.com, kevin.tian@intel.com, baolu.lu@linux.intel.com, robdclark@gmail.com, christian.koenig@amd.com, bharatku@xilinx.com, rgummal@xilinx.com, robh@kernel.org, mark.rutland@arm.com Subject: [PATCH v2 14/40] dt-bindings: document stall and PASID properties for IOMMU masters Date: Fri, 11 May 2018 20:06:15 +0100 Message-Id: <20180511190641.23008-15-jean-philippe.brucker@arm.com> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180511190641.23008-1-jean-philippe.brucker@arm.com> References: <20180511190641.23008-1-jean-philippe.brucker@arm.com> X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: X-Virus-Scanned: ClamAV using ClamSMTP On ARM systems, some platform devices behind an IOMMU may support stall and PASID features. Stall is the ability to recover from page faults and PASID offers multiple process address spaces to the device. Together they allow to do paging with a device. Let the firmware tell us when a device supports stall and PASID. Cc: robh@kernel.org Cc: mark.rutland@arm.com Reviewed-by: Rob Herring Signed-off-by: Jean-Philippe Brucker --- .../devicetree/bindings/iommu/iommu.txt | 24 +++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/Documentation/devicetree/bindings/iommu/iommu.txt b/Documentation/devicetree/bindings/iommu/iommu.txt index 5a8b4624defc..ec3ea3a97b77 100644 --- a/Documentation/devicetree/bindings/iommu/iommu.txt +++ b/Documentation/devicetree/bindings/iommu/iommu.txt @@ -86,6 +86,30 @@ have a means to turn off translation. But it is invalid in such cases to disable the IOMMU's device tree node in the first place because it would prevent any driver from properly setting up the translations. +Optional properties: +-------------------- +- dma-can-stall: When present, the master can wait for a transaction to + complete for an indefinite amount of time. Upon translation fault some + IOMMUs, instead of aborting the translation immediately, may first + notify the driver and keep the transaction in flight. This allows the OS + to inspect the fault and, for example, make physical pages resident + before updating the mappings and completing the transaction. Such IOMMU + accepts a limited number of simultaneous stalled transactions before + having to either put back-pressure on the master, or abort new faulting + transactions. + + Firmware has to opt-in stalling, because most buses and masters don't + support it. In particular it isn't compatible with PCI, where + transactions have to complete before a time limit. More generally it + won't work in systems and masters that haven't been designed for + stalling. For example the OS, in order to handle a stalled transaction, + may attempt to retrieve pages from secondary storage in a stalled + domain, leading to a deadlock. + +- pasid-num-bits: Some masters support multiple address spaces for DMA, by + tagging DMA transactions with an address space identifier. By default, + this is 0, which means that the device only has one address space. + Notes: ======