From: Alan Cox <alan@lxorguk.ukuu.org.uk>
To: "Sjur Brændeland" <sjur.brandeland@stericsson.com>
Cc: linux-kernel@vger.kernel.org, Arnd Bergmann <arnd@arndb.de>,
Linus Walleij <linus.walleij@linaro.org>,
sjurbren@gmail.com
Subject: Re: [RESEND PATCHv5 09/11] modem_shm: Character device for SHM channel access.
Date: Thu, 2 Aug 2012 11:25:42 +0100 [thread overview]
Message-ID: <20120802112542.6ae3dd8f@pyramind.ukuu.org.uk> (raw)
In-Reply-To: <1327999726-8774-10-git-send-email-sjur.brandeland@stericsson.com>
On Tue, 31 Jan 2012 09:48:44 +0100
Sjur Brændeland <sjur.brandeland@stericsson.com> 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 ?
next prev parent reply other threads:[~2012-08-02 10:21 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-01-31 8:48 [RESEND PATCHv5 00/11] modem_shm: Driver for ST-E Thor M7400 LTE modem Sjur Brændeland
2012-01-31 8:48 ` [RESEND PATCHv5 01/11] modem_shm: Shared Memory layout for ST-E M7400 driver Sjur Brændeland
2012-01-31 8:48 ` [RESEND PATCHv5 02/11] modem_shm: Channel config definitions " Sjur Brændeland
2012-01-31 8:48 ` [RESEND PATCHv5 03/11] modem_shm: Configuration for SHM Channel an devices Sjur Brændeland
2012-01-31 8:48 ` [RESEND PATCHv5 04/11] modem_shm: geni/geno driver interface Sjur Brændeland
2012-01-31 8:48 ` [RESEND PATCHv5 05/11] modem_shm: genio dummy driver Sjur Brændeland
2012-01-31 8:48 ` [RESEND PATCHv5 06/11] modem_shm: Add SHM device bus Sjur Brændeland
2012-01-31 8:48 ` [RESEND PATCHv5 07/11] modem_shm: Add shm device implementation Sjur Brændeland
2012-01-31 8:48 ` [RESEND PATCHv5 08/11] modem_shm: SHM Configuration data handling Sjur Brændeland
2012-01-31 8:48 ` [RESEND PATCHv5 09/11] modem_shm: Character device for SHM channel access Sjur Brændeland
2012-08-02 10:25 ` Alan Cox [this message]
2012-08-02 12:11 ` Sjur Brændeland
2012-08-07 10:03 ` Alan Cox
2012-01-31 8:48 ` [RESEND PATCHv5 10/11] modem_shm: Makefile and Kconfig for M7400 Shared Memory Drivers Sjur Brændeland
2012-01-31 8:48 ` [RESEND PATCHv5 11/11] caif_shm: Add CAIF driver for Shared memory for M7400 Sjur Brændeland
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=20120802112542.6ae3dd8f@pyramind.ukuu.org.uk \
--to=alan@lxorguk.ukuu.org.uk \
--cc=arnd@arndb.de \
--cc=linus.walleij@linaro.org \
--cc=linux-kernel@vger.kernel.org \
--cc=sjur.brandeland@stericsson.com \
--cc=sjurbren@gmail.com \
/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
all inboxes | Powered by JetHome®