On Tue, 31 Jan 2012 09:48:44 +0100
Sjur Br?ndeland <[email protected]> wrote:
> Add a character device implementation for the SHM stream channels.
> The character device provides asynchronous IO and ring-buffer handling.
> The device copies data directly from the Shared Memory area into
> user-land buffers.
What is the use case for this - it seems a little odd that it's not using
the tty layer so won't work with all the normal modem apps as anyone
would expect and want ?
> +static unsigned int shmchr_chrpoll(struct file *filp, poll_table *waittab)
> +{
> + struct shmchr_char_dev *dev = filp->private_data;
> + unsigned int mask = 0;
> +
> + if (dev == NULL) {
> + mdev_dbg(dev, "private_data not set!\n");
> + return -EBADFD;
> + }
How can this occur. If it can't occur why check ? BUG_ON() would
certainly be better to as you'd get a trace and it would get captured not
silently ignored and problems never detected.
An if.. dbg sequence to end users is basically "silently pretend we
didn't break and hope", which isn't ideal at all.
> +
> + /* I want to be alone on dev (except status and queue). */
> + if (mutex_lock_interruptible(&dev->mutex)) {
> + mdev_dbg(dev, "mutex_lock_interruptible got signalled\n");
> + mask |= POLLERR;
> + goto out_unlocked;
That's very odd behaviour for poll() and may confuse apps. Can the mutex
ever be held for a long time ?
>On Thu, Aug 2, 2012 at 12:25 PM,
>Alan Cox <[email protected]> wrote:
>> Add a character device implementation for the SHM stream channels.
>> The character device provides asynchronous IO and ring-buffer handling.
>> The device copies data directly from the Shared Memory area into
>> user-land buffers.
>
> What is the use case for this - it seems a little odd that it's not using
> the tty layer so won't work with all the normal modem apps as anyone
> would expect and want ?
Hi Alan,
Thank you for reviewing this patch.
I am working on a re-spin of the entire patch-set for Modem-SHM using
the RemoteProc framework from Ohad Ben Cohen and using Virtio as
transport mechanism between modem and host. I hope to be able to
use Virtio Console for the tty.The use-case tty/char device is for
transfering boot images to the modem and fetch crash logs.
For normal operation of the modem the CAIF protocol is used. I'm writing
on a new CAIF-Virtio driver for this that works with the RemoteProc
framework.
Regards,
Sjur
> I am working on a re-spin of the entire patch-set for Modem-SHM using
> the RemoteProc framework from Ohad Ben Cohen and using Virtio as
> transport mechanism between modem and host. I hope to be able to
> use Virtio Console for the tty.The use-case tty/char device is for
> transfering boot images to the modem and fetch crash logs.
That would seem a sensible approach.
> For normal operation of the modem the CAIF protocol is used. I'm writing
> on a new CAIF-Virtio driver for this that works with the RemoteProc
> framework.
Ok.
Alan