Skip to contentSkip to conversation

config_distro_bootcmd: Run 'scsi scan' before trying scsi disks

PATCH New Hans de Goede 1 participant 1 message Sep 15, 2014

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 config_distro_bootcmd: Run 'scsi scan' before trying scsi disks

Scsi disks need to be probed before we try to access them, otherwise all accesses fail with: ** Bad device size - scsi 0 **.

---
 include/config_distro_bootcmd.h | 17 +++++++++++++++--
 1 file changed, 15 insertions(+), 2 deletions(-)
include/config_distro_bootcmd.h +15 -2
index 90d9901..be616e8 100644
@@ -53,10 +53,23 @@
 #endif
 
 #ifdef CONFIG_CMD_SCSI
-#define BOOTENV_SHARED_SCSI	BOOTENV_SHARED_BLKDEV(scsi)
+#define BOOTENV_RUN_SCSI_INIT "run scsi_init; "
+#define BOOTENV_SET_SCSI_NEED_INIT "setenv scsi_need_init; "
+#define BOOTENV_SHARED_SCSI \
+	"scsi_init=" \
+		"if ${scsi_need_init}; then " \
+			"setenv scsi_need_init false; " \
+			"scsi scan; " \
+		"fi\0" \
+	\
+	"scsi_boot=" \
+		BOOTENV_RUN_SCSI_INIT \
+		BOOTENV_SHARED_BLKDEV_BODY(scsi)
 #define BOOTENV_DEV_SCSI	BOOTENV_DEV_BLKDEV
 #define BOOTENV_DEV_NAME_SCSI	BOOTENV_DEV_NAME_BLKDEV
 #else
+#define BOOTENV_RUN_SCSI_INIT
+#define BOOTENV_SET_SCSI_NEED_INIT
 #define BOOTENV_SHARED_SCSI
 #define BOOTENV_DEV_SCSI \
 	BOOT_TARGET_DEVICES_references_SCSI_without_CONFIG_CMD_SCSI
@@ -189,7 +202,7 @@
 	\
 	BOOT_TARGET_DEVICES(BOOTENV_DEV)                                  \
 	\
-	"bootcmd=" BOOTENV_SET_USB_NEED_INIT                              \
+	"bootcmd=" BOOTENV_SET_USB_NEED_INIT BOOTENV_SET_SCSI_NEED_INIT   \
 		"for target in ${boot_targets}; do "                      \
 			"run bootcmd_${target}; "                         \
 		"done\0"
Signature · 26 lines
2.1.0


--------------090803010205010701090202
Content-Type: text/x-patch;
 name="0001-config_distro_bootcmd-Run-scsi-scan-before-trying-sc.patch"
Content-Transfer-Encoding: quoted-printable
Content-Disposition: attachment;
 filename*0="0001-config_distro_bootcmd-Run-scsi-scan-before-trying-sc.pa";
 filename*1="tch"

=46rom 19298d4bfff28bba6f44fcf80530106306221412 Mon Sep 17 00:00:00 2001
From: Hans de Goede <[email protected]>
Date: Mon, 15 Sep 2014 19:55:49 +0200
Subject: [PATCH] config_distro_bootcmd: Run 'scsi scan' before trying scs=
i
 disks

Scsi disks need to be probed before we try to access them, otherwise all
accesses fail with: ** Bad device size - scsi 0 **.

Reported-by: Karsten Merker <[email protected]>
Signed-off-by: Hans de Goede <[email protected]>
---
 include/config_distro_bootcmd.h | 17 +++++++++++++++--
 1 file changed, 15 insertions(+), 2 deletions(-)
include/config_distro_boot= renamed from include/config_distro_bootcmd.h +0 -0

cmd.h
index 90d9901..be616e8 100644

include/config_distro_bootcmd.h +0 -0
@@ -53,10 +53,23 @@
 #endif

=20
#ifdef CONFIG_CMD_SCSI
-#define BOOTENV_SHARED_SCSI BOOTENV_SHARED_BLKDEV(scsi)
+#define BOOTENV_RUN_SCSI_INIT "run scsi_init; " +#define BOOTENV_SET_SCSI_NEED_INIT "setenv scsi_need_init; " +#define BOOTENV_SHARED_SCSI \
+ "scsi_init=3D" \
+ "if ${scsi_need_init}; then " \
+ "setenv scsi_need_init false; " \
+ "scsi scan; " \
+ "fi\0" \
+ \
+ "scsi_boot=3D" \
+ BOOTENV_RUN_SCSI_INIT \
+ BOOTENV_SHARED_BLKDEV_BODY(scsi)
#define BOOTENV_DEV_SCSI BOOTENV_DEV_BLKDEV
#define BOOTENV_DEV_NAME_SCSI BOOTENV_DEV_NAME_BLKDEV
#else
+#define BOOTENV_RUN_SCSI_INIT
+#define BOOTENV_SET_SCSI_NEED_INIT
#define BOOTENV_SHARED_SCSI
#define BOOTENV_DEV_SCSI \
BOOT_TARGET_DEVICES_references_SCSI_without_CONFIG_CMD_SCSI
@@ -189,7 +202,7 @@
\
BOOT_TARGET_DEVICES(BOOTENV_DEV) \
\
- "bootcmd=3D" BOOTENV_SET_USB_NEED_INIT \
+ "bootcmd=3D" BOOTENV_SET_USB_NEED_INIT BOOTENV_SET_SCSI_NEED_INIT \
"for target in ${boot_targets}; do " \
"run bootcmd_${target}; " \
"done\0"
--=20
2.1.0

--------------090803010205010701090202--