[PATCH] cmd/scsi: drop scsi reset command

David Lechner dlechner at baylibre.com
Thu Mar 26 21:39:52 CET 2026


Since commit b630f8b3aefc ("scsi: Forceably finish migration to DM_SCSI")
the "scsi reset" command has no possibility of actually resetting any
SCSI controller. Drop the command to avoid confusion that the command is
actually resetting the SCSI controller.

Signed-off-by: David Lechner <dlechner at baylibre.com>
---
This is just something I noticed while inspecting the code. Since it
has done nothing for a couple of years, it seems likely that no one is
using it, so hopefully can just be removed. And if anyone actually is 
using it, removing it should actually make them aware there is a problem
vs. currently silently not doing what was intended. In that case,
someone who actually uses it can re-implement it properly.
---
 cmd/scsi.c                 |  8 --------
 test/py/tests/test_scsi.py | 10 ----------
 2 files changed, 18 deletions(-)

diff --git a/cmd/scsi.c b/cmd/scsi.c
index 9f7613424e5..ad7d8a4b664 100644
--- a/cmd/scsi.c
+++ b/cmd/scsi.c
@@ -31,13 +31,6 @@ static int do_scsi(struct cmd_tbl *cmdtp, int flag, int argc,
 	int ret;
 
 	if (argc == 2) {
-		if (strncmp(argv[1], "res", 3) == 0) {
-			printf("\nReset SCSI\n");
-			ret = scsi_scan(true);
-			if (ret)
-				return CMD_RET_FAILURE;
-			return ret;
-		}
 		if (strncmp(argv[1], "scan", 4) == 0) {
 			ret = scsi_scan(true);
 			if (ret)
@@ -52,7 +45,6 @@ static int do_scsi(struct cmd_tbl *cmdtp, int flag, int argc,
 U_BOOT_CMD(
 	scsi, 5, 1, do_scsi,
 	"SCSI sub-system",
-	"reset - reset SCSI controller\n"
 	"scsi info  - show available SCSI devices\n"
 	"scsi scan  - (re-)scan SCSI bus\n"
 	"scsi device [dev] - show or set current device\n"
diff --git a/test/py/tests/test_scsi.py b/test/py/tests/test_scsi.py
index 2a35e47e558..4390ff65845 100644
--- a/test/py/tests/test_scsi.py
+++ b/test/py/tests/test_scsi.py
@@ -38,16 +38,6 @@ def scsi_setup(ubman):
 
     return dev_num, dev_type, dev_size
 
- at pytest.mark.buildconfigspec('cmd_scsi')
-def test_scsi_reset(ubman):
-    dev_num, dev_type, dev_size = scsi_setup(ubman)
-    output = ubman.run_command('scsi reset')
-    assert f'Device {dev_num}:' in output
-    assert f'Type: {dev_type}' in output
-    assert f'Capacity: {dev_size}' in output
-    output = ubman.run_command('echo $?')
-    assert output.endswith('0')
-
 @pytest.mark.buildconfigspec('cmd_scsi')
 def test_scsi_info(ubman):
     dev_num, dev_type, dev_size = scsi_setup(ubman)

---
base-commit: 80a4c49a4ab2ad06fa84a8b7bdf6e33b3b5101bf
change-id: 20260326-cmd-scsi-drop-reset-1675b567c2d9

Best regards,
--  
David Lechner <dlechner at baylibre.com>



More information about the U-Boot mailing list