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 BF5F5C433F5 for ; Wed, 11 May 2022 21:20:53 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id EE2C083EB9; Wed, 11 May 2022 23:20:43 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=unrailed.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; secure) header.d=unrailed.org header.i=@unrailed.org header.b="v0/aJv9A"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 3D25F840AD; Wed, 11 May 2022 23:20:41 +0200 (CEST) Received: from outbound2.mail.transip.nl (outbound2.mail.transip.nl [IPv6:2a01:7c8:7c8::73]) (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 018B383D7D for ; Wed, 11 May 2022 23:20:36 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=unrailed.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=rogier@unrailed.org Received: from submission15.mail.transip.nl (unknown [10.103.8.166]) by outbound2.mail.transip.nl (Postfix) with ESMTP id 4Kz79c4xzfzYcyk; Wed, 11 May 2022 23:20:36 +0200 (CEST) Received: from Dantrag.scratch.mit.edu (ftth-213-233-205-025.solcon.nl [213.233.205.25]) by submission15.mail.transip.nl (Postfix) with ESMTPA id 4Kz79c0LV8z3ws8; Wed, 11 May 2022 23:20:36 +0200 (CEST) From: rogier@unrailed.org To: sr@denx.de, sjg@chromium.org, u-boot@lists.denx.de, pali@kernel.org Cc: Rogier Stam Subject: [PATCH v2] Add SCSI scan for ENV in EXT4 or FAT Date: Wed, 11 May 2022 23:20:28 +0200 Message-Id: <1652304028-23508-2-git-send-email-rogier@unrailed.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1652304028-23508-1-git-send-email-rogier@unrailed.org> References: <1652304028-23508-1-git-send-email-rogier@unrailed.org> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Scanned-By: ClueGetter at submission15.mail.transip.nl DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; s=transip-a; d=unrailed.org; t=1652304036; h=from:subject:to:cc: references:in-reply-to:date:mime-version:content-type; bh=ITY5CycotcgCGlaBxOfEAezIMvudGx/kJntctuimJwY=; b=v0/aJv9AswGqHqE0fO88cpzBmktHwwIu4Z4HMZAgtzZp8sywoA1bvtj3HAS3Uu6LvrnmUS 1AwcEbwffJ2A7ZEBBiDVNBRCtCq0OgBe2etfOSn5PVxQQ1OtKbIsXU+LgiVjMoC5gC0sYn WbKvjkb03xySPhfmytPlBIWTHcHt5jRN8BAA850W/ICm2wUzKAWk4yapqcrPFwlxrMM6Mr n1q65/TrEvjaLop6ZIN7PqO+uZYHAeZoPOkPb1A/C39bMsd+oiZPCUPiwLydQajZxOKtX3 d+zaQYyHS0UYVJaqS/VpRSFQ8tjrp3sZzsTm3/85XO140n0+/+tg4FKQp8Ox8w== X-Report-Abuse-To: abuse@transip.nl 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 From: Rogier Stam When having environment stored in EXT4 or FAT and using an AHCI or SCSI device / partition the scan would not be performed early enough and hence the device would not be recognized. This change adds the scan when the interface is "scsi" in a similar way to mmc_initialize. Signed-off-by: Rogier Stam Reviewed-by: Pali Rohár --- env/ext4.c | 5 +++++ env/fat.c | 8 +++++++- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/env/ext4.c b/env/ext4.c index 9f65afb..47e05a4 100644 --- a/env/ext4.c +++ b/env/ext4.c @@ -31,6 +31,7 @@ #include #include #include +#include #include DECLARE_GLOBAL_DATA_PTR; @@ -146,6 +147,10 @@ static int env_ext4_load(void) if (!strcmp(ifname, "mmc")) mmc_initialize(NULL); #endif +#if defined(CONFIG_AHCI) || defined(CONFIG_SCSI) + if (!strcmp(ifname, "scsi")) + scsi_scan(true); +#endif part = blk_get_device_part_str(ifname, dev_and_part, &dev_desc, &info, 1); diff --git a/env/fat.c b/env/fat.c index 6251d96..3172130 100644 --- a/env/fat.c +++ b/env/fat.c @@ -17,6 +17,7 @@ #include #include #include +#include #include #include #include @@ -128,7 +129,12 @@ static int env_fat_load(void) if (!strcmp(ifname, "mmc")) mmc_initialize(NULL); #endif - +#ifndef CONFIG_SPL_BUILD +#if defined(CONFIG_AHCI) || defined(CONFIG_SCSI) + if (!strcmp(CONFIG_ENV_FAT_INTERFACE, "scsi")) + scsi_scan(true); +#endif +#endif part = blk_get_device_part_str(ifname, dev_and_part, &dev_desc, &info, 1); if (part < 0) -- 2.7.4