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 442B0C433EF for ; Thu, 31 Mar 2022 10:12:00 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 1786883093; Thu, 31 Mar 2022 12:11:11 +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="f+vQTenJ"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 9BD8A8420C; Thu, 31 Mar 2022 12:10:23 +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 EDD25841FD for ; Thu, 31 Mar 2022 12:10:17 +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=3CX5FYgYKBjQQiSkbbWeeWbU.Seck-ReejbYiji.TUdn.TU@flex--ascull.bounces.google.com Received: by mail-wm1-x34a.google.com with SMTP id i6-20020a1c5406000000b0038c97ed0db5so9283961wmb.7 for ; Thu, 31 Mar 2022 03:10:17 -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=Lk2IN1oQH0ULYeCJL3mtkRFkrMOG6Enlzx+r9k3IBIg=; b=f+vQTenJ6WlbnTEDtjxcWjLg5hIOci4Nu6COAUwFsOJ+5IecLBje+whbnNv+Yj8iZA /zlZGS09ahu752pXhgGfggRLBOjX5qVmvU3t0Yt6Woh+mkW3zS+q42K9jaed+vifPIUO zZv4PPwL0caCeVEBOK3xIGD+UeRwEuYYoZaWTlihpfFKfiI/J0oBgxxfiYc5PtJajVSA hbnwLak7lymTy+jLSqPixpwAmdxCwGZscxH29YczX8P1xUVYRaBhFewo0Bd6EU+5kKOf LxLReuCrSUc8dtuDpi6hr2axo0LuKmLDqNpf9G4F4SehXaDfSqOE1bkL0ki8KIY+GUKD fUOA== 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=Lk2IN1oQH0ULYeCJL3mtkRFkrMOG6Enlzx+r9k3IBIg=; b=ZtjmtTRN64uOQzZX1kIpr3G06Se/e03Cayxl8lKq3cYLv4ggXcoVD2bVuhdjgibfxw cg9tjPVVb9rrga1RcZrbwf9xW5yMc0XCndei1tuYkSRWecd5ihHjpXcCI2CUsi+mQ07T 6qtXfBzXutlXGGQgf0fANoVfBA/2lv1cze9wGHLaXU3U1Ms5DBHk7r5yOGL25TMDue77 wRu0tp6N2PTPsN8KKYRVc9X+m9PVe3JgVL70xvGEgLwzOYhejsuPrBUuh37Ut9QdH98W oz8KJTzRkY+Dod+yKE7L7DN4JDCXN1vKWuEONR2IB2EiOQ+TWk4sg8Bi+IL5S0pIE96C 0pSQ== X-Gm-Message-State: AOAM533fAWIHH3uuGgEndM1mqiTqr7JZYVJJuvwQJUTghMGKJw7Wv9rb V0UTYAFY72rqYgh2R3Ws+dnYQKLfbot5xTn4XP6cCBno8JfEQgbIaKA1vAP43Cs3hpzFFXsJmZo m4yIHhvhBKlX92O5BjnVyVQrmZpnfiqq7TdPl/JuirNor0Tw3B234TKW8EHs= X-Google-Smtp-Source: ABdhPJyMTBpRZwWUkwvtj1GHv9DJ9lbkvyJGpqmbIS3ALRCO6oOJaXXam5nAeWWwvzeOG67h6WeEp0QVf2s= X-Received: from ascull.c.googlers.com ([fda3:e722:ac3:cc00:28:9cb1:c0a8:1510]) (user=ascull job=sendgmr) by 2002:a05:600c:3548:b0:38c:e73d:e0e0 with SMTP id i8-20020a05600c354800b0038ce73de0e0mr4313685wmq.158.1648721417376; Thu, 31 Mar 2022 03:10:17 -0700 (PDT) Date: Thu, 31 Mar 2022 10:09:47 +0000 In-Reply-To: <20220331100949.3637425-1-ascull@google.com> Message-Id: <20220331100949.3637425-10-ascull@google.com> Mime-Version: 1.0 References: <20220331100949.3637425-1-ascull@google.com> X-Mailer: git-send-email 2.35.1.1094.g7c7d902a7c-goog Subject: [PATCH 09/11] test: dm: virtio: Test virtio device driver probing From: Andrew Scull To: u-boot@lists.denx.de Cc: sjg@chromium.org, bmeng.cn@gmail.com, adelva@google.com, keirf@google.com, ptosi@google.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 --- test/dm/virtio.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/test/dm/virtio.c b/test/dm/virtio.c index 769945a0d8..7139c31ab5 100644 --- a/test/dm/virtio.c +++ b/test/dm/virtio.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.1094.g7c7d902a7c-goog