Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp4815822iog; Wed, 22 Jun 2022 06:28:13 -0700 (PDT) X-Google-Smtp-Source: AGRyM1vdnf4qZdCMuNj2qUSgEKC+cPKtoKkw/PuuYUc1GLc9KufAzIweWfS+MnXRXiZAfSYPvlxu X-Received: by 2002:a05:6402:2051:b0:435:71b5:b627 with SMTP id bc17-20020a056402205100b0043571b5b627mr4085693edb.267.1655904493170; Wed, 22 Jun 2022 06:28:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1655904493; cv=none; d=google.com; s=arc-20160816; b=A/CGtxdItOX5b3hQUybxNgBc2uWblkFrdTJkVDKscgx0zP7HR+j7e3kTX95maRHn4c 02hDdC4xuuQgU9B1Zi7/4pi7fE9cpRHWENMG6zm242mhzfM/9REounVTAvBMezK6aQeS zh0Fp5ic32Ba8ew0AhOL4+2kO3aMhOz9P9Rm9yEjlZbId99LpbxD8rTNhkp16S2cG5AN whkMzboTBz74j8yd/vOiRrENNZx51BmOZXizFayP4QWIcJTfKv2wSC5sNJeufoBzxGLT 96csz+ulNUU5CY2g2VHW+ERuYa2hVEAGVPqKDIH6Mg3m3f/MzwIJTSXcwyaWPx8mynkp kVKg== 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=zneSlm/FBIo8HIfpwrpeYXGfaaeCvJcmoVkNt34CA/4=; b=SYbCrnEkmhMQtuowEPuGXetpMTE9oFb3uC7ddPtj847R7BzPVMP8/uiTHe/2+yWA49 oJDdYtnkuV4U1uudC7Ns/dOE8pJQNDhV7Jd6XryNfy4Wnu9iTMVwWoU5ilThox/hAy17 0xWC66fX/+wjulViAXYzNw+y+9lM/gsNKFDUrU9pvaZVFYD2/mZzCboW9fDGfEp8cH73 d+xD6kUB7tb+Fw/NrvsCscSCD8z2jAdISAfq6CdOYsQKb+ONBlJZCu7e4sorSBmOSF6I nlVlHHnG6Z4yz2eE2Prefn7XZsCht8oKlXAC8yIlOAmm84euHEFB9pB52KeJa4SSQ0V7 XNoQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@kapsi.fi header.s=20161220 header.b=lGVQvzII; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id y16-20020a056402359000b0043580fc2e3dsi11608161edc.472.2022.06.22.06.27.45; Wed, 22 Jun 2022 06:28:13 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=fail header.i=@kapsi.fi header.s=20161220 header.b=lGVQvzII; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1357637AbiFVNZ6 (ORCPT + 99 others); Wed, 22 Jun 2022 09:25:58 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44584 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229893AbiFVNYz (ORCPT ); Wed, 22 Jun 2022 09:24:55 -0400 Received: from mail.kapsi.fi (mail.kapsi.fi [IPv6:2001:67c:1be8::25]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C8AAD39146; Wed, 22 Jun 2022 06:23:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=kapsi.fi; s=20161220; h=Content-Transfer-Encoding:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To:Content-Type:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=zneSlm/FBIo8HIfpwrpeYXGfaaeCvJcmoVkNt34CA/4=; b=lGVQvzIIViuCsb85jMK1fqXWbp SuJd3L8bfoi0b1hP24/oURQXg4fPj6gq57kRoIiSclCzH6XLLxN9fFckP2iPxA6WUqjRnQNfhKXiL YsTZLIedMKg8AgVKd5kH0FTysKjfMj3z37hzTD3TQYzWGl9WCFG5AIiXm+PEQ9vxShN+hGleA8fnT 8c3Zv82wa/d0T0qKphQLKygA6n3kUGUpca/GTMmfCBRtc5veU+c54RD+c6sesQsuj+LmbW/KM0zLm JB9LFN+FNW2t/fBz8uACrsDUFUj/6vPdnmiGcSwvsr6YQef/cGlGzNlF26E1xun7Q8W2Gag2dx93i /stqIcIw==; Received: from 91-158-25-70.elisa-laajakaista.fi ([91.158.25.70] helo=toshino.localdomain) by mail.kapsi.fi with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1o40Kl-000abh-DJ; Wed, 22 Jun 2022 16:23:50 +0300 From: Mikko Perttunen To: Thierry Reding , Jonathan Hunter Cc: Mikko Perttunen , Greg Kroah-Hartman , Mian Yousaf Kaukab , linux-tegra@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 2/2] arm64: tegra: Mark BPMP channels as no-memory-wc Date: Wed, 22 Jun 2022 16:23:00 +0300 Message-Id: <20220622132300.1746201-2-cyndis@kapsi.fi> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220622132300.1746201-1-cyndis@kapsi.fi> References: <20220622132300.1746201-1-cyndis@kapsi.fi> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-SA-Exim-Connect-IP: 91.158.25.70 X-SA-Exim-Mail-From: cyndis@kapsi.fi X-SA-Exim-Scanned: No (on mail.kapsi.fi); SAEximRunCond expanded to false X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Mikko Perttunen The Tegra SYSRAM contains regions access to which is restricted to certain hardware blocks on the system, and speculative accesses to those will cause issues. Patch 'misc: sram: Only map reserved areas in Tegra SYSRAM' attempted to resolve this by only mapping the regions specified in the device tree on the assumption that there are no such restricted areas within the 64K-aligned area of memory that contains the memory we wish to map. Turns out this assumption is wrong, as there are such areas above the 4K pages described in the device trees. As such, we need to use the bigger hammer that is no-memory-wc, which causes the memory to be mapped as Device memory to which speculative accesses are disallowed. As such, the previous patch in the series, 'firmware: tegra: bpmp: do only aligned access to IPC memory area', is required with this patch to make the BPMP driver only issue aligned memory accesses as those are also required with Device memory. Fixes: fec29bf04994 ("misc: sram: Only map reserved areas in Tegra SYSRAM") Signed-off-by: Mikko Perttunen --- arch/arm64/boot/dts/nvidia/tegra186.dtsi | 1 + arch/arm64/boot/dts/nvidia/tegra194.dtsi | 1 + arch/arm64/boot/dts/nvidia/tegra234.dtsi | 1 + 3 files changed, 3 insertions(+) diff --git a/arch/arm64/boot/dts/nvidia/tegra186.dtsi b/arch/arm64/boot/dts/nvidia/tegra186.dtsi index 0e9afc3e2f26..9eca18b54698 100644 --- a/arch/arm64/boot/dts/nvidia/tegra186.dtsi +++ b/arch/arm64/boot/dts/nvidia/tegra186.dtsi @@ -1820,6 +1820,7 @@ sram@30000000 { #address-cells = <1>; #size-cells = <1>; ranges = <0x0 0x0 0x30000000 0x50000>; + no-memory-wc; cpu_bpmp_tx: sram@4e000 { reg = <0x4e000 0x1000>; diff --git a/arch/arm64/boot/dts/nvidia/tegra194.dtsi b/arch/arm64/boot/dts/nvidia/tegra194.dtsi index d1f8248c00f4..3fdb0b852718 100644 --- a/arch/arm64/boot/dts/nvidia/tegra194.dtsi +++ b/arch/arm64/boot/dts/nvidia/tegra194.dtsi @@ -2684,6 +2684,7 @@ sram@40000000 { #address-cells = <1>; #size-cells = <1>; ranges = <0x0 0x0 0x40000000 0x50000>; + no-memory-wc; cpu_bpmp_tx: sram@4e000 { reg = <0x4e000 0x1000>; diff --git a/arch/arm64/boot/dts/nvidia/tegra234.dtsi b/arch/arm64/boot/dts/nvidia/tegra234.dtsi index cb3af539e477..0213a7e3dad0 100644 --- a/arch/arm64/boot/dts/nvidia/tegra234.dtsi +++ b/arch/arm64/boot/dts/nvidia/tegra234.dtsi @@ -1325,6 +1325,7 @@ sram@40000000 { #address-cells = <1>; #size-cells = <1>; ranges = <0x0 0x0 0x40000000 0x80000>; + no-memory-wc; cpu_bpmp_tx: sram@70000 { reg = <0x70000 0x1000>; -- 2.36.1