From patchwork Wed Jan 27 15:43:21 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: 371567 Delivered-To: patch@linaro.org Received: by 2002:a02:a60d:0:0:0:0:0 with SMTP id c13csp386338jam; Wed, 27 Jan 2021 07:48:15 -0800 (PST) X-Google-Smtp-Source: ABdhPJw9YAqbRw+er2TFM+3YTSJJCCbFL8T3Ux74h6fZy588QZ+ovofNBLO53fY4wJMC6vZs5+wf X-Received: by 2002:a05:6402:1809:: with SMTP id g9mr9567966edy.2.1611762495039; Wed, 27 Jan 2021 07:48:15 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1611762495; cv=none; d=google.com; s=arc-20160816; b=pxcFBLacW4lyEyLWV5VO2Plp1NdIOF6eMQZbqAQ9ISIoCy6IG3b8tL1wUq90GVNfSw V9PkobyJUr3Hg+DF6mBE7qZUjF5LN5IVi10x00Dc5I6N4ZkOyV/zCI6fBwrHf76dep6O pM5Xqc4/sDAuLJZD1K5tzfRvr701AMN6rpaNX8eKIcEpTczFC/x4pav8UfxXgdlUxtIf q1Sh8mkk9FsymmsWfQTEXijgMdNRv1IYYuK5ZTHCgCog9beQp14dCSMJAkdd+Bsk5hfX U6ZogIVch572MdlCjDSuNgW+tcvg/md5amgPuecUNHKckt7g3YxJ7XaVjp5TbJLxAkl1 ZWoQ== 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=SJegczB2R1IyVn4esOinYjvVpMKU55gHDQWoWocUvrVMPq4omXXQzo5Zg1dTG8xdpi mjGTH9f1bH/wgb6CLpCtdd38z8OOHCze7TRfk7kuTpmj3xxxIcFt+nhuEJDhu0plchAg n9A2DSc4LTJla5Bw4BO5OBPwjrEeY1g+eXLBtgfaJqUnvTD1ZUgQzJDBuG+PlRrTiT3V 1Ge9IqhXYJklLyNiXteYXCl1Pzn3Z/Ao5KqqVmQeA7HD9neJZXi1lqXiPG2VgCzq9eCI zcaybne0hgv7cpuccKdY1+qUpn2VCmKkv1rmf/OoJtxD5F23Lq6vNT4NU5CKDHC68QKt JD3w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=rbK1aLxa; spf=pass (google.com: domain of devicetree-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=devicetree-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 cy17si1201994edb.193.2021.01.27.07.48.14; Wed, 27 Jan 2021 07:48:15 -0800 (PST) Received-SPF: pass (google.com: domain of devicetree-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=rbK1aLxa; spf=pass (google.com: domain of devicetree-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=devicetree-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 S234675AbhA0Pr7 (ORCPT + 6 others); Wed, 27 Jan 2021 10:47:59 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60284 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236392AbhA0PqO (ORCPT ); Wed, 27 Jan 2021 10:46:14 -0500 Received: from mail-wm1-x336.google.com (mail-wm1-x336.google.com [IPv6:2a00:1450:4864:20::336]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6BE25C061354 for ; Wed, 27 Jan 2021 07:44:45 -0800 (PST) Received: by mail-wm1-x336.google.com with SMTP id y187so2073694wmd.3 for ; Wed, 27 Jan 2021 07:44:45 -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=rbK1aLxadekkDLedlYkhXNNhT2RXl9ArKYIMq5P+xZUhGoeMuNK3hNiCz/AdZv7dFV OSkzpHq8cAXoa/SXmQczZVVsMDUa3zgVBPkpfFJsnMVHytFJ4lPtF7iVgQDdouVwknB6 PKAJ3I0JTJnun9bq1lGNt8cZHMDadB4iIeVL949UJaWXlk8wdS6to9Ss+zGxoSi5GdbL rQVmX44XNm3Yoa6Lp0sLLAnANdFnGsOPlibkhusNtF+Vv0m8ZbNcxG4L4D1R1D/UxyLB XIv8tC7yp0wBkuUigCeJ+XCpBK2QPUanxRD8fKUUvRyaioR65KVTDBWpW69znMpePx9P xlLQ== 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=Sbsnpo7VK0A2nWlxLHWMTnNcTgJDCL2He8NPSt70OjgFT+uinTFq/cdXiORG/GTzsH qanBEt39eT9nEYgb5q4IBlwliKqf2BlMsRrQR1jWXpANhTPO9dILBQjO4vM3IHole98A ckaVcxyIQhmRY9cHPPmBzqrAZlJ/kyDEkovkG8pkJ5FA6aqsJfUk1kStck2w9RuJohL7 50sLlfq1AEsTXWw1PMI7QyYpZweO7kVT2JbWiECKKFM7GdQxf0CbZbBUvVXkSxrGwx8v tlVRcn24cKhHjhW6adal2LBY8gI/69/Lznh7YiP04gUAKIBE3NhV4OKkMXUJWsgoc4I8 8A+A== X-Gm-Message-State: AOAM533aD19X529C/9fUrU2XGe785ds36nz6ULCKCkv8F7XPo/Vs4PaY DQR1eu95a1hVz2P9oybPJUCHp5ae01+HzA== X-Received: by 2002:a1c:2c0b:: with SMTP id s11mr4542706wms.13.1611762284206; Wed, 27 Jan 2021 07:44:44 -0800 (PST) Received: from localhost.localdomain ([2001:1715:4e26:a7e0:116c:c27a:3e7f:5eaf]) by smtp.gmail.com with ESMTPSA id r13sm3046921wmh.9.2021.01.27.07.44.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 27 Jan 2021 07:44:43 -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 v12 08/10] dt-bindings: document stall property for IOMMU masters Date: Wed, 27 Jan 2021 16:43:21 +0100 Message-Id: <20210127154322.3959196-9-jean-philippe@linaro.org> X-Mailer: git-send-email 2.30.0 In-Reply-To: <20210127154322.3959196-1-jean-philippe@linaro.org> References: <20210127154322.3959196-1-jean-philippe@linaro.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: devicetree@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: ======