From patchwork Wed Nov 13 04:49:46 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Caleb Connolly X-Patchwork-Id: 842870 Delivered-To: patch@linaro.org Received: by 2002:a5d:6392:0:b0:381:e71e:8f7b with SMTP id p18csp19391wru; Tue, 12 Nov 2024 20:50:05 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCUeN4QPIpnyVKDlxSwKu2LmmMmZU2FcmcyAsckcT2PMjsdv2NK/izTUXX2M4EqLXNh6LQ8wsA==@linaro.org X-Google-Smtp-Source: AGHT+IEpRQMZR48Mx/kwEvw6WsYbv0J844OevFm41Z8bXaP/Gz3gFMARdlkU6qpRlpEfeqNG2MVv X-Received: by 2002:a05:6402:2351:b0:5cf:4687:b816 with SMTP id 4fb4d7f45d1cf-5cf4f3c08bdmr4268109a12.31.1731473405372; Tue, 12 Nov 2024 20:50:05 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1731473405; cv=none; d=google.com; s=arc-20240605; b=JxtKv7s3svJgp7WqPK1RjIYn9GaCS/l1DGT75rheugTONdofNE+XE+A0e4IlvHH0y+ mHkJtrjOydmpFtmdnj8enPwMVKIhSm+oGMK7A8Jws5IMSq03SxmPOUJkvoUJAtG7Il34 b8RjZFCQMd21e3kBcVVxD5lR+WlhwD+Wgci+xxndAk3InoUd2TV6+niyNwISF9Bwsa5c uvctBdrztqDSJ09hW16Y3zSm/IecfugCPoS65ixNHnGw+WhPr3xvxWGjcKmuNlVhWL71 C/8g16WqNkzRfaxYKhqMt3pfploap/38gUqGiS501eBcbqE6n9RiHxWXWc3jqcwGtlDC 6ttQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:message-id:date:subject:cc:to:from:dkim-signature; bh=Pku2bhDKDLK/dBIWCLpSXuhollEghV1AN0DdaW6alEo=; fh=wYQhm58CqYTVkFUy2W/sdoVgTeabBlAd1NgNChHPG70=; b=MyknPfXNFAbG/EgS/uS1rfosN0t6uVJJpd14lz8Tc6msXnGIQZWxquvZmQZ9WckYzd x18XKlAvVFfMyjOlfYSM6Spj6RcArJfFS9hHKjd2E4xXYE12n26G50l62Ig7risssTPC j/UBCEHWqIYWYiBfvDAk78oo3GZgu97FTvqZB3iFBvbWiHzwJ8COdqAUpuACDw4gXN6D VY+uQxTJF/qA4hK+EKwgs/rBiQYaPvPIwxByJGExI9vLSL3AxmkGZmpu/1G2H1mZJYwG X/NjczkIzoceHSmZBXsu5WNWd+z8cdwZslYIUVINQaNsw8n61Iq5VOEJ9H0JQ1DJPORs I2mQ==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=DWhSFFdg; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Return-Path: Received: from phobos.denx.de (phobos.denx.de. [85.214.62.61]) by mx.google.com with ESMTPS id 4fb4d7f45d1cf-5cf644890a7si532934a12.549.2024.11.12.20.50.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 Nov 2024 20:50:05 -0800 (PST) Received-SPF: pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 as permitted sender) client-ip=85.214.62.61; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=DWhSFFdg; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 51C8B8952B; Wed, 13 Nov 2024 05:50:04 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org 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=linaro.org header.i=@linaro.org header.b="DWhSFFdg"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 9B0C789537; Wed, 13 Nov 2024 05:50:02 +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.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_BLOCKED, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-ed1-x52f.google.com (mail-ed1-x52f.google.com [IPv6:2a00:1450:4864:20::52f]) (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 8F24E89515 for ; Wed, 13 Nov 2024 05:50:00 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=caleb.connolly@linaro.org Received: by mail-ed1-x52f.google.com with SMTP id 4fb4d7f45d1cf-5cec93719ccso8333697a12.2 for ; Tue, 12 Nov 2024 20:50:00 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1731473400; x=1732078200; darn=lists.denx.de; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=Pku2bhDKDLK/dBIWCLpSXuhollEghV1AN0DdaW6alEo=; b=DWhSFFdgr/zFuYPAOfGYcBdm0PA8eSHwbisdk4Nzd14accO1y3M3dofSiFEVHolA9L ryjVrK3C5O0Oc68yF4H0xJaHEKngCK8ygfF7aZ9UHwe+EAZXIRZgpD5MgVs7yyo8XgDj bJ1/Geivm+lnS/2jMygB14eT6I0oLbmfvfjRPWeGaFVyEp0m/FrDfsaMGoAcXAPL9NPl EnxjGcKSkekc/a5ZrSl1sroOcEM2XqlQpFWUN/kjy//RjNW1mMRg9mmoZh7g1Q9ra93k 8jQvcKSbEW0wIl5ujZHLXxGpCBxAedb5Jl3yifTyJUcAeAw8f/DZGK4YR2r+LDKM5S7d EZqg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1731473400; x=1732078200; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=Pku2bhDKDLK/dBIWCLpSXuhollEghV1AN0DdaW6alEo=; b=qK4AqA0UuvgeIOGEoQVqqxp+5Z9Gv2Sk+5QqKVtuuzF02vcWi+lIrwQj4aV5DHd91C Av+4YxfL629q/DUg3jIafnCVqW+J75/k3DHKeBgDTnVRgcg80PHu8pGKCjgzbfSaiYXb rTJKsW27TFbyKlWonivwl2Hzq3VLuQ2KwO6x6WWXzdnu/h+1tu8ESWhZNN2PI35D2lJs NdhyAmO1EVm1sw8F4jQ8U0YxXgwuNTFe512YN3P5DzM7Hj4XaVU/cym17eFrgH4nw/n8 Fox7/T8MDm1eCBlrQXiPpIww1EBlhnBpWdymepun8QmG/mvDblquxzsDDGtTrXay9Tfn d1Jg== X-Forwarded-Encrypted: i=1; AJvYcCUMEybWVJJ2lLmkqHtbEJVtGdl454ZEpWlVOdniwcZ+l7OHFKb1eSZSm7xRFL05Dmabiih1dyE=@lists.denx.de X-Gm-Message-State: AOJu0Yygdotg7sMgdss4BMdYxdX2LPwFrfuuXkGK5YVbPKIXJ7DXnRxB 0MytfOhPjUvCE+C2WWBZnAwiCs+We0nzw7AedVTGnhLzFoYdkbeuTRWCJtfTBho= X-Received: by 2002:a05:6402:40ce:b0:5ce:fc3b:d46c with SMTP id 4fb4d7f45d1cf-5cf4f362882mr4755914a12.18.1731473399912; Tue, 12 Nov 2024 20:49:59 -0800 (PST) Received: from lion.caleb.rex.connolly.tech ([2a02:8109:888d:ff00:ca7f:54ff:fe52:4519]) by smtp.gmail.com with ESMTPSA id 4fb4d7f45d1cf-5cf642f9eabsm439241a12.23.2024.11.12.20.49.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 Nov 2024 20:49:58 -0800 (PST) From: Caleb Connolly To: Alexander Dahl , Caleb Connolly , Christian Taedcke , Heinrich Schuchardt , Ilias Apalodimas , Tom Rini Cc: u-boot-qcom@groups.io, u-boot@lists.denx.de Subject: [PATCH] fs: fat: allow FS and device to have mismatching sector sizes Date: Wed, 13 Nov 2024 05:49:46 +0100 Message-ID: <20241113044956.1836896-1-caleb.connolly@linaro.org> X-Mailer: git-send-email 2.47.0 MIME-Version: 1.0 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.8 at phobos.denx.de X-Virus-Status: Clean The Qualcomm Robotics RB1 and RB2 boards feature MMC storage provisioned with a 4k sector size GPT, with factory partitions formatted with filesystems using 512 byte sector sizes. Whilst certainly unusual, and really not ideal, this appears to work fine in practise. So demote this failure condition to a debug log. Signed-off-by: Caleb Connolly --- fs/fat/fat.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/fs/fat/fat.c b/fs/fat/fat.c index e2570e816768..a84ca301cad1 100644 --- a/fs/fat/fat.c +++ b/fs/fat/fat.c @@ -645,13 +645,12 @@ static int get_fs_info(fsdata *mydata) mydata->rootdir_sect = mydata->fat_sect + mydata->fatlength * bs.fats; mydata->sect_size = get_unaligned_le16(bs.sector_size); mydata->clust_size = bs.cluster_size; - if (mydata->sect_size != cur_part_info.blksz) { - log_err("FAT sector size mismatch (fs=%u, dev=%lu)\n", + if (mydata->sect_size != cur_part_info.blksz) + log_debug("FAT sector size mismatch (fs=%u, dev=%lu)\n", mydata->sect_size, cur_part_info.blksz); - return -1; - } + if (mydata->clust_size == 0) { log_err("FAT cluster size not set\n"); return -1; }