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 53F3EC433F5 for ; Wed, 13 Apr 2022 14:23:43 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 37F6B83E49; Wed, 13 Apr 2022 16:22:22 +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="Hi0EQpp6"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 223F883E0A; Wed, 13 Apr 2022 16:22:09 +0200 (CEST) Received: from mail-wr1-x449.google.com (mail-wr1-x449.google.com [IPv6:2a00:1450:4864:20::449]) (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 8FA4483E04 for ; Wed, 13 Apr 2022 16:22:06 +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=3jtxWYgYKBrsbtdvmmhpphmf.dpnv-cppumjtut.efoy.ef@flex--ascull.bounces.google.com Received: by mail-wr1-x449.google.com with SMTP id z16-20020adff1d0000000b001ef7dc78b23so416155wro.12 for ; Wed, 13 Apr 2022 07:22:06 -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=0eW2sE9MqvfvOE7IMAZCLutKSFke1VJrlTOJ+A3LiNU=; b=Hi0EQpp6mZKurwNQcK5X1wOH092gPPYKeAL7no1BbT9p3BVShFe2QFPFnyODNaLWdC AhurmRJKw4dLG4z+blnDxlGroict1qxxQTpOkGGmRJm9f2E5c5hYfGDUM5JEZveExash YE+OPKHdkLsb2oBD6gRD621BuboQHpoaGcAm+i3mBdwxDgWaiy4WXuvVP55bQLOD5puP wDsdxCoaQCnTs0jPL8bjoOpnmy2VnYyAsmfWEem/8BQ6jIJbLMVVSxrL+hVIliqVSJH3 GvnYMrpsa5m1lH41vRAhbJjdTBIjv8qZPbbfcOxzYo/Yxy3JeUnbSn4OI+9XayQjlezm r8+g== 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=0eW2sE9MqvfvOE7IMAZCLutKSFke1VJrlTOJ+A3LiNU=; b=Qn7AUmsNJHAHXdPU/jE1aW3b+wCwMn/6xH0aOkbaPVYyP5SoGFnJLqNzYVhFrcD5hm yw0E9wDjPOjJl0Uju8Sbe1hwSO+KiinvmtRt9oozWhaZLF3B6MsShEFaSTFgwnIA2ACJ iFS+IGzPffiwfim2gWiWYECWjamyujKSE+g/Buip9c9Dtqin2K3LlvSePdjtlyFzxEHk ZZxzccbdP+5opLa+ioJ4deGGQ9u69xETxWt5H2j+Z7FTCRF6H+9aUMDxH5f3271CGWH8 C6fBISId5EGzLnP2H/Fib8TR1Fq5KlfZnhHLsFgUygiWD9y5HkZvInslBsfmEWB8+NfB uhrg== X-Gm-Message-State: AOAM5315H3DforEsvu5jUrruIMsTUSqhK03sZyA7FLR7AfBKUwurKaRo wNvA12R6ttJU4jZqnHsdOdiJtEywtQ29asX4EOUlwvGSTRuV9GaaQOIMIT58HQrVz6gxOOSCqAx O3xM9WwHwrzzoxdW9bwtnKlD6/cdoR7ITbf+vYg7BRVIKYaxbNB43OsJP59I= X-Google-Smtp-Source: ABdhPJx+WXvENM3UK7XNr4bb8UrHGGHgfl+Yt3LDNOsf2mA/M3jR2C1kmsARpnVaYYza63QdUF2E6pMH4XE= X-Received: from ascull.c.googlers.com ([fda3:e722:ac3:cc00:28:9cb1:c0a8:1510]) (user=ascull job=sendgmr) by 2002:adf:914f:0:b0:207:d1cc:77e0 with SMTP id j73-20020adf914f000000b00207d1cc77e0mr80425wrj.475.1649859726057; Wed, 13 Apr 2022 07:22:06 -0700 (PDT) Date: Wed, 13 Apr 2022 14:21:35 +0000 In-Reply-To: <20220413142137.560987-1-ascull@google.com> Message-Id: <20220413142137.560987-11-ascull@google.com> Mime-Version: 1.0 References: <20220413142137.560987-1-ascull@google.com> X-Mailer: git-send-email 2.35.1.1178.g4f1659d476-goog Subject: [PATCH v2 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, 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.35.1.1178.g4f1659d476-goog