From 21eea886b145e63340b1d2bd93f19db923344e59 Mon Sep 17 00:00:00 2001 From: Peter Robinson Date: Thu, 26 Mar 2020 11:28:23 +0000 Subject: [PATCH] Fix ext4 alignment issue seen on some NXP i.MX devices --- fs-ext4-Fix-alignment-of-cache-buffers.patch | 109 +++++++++++++++++++ uboot-tools.spec | 6 +- 2 files changed, 114 insertions(+), 1 deletion(-) create mode 100644 fs-ext4-Fix-alignment-of-cache-buffers.patch diff --git a/fs-ext4-Fix-alignment-of-cache-buffers.patch b/fs-ext4-Fix-alignment-of-cache-buffers.patch new file mode 100644 index 0000000..2f14f51 --- /dev/null +++ b/fs-ext4-Fix-alignment-of-cache-buffers.patch @@ -0,0 +1,109 @@ +From patchwork Wed Mar 25 20:27:51 2020 +Content-Type: text/plain; charset="utf-8" +MIME-Version: 1.0 +Content-Transfer-Encoding: 7bit +X-Patchwork-Submitter: Jan Kiszka +X-Patchwork-Id: 1261644 +Return-Path: +X-Original-To: incoming@patchwork.ozlabs.org +Delivered-To: patchwork-incoming@bilbo.ozlabs.org +Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) + smtp.mailfrom=lists.denx.de (client-ip=85.214.62.61; + helo=phobos.denx.de; + envelope-from=u-boot-bounces@lists.denx.de; + receiver=) +Authentication-Results: ozlabs.org; + dmarc=fail (p=none dis=none) header.from=siemens.com +Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) + (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) + key-exchange X25519 server-signature RSA-PSS (4096 bits) + server-digest SHA256) (No client certificate requested) + by ozlabs.org (Postfix) with ESMTPS id 48nfnl4Nyzz9sPk + for ; + Thu, 26 Mar 2020 07:28:11 +1100 (AEDT) +Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) + by phobos.denx.de (Postfix) with ESMTP id F0DD781264; + Wed, 25 Mar 2020 21:28:01 +0100 (CET) +Authentication-Results: phobos.denx.de; + dmarc=fail (p=none dis=none) header.from=siemens.com +Authentication-Results: phobos.denx.de; + spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de +Received: by phobos.denx.de (Postfix, from userid 109) + id 63F418176E; Wed, 25 Mar 2020 21:27:59 +0100 (CET) +X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de +X-Spam-Level: +X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, RCVD_IN_MSPIKE_H3, + RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,URIBL_BLOCKED autolearn=ham + autolearn_force=no version=3.4.2 +Received: from thoth.sbs.de (thoth.sbs.de [192.35.17.2]) + (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 + bits)) (No client certificate requested) + by phobos.denx.de (Postfix) with ESMTPS id 8068780111 + for ; Wed, 25 Mar 2020 21:27:54 +0100 (CET) +Authentication-Results: phobos.denx.de; + dmarc=pass (p=none dis=none) header.from=siemens.com +Authentication-Results: phobos.denx.de; + spf=pass smtp.mailfrom=jan.kiszka@siemens.com +Received: from mail2.sbs.de (mail2.sbs.de [192.129.41.66]) + by thoth.sbs.de (8.15.2/8.15.2) with ESMTPS id 02PKRqHN010973 + (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); + Wed, 25 Mar 2020 21:27:52 +0100 +Received: from [167.87.79.232] ([167.87.79.232]) + by mail2.sbs.de (8.15.2/8.15.2) with ESMTP id 02PKRqX9010863; + Wed, 25 Mar 2020 21:27:52 +0100 +From: Jan Kiszka +Subject: [PATCH] fs: ext4: Fix alignment of cache buffers +To: U-Boot Mailing List , Tom Rini +Cc: Stephen Warren +Message-ID: +Date: Wed, 25 Mar 2020 21:27:51 +0100 +User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 + Thunderbird/68.6.0 +MIME-Version: 1.0 +Content-Language: en-US +X-BeenThere: u-boot@lists.denx.de +X-Mailman-Version: 2.1.30rc1 +Precedence: list +List-Id: U-Boot discussion +List-Unsubscribe: , + +List-Archive: +List-Post: +List-Help: +List-Subscribe: , + +Errors-To: u-boot-bounces@lists.denx.de +Sender: "U-Boot" +X-Virus-Scanned: clamav-milter 0.102.2 at phobos.denx.de +X-Virus-Status: Clean + +From: Jan Kiszka + +We need to align the cache buffer to ARCH_DMA_MINALIGN in order to avoid +access errors like + +CACHE: Misaligned operation at range [be0231e0, be0235e0] + +seen on the MCIMX7SABRE. + +Fixes: d5aee659f217 ("fs: ext4: cache extent data") +Signed-off-by: Jan Kiszka +Reviewed-by: Tom Rini +Reviewed-by: Stephen Warren +--- + fs/ext4/ext4fs.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/fs/ext4/ext4fs.c b/fs/ext4/ext4fs.c +index 1c616a26a2..966b427a97 100644 +--- a/fs/ext4/ext4fs.c ++++ b/fs/ext4/ext4fs.c +@@ -288,7 +288,7 @@ int ext_cache_read(struct ext_block_cache *cache, lbaint_t block, int size) + if (cache->buf && cache->block == block && cache->size == size) + return 1; + ext_cache_fini(cache); +- cache->buf = malloc(size); ++ cache->buf = memalign(ARCH_DMA_MINALIGN, size); + if (!cache->buf) + return 0; + if (!ext4fs_devread(block, 0, size, cache->buf)) { diff --git a/uboot-tools.spec b/uboot-tools.spec index 1eed179..1acc0c5 100644 --- a/uboot-tools.spec +++ b/uboot-tools.spec @@ -2,7 +2,7 @@ Name: uboot-tools Version: 2020.04 -Release: 0.4%{?candidate:.%{candidate}}%{?dist} +Release: 0.5%{?candidate:.%{candidate}}%{?dist} Summary: U-Boot utilities License: GPLv2+ BSD LGPL-2.1+ LGPL-2.0+ URL: http://www.denx.de/wiki/U-Boot @@ -26,6 +26,7 @@ Patch5: rpi-Enable-using-the-DT-provided-by-the-Raspberry-Pi.patch Patch6: dragonboard-fixes.patch Patch7: ARM-tegra-Add-NVIDIA-Jetson-Nano.patch Patch8: arm-tegra-defaine-fdtfile-for-all-devices.patch +Patch9: fs-ext4-Fix-alignment-of-cache-buffers.patch BuildRequires: bc BuildRequires: dtc @@ -247,6 +248,9 @@ cp -p board/warp7/README builds/docs/README.warp7 %endif %changelog +* Thu Mar 26 2020 Peter Robinson 2020.04-0.5-rc3 +- Fix ext4 alignment issue seen on some NXP i.MX devices + * Wed Feb 26 2020 Peter Robinson 2020.04-0.4-rc3 - 2020.04 RC3