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 F1D63C636CB for ; Sat, 28 Jan 2023 22:01:39 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 934A88574D; Sat, 28 Jan 2023 23:01:36 +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="clwljZlx"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id C32118574F; Sat, 28 Jan 2023 23:01:27 +0100 (CET) Received: from mail-il1-x12e.google.com (mail-il1-x12e.google.com [IPv6:2607:f8b0:4864:20::12e]) (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 7B04B8575A for ; Sat, 28 Jan 2023 23:01:22 +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-il1-x12e.google.com with SMTP id d10so3735358ilc.12 for ; Sat, 28 Jan 2023 14:01:22 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=i4zb8uy0LGoSiOVEboEufWkAr83vm259shcBlqGiIns=; b=clwljZlxXvg8p1k1eZkfj96DepPu6lJsLGnS3OXZeFpWbN69S/6xetoY0EAPEKbZTh f2duzvjIX8wbiHpsnm96tDwmdICxb0nVuuDQyPRKRp8v7lxCbO4mQKaDNcG5qVi+PGW8 /TxvKiUcqmzAMcIxw8ZpwPJjad1qogNWd5AoM= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=i4zb8uy0LGoSiOVEboEufWkAr83vm259shcBlqGiIns=; b=p/HWCe0eXGDpcpSAHTSpgzl/ZG4qWbsIBpMFVW+6ZmQFvNv0WZnhALsdImtZZWLK5o vpJiH7X9U3lLP+TAn8J+m+wOyTE/jLdIrA88uHUf4tGmxkHYlNSkjPta9S+UyuRSi4MO BSqSCLACOzRZGVbO0ycDajDdjRF2VGzKNA7LRVZcwlxoQBemEzZvjVsmn8vHW6fMVwgp vluYYcguGKSwwdrC7s1H5996EB9uCqWP2IC+zDV+JSNLL5/CjaOB1ES5YCd0fkRw+oPw YykuhnYP/UifZo+jr39Ux7aY65I8SjQNLsxsYj2Z6NjG2IRp0/MzOGKa6jJtOA6W61hR lzfQ== X-Gm-Message-State: AO0yUKUZJrViLKmpXMPiUFJIRNrevA16lX/NC5okCq06ql/kklgFsI7S VUMQ0PSIekUIFjMcr4+SB9XlkeHCbZdKl8W9 X-Google-Smtp-Source: AK7set9+5FubkTxhaCAUQH1RcYwROUpdh+2WylwzIzV75q2QwZxyEa2z6fGAy1DT24krjolcqC5k9w== X-Received: by 2002:a05:6e02:18c5:b0:310:ea0f:3229 with SMTP id s5-20020a056e0218c500b00310ea0f3229mr108238ilu.18.1674943267612; Sat, 28 Jan 2023 14:01:07 -0800 (PST) Received: from sjg1.roam.corp.google.com (c-73-14-173-85.hsd1.co.comcast.net. [73.14.173.85]) by smtp.gmail.com with ESMTPSA id f15-20020a056e0212af00b0030f1be2e051sm2525521ilr.39.2023.01.28.14.01.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 28 Jan 2023 14:01:07 -0800 (PST) From: Simon Glass To: U-Boot Mailing List Cc: Tom Rini , Albert Aribaud , Ilias Apalodimas , Simon Glass , Bin Meng Subject: [PATCH 02/13] virtio: Add some debugging Date: Sat, 28 Jan 2023 15:00:17 -0700 Message-Id: <20230128220028.53575-3-sjg@chromium.org> X-Mailer: git-send-email 2.39.1.456.gfc5497dd1b-goog In-Reply-To: <20230128220028.53575-1-sjg@chromium.org> References: <20230128220028.53575-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.6 at phobos.denx.de X-Virus-Status: Clean When QEMU does not respond for some reason, it is helpful to have debugging info to show. Add some. Signed-off-by: Simon Glass --- drivers/virtio/virtio_blk.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/drivers/virtio/virtio_blk.c b/drivers/virtio/virtio_blk.c index 30cfc56725c..95810582867 100644 --- a/drivers/virtio/virtio_blk.c +++ b/drivers/virtio/virtio_blk.c @@ -4,6 +4,8 @@ * Copyright (C) 2018, Bin Meng */ +#define LOG_CATEGORY UCLASS_VIRTIO + #include #include #include @@ -42,6 +44,8 @@ static ulong virtio_blk_do_req(struct udevice *dev, u64 sector, sgs[num_out + num_in++] = &data_sg; sgs[num_out + num_in++] = &status_sg; + log_debug("dev=%s, active=%d, priv=%p, priv->vq=%p\n", dev->name, + device_active(dev), priv, priv->vq); ret = virtqueue_add(priv->vq, sgs, num_out, num_in); if (ret) @@ -49,8 +53,10 @@ static ulong virtio_blk_do_req(struct udevice *dev, u64 sector, virtqueue_kick(priv->vq); + log_debug("wait..."); while (!virtqueue_get_buf(priv->vq, NULL)) ; + log_debug("done\n"); return status == VIRTIO_BLK_S_OK ? blkcnt : -EIO; } @@ -58,6 +64,7 @@ static ulong virtio_blk_do_req(struct udevice *dev, u64 sector, static ulong virtio_blk_read(struct udevice *dev, lbaint_t start, lbaint_t blkcnt, void *buffer) { + log_debug("read %s\n", dev->name); return virtio_blk_do_req(dev, start, blkcnt, buffer, VIRTIO_BLK_T_IN); } -- 2.39.1.456.gfc5497dd1b-goog