Re: [PATCHv5 2/3] virtio_console: Add support for remoteproc serial

From: Rusty Russell
Date: Wed Sep 26 2012 - 22:05:31 EST


sjur.brandeland@xxxxxxxxxxxxxx writes:
> From: Sjur BrÃndeland <sjur.brandeland@xxxxxxxxxxxxxx>
>
> Add a simple serial connection driver called
> VIRTIO_ID_RPROC_SERIAL (11) for communicating with a
> remote processor in an asymmetric multi-processing
> configuration.
>
...
> static struct port_buffer *alloc_buf(struct virtqueue *vq, size_t buf_size,
> int nrbufs)
> {
> struct port_buffer *buf;
> size_t alloc_size;
>
> + if (is_rproc_serial(vq->vdev) && !irqs_disabled())
> + reclaim_dma_bufs();

Hmm, you need a gfp_t arg into alloc_buf; your last patch simply changed
them all to GFP_ATOMIC, which makes the console far less memory
friendly.

You check !irqs_disabled() in a couple of places; I think the caller
needs to indicate (possibly by checking for gfp == GFP_KERNEL) whether
it's safe to call reclaim_dma_bufs().

> @@ -838,6 +927,10 @@ static ssize_t port_fops_splice_write(struct pipe_inode_info *pipe,
> .u.data = &sgl,
> };
>
> + /* rproc_serial does not support splice */
> + if (is_rproc_serial(port->out_vq->vdev))
> + return -EINVAL;

Why not? ;)

Thanks,
Rusty.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/