From mboxrd@z Thu Jan 1 00:00:00 1970 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 phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 1C24FC433EF for ; Sat, 5 Feb 2022 16:43:02 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id EFE4B83BD4; Sat, 5 Feb 2022 17:40:32 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=denx.de Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=denx.de; s=phobos-20191101; t=1644079233; bh=WvOntusw9NKhdC6XaSjzy4vs/sHb9imxNvBRu/lWBrw=; h=From:To:Subject:In-reply-to:Date:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From; b=kXjNKAB2eB/PDF98Nh1wh0/7qiKjG168jYo1VEjCndtxJEQEvM3Z/aRJD9xHv1OxT ykx32kCmAkgd+bHFCyU7NO2gqYw/5F/CXLghf1+T7gSWJ3FUdr+Sjdus8bHPUpldBr J68rthM+uIl1kpnRbd/Ce4s37aIIJyTsD9oLmVnzzuKS2ZhR9hX393IIuDy/5uA2SD 1GGk3pp92JaLYN4xJd/yrR+ccLUDJKEFvIC5ZI6sPXFuZ944dlmwUyKOznrh3G4lAh gy7IIUwAzchNM1ihhp8FUlPHD2/pka/LXTy2Ba82CExxBmEjJ8oDkZCxfWS45OHjgV n+uxcJRxj00uw== Received: by phobos.denx.de (Postfix, from userid 109) id 96F6783BC7; Sat, 5 Feb 2022 17:40:30 +0100 (CET) Received: from mail-out.m-online.net (mail-out.m-online.net [212.18.0.9]) (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 B77E083B54 for ; Sat, 5 Feb 2022 17:40:27 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=denx.de Authentication-Results: phobos.denx.de; spf=fail smtp.mailfrom=sbabic@denx.de Received: from frontend01.mail.m-online.net (unknown [192.168.8.182]) by mail-out.m-online.net (Postfix) with ESMTP id 4JrdSC31JCz1r3wq; Sat, 5 Feb 2022 17:40:27 +0100 (CET) Received: from localhost (dynscan1.mnet-online.de [192.168.6.70]) by mail.m-online.net (Postfix) with ESMTP id 4JrdSC2g8fz1qqkC; Sat, 5 Feb 2022 17:40:27 +0100 (CET) X-Amavis-Alert: BAD HEADER SECTION, Missing required header field: "Date" Received: from mail.mnet-online.de ([192.168.8.182]) by localhost (dynscan1.mail.m-online.net [192.168.6.70]) (amavisd-new, port 10024) with ESMTP id LTPZTbNHJTro; Sat, 5 Feb 2022 17:40:26 +0100 (CET) Received: from papero (host-88-217-136-221.customer.m-online.net [88.217.136.221]) by mail.mnet-online.de (Postfix) with ESMTP; Sat, 5 Feb 2022 17:40:26 +0100 (CET) From: sbabic@denx.de X-Patchwork-Submitter: Gary Bisson X-Patchwork-Id: 1578577 X-Patchwork-Delegate: sbabic@denx.de To: Gary Bisson ,u-boot@lists.denx.de Subject: [PATCH] cmd: bcb: fix bcb struct alignment issue In-reply-to: <20220111170606.2042950-1-gary.bisson@boundarydevices.com> Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit MIME-Version: 1.0 Message-Id: <20220205164030.96F6783BC7@phobos.denx.de> Date: Sat, 5 Feb 2022 17:40:27 +0100 (CET) X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 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.103.5 at phobos.denx.de X-Virus-Status: Clean > Without this patch the bcb struct could be located at an odd address > which resulted in data not being copied to the buffer. > Here was the repro steps (from Mattijs): > => mmc dev 1 > => bcb load 1 misc > => bcb dump command > 00000000: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 > 00000010: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 > => part start mmc 1 misc misc_start > => mmc read ${loadaddr} ${misc_start} 4 > => bcb load 1 misc > => bcb dump command > 00000000: 62 6f 6f 74 6f 6e 63 65 2d 62 6f 6f 74 6c 6f 61 > 00000010: 64 65 72 00 00 00 00 00 00 00 00 00 00 00 00 00 > This behavior was observed on an Amlogic A311D (ARM64) platform with a > recent GCC toolchain (11.2.0) but is most likely affecting other > platforms. > To avoid issues the structure is aligned on DMA minimum alignment value > as it is passed directly to the read function. > Signed-off-by: Gary Bisson > Tested-by: Mattijs Korpershoek # on khadas vim3 Applied to u-boot-imx, master, thanks ! Best regards, Stefano Babic -- ===================================================================== DENX Software Engineering GmbH, Managing Director: Wolfgang Denk HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sbabic@denx.de =====================================================================