From patchwork Tue Feb 8 15:25:18 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cristian Marussi X-Patchwork-Id: 12738877 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 8762BC433EF for ; Tue, 8 Feb 2022 15:27:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:List-Subscribe:List-Help: List-Post:List-Archive:List-Unsubscribe:List-Id:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=aa/RpE3DNzFY9/KLfpd9f3F51W7bCdhgQMmnc1Dlw10=; b=SNcyBPLaJRexXM lJ0RyGvty4dUcxweVUpOTN04n50M8hlr5tP4IiZOPkhx7JmeE/YT0eJzHsrVdV3lFwwgtupCIduWq q543mbtqhj/QSFazyjx74ZJwWCg2MhlwV9sRA6a9qr64EQTNYV+o8ZbKA5N86BcsBnJ8ngdIzznj5 CQdvVZILlxcdO3q9NgDVNzAyhu2mMPM2Fbr0g64IHeR14qZcVIz76HV5S5rAWqP8MKg3ri7IPsoDT FFNzO9W3e9gJBgGsLZtqmoVNvs3h44y7YtASRqasYlyxCwQzIvqv4ZjNGMwU4WSRjv1l6qcu6658h Q/GNFQxNeq+M4+KtjWnA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nHSNO-00ET1t-Ue; Tue, 08 Feb 2022 15:25:55 +0000 Received: from foss.arm.com ([217.140.110.172]) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nHSN5-00ESw8-BN for linux-arm-kernel@lists.infradead.org; Tue, 08 Feb 2022 15:25:36 +0000 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id DCD1811FB; Tue, 8 Feb 2022 07:25:33 -0800 (PST) Received: from e120937-lin.home (unknown [172.31.20.19]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 7F43E3F73B; Tue, 8 Feb 2022 07:25:32 -0800 (PST) From: Cristian Marussi To: linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, virtualization@lists.linux-foundation.org Cc: sudeep.holla@arm.com, mst@redhat.com, vincent.guittot@linaro.org, souvik.chakravarty@arm.com, peter.hilber@opensynergy.com, igor.skalkin@opensynergy.com, cristian.marussi@arm.com Subject: [PATCH 2/4] tools/virtio: Add missing spin_lock_init on virtio_test Date: Tue, 8 Feb 2022 15:25:18 +0000 Message-Id: <20220208152520.52983-3-cristian.marussi@arm.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20220208152520.52983-1-cristian.marussi@arm.com> References: <20220208152520.52983-1-cristian.marussi@arm.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220208_072535_451243_355C5636 X-CRM114-Status: UNSURE ( 7.48 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org A missing spin_lock_init() call can cause the test to hang indefinitely on spin_lock() at virtqueue creation time. Signed-off-by: Cristian Marussi --- tools/virtio/virtio_test.c | 1 + 1 file changed, 1 insertion(+) diff --git a/tools/virtio/virtio_test.c b/tools/virtio/virtio_test.c index d882075c097f..d9cb3d22d52f 100644 --- a/tools/virtio/virtio_test.c +++ b/tools/virtio/virtio_test.c @@ -133,6 +133,7 @@ static void vdev_info_init(struct vdev_info* dev, unsigned long long features) dev->vdev.dev.driver = &dev->vdriver.driver; dev->vdev.features = features; INIT_LIST_HEAD(&dev->vdev.vqs); + spin_lock_init(&dev->vdev.vqs_list_lock); dev->buf_size = 1024; dev->buf = malloc(dev->buf_size); assert(dev->buf);