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 9EE18C433FE for ; Mon, 16 May 2022 10:45:09 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 5B60384281; Mon, 16 May 2022 12:44:35 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=reject dis=none) header.from=google.com 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; unprotected) header.d=google.com header.i=@google.com header.b="YU5KEFgy"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 42F908424E; Mon, 16 May 2022 12:42:32 +0200 (CEST) Received: from mail-wm1-x34a.google.com (mail-wm1-x34a.google.com [IPv6:2a00:1450:4864:20::34a]) (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 900CA8424F for ; Mon, 16 May 2022 12:42:14 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=3hSqCYgYKBvwewgyppksskpi.gsqy-fssxpmwxw.hir1.hi@flex--ascull.bounces.google.com Received: by mail-wm1-x34a.google.com with SMTP id z23-20020a05600c221700b003942fd37764so10141552wml.8 for ; Mon, 16 May 2022 03:42:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=date:in-reply-to:message-id:mime-version:references:subject:from:to :cc; bh=A7ytoxFo/oOlpmL5VM+Et7s+VRzgp3+xRcNdfV+/dWo=; b=YU5KEFgyI7r/a/3YZ1WN/O6dBciZbLxA7fVZpnuevz7tq+tVbjnc6XHeywSr+Rl50i ccFoIHbRlq2sgKvySYch4IT3cZd8WR5Urpuj1zHZrQM+pv5JUlHj0LHVNOfR59jbSFUH 2zSrZQcrGcWUFMAJAii2PHwstaiLXn0BWAZ4Yd/bD083eIuBi7VCJupFsjIjxrGHlWZ/ 1JNP0M6UVQuXaJ4/cgiPTEjSwkTk/stX7TF/hHyO5dvbUyTt/My+QRLeUAIxRs/iZNA1 LC68ZEHTuLPnAiGXV9gXsvcvADaaZiT/8J5/Q9ofxIeBS5uomacWIk3WDqccGOLhR199 BSMg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:in-reply-to:message-id:mime-version :references:subject:from:to:cc; bh=A7ytoxFo/oOlpmL5VM+Et7s+VRzgp3+xRcNdfV+/dWo=; b=MBSEEScByfVZ/CZIQEmezrJsaxRIs2exH2yDBPpEVYR3xg8IfPt9Su9ofjlbla7sww A2D2utte3L1oN/Rr5c/FQ95pN9mqCj4w08Q3r2kFPYct1WiFQ/mv+3vQCBBIDiKoxnK5 BQVj/T72VCKKqbxKyFkBKP4wiGjjtMXEeccblRistUVfuPHawGhggDxWEp7/ZDpXQVEu DTzy96NUJc5nPemMFObpZ2k4G2auPo+VYOOD9IadF71dXnmtcgI17xZsT5ogOhBR/Oki j3uzKcLjZ6BCXIweJ3O7fLWBuu2qQCbvoLShoNekxke7pXIWWNv+eF19tLKN2Ybq5bOt za2w== X-Gm-Message-State: AOAM532OqJlD+9VapB5oqoVlLKq5AkIT2qejtU1V3TxaXp9CuOUAHJbx hq9WYgCFx53WTs6fODMS6Mzb46u7NhPeZCwXwYWU6oYNzuoCL+k5epdfdINMzOICd9bELknAjMC LFGn6T+aXyU3YnnD+AY9xZ02s2+kt6dQ3inDLngFSujNCk5hC6OXE3uOu6/M= X-Google-Smtp-Source: ABdhPJxyZuKvd1QStXFNLBECT/OUlHpR5B2qUxyicP+4d8laLQCAx9+8/ya/kd4fUb4dCFR2gkHzCJsLFq0= X-Received: from ascull.c.googlers.com ([fda3:e722:ac3:cc00:28:9cb1:c0a8:1510]) (user=ascull job=sendgmr) by 2002:a7b:c086:0:b0:393:f6fa:cfc7 with SMTP id r6-20020a7bc086000000b00393f6facfc7mr27127130wmh.62.1652697733242; Mon, 16 May 2022 03:42:13 -0700 (PDT) Date: Mon, 16 May 2022 10:41:38 +0000 In-Reply-To: <20220516104140.1047229-1-ascull@google.com> Message-Id: <20220516104140.1047229-11-ascull@google.com> Mime-Version: 1.0 References: <20220516104140.1047229-1-ascull@google.com> X-Mailer: git-send-email 2.36.0.550.gb090851708-goog Subject: [PATCH v3 10/12] test: dm: virtio: Test virtio device driver probing From: Andrew Scull To: u-boot@lists.denx.de Cc: sjg@chromium.org, trini@konsulko.com, bmeng.cn@gmail.com, Andrew Scull Content-Type: text/plain; charset="UTF-8" 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 Once the virtio-rng driver has been bound, probe it to trigger the pre and post child probe hooks of the virtio uclass driver. Check the status of the virtio device to confirm it reached the expected state. Signed-off-by: Andrew Scull Reviewed-by: Simon Glass --- test/dm/virtio_device.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/test/dm/virtio_device.c b/test/dm/virtio_device.c index f5f2349750..d0195e6bf0 100644 --- a/test/dm/virtio_device.c +++ b/test/dm/virtio_device.c @@ -34,6 +34,15 @@ static int dm_test_virtio_base(struct unit_test_state *uts) ut_assertok(virtio_get_status(dev, &status)); ut_asserteq(VIRTIO_CONFIG_S_ACKNOWLEDGE, status); + /* probe the virtio-rng driver */ + ut_assertok(device_probe(dev)); + + /* check the device was reset and the driver picked up the device */ + ut_assertok(virtio_get_status(dev, &status)); + ut_asserteq(VIRTIO_CONFIG_S_DRIVER | + VIRTIO_CONFIG_S_DRIVER_OK | + VIRTIO_CONFIG_S_FEATURES_OK, status); + return 0; } DM_TEST(dm_test_virtio_base, UT_TESTF_SCAN_PDATA | UT_TESTF_SCAN_FDT); -- 2.36.0.550.gb090851708-goog