From patchwork Mon Apr 29 11:39:37 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jean-Philippe Brucker X-Patchwork-Id: 13646681 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id BD767C25B10 for ; Mon, 29 Apr 2024 11:43:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=xf5BPJHR9zjhfCFD+vSMSrP1Px5QVX+JQ/Q+MZewVEc=; b=IHyN4CMUApLnPQ gCfvNraMfMEGfzW4r6GMgLR3rU/ez4a4cfPilraXKDZJEl9oQ60uMWwI9dWp4zPo57eQJbUX3QQY/ 4y59A9p2yo2aiRAspP0xGmnd0BZCygChpq3spWpN6B4fYw274CREMOUwSAYnmd7YJjY05ssHYx2vy 225tD/J/8I2XJ+DHrWIKBPYaoSRoiZ5qTijSykEX4YEdUghBD0tJME/FS1rnU6AXEYTLNvz9ufAAV FGbgFcjr1pX0oHByaYel4mYtoOGAsbWnVFfe2VtvIirXK4LBZ8NAiWU3AKYfHAMZZKPiUpzyJamPI kckuvNbWXLvwylCbkDAA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1s1PQ2-00000002VCM-1Lnm; Mon, 29 Apr 2024 11:43:38 +0000 Received: from mail-lj1-x235.google.com ([2a00:1450:4864:20::235]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1s1PPd-00000002UzX-2LT2 for linux-arm-kernel@lists.infradead.org; Mon, 29 Apr 2024 11:43:15 +0000 Received: by mail-lj1-x235.google.com with SMTP id 38308e7fff4ca-2db6f5977e1so50343011fa.2 for ; Mon, 29 Apr 2024 04:43:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1714390988; x=1714995788; darn=lists.infradead.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=4AHu2GrYMZd5nsIxhghrANJzfEVXRFCsK+/iWXt8RrI=; b=dSr3meNDjfd1XYzxzpli5gIJ74dQqjI6mOzSOzHtAu7sgkF8w1bxkq/FZoRp5iOWY3 A47EBvMlXkrV0Bp3emWoVPxK7Y3y+yh2CLdVtzv9pWJPQcYYAPNHfAXkewBp5qk1jxbe xMmB7Khy/SXWaHeRNAsRU5W7E8b/aP388HqhN+yt9AyZJSUYQn1/9o8/szh4nO+zL+Yk 1FsvNaTFO3uvoeLZBP5x9riZSWW0Y+5HA1z41QUWaJOxq5c9qeLelODn534oaDESfZ1+ yL7LAmnxnRuX3EwNXptP19rOMop09dSJI9vrMIxtmFH3+8nlTqw+ii2YYTYsdX7w8iXu GP+Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1714390988; x=1714995788; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=4AHu2GrYMZd5nsIxhghrANJzfEVXRFCsK+/iWXt8RrI=; b=uVU3VSkEHblCom64EVdPxSrOGDEmWcUGvoHpMDLZ9kYC/BQZ/pMGH23BxsR4idaATU +MgLIrLEIvk8tYEFSqFVCYORUtXaiC6Mq6d31dlbRK+C0LFgz6HpPqp4RN/3TPgamkFP C+hX981U6eT101khmYAjWmY/Nb0L9z/3HKIl+UuPEMvVttGR16WvbscKca99huNBlwoo QTHc5pDaQ9u3LXM18PG4gValbENsK1CsbCPWCEY304nJVdizqOJnYtwEFbVOLdeY4Klg jSDPJMjZfFtHM5ILICdyUAw9+GWynji4aQfe6n7MOT0BZhvXPj860Su2FbyZqZ8oML6X wExw== X-Forwarded-Encrypted: i=1; AJvYcCU9IXnoaTt34mToYz8ImkRBiYNynnv36SfQEhHw7P784T7f+MCly3L+Kq0jsOBbYVObrch19kePUT0ExK4oA08F4dzcO389i+J6EJUHPpJm7Z//9dM= X-Gm-Message-State: AOJu0YxH5g99Ko7ScNvO50jjECum7Gh76Vt4f1MgKn6rKywP6Oc4ukf6 j95CK6uaiqtjNrrK/EQrKUzxyL1Kcj0CTY4l1+R27TvTH8b6pYnbYDDtuYu5JRU= X-Google-Smtp-Source: AGHT+IEM/SX8JWy3onOefygk1LTTCZaAW7PQ3Tj7tXR9aiLyU2Z/2Z/HvLOTcE/H0E6Xb96t5e5h8A== X-Received: by 2002:a2e:901a:0:b0:2d8:4169:3a58 with SMTP id h26-20020a2e901a000000b002d841693a58mr6273268ljg.41.1714390987975; Mon, 29 Apr 2024 04:43:07 -0700 (PDT) Received: from localhost.localdomain ([2.221.137.100]) by smtp.gmail.com with ESMTPSA id j28-20020a05600c1c1c00b0041bfb176a87sm7006611wms.27.2024.04.29.04.43.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 29 Apr 2024 04:43:07 -0700 (PDT) From: Jean-Philippe Brucker To: will@kernel.org, lpieralisi@kernel.org, kw@linux.com, robh@kernel.org, bhelgaas@google.com, krzk+dt@kernel.org, conor+dt@kernel.org, liviu.dudau@arm.com, sudeep.holla@arm.com, joro@8bytes.org Cc: robin.murphy@arm.com, nicolinc@nvidia.com, ketanp@nvidia.com, linux-pci@vger.kernel.org, linux-arm-kernel@lists.infradead.org, iommu@lists.linux.dev, devicetree@vger.kernel.org, Jean-Philippe Brucker Subject: [PATCH 1/3] dt-bindings: PCI: generic: Add ats-supported property Date: Mon, 29 Apr 2024 12:39:37 +0100 Message-ID: <20240429113938.192706-3-jean-philippe@linaro.org> X-Mailer: git-send-email 2.44.0 In-Reply-To: <20240429113938.192706-2-jean-philippe@linaro.org> References: <20240429113938.192706-2-jean-philippe@linaro.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240429_044313_619672_66712E86 X-CRM114-Status: GOOD ( 10.96 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Add a way for firmware to tell the OS that ATS is supported by the PCI root complex. An endpoint with ATS enabled may send Translation Requests and Translated Memory Requests, which look just like Normal Memory Requests with a non-zero AT field. So a root controller that ignores the AT field may simply forward the request to the IOMMU as a Normal Memory Request, which could end badly. In any case, the endpoint will be unusable. The ats-supported property allows the OS to only enable ATS in endpoints if the root controller can handle ATS requests. Only add the property to pcie-host-ecam-generic for the moment. For non-generic root controllers, availability of ATS can be inferred from the compatible string. Signed-off-by: Jean-Philippe Brucker Reviewed-by: Rob Herring Reviewed-by: Liviu Dudau --- From a while ago: https://lore.kernel.org/all/20200219222454.GA16221@bogus/ --- Documentation/devicetree/bindings/pci/host-generic-pci.yaml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Documentation/devicetree/bindings/pci/host-generic-pci.yaml b/Documentation/devicetree/bindings/pci/host-generic-pci.yaml index d25423aa71674..94d4a4914a483 100644 --- a/Documentation/devicetree/bindings/pci/host-generic-pci.yaml +++ b/Documentation/devicetree/bindings/pci/host-generic-pci.yaml @@ -110,6 +110,12 @@ properties: iommu-map-mask: true msi-parent: true + ats-supported: + description: + Indicates that a PCIe host controller supports ATS, and can handle Memory + Requests with Address Type (AT). + type: boolean + required: - compatible - reg