From patchwork Wed May 26 13:34:57 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Punit Agrawal X-Patchwork-Id: 12282043 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=-13.8 required=3.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED,DKIM_SIGNED,DKIM_VALID,FREEMAIL_FORGED_FROMDOMAIN, FREEMAIL_FROM,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,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 7564DC47089 for ; Wed, 26 May 2021 15:11:58 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id 292456101E for ; Wed, 26 May 2021 15:11:58 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 292456101E Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com 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=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version: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:In-Reply-To:References: List-Owner; bh=rHSyLAI9H3rap5CRJOO2yxg06my/ntK+JcX4GtvNJK8=; b=zjoBwxBfiFS4AA vxH42GVScoK+haDQMhsltbCp21gngmKx6jdruP69nUGGfsibYuqYkEFSAoQfxePLjfYfPdQyEW3fx jRMhZ6WLR2yLK8Izw/qFFHACPm842TgO8x5OPGt8rX/Ko2dSwGFug4vDwFEpWeyzGO2rDlK2mov69 EYbx0aZzFxaKIVeMwDnyz/QjxN5FdwfsPnpxUlScYxcI+yJgj3lDHcmYbYHwa9kaCs2tbiRrphGjM VGBETW9WbXXrt98dHpGv0r6pdgM7JJroGIgZZFnbGqvxUYlMidJI6jx2lVZ8zmTGCcY1yZsQDCzgT ZgxwHb9QsmlD+LCnR1ug==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1llvAC-00FDcG-A4; Wed, 26 May 2021 15:09:41 +0000 Received: from mail-pl1-x62d.google.com ([2607:f8b0:4864:20::62d]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1lltgs-00ETtw-OS; Wed, 26 May 2021 13:35:20 +0000 Received: by mail-pl1-x62d.google.com with SMTP id b7so648116plg.0; Wed, 26 May 2021 06:35:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=F8dHlJ0lGaZ4wpJABZ5l0Lg6R0avpm3vrRyQsHumOeE=; b=epsWKguyEB98VsG4g5HiqVtaommrLsZL53nG6q0aN7yF5mJj0B/2cPn15+vS9HLNjQ uOUqzBaCc7DzRcE7UwwD/V8/culypfrKDsM37cyvTgNgbDtzTHWSrL8LDeVtn47gyftE b59vyfNQdRsjnneZWUU6y4Ir9Hy6wXzO8SJ67OX/9D29pXSk+lVJr1XIVZV1cNjh7JTd RfpTFJui1GUXo0nkuVCU250++QamJshEUlf7Ui6ygXT6jX2uu1GAeBscbIARb7uCgr9u +wPwTxWISZlSw0WvqHCFDkMYR1URvacMDOUnalfJ+9bdZU2uexdjI0LWXGoOopYjvD5Z hvXQ== 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:mime-version :content-transfer-encoding; bh=F8dHlJ0lGaZ4wpJABZ5l0Lg6R0avpm3vrRyQsHumOeE=; b=mBADjygy3Mk4GIjPrghQIX2ei5PzPQGZj1uLfGkdVD0RJH7y6MTtHvUdRq0/1dI8eD /C0QrDWyYqJgldSOLbZYDmpM/9EMDYCu/rYwZpHLkK6hQUqwEv/BNdkzEdBPWspnJqVW ZRzewMIHGyevBSYb54sAuB05+riTi8BktZNAYy22SCm8CYDcK9YpJeZIIQFkZ79fc0TU 62HMrRCfqj2IbBFCi03ggkiLXjzXx1zmkqoFURP6VBidld6wLDEkVmiiWH+bOJqcOTF8 M67Moafsk1kAM/3oIV/D605NyK2qTjCqq8wcb//RuoeQXp2nA0Ni/OTjA/g/6sq479GG 197A== X-Gm-Message-State: AOAM531jLCO7E/lxW2T5dv0E+4/yebQBBxL9tptBx61e++KaxyGuwioN gvZYP0vpwb2I2+Pxf+DHS2rVLZIP2jJ/Ng== X-Google-Smtp-Source: ABdhPJzGn0Ut3JMzBSazvjKb8GN3035Bdop0143PDzTq0qfvM+JMplSl6F492wDKE5+6f14RKy3IsA== X-Received: by 2002:a17:90a:9517:: with SMTP id t23mr3913586pjo.130.1622036116987; Wed, 26 May 2021 06:35:16 -0700 (PDT) Received: from localhost (122x211x248x161.ap122.ftth.ucom.ne.jp. [122.211.248.161]) by smtp.gmail.com with ESMTPSA id d18sm9301654pgm.93.2021.05.26.06.35.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 26 May 2021 06:35:16 -0700 (PDT) From: Punit Agrawal To: linux-rockchip@lists.infradead.org Cc: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, alexandru.elisei@arm.com, wqu@suse.com, robin.murphy@arm.com, pgwipeout@gmail.com, ardb@kernel.org, briannorris@chromium.org, shawn.lin@rock-chips.com, linux-pci@vger.kernel.org, Punit Agrawal , Heiko Stuebner , Rob Herring Subject: [PATCH] arm64: dts: rockchip: Update PCI host bridge window to 32-bit address memory Date: Wed, 26 May 2021 22:34:57 +0900 Message-Id: <20210526133457.3102393-1-punitagrawal@gmail.com> X-Mailer: git-send-email 2.30.2 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210526_063518_864382_3EA0B836 X-CRM114-Status: GOOD ( 16.97 ) 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 The PCIe host bridge on RK3399 advertises a single address range marked as 64-bit memory even though it lies entirely below 4GB. While previously, the OF PCI range parser treated 64-bit ranges more leniently (i.e., as 32-bit), since commit 9d57e61bf723 ("of/pci: Add IORESOURCE_MEM_64 to resource flags for 64-bit memory addresses") the code takes a stricter view and treats the ranges as advertised in the device tree (i.e, as 64-bit). The change in behaviour causes failure when allocating bus addresses to devices connected behind a PCI-to-PCI bridge that require non-prefetchable memory ranges. The allocation failure was observed for certain Samsung NVMe drives connected to RockPro64 boards. Update the host bridge window attributes to treat it as 32-bit address memory. This fixes the allocation failure observed since commit 9d57e61bf723. Reported-by: Alexandru Elisei Link: https://lore.kernel.org/r/7a1e2ebc-f7d8-8431-d844-41a9c36a8911@arm.com Suggested-by: Robin Murphy Signed-off-by: Punit Agrawal Cc: Heiko Stuebner Cc: Rob Herring --- Hi, The patch fixes the failure observed with detecting certain Samsung NVMe drives on RK3399 based boards. Hopefully, the folks on this thread can provide some input on the reason the host bridge window was originally marked as 64-bit or if there are any downsides to applying the patch. Thanks, Punit arch/arm64/boot/dts/rockchip/rk3399.dtsi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/arm64/boot/dts/rockchip/rk3399.dtsi b/arch/arm64/boot/dts/rockchip/rk3399.dtsi index 634a91af8e83..4b854eb21f72 100644 --- a/arch/arm64/boot/dts/rockchip/rk3399.dtsi +++ b/arch/arm64/boot/dts/rockchip/rk3399.dtsi @@ -227,7 +227,7 @@ pcie0: pcie@f8000000 { <&pcie_phy 2>, <&pcie_phy 3>; phy-names = "pcie-phy-0", "pcie-phy-1", "pcie-phy-2", "pcie-phy-3"; - ranges = <0x83000000 0x0 0xfa000000 0x0 0xfa000000 0x0 0x1e00000>, + ranges = <0x82000000 0x0 0xfa000000 0x0 0xfa000000 0x0 0x1e00000>, <0x81000000 0x0 0xfbe00000 0x0 0xfbe00000 0x0 0x100000>; resets = <&cru SRST_PCIE_CORE>, <&cru SRST_PCIE_MGMT>, <&cru SRST_PCIE_MGMT_STICKY>, <&cru SRST_PCIE_PIPE>,