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 mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3D4B6C433F5 for ; Fri, 15 Oct 2021 15:50:52 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id 624FA611C8 for ; Fri, 15 Oct 2021 15:50:51 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 624FA611C8 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=denx.de Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=lists.denx.de Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id E70F18385C; Fri, 15 Oct 2021 17:50:45 +0200 (CEST) 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=1634313047; bh=i8HrB3ZIe5Kt8Y3jIPYy8HDCysJhhl5DPBANXeIT2r4=; h=From:Subject:To:Cc:References:Date:In-Reply-To:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=HazJ01XtFG5iU1iQwsTOCYM2vrmJkl/sL1Mr7BvukG15Sigv6wq6TmbxBDCK1twq0 9SpeXk4L3NbkrRGcUGq7KgrRh0hx/4+LH0D6N25UplcyIKwjOGnjn3ztKP0wAFA0sH qOwpkrQWXAeRqY2xKUkWoDuDtsydeK958p+kaNHgoDwtXgUiId7YtGRdIyQrt9KTNm sWyymY+bHBYeg1ND0W+QdCHc3Acg9/NSMKstSg/bcMLFGEdRMk0TfK+wc9auKTJovq FAU1V4VajTOSm+sYbo/zIeGrF3Dp+nlTDoRO8E6ZoIULM5EPNmOkWui4EBkzYsv+9X QJ8pZZv9OhPCw== Received: from [127.0.0.1] (p578adb1c.dip0.t-ipconnect.de [87.138.219.28]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: marex@denx.de) by phobos.denx.de (Postfix) with ESMTPSA id A60EA836E9; Fri, 15 Oct 2021 17:50:22 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=denx.de; s=phobos-20191101; t=1634313023; bh=i8HrB3ZIe5Kt8Y3jIPYy8HDCysJhhl5DPBANXeIT2r4=; h=From:Subject:To:Cc:References:Date:In-Reply-To:From; b=SG6NycSqrwsUwvD0Y61HT+RalYumlgEnbiSXS2ERVdUUuXy0zwtFb+Fzz0/j9mman 4rRJkJHm4GQR2NZ5vEUFGnoll6GciRdiZyuQ4V+iYxI2mOw3VGKELhoBjMqIne8+zT VodV7CNPVXjKw7Re9aCK2pFoYELoqClLhx21c4OvhpbOkQvC7fLdP8pKc8SjsQ48yD /2G7YBB6lnZQdot8yrPHdQv5c65c/YUP/CUgtAupIY6MZsGmYcUXbJGEGCw/U7vb9L 7EwP5kpnN5s+u1GYgee1b9e0OunjdyDtmWXf8ftcktvXHGTkEOENVXpF3E7DQBJak6 JMXRwCZnismig== From: Marek Vasut Subject: Re: [PATCH] board_f: Copy GD to new GD even if relocation disabled To: "Peng Fan (OSS)" , Marek Vasut , u-boot@lists.denx.de Cc: Simon Glass , Tom Rini References: <20211010214410.870766-1-marek.vasut+renesas@gmail.com> Message-ID: Date: Fri, 15 Oct 2021 16:29:06 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.14.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.34 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.2 at phobos.denx.de X-Virus-Status: Clean On 10/14/21 3:52 AM, Peng Fan (OSS) wrote: [...] >> diff --git a/common/board_f.c b/common/board_f.c >> index 3dc0eaa59c..2161a7411d 100644 >> --- a/common/board_f.c >> +++ b/common/board_f.c >> @@ -674,6 +674,7 @@ static int reloc_bloblist(void) >>   static int setup_reloc(void) >>   { >>       if (gd->flags & GD_FLG_SKIP_RELOC) { >> +        memcpy(gd->new_gd, (char *)gd, sizeof(gd_t)); >>           debug("Skipping relocation due to flag\n"); >>           return 0; >>       } >> > > I still think my patch is better :) > https://patchwork.ozlabs.org/project/uboot/patch/20211013095445.18428-1-peng.fan@oss.nxp.com/ > > > But anyway if you prefer, you could have a v2 to include dtb relocation. Your patch does not reflect the gd->reloc_off update in new_gd in case GD_SKIP_RELOC_FLAG is NOT set, that's a bug. This patch does not have that problem. I thought about expanding the if above to deduplicate the memcpy, but that looked rather ugly, but we can try that instead.