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: 12035987 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.9 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5A6F8C433DB for ; Thu, 21 Jan 2021 12:42:10 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 09A5A239FF for ; Thu, 21 Jan 2021 12:42:10 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 09A5A239FF Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To:Message-Id:Date: Subject:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=37qTmxerRMW79rv59PTw5wHpW5JJAFyT24+z0YBwE1Q=; b=yLK4gCg+KhWtlyl/PJZSfoppm 62/S0ucBTz3ci3gwCMq6f0Ucod1qoQz+ODwoPMB75DpJKq2Zt32hgExLmtZ3ps40g3IqI6fkuWCBh ymqpki0D4kDkiA9TP9DI28ZoAvah4YXAjM5egfmJGjGyJ+qwGHpFgrT7TFzqgvfAdrFJFBU1t2fcg 2WcFF6pXcOoy3FyySl8SJx2TDbPB8SdLhep4i7otjxoPIg0YJS9Bc7QkJz2wNqHR/iArKdOve0Z3I V4QCFe1tJEdKojWWKcz+ckCZthQv9YY1zUn6A/Bn7Xt1psLucJb948WjQjtf2YJtTBU8v2bvvQ8s0 YZrX2BSJg==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1l2ZGI-0007Cr-Gd; Thu, 21 Jan 2021 12:40:30 +0000 Received: from mail-wm1-x32b.google.com ([2a00:1450:4864:20::32b]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1l2ZFW-0006xG-AW for linux-arm-kernel@lists.infradead.org; Thu, 21 Jan 2021 12:39:50 +0000 Received: by mail-wm1-x32b.google.com with SMTP id c127so1389406wmf.5 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=AnNakgkJuopoRrUPfKCSvWZqTx6UYwXmKpkorNu9gKMbTnXzxWg3yzadLSn0a/39Gb gnR9tL/k2VEG6Q731olRk6UzmP7XjRXz3u2fPa8rqVZElG13fgWdO1CGkPviZRBw1p/Z SImRWO1bkJwSRCEgUi/jxOS07APkYp/wGP30V/+xHqn/0k/hzTEZXlkm9kbRtnblMI67 /54CldZSlfFhQ4BzKe4syuunlBRpz+l+J5/BpjlgpFsRfKlFiSj7Y9CtsgiMDNP6I3zE quqhBwX+8A5FPv5evNf/LVd4aMG012RSeAqEZztHGqvV+97q2lR1b5qYJZ6vi2TQbmpr 8S8g== X-Gm-Message-State: AOAM531xa8JHXXtj8zdOcz8msa+3lSvHfuGrqeEfBS9/hOjtPDBcykqk 46M4C11zeq9TxALAKgNYRlC8jQ== X-Google-Smtp-Source: ABdhPJyyu67AxXul4I8BEhqNEVWy7+2JiEYaRD6cGbSWv/kOI2QhFIZt2cXoy+7w3p9jk6gaghyMpw== 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 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 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210121_073942_426177_F21C1D54 X-CRM114-Status: GOOD ( 14.00 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: vivek.gautam@arm.com, guohanjun@huawei.com, Jean-Philippe Brucker , lorenzo.pieralisi@arm.com, linux-acpi@vger.kernel.org, zhangfei.gao@linaro.org, lenb@kernel.org, devicetree@vger.kernel.org, kevin.tian@intel.com, jacob.jun.pan@linux.intel.com, eric.auger@redhat.com, robh+dt@kernel.org, Jonathan.Cameron@huawei.com, linux-arm-kernel@lists.infradead.org, rjw@rjwysocki.net, shameerali.kolothum.thodi@huawei.com, iommu@lists.linux-foundation.org, sudeep.holla@arm.com, robin.murphy@arm.com, linux-accelerators@lists.ozlabs.org, baolu.lu@linux.intel.com Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.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(+) 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: ======