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 4C8E5C433F5 for ; Tue, 8 Feb 2022 23:27:37 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id EAFE883E03; Wed, 9 Feb 2022 00:27:20 +0100 (CET) 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="JCF88Ac/"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 6E9CB83D36; Wed, 9 Feb 2022 00:27:19 +0100 (CET) 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 11AEB83DAB for ; Wed, 9 Feb 2022 00:27:15 +0100 (CET) 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 submission3.mail.transip.nl (unknown [10.100.4.72]) by outbound2.mail.transip.nl (Postfix) with ESMTP id 4JtfLB4xPWzYdD7; Wed, 9 Feb 2022 00:27:14 +0100 (CET) Received: from Dantrag.scratch.mit.edu (ftth-213-233-205-025.solcon.nl [213.233.205.25]) by submission3.mail.transip.nl (Postfix) with ESMTPA id 4JtfL96v5Jz43Tv1; Wed, 9 Feb 2022 00:27:13 +0100 (CET) From: Rogier Stam To: u-boot@lists.denx.de Cc: Rogier Stam Subject: [PATCH 2/2] Add SCSI scan for ENV in EXT4 or FAT Date: Wed, 9 Feb 2022 00:27:01 +0100 Message-Id: <1644362821-9002-3-git-send-email-rogier@unrailed.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1644362821-9002-1-git-send-email-rogier@unrailed.org> References: <1644362821-9002-1-git-send-email-rogier@unrailed.org> X-Scanned-By: ClueGetter at submission3.mail.transip.nl DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; s=transip-a; d=unrailed.org; t=1644362834; h=from:subject:to:cc: references:in-reply-to:date; bh=pWclSW6dNF0j6LpanISY2FcEtmI5XUYBbsl4H8jyiYw=; b=JCF88Ac/EZCHCJC+CIQsDmkyzCejVAKhdxMWcLb1qfDPAEJ6Anp24yktUTUsZldsCVmIbu HggYeDtbB+XlrjPw8j9s1WRPOe8uyiaEpEupxLKI5W7vFII8G7HOCh1Cb2YQSroh2RCCmU +u/ZEdrRiwKHfOsdHlwCpxEQyPVMYnyfmyXty3SC9T5nPXH7GqjrTizqwj7K9W7Q6hNVTU UEdrKNEzVAlKH+1u4xGYKQWPX5Fn6tH4CjhX9rvJ8fJxMnwKD0V8jqbCuGGE04tztAIIUQ mhL5qUHTmMzUf8EoSZ4wOuxdj8yvi+/if+YbcI0JQgpX3TbnhpB25+89O4S6qw== 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 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 --- env/ext4.c | 5 +++++ env/fat.c | 5 +++++ 2 files changed, 10 insertions(+) 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 fdccd6c..dbd6a13 100644 --- a/env/fat.c +++ b/env/fat.c @@ -17,6 +17,7 @@ #include #include #include +#include #include #include #include @@ -122,6 +123,10 @@ static int env_fat_load(void) if (!strcmp(CONFIG_ENV_FAT_INTERFACE, "mmc")) mmc_initialize(NULL); #endif +#if defined(CONFIG_AHCI) || defined(CONFIG_SCSI) + if (!strcmp(CONFIG_ENV_FAT_INTERFACE, "scsi")) + scsi_scan(true); +#endif part = blk_get_device_part_str(CONFIG_ENV_FAT_INTERFACE, env_fat_device_and_part(), -- 2.7.4