kvm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Max Gurtovoy <mgurtovoy@nvidia.com>
To: <mst@redhat.com>, <kvm@vger.kernel.org>,
	<virtualization@lists.linux-foundation.org>,
	<jasowang@redhat.com>
Cc: <oren@nvidia.com>, <nitzanc@nvidia.com>, <cohuck@redhat.com>,
	Max Gurtovoy <mgurtovoy@nvidia.com>
Subject: [PATCH v2 3/3] virtio_pci: add module param for reset_timeout
Date: Thu, 8 Apr 2021 08:11:09 +0000	[thread overview]
Message-ID: <20210408081109.56537-3-mgurtovoy@nvidia.com> (raw)
In-Reply-To: <20210408081109.56537-1-mgurtovoy@nvidia.com>

Enable the user to set the time for waiting for successful reset by the
virtio controller. Set the default to 180 seconds.

Signed-off-by: Max Gurtovoy <mgurtovoy@nvidia.com>
---
 drivers/virtio/virtio_pci_common.c | 5 +++++
 drivers/virtio/virtio_pci_common.h | 2 ++
 drivers/virtio/virtio_pci_modern.c | 3 ++-
 3 files changed, 9 insertions(+), 1 deletion(-)

diff --git a/drivers/virtio/virtio_pci_common.c b/drivers/virtio/virtio_pci_common.c
index 222d630c41fc..3a4c57839ed8 100644
--- a/drivers/virtio/virtio_pci_common.c
+++ b/drivers/virtio/virtio_pci_common.c
@@ -24,6 +24,11 @@ MODULE_PARM_DESC(force_legacy,
 		 "Force legacy mode for transitional virtio 1 devices");
 #endif
 
+unsigned int reset_timeout = 180;
+module_param_named(reset_timeout, reset_timeout, uint, 0644);
+MODULE_PARM_DESC(reset_timeout,
+		 "timeout in seconds for reset virtio device operation");
+
 /* wait for pending irq handlers */
 void vp_synchronize_vectors(struct virtio_device *vdev)
 {
diff --git a/drivers/virtio/virtio_pci_common.h b/drivers/virtio/virtio_pci_common.h
index beec047a8f8d..4760cdf74961 100644
--- a/drivers/virtio/virtio_pci_common.h
+++ b/drivers/virtio/virtio_pci_common.h
@@ -29,6 +29,8 @@
 #include <linux/highmem.h>
 #include <linux/spinlock.h>
 
+extern unsigned int reset_timeout;
+
 struct virtio_pci_vq_info {
 	/* the actual virtqueue */
 	struct virtqueue *vq;
diff --git a/drivers/virtio/virtio_pci_modern.c b/drivers/virtio/virtio_pci_modern.c
index dcee616e8d21..811fc1719d8c 100644
--- a/drivers/virtio/virtio_pci_modern.c
+++ b/drivers/virtio/virtio_pci_modern.c
@@ -162,7 +162,8 @@ static int vp_reset(struct virtio_device *vdev)
 {
 	struct virtio_pci_device *vp_dev = to_vp_device(vdev);
 	struct virtio_pci_modern_device *mdev = &vp_dev->mdev;
-	unsigned long timeout = jiffies + msecs_to_jiffies(180000);
+	unsigned long timeout = jiffies +
+		msecs_to_jiffies(reset_timeout * 1000);
 
 	/* 0 status means a reset. */
 	vp_modern_set_status(mdev, 0);
-- 
2.25.4


  parent reply	other threads:[~2021-04-08  8:11 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-08  8:11 [PATCH v2 1/3] virtio: update reset callback to return status Max Gurtovoy
2021-04-08  8:11 ` [PATCH v2 2/3] virito_pci: add timeout to reset device operation Max Gurtovoy
2021-04-08  9:01   ` Jason Wang
2021-04-08  9:44     ` Max Gurtovoy
2021-04-08 12:45       ` Jason Wang
2021-04-08 12:57         ` Max Gurtovoy
2021-04-08 13:18           ` Jason Wang
2021-04-08  8:11 ` Max Gurtovoy [this message]
2021-04-08  8:58 ` [PATCH v2 1/3] virtio: update reset callback to return status Jason Wang
2021-04-08  9:56   ` Max Gurtovoy
2021-04-08 13:14     ` Jason Wang
2021-04-08 14:24       ` Max Gurtovoy
2021-04-09  5:22         ` Jason Wang
2021-04-11  9:50           ` Max Gurtovoy
2021-04-12  9:07             ` Michael S. Tsirkin
2021-04-12 12:17               ` Max Gurtovoy
2021-04-12 21:29                 ` Michael S. Tsirkin
2021-04-08 15:56     ` Michael S. Tsirkin
2021-04-12 11:55       ` Max Gurtovoy
2021-04-12 12:04         ` Michael S. Tsirkin
2021-04-12 13:03           ` Max Gurtovoy
2021-04-12 21:23             ` Michael S. Tsirkin
2021-04-12 22:53               ` Max Gurtovoy
2021-04-13  2:42                 ` Jason Wang
2021-04-13  4:52                   ` Michael S. Tsirkin
2021-04-13  4:42                 ` Michael S. Tsirkin
2021-04-13 10:56                   ` Max Gurtovoy
2021-04-08 16:18 ` Michael S. Tsirkin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210408081109.56537-3-mgurtovoy@nvidia.com \
    --to=mgurtovoy@nvidia.com \
    --cc=cohuck@redhat.com \
    --cc=jasowang@redhat.com \
    --cc=kvm@vger.kernel.org \
    --cc=mst@redhat.com \
    --cc=nitzanc@nvidia.com \
    --cc=oren@nvidia.com \
    --cc=virtualization@lists.linux-foundation.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).