linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: sjur.brandeland@stericsson.com
To: "Michael S . Tsirkin" <mst@redhat.com>
Cc: "Sjur Brændeland" <sjurbren@gmail.com>,
	"Sjur Brændeland" <sjur.brandeland@stericsson.com>,
	"Rusty Russell" <rusty@rustcorp.com.au>,
	"Amit Shah" <amit.shah@redhat.com>,
	"Ohad Ben-Cohen" <ohad@wizery.com>,
	"Linus Walleij" <linus.walleij@linaro.org>,
	virtualization@lists.linux-foundation.org,
	linux-kernel@vger.kernel.org
Subject: [RFCv2 2/2] virtio_console: Add feature to disable console port
Date: Fri,  7 Sep 2012 08:57:46 +0200	[thread overview]
Message-ID: <1347001066-13521-3-git-send-email-sjur.brandeland@stericsson.com> (raw)
In-Reply-To: <1347001066-13521-1-git-send-email-sjur.brandeland@stericsson.com>

From: Sjur Brændeland <sjur.brandeland@stericsson.com>

Add the feature VIRTIO_CONSOLE_F_NO_HVC. With this bit set
only port-devices are created. The console port and
port control virtio-queues are not created.

The console port is not suited for communicating
to a remote processor because of it's blocking behavior.
But the port-device supports efficient non-blocking IO
to a remote processor.

Signed-off-by: Sjur Brændeland <sjur.brandeland@stericsson.com>
cc: Rusty Russell <rusty@rustcorp.com.au>
cc: Michael S. Tsirkin <mst@redhat.com>
cc: Amit Shah <amit.shah@redhat.com>
cc: Ohad Ben-Cohen <ohad@wizery.com>
cc: Linus Walleij <linus.walleij@linaro.org>
cc: virtualization@lists.linux-foundation.org
cc: linux-kernel@vger.kernel.org
---
 drivers/char/virtio_console.c  |    6 +++++-
 include/linux/virtio_console.h |    1 +
 2 files changed, 6 insertions(+), 1 deletion(-)

diff --git a/drivers/char/virtio_console.c b/drivers/char/virtio_console.c
index 469c05f..7408c00 100644
--- a/drivers/char/virtio_console.c
+++ b/drivers/char/virtio_console.c
@@ -1244,10 +1244,13 @@ static int add_port(struct ports_device *portdev, u32 id)
 		goto free_device;
 	}
 
+	/* Don't initialize the port_console if F_NO_HVC is set*/
+	if (virtio_has_feature(port->portdev->vdev, VIRTIO_CONSOLE_F_NO_HVC))
+		port->host_connected = true;
 	/*
 	 * If we're not using multiport support, this has to be a console port
 	 */
-	if (!use_multiport(port->portdev)) {
+	else if (!use_multiport(port->portdev)) {
 		err = init_port_console(port);
 		if (err)
 			goto free_inbufs;
@@ -1896,6 +1899,7 @@ static unsigned int features[] = {
 #if VIRTIO_CONSOLE_HAS_DMA
 	VIRTIO_CONSOLE_F_DMA_MEM,
 #endif
+	VIRTIO_CONSOLE_F_NO_HVC,
 
 };
 
diff --git a/include/linux/virtio_console.h b/include/linux/virtio_console.h
index b27f7fa..a7c8974 100644
--- a/include/linux/virtio_console.h
+++ b/include/linux/virtio_console.h
@@ -39,6 +39,7 @@
 #define VIRTIO_CONSOLE_F_SIZE	0	/* Does host provide console size? */
 #define VIRTIO_CONSOLE_F_MULTIPORT 1	/* Does host provide multiple ports? */
 #define VIRTIO_CONSOLE_F_DMA_MEM 2	/* Use DMA memory in vrings */
+#define VIRTIO_CONSOLE_F_NO_HVC 3	/* Disable use of HVC */
 
 #define VIRTIO_CONSOLE_BAD_ID		(~(u32)0)
 
-- 
1.7.9.5


  parent reply	other threads:[~2012-09-07  6:58 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-09-07  6:57 [RFCv2 1/2] virtio_console: Add support for DMA memory allocation sjur.brandeland
2012-09-07  6:57 ` [PATCHv2] virtio: Don't access device data after unregistration sjur.brandeland
2012-09-07  6:57 ` sjur.brandeland [this message]
2012-09-10  7:53 ` [RFCv2 1/2] virtio_console: Add support for DMA memory allocation Rusty Russell
2012-09-10 15:18   ` [RFCv3] virtio_console: Add support for virtio remoteproc serial sjur.brandeland
2012-09-12  6:00     ` Rusty Russell

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=1347001066-13521-3-git-send-email-sjur.brandeland@stericsson.com \
    --to=sjur.brandeland@stericsson.com \
    --cc=amit.shah@redhat.com \
    --cc=linus.walleij@linaro.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mst@redhat.com \
    --cc=ohad@wizery.com \
    --cc=rusty@rustcorp.com.au \
    --cc=sjurbren@gmail.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).