From patchwork Thu Jan 28 08:10:07 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gary Bisson X-Patchwork-Id: 1432587 X-Patchwork-Delegate: trini@ti.com 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=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=boundarydevices.com header.i=@boundarydevices.com header.a=rsa-sha256 header.s=google header.b=F6zEjYFr; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4DRCnn5S9Gz9sBy for ; Thu, 28 Jan 2021 19:10:21 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 2327E82603; Thu, 28 Jan 2021 09:10:17 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=boundarydevices.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; unprotected) header.d=boundarydevices.com header.i=@boundarydevices.com header.b="F6zEjYFr"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 0EE438262D; Thu, 28 Jan 2021 09:10:15 +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=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-wm1-x32b.google.com (mail-wm1-x32b.google.com [IPv6:2a00:1450:4864:20::32b]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 55100825C4 for ; Thu, 28 Jan 2021 09:10:12 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=boundarydevices.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=gary.bisson@boundarydevices.com Received: by mail-wm1-x32b.google.com with SMTP id f16so3518376wmq.5 for ; Thu, 28 Jan 2021 00:10:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=boundarydevices.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=F38Dnlms1Mt+XxDV9VWItCge0nndNpDuRnBu/tUwcZQ=; b=F6zEjYFroZTe52MUOWgb2RhZNamdR1beTE70agtvrdNESzEv5rc6czx/rE5NyYSVSP QCk5pdr6SR5L+1GJUduejx2PO0a5pMo+vogrrgockDlxaTJXe4kKGLiglDoH5I37lOoV e+0ZxNz0br7/Yl7+yJ+RL65cCw1g1IgyJI6Gc= 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:in-reply-to :references:mime-version:content-transfer-encoding; bh=F38Dnlms1Mt+XxDV9VWItCge0nndNpDuRnBu/tUwcZQ=; b=YxsGO8TN9PpkLGJiVu3wvqyaWPgdM4t9a1JvLDkQ8nBttKaEPFUfev9L6Y6mYCr5EN VOhp5tirxcMlg4v+eI+FuHCvlNb/1/XP70ym1YJKGJ8IUjIO/JcSu5eAaonzwbR4BIkh j807KI26jkRg04BNDTpjliqbj10vxPYlxU6NPMdkzAWanUCWeFtAEbvdtwSStxQ9JUpW /g2/7NK3/VLv+aXXDusroENzduI5oJcveGUrJKV0smf4Y+v/xLq+PEDIvj1CEj0cqcr0 4/vyJbuuC+od0E1iWXVfrcchnHjhQEvRCeotXplYOek3QKWBZz68F3rlvKRFTzNIxu76 Xz9g== X-Gm-Message-State: AOAM533KxGS6hgZ0E/FjszhgMIfMcB+GE2cGAypJ7koMIro/rYk/UMqA +I8mEWTUSBuNrpr+HDrAYJNiRGCXqHiyjRxA X-Google-Smtp-Source: ABdhPJyp8VtRfliZgsMtswIy/K6H9tU5DdmZFElVq4BTXmDTE0SGFk/Ne33u1JkCp3FgDrgJEitiyw== X-Received: by 2002:a05:600c:299:: with SMTP id 25mr7406857wmk.183.1611821411603; Thu, 28 Jan 2021 00:10:11 -0800 (PST) Received: from p1g2.home (2a01cb000f9f0e008f0bd0d6ec94dd0e.ipv6.abo.wanadoo.fr. [2a01:cb00:f9f:e00:8f0b:d0d6:ec94:dd0e]) by smtp.gmail.com with ESMTPSA id h1sm6129677wrr.73.2021.01.28.00.10.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Jan 2021 00:10:10 -0800 (PST) From: Gary Bisson To: u-boot@lists.denx.de Cc: xypron.glpk@gmx.de, sjg@chromium.org, m.szyprowski@samsung.com, Gary Bisson Subject: [PATCH v2] disk: part_dos: update partition table entries after write Date: Thu, 28 Jan 2021 09:10:07 +0100 Message-Id: <20210128081007.10587-1-gary.bisson@boundarydevices.com> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20210127201944.9098-1-gary.bisson@boundarydevices.com> References: <20210127201944.9098-1-gary.bisson@boundarydevices.com> MIME-Version: 1.0 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.102.3 at phobos.denx.de X-Virus-Status: Clean Fixes issues when switching from GPT to MBR partition tables. Signed-off-by: Gary Bisson Acked-by: Marek Szyprowski --- Changes for v2: - added part_init() inside write_mbr_partitions(), as suggested by Heinrich --- disk/part_dos.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/disk/part_dos.c b/disk/part_dos.c index f431925745c..60addc6e00d 100644 --- a/disk/part_dos.c +++ b/disk/part_dos.c @@ -423,6 +423,9 @@ int write_mbr_partitions(struct blk_desc *dev, ext_part_sect = next_ebr; } + /* Update the partition table entries*/ + part_init(dev_desc); + return 0; } @@ -499,6 +502,9 @@ int write_mbr_sector(struct blk_desc *dev_desc, void *buf) return 1; } + /* Update the partition table entries*/ + part_init(dev_desc); + return 0; }