mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-07-16 11:05:53 -04:00
tty: virtio: drop virtio_cons_early_init()
The last user of virtio_cons_early_init() was dropped in commit
7fb2b2d512 ("s390/virtio: remove the old KVM virtio transport").
So now, drop virtio_cons_early_init() and the logic and headers behind
too.
Signed-off-by: Jiri Slaby (SUSE) <jirislaby@kernel.org>
Acked-by: Jason Wang <jasowang@redhat.com>
Cc: Richard Henderson <richard.henderson@linaro.org>
Cc: Ivan Kokshaysky <ink@jurassic.park.msu.ru>
Cc: Matt Turner <mattst88@gmail.com>
Cc: Amit Shah <amit@kernel.org>
Cc: Arnd Bergmann <arnd@arndb.de>
Cc: "Michael S. Tsirkin" <mst@redhat.com>
Cc: Xuan Zhuo <xuanzhuo@linux.alibaba.com>
Cc: linux-alpha@vger.kernel.org
Cc: virtualization@lists.linux.dev
Link: https://lore.kernel.org/r/20231130113001.29154-1-jirislaby@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
78d60dae9a
commit
675bf8ef20
@@ -230,9 +230,6 @@ struct port {
|
||||
bool guest_connected;
|
||||
};
|
||||
|
||||
/* This is the very early arch-specified put chars function. */
|
||||
static int (*early_put_chars)(u32, const char *, int);
|
||||
|
||||
static struct port *find_port_by_vtermno(u32 vtermno)
|
||||
{
|
||||
struct port *port;
|
||||
@@ -1114,9 +1111,6 @@ static int put_chars(u32 vtermno, const char *buf, int count)
|
||||
void *data;
|
||||
int ret;
|
||||
|
||||
if (unlikely(early_put_chars))
|
||||
return early_put_chars(vtermno, buf, count);
|
||||
|
||||
port = find_port_by_vtermno(vtermno);
|
||||
if (!port)
|
||||
return -EPIPE;
|
||||
@@ -1142,10 +1136,6 @@ static int get_chars(u32 vtermno, char *buf, int count)
|
||||
{
|
||||
struct port *port;
|
||||
|
||||
/* If we've not set up the port yet, we have no input to give. */
|
||||
if (unlikely(early_put_chars))
|
||||
return 0;
|
||||
|
||||
port = find_port_by_vtermno(vtermno);
|
||||
if (!port)
|
||||
return -EPIPE;
|
||||
@@ -1201,21 +1191,6 @@ static const struct hv_ops hv_ops = {
|
||||
.notifier_hangup = notifier_del_vio,
|
||||
};
|
||||
|
||||
/*
|
||||
* Console drivers are initialized very early so boot messages can go
|
||||
* out, so we do things slightly differently from the generic virtio
|
||||
* initialization of the net and block drivers.
|
||||
*
|
||||
* At this stage, the console is output-only. It's too early to set
|
||||
* up a virtqueue, so we let the drivers do some boutique early-output
|
||||
* thing.
|
||||
*/
|
||||
int __init virtio_cons_early_init(int (*put_chars)(u32, const char *, int))
|
||||
{
|
||||
early_put_chars = put_chars;
|
||||
return hvc_instantiate(0, 0, &hv_ops);
|
||||
}
|
||||
|
||||
static int init_port_console(struct port *port)
|
||||
{
|
||||
int ret;
|
||||
@@ -1256,13 +1231,6 @@ static int init_port_console(struct port *port)
|
||||
spin_unlock_irq(&pdrvdata_lock);
|
||||
port->guest_connected = true;
|
||||
|
||||
/*
|
||||
* Start using the new console output if this is the first
|
||||
* console to come up.
|
||||
*/
|
||||
if (early_put_chars)
|
||||
early_put_chars = NULL;
|
||||
|
||||
/* Notify host of port being opened */
|
||||
send_control_msg(port, VIRTIO_CONSOLE_PORT_OPEN, 1);
|
||||
|
||||
@@ -1999,7 +1967,6 @@ static int virtcons_probe(struct virtio_device *vdev)
|
||||
struct ports_device *portdev;
|
||||
int err;
|
||||
bool multiport;
|
||||
bool early = early_put_chars != NULL;
|
||||
|
||||
/* We only need a config space if features are offered */
|
||||
if (!vdev->config->get &&
|
||||
@@ -2010,9 +1977,6 @@ static int virtcons_probe(struct virtio_device *vdev)
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
/* Ensure to read early_put_chars now */
|
||||
barrier();
|
||||
|
||||
portdev = kmalloc(sizeof(*portdev), GFP_KERNEL);
|
||||
if (!portdev) {
|
||||
err = -ENOMEM;
|
||||
@@ -2100,18 +2064,6 @@ static int virtcons_probe(struct virtio_device *vdev)
|
||||
__send_control_msg(portdev, VIRTIO_CONSOLE_BAD_ID,
|
||||
VIRTIO_CONSOLE_DEVICE_READY, 1);
|
||||
|
||||
/*
|
||||
* If there was an early virtio console, assume that there are no
|
||||
* other consoles. We need to wait until the hvc_alloc matches the
|
||||
* hvc_instantiate, otherwise tty_open will complain, resulting in
|
||||
* a "Warning: unable to open an initial console" boot failure.
|
||||
* Without multiport this is done in add_port above. With multiport
|
||||
* this might take some host<->guest communication - thus we have to
|
||||
* wait.
|
||||
*/
|
||||
if (multiport && early)
|
||||
wait_for_completion(&early_console_added);
|
||||
|
||||
return 0;
|
||||
|
||||
free_chrdev:
|
||||
|
||||
Reference in New Issue
Block a user