All of lore.kernel.org
 help / color / mirror / Atom feed
From: Simon Glass <sjg@chromium.org>
To: U-Boot Mailing List <u-boot@lists.denx.de>
Cc: Dennis Gilmore <dennis@ausil.us>,
	Lukas Auer <lukas.auer@aisec.fraunhofer.de>,
	Daniel Schwierzeck <daniel.schwierzeck@gmail.com>,
	Tom Rini <trini@konsulko.com>,
	Michal Simek <michal.simek@xilinx.com>,
	Ilias Apalodimas <ilias.apalodimas@linaro.org>,
	Steffen Jaeckel <jaeckel-floss@eyet-services.de>,
	Simon Glass <sjg@chromium.org>, Marek Vasut <marex@denx.de>,
	Pavel Herrmann <morpheus.ibis@gmail.com>
Subject: [PATCH v5 09/34] test: dm: Restart USB before assuming it is stopped
Date: Sun, 24 Apr 2022 23:31:02 -0600	[thread overview]
Message-ID: <20220425053127.19950-10-sjg@chromium.org> (raw)
In-Reply-To: <20220425053127.19950-1-sjg@chromium.org>

Update the blk test to stop USB first, in case another test has started
it.

Signed-off-by: Simon Glass <sjg@chromium.org>
---

(no changes since v1)

 test/dm/blk.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/test/dm/blk.c b/test/dm/blk.c
index 8556cc7159c..85c3a3bd45c 100644
--- a/test/dm/blk.c
+++ b/test/dm/blk.c
@@ -15,6 +15,9 @@
 
 DECLARE_GLOBAL_DATA_PTR;
 
+/* Allow resetting the USB-started flag */
+extern char usb_started;
+
 /* Test that block devices can be created */
 static int dm_test_blk_base(struct unit_test_state *uts)
 {
@@ -66,8 +69,11 @@ static int dm_test_blk_usb(struct unit_test_state *uts)
 	struct udevice *usb_dev, *dev;
 	struct blk_desc *dev_desc;
 
+	usb_started = false;
+
 	/* Get a flash device */
 	state_set_skip_delays(true);
+	ut_assertok(usb_stop());
 	ut_assertok(usb_init());
 	ut_assertok(uclass_get_device(UCLASS_MASS_STORAGE, 0, &usb_dev));
 	ut_assertok(blk_get_device_by_str("usb", "0", &dev_desc));
-- 
2.36.0.rc2.479.g8af0fa9b8e-goog


  parent reply	other threads:[~2022-04-25  5:33 UTC|newest]

Thread overview: 36+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-04-25  5:30 [PATCH v5 00/34] Initial implementation of standard boot Simon Glass
2022-04-25  5:30 ` [PATCH v5 01/34] lib: Move string tests to the string module Simon Glass
2022-04-25  5:30 ` [PATCH v5 02/34] test: Add tests for trailing_strtol() Simon Glass
2022-04-25  5:30 ` [PATCH v5 03/34] lib: Correct comment formatting to avoid sphinx problems Simon Glass
2022-04-25  5:30 ` [PATCH v5 04/34] lib: Fix a few bugs in trailing_strtoln() Simon Glass
2022-04-25  5:30 ` [PATCH v5 05/34] lib: Add a way to find the postiion of a trailing number Simon Glass
2022-04-25  5:30 ` [PATCH v5 06/34] dm: core: Rename and fix uclass_get_by_name_len() Simon Glass
2022-04-25  5:31 ` [PATCH v5 07/34] dm: core: Allow finding a uclass device by partial name Simon Glass
2022-04-25  5:31 ` [PATCH v5 08/34] test: fastboot: Avoid using mmc1 Simon Glass
2022-04-25  5:31 ` Simon Glass [this message]
2022-04-25  5:31 ` [PATCH v5 10/34] dm: blk: Add a function to return the device type Simon Glass
2022-04-25  5:31 ` [PATCH v5 11/34] fs: Add a function to set the filesystem type Simon Glass
2022-04-25  5:31 ` [PATCH v5 12/34] bootstd: Add the concept of a bootflow Simon Glass
2022-04-25  5:31 ` [PATCH v5 13/34] bootstd: Add the bootstd uclass and core implementation Simon Glass
2022-04-25  5:31 ` [PATCH v5 14/34] bootstd: Add the bootdev uclass Simon Glass
2022-04-25  5:31 ` [PATCH v5 15/34] bootstd: Add the bootmeth uclass and helpers Simon Glass
2022-04-25  5:31 ` [PATCH v5 16/34] bootstd: Add support for bootflows Simon Glass
2022-04-25  5:31 ` [PATCH v5 17/34] bootstd: Add a bootdev command Simon Glass
2022-04-25  5:31 ` [PATCH v5 18/34] bootstd: Add a bootflow command Simon Glass
2022-04-25  5:31 ` [PATCH v5 19/34] bootstd: Add a bootmeth command Simon Glass
2022-04-25  5:31 ` [PATCH v5 21/34] bootstd: mmc: Add a bootdev driver Simon Glass
2022-04-25  5:31 ` [PATCH v5 22/34] bootstd: ethernet: " Simon Glass
2022-04-25  5:31 ` [PATCH v5 23/34] bootstd: Add an implementation of distro PXE boot Simon Glass
2022-04-25  5:31 ` [PATCH v5 24/34] bootstd: Add an implementation of EFI boot Simon Glass
2022-04-25  5:31 ` [PATCH v5 26/34] bootstd: Add an implementation of EFI bootmgr Simon Glass
2022-04-25  5:31 ` [PATCH v5 27/34] bootstd: Add a sandbox bootmeth driver Simon Glass
2022-04-25  5:31 ` [PATCH v5 29/34] bootstd: Add an implementation of script boot Simon Glass
2022-04-25  5:31 ` [PATCH v5 30/34] bootstd: usb: Add a bootdev driver Simon Glass
2022-04-25  5:31 ` [PATCH v5 31/34] bootstd: Add tests for bootstd including all uclasses Simon Glass
2022-04-25  5:31 ` [PATCH v5 32/34] bootstd: Add setup for the bootflow tests Simon Glass
2022-05-09 18:06   ` Heinrich Schuchardt
2022-04-25  5:31 ` [PATCH v5 33/34] bootstd: doc: Add documentation Simon Glass
2022-04-25  5:31 ` [PATCH v5 34/34] bootstd: Provide a default command Simon Glass
2022-04-25 22:50 ` [PATCH v5 00/34] Initial implementation of standard boot Tom Rini
2022-04-26  4:55   ` Peter Robinson
2022-04-26 12:17     ` Tom Rini

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220425053127.19950-10-sjg@chromium.org \
    --to=sjg@chromium.org \
    --cc=daniel.schwierzeck@gmail.com \
    --cc=dennis@ausil.us \
    --cc=ilias.apalodimas@linaro.org \
    --cc=jaeckel-floss@eyet-services.de \
    --cc=lukas.auer@aisec.fraunhofer.de \
    --cc=marex@denx.de \
    --cc=michal.simek@xilinx.com \
    --cc=morpheus.ibis@gmail.com \
    --cc=trini@konsulko.com \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.