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 D7ABEC433F5 for ; Wed, 19 Jan 2022 01:45:18 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 75BFD837B6; Wed, 19 Jan 2022 02:44:27 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.b="cF/Igf3c"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 249A7836CF; Wed, 19 Jan 2022 02:43:57 +0100 (CET) Received: from mail-io1-xd29.google.com (mail-io1-xd29.google.com [IPv6:2607:f8b0:4864:20::d29]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 66B46836E6 for ; Wed, 19 Jan 2022 02:43:47 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=sjg@chromium.org Received: by mail-io1-xd29.google.com with SMTP id w7so967533ioj.5 for ; Tue, 18 Jan 2022 17:43:47 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=Ru3Yz7/9Izcohxdw0moOhYO92yJXEWW7vNDjwBQdrJQ=; b=cF/Igf3cRNqFmjzpauxQbJjVPMBZ/Gmz0IPAifY5ayFndLn0t7GTi9jBXFTEQSbC2b keZd3soAAkdv0W66qW8aUaEe+oDp/4Ig2p8GAWtCOIs83TW6xYuZi01Mzq1OcK1magoF t7+S2eZh4UfKXetK+pmT+e71Gi2KmJbFs9YeM= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=Ru3Yz7/9Izcohxdw0moOhYO92yJXEWW7vNDjwBQdrJQ=; b=HbJc69xuNRaohD1i6wy4TXyIteOwTJsB7j9ABvtJDkfNDZ8zyqFk4NRfwd6oe2Q39t yKj7ptUHzQSEKN2NHPi18fdfoADowcKkUharZoCsxmavc5N9+YcV33cNpeJFtjBnXR8k nEDIphd95fJc4hl3j2I/HA96NfIWfn6uqudbkW4nCsSKSoMakqPabVqeBL7JmonQGqrZ /9lfawttVwQweF4gYrgX716RcbpPVclOa9R5XNW2C1kgunkdTJ8ygok1AzQOB4RoURvC p1slUrewfjsWuSFOdeVks+foPsBNLVnAYrb+WrDMCUAdLppDRvtxCThp/ndEkmvdqIua w44g== X-Gm-Message-State: AOAM531iw/tjlxblbhMYXJwHXdXfJfP21sALZL1ez0keJE2U0OM4A/q2 NZKEaP+hSppsALW2N8homUNE3mIfiDZEgg== X-Google-Smtp-Source: ABdhPJztbKSSVkixyNCJGARCpDUBA7vf8jEqGxqGVb1rB/tpMWAWNAC+qBSNLOrMKFIKkElixGPZjQ== X-Received: by 2002:a05:6638:11ce:: with SMTP id g14mr1909161jas.188.1642556626074; Tue, 18 Jan 2022 17:43:46 -0800 (PST) Received: from kiwi.bld.corp.google.com (c-67-190-101-114.hsd1.co.comcast.net. [67.190.101.114]) by smtp.gmail.com with ESMTPSA id j18sm10546314ila.86.2022.01.18.17.43.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 18 Jan 2022 17:43:45 -0800 (PST) From: Simon Glass To: U-Boot Mailing List Cc: Ilias Apalodimas , Daniel Schwierzeck , Dennis Gilmore , Steffen Jaeckel , Lukas Auer , Michal Simek , Tom Rini , Heinrich Schuchardt , Simon Glass , Marek Vasut , Pavel Herrmann Subject: [PATCH v3 08/31] test: dm: Restart USB before assuming it is stopped Date: Tue, 18 Jan 2022 18:42:52 -0700 Message-Id: <20220119014315.1938157-9-sjg@chromium.org> X-Mailer: git-send-email 2.34.1.703.g22d0c6ccf7-goog In-Reply-To: <20220119014315.1938157-1-sjg@chromium.org> References: <20220119014315.1938157-1-sjg@chromium.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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.2 at phobos.denx.de X-Virus-Status: Clean Update the blk test to stop USB first, in case another test has started it. Signed-off-by: Simon Glass --- (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 deccf05289b..b5957a20fb0 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.34.1.703.g22d0c6ccf7-goog