From patchwork Thu Apr 1 15:47:17 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: 413637 Delivered-To: patch@linaro.org Received: by 2002:a02:8562:0:0:0:0:0 with SMTP id g89csp768569jai; Thu, 1 Apr 2021 10:46:21 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxk43rTr4+tcTnrSDaUQYRjOV6QFyHR1IYT6dd8mVWJbgZlHHijcRdzJEgxrM41mRZ0FFO3 X-Received: by 2002:a17:906:7102:: with SMTP id x2mr10463919ejj.355.1617299180899; Thu, 01 Apr 2021 10:46:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1617299180; cv=none; d=google.com; s=arc-20160816; b=PCq+bjecrDsrsayJjPURcw+FsZbH6grr4rEaSZAIhQ/TrGvVU2NeC8DsSmSp1r5641 YxNsYCLLP1DY7G5VQfLPFo15Aj31lal5IRYwrPTN7IYGuG7bfVc1mH0R46TgPRQUkyez jzaX5aLPBd3b0ohII5mKt88/fTgHPP3rzlH/vTe1DjgW67M4epbgTWxIcXwdsmPfA8yh xdUoLhMJw5hquDVK04cORWjGzUcyaaD69WdaHm8Jd1kcWz1Qn0/0YHB92qmEvkRPxKyx Kz+fIzCSMZ/CdUVTiWnpRMLWE7/9RCNuU+i5KVcK3RcH0RHbKwtbhtruGya9wubknV6B juwg== 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=qpxpWMnrPJKc07Z7A57L4cT+PGNv1GXXzLI4P6Yd1EE=; b=sDBDxz2fmnHb+e6fV7cooybEWek4oOMUUGrQxNJyztLCVWc+Gh/VZzJ9K4SPRqi8p9 Yl84KTFIyy6z9larop5nF+MTaojb/WTLjx4tPIYNNerPMTwJiBlTw1l9k93+Rj5C329P EYKt1kL8OmZOWXYBFRFQaYamVJItjXh1WvZSPW08Jutm0OCq6sMqSix+VeuL7SwmhzL0 T7jcP4GYi5QHOne42zv8laZ0UroEkxRTlqlpSUtPiAOZvUOhMR6h5CMtzjByR5qFBlDW LX0FjiEXc6OqFf4qbpj2vlRECXXj5bdGqvOvB22wI7pOCxOc8TGCycmtckgoyJnz0/dt 0zZQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=jFGB9GSo; 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 v24si4734993eja.84.2021.04.01.10.46.20; Thu, 01 Apr 2021 10:46:20 -0700 (PDT) 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=jFGB9GSo; 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 S234522AbhDARmm (ORCPT + 6 others); Thu, 1 Apr 2021 13:42:42 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57200 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234395AbhDARhF (ORCPT ); Thu, 1 Apr 2021 13:37:05 -0400 Received: from mail-wr1-x433.google.com (mail-wr1-x433.google.com [IPv6:2a00:1450:4864:20::433]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EF061C02D55F for ; Thu, 1 Apr 2021 08:48:22 -0700 (PDT) Received: by mail-wr1-x433.google.com with SMTP id z2so2295805wrl.5 for ; Thu, 01 Apr 2021 08:48:22 -0700 (PDT) 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=qpxpWMnrPJKc07Z7A57L4cT+PGNv1GXXzLI4P6Yd1EE=; b=jFGB9GSoGXYX3K+nuYC/3qk1ccHgek4JlpJBTapcg1kGDi0EdR05JaD/W+kS5Ry4r/ 9jACVmw8RpTQJ6aOuJgcb6f+gsjrqmWJus8aUSvQ+3uHqKAmIezP63nLwJXSJphZ76J4 PwfJzOX9u5yhYHyn3trzzAPq2lI9dQCuJfTjmP+h+DmS1Ij9KW7MP8j+A5EckrmP6ymW YLSf8FR6eUJaHuhk19X4uDd50R2umQSPSWMTVVCqs4CNs5DLQYoQ/VwCDQlAYkUSjA1E OoCkNJREzAOO7+BOlLztBFnSlSDBqlYwLDudahJeNKDwIFxCDvl72kvfg2Q+AXBGz/pP kMGw== 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=qpxpWMnrPJKc07Z7A57L4cT+PGNv1GXXzLI4P6Yd1EE=; b=GWEmwcz8YoRvKQHPcWOoEaVTOk4pyS22dMgoj1Ql6m92bFZs5JNJWM40nzV8MoqDHR 7gYqR8venwtE3mixbuMdbc9CrTjJgaLo+1v1IN2w0EEsoLyI3XCJQulMdcTTCLPwDGxX QPBtX55Jetmw8AzEKnKSMIIdr81wF6/P5bn0j1HNXhZoQZya3g1C3h5gOqApywwIiVrR 5fT89Fh6zEkd9KfiHjjB+SiV0qT16cEBVIUUZ2LRYMCOzg3LDIf304qOsZIi8ebURehN 4kkVpK5TGZiVipZNZ5lexioszI4IRj/HHwL1aEF4LA2QdnVU3uHplL5oPfgCBT9WhR6Q ZSew== X-Gm-Message-State: AOAM533Ovkoo+NduapiiuZ/fk1hbDKXwn36mxjiqy6LmMjOpfODySm0t UlPS7/SOSGszFs5o9QcVIbTMpw== X-Received: by 2002:adf:fb0e:: with SMTP id c14mr10678009wrr.140.1617292101697; Thu, 01 Apr 2021 08:48:21 -0700 (PDT) Received: from localhost.localdomain ([2001:1715:4e26:a7e0:116c:c27a:3e7f:5eaf]) by smtp.gmail.com with ESMTPSA id y8sm8722505wmi.46.2021.04.01.08.48.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 01 Apr 2021 08:48:21 -0700 (PDT) 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, zhukeqian1@huawei.com, wangzhou1@hisilicon.com, Jean-Philippe Brucker , Rob Herring Subject: [PATCH v14 08/10] dt-bindings: document stall property for IOMMU masters Date: Thu, 1 Apr 2021 17:47:17 +0200 Message-Id: <20210401154718.307519-9-jean-philippe@linaro.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210401154718.307519-1-jean-philippe@linaro.org> References: <20210401154718.307519-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: Eric Auger Reviewed-by: Rob Herring Signed-off-by: Jean-Philippe Brucker --- .../devicetree/bindings/iommu/iommu.txt | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) -- 2.31.1 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: ======