From patchwork Thu Jan 21 12:36:22 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jean-Philippe Brucker X-Patchwork-Id: 367841 Delivered-To: patch@linaro.org Received: by 2002:a02:a60d:0:0:0:0:0 with SMTP id c13csp532900jam; Thu, 21 Jan 2021 04:42:57 -0800 (PST) X-Google-Smtp-Source: ABdhPJxh+HOONQ6K69s8F3Zl/QuC4qAGOA/NHo0g1smHHCQbKCtnzd9OAJIZ7n0OlnQzjhIMSs91 X-Received: by 2002:a17:906:8609:: with SMTP id o9mr9060468ejx.241.1611232977754; Thu, 21 Jan 2021 04:42:57 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1611232977; cv=none; d=google.com; s=arc-20160816; b=l5Wtx/9LemSTNcpgHiYEjwRf3GIoOAY2dRJU3ihg8rdxm9XUKoVhmUIdqOvLpbtXjn LGtyaVSyVlEWCaddOnightObISwIQ7x7KBLcsNOG0rrYL+12yDpwCUaeexHlyAnuIvrZ SRPLc/k9zFohL66zM7uYz5UtHN3GBlGMAjwRtHanFSYXqm5thfg9I9Y1yOPIf1B3fbwr mhj/lIpGtDiC/Ah/bdwgi1TaI4ODzTYJjOCOvvfsLYXVJ15uxQedoeL8M9/AtpDN+KZR 95uGF9git88L4Wr/lM5iRWLhVf9SH/lpow5BFn3XAKjuNFOMhIQf6GrcLpVj1vQQ9k7S yGsw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=Iza7ai+1pJVkOiREPpK3tUFt/+4KEOcT4kmdIoRu1W4=; b=akm7j5EoJ2z3QhDXjz1PVkK4+KxqdvL6idqU+hWROfkUTOKSLXNS+Ow5l1+kF81NI8 1S1nDbP6ASEDPjoIpX+ruqMZo+8cJl8DU74csM4uA3H1ZTEtZRSieAdVgytEp7susce6 SYcJUNqcstanzGfiYCJyOXWPcAQNA0CRLq8BNEBCOHO9YKmAAYr4jsHAwJdfgNS5+saV vnxFYaeuXAgml8XIY+NQg3WxZIZtso38SwOWgqf0OLg53N3SailREC8wvFepA/osHuXR Xi87gm3vDwuhj1tedduLSU6xLb5F9asdm77jAAnBOTB8WURHkSZCaxmSouJAIli2I488 uRLw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=ncM2Etu8; spf=pass (google.com: domain of linux-acpi-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-acpi-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id r7si2072058edv.345.2021.01.21.04.42.57; Thu, 21 Jan 2021 04:42:57 -0800 (PST) Received-SPF: pass (google.com: domain of linux-acpi-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=ncM2Etu8; spf=pass (google.com: domain of linux-acpi-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-acpi-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728146AbhAUMml (ORCPT + 4 others); Thu, 21 Jan 2021 07:42:41 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57090 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731437AbhAUMlR (ORCPT ); Thu, 21 Jan 2021 07:41:17 -0500 Received: from mail-wm1-x32e.google.com (mail-wm1-x32e.google.com [IPv6:2a00:1450:4864:20::32e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8B3A8C06179F for ; Thu, 21 Jan 2021 04:39:42 -0800 (PST) Received: by mail-wm1-x32e.google.com with SMTP id e15so1400762wme.0 for ; Thu, 21 Jan 2021 04:39:42 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=Iza7ai+1pJVkOiREPpK3tUFt/+4KEOcT4kmdIoRu1W4=; b=ncM2Etu85nnnt1D5R9wUQk3EdfSF9pw+1ijx4nvgrK8oJD23eDuaDfijqTYecFMFyX wDn3pvejZJ45AWRW6k6uYvZj0k+50DwmufnS5BpjT5RFasOCp1okzSAfVbHxJTAkpOjR bFiaj49TLoUmXz50hHl/5dwzxButCVFM8yeIw6pGwP/VnDadugin6h75nubMSCJcAFqO jY17KorelU5Yco4R8uyif+WIeJveoSTMmVpvqNg2IGuEPh6AEA1HXRbFShVjnA2Ncrhu uH+qklVmhowQvcKcP5AUrwxWYPH+BSK1kwjb0JAjJKGJmLV9xrQZONTw0SAGUCP+iOuo n96A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=Iza7ai+1pJVkOiREPpK3tUFt/+4KEOcT4kmdIoRu1W4=; b=TwN/OCM9G3/aUsninRqdm/VQBTQ9stQa8+Gy5yj5dZahAQKjQEjKM+yMV7hfzKWMsx Vpa7tH0h6hcXgh/ziuqQdMHKkpmMkTBzHaRkA35Nua9qLLtsBDAEAYHbRTPJQAkel3fW bjXXYYGs0GhYoxd9b+ZxKv0tuUAeDhmYW8NrdT2gp4RNr8Cwn9G/u3bnYTKxdjySm36p wmmlnqITQMYPiYoNePaFJCz34S0hBelHmdK1XmkqEnuiDlD6t8gSerZlP9osGjuBpVV+ nY58YrQdcasQ/ualDCd/X3yz6/QXdIgg/y1B44CyQBw2jMVFzKLuRZUVPlfIHa/hUSX0 qwxg== X-Gm-Message-State: AOAM533IR2K1Bp3UwCEtuWQJWLwz1eVtgTlpKx8eb38wjH2oCJN5UV3W VC3sSI5gQdzaU+03YF6YO3eh3g== X-Received: by 2002:a1c:dc83:: with SMTP id t125mr8923805wmg.154.1611232781283; Thu, 21 Jan 2021 04:39:41 -0800 (PST) Received: from localhost.localdomain ([2001:1715:4e26:a7e0:116c:c27a:3e7f:5eaf]) by smtp.gmail.com with ESMTPSA id p18sm7979248wmc.31.2021.01.21.04.39.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 21 Jan 2021 04:39:40 -0800 (PST) From: Jean-Philippe Brucker To: joro@8bytes.org, will@kernel.org Cc: lorenzo.pieralisi@arm.com, robh+dt@kernel.org, guohanjun@huawei.com, sudeep.holla@arm.com, rjw@rjwysocki.net, lenb@kernel.org, robin.murphy@arm.com, Jonathan.Cameron@huawei.com, eric.auger@redhat.com, iommu@lists.linux-foundation.org, devicetree@vger.kernel.org, linux-acpi@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-accelerators@lists.ozlabs.org, baolu.lu@linux.intel.com, jacob.jun.pan@linux.intel.com, kevin.tian@intel.com, vdumpa@nvidia.com, zhangfei.gao@linaro.org, shameerali.kolothum.thodi@huawei.com, vivek.gautam@arm.com, Jean-Philippe Brucker , Rob Herring Subject: [PATCH v10 08/10] dt-bindings: document stall property for IOMMU masters Date: Thu, 21 Jan 2021 13:36:22 +0100 Message-Id: <20210121123623.2060416-9-jean-philippe@linaro.org> X-Mailer: git-send-email 2.30.0 In-Reply-To: <20210121123623.2060416-1-jean-philippe@linaro.org> References: <20210121123623.2060416-1-jean-philippe@linaro.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-acpi@vger.kernel.org On ARM systems, some platform devices behind an IOMMU may support stall, which is the ability to recover from page faults. Let the firmware tell us when a device supports stall. Reviewed-by: Rob Herring Signed-off-by: Jean-Philippe Brucker --- .../devicetree/bindings/iommu/iommu.txt | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) -- 2.30.0 diff --git a/Documentation/devicetree/bindings/iommu/iommu.txt b/Documentation/devicetree/bindings/iommu/iommu.txt index 3c36334e4f94..26ba9e530f13 100644 --- a/Documentation/devicetree/bindings/iommu/iommu.txt +++ b/Documentation/devicetree/bindings/iommu/iommu.txt @@ -92,6 +92,24 @@ Optional properties: tagging DMA transactions with an address space identifier. By default, this is 0, which means that the device only has one address space. +- 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. + Notes: ======