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 X-Spam-Level: X-Spam-Status: No, score=-10.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id F1A4CC4338F for ; Wed, 25 Aug 2021 01:20:25 +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 611BF6121E for ; Wed, 25 Aug 2021 01:20:25 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 611BF6121E Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com 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 797BF82DB0; Wed, 25 Aug 2021 03:20:23 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="l8tKplSQ"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id D407B8032E; Tue, 24 Aug 2021 17:30:11 +0200 (CEST) Received: from mail-ej1-x633.google.com (mail-ej1-x633.google.com [IPv6:2a00:1450:4864:20::633]) (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 23DAE81BC0 for ; Tue, 24 Aug 2021 17:30:05 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=thibaultferrante@gmail.com Received: by mail-ej1-x633.google.com with SMTP id ia27so22984911ejc.10 for ; Tue, 24 Aug 2021 08:30:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=SV5i5mqWm8c2WiYKns9XZ8rZVc8YpeYtrSKc68F7I7k=; b=l8tKplSQMqsRY58gwsTzGGGiBnBCnMP9LfvZHl1wFFc462IcIW5W/+NVpuwKQWRVD3 UQWTW8H4NjYBia5QqmvWZnIWi+xPQQNYHwSw6nIKxgWiwbrttLQx7KGJJWEH8A6roYCg 4Jc+i8yb+RxG8bZMm8IS36AS1eDEC7yi61pvarBlwi/SSjdtuQg2Ab822MUmJKY72FUx NFcAId+oYB9WitfII/XgoNdrD/oDzFMJ0q23Ds8YfBdtlqc0mdJpn2WC5rs0odoNSkfQ DDtVW8qf+UG3hA22ak7xuoJsVOD3PzrJ4lcMGw2C8cHqYtri8dA5YWTwF/2BZuZhpSbn V/cw== 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:mime-version :content-transfer-encoding; bh=SV5i5mqWm8c2WiYKns9XZ8rZVc8YpeYtrSKc68F7I7k=; b=rulfQdjtJ3ZH1o/2gMfK7yh0C2qrKCiPwM1RcL43Y8V5K1bbEgCZrE8ze/BKT8SlO9 kdLyXjHr8SkZZ5+OMwpjQFARQToHkCNvgD0DdyNSoqusLK3taFC3bCPlwhk1OiS/otVF oj9VqG2ofOMilxCNigztwyId1afQ89R82u5o/wcgc2GSxHoDmiDD/R8cE8C9D4fzOLAS 9jFrRIDSaw+CVnKi1VeVaQHdD19gFgCytRAAHGABuanZ33yIQdnJn9DxygyvRq5nBUy+ RXitzM/GzTSaPuVUZEC4hJQuhp/2e1y1qSBgOAQe5Xbg/rJ5m5YW1CWCru0QwzFHr5eZ JYHg== X-Gm-Message-State: AOAM532aJD2U23mwLjiwQndtARQQqgDQbVv7xZlh9xs8ku762aJMCTWP KEJqvTGELbj3uOVuW5VNcU3fAFc/i6HrWMes X-Google-Smtp-Source: ABdhPJy2HQCTUNky9hSlOTCe4nB7juZ2EH2ZJlMWXMCfgYTMQFPbeYbIBjjgdTdAkqKvc+39QtjMFQ== X-Received: by 2002:a17:907:174b:: with SMTP id lf11mr14066838ejc.35.1629819004574; Tue, 24 Aug 2021 08:30:04 -0700 (PDT) Received: from thibf-XPS-13-9380.fritz.box ([2a10:3781:1636:1:117e:a790:cac9:e365]) by smtp.googlemail.com with ESMTPSA id c6sm9420038eje.105.2021.08.24.08.30.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 24 Aug 2021 08:30:04 -0700 (PDT) From: Thibault Ferrante X-Google-Original-From: Thibault Ferrante To: u-boot@lists.denx.de Cc: wd@denx.de, joe.hershberger@ni.com, hws@denx.de, alex.kiernan@gmail.com, lg@denx.de, Thibault Ferrante , =?UTF-8?q?Martin=20Hundeb=C3=B8ll?= Subject: [PATCH 0/1] tools: env: Handle shorter read calls Date: Tue, 24 Aug 2021 17:29:49 +0200 Message-Id: <20210824152950.919452-1-thibault.ferrante@gmail.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Mailman-Approved-At: Wed, 25 Aug 2021 03:20:22 +0200 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 specific devices, read can return less bytes than expected. I noticed this problem on a EEPROM chip with 16Kbyte of memory. Defining an environment with more than 4Kbyte leads to less bytes read than expected and failures from fw_printenv/fw_setenv. This patch target to handle this issue by doing multiple reads instead of exiting directly. Thibault Ferrante (1): tools: env: Handle shorter read calls tools/env/fw_env.c | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) -- 2.25.1