mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Greg KH <gregkh@linuxfoundation.org>
To: Xiaolong Ye <yexl@marvell.com>
Cc: hjk@hansjkoch.de, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] Add uio_sync_event interface to support mulit-instances case in UIO framework
Date: Wed, 14 Aug 2013 11:36:06 -0700	[thread overview]
Message-ID: <20130814183606.GB25715@kroah.com> (raw)
In-Reply-To: <1376483423-603-1-git-send-email-yexl@marvell.com>

On Wed, Aug 14, 2013 at 08:30:22PM +0800, Xiaolong Ye wrote:
> Hi, guys,
> 
> Recently, we have met fake interrupt issue when using UIO as our vpu
> driver in mulit-instances case, the issue can be described as below:

Do you have a pointer to this driver?

> In multi-instances case, we use vpu_lock(semaphore) to implement the mutually exclusive access to the
> device, each instace open uio device once and will be associated with a fd and its own uio_listener,
> we use poll to wait for the hardware interrupt. So let's assume that there are two instances, A and B,
> their uio_listener->event_count and idev->event are all 0 at the beginning, then A get the vpu_lock and start
> to work, it will block at poll()(because listener->event_count == idev->count) until H/W interrupt happens
> (atomic_inc(&idev->event)), after it releases vpu_lock, B will get the lock and start to work, however,
> its poll will return immediately because B's uio_listener->event_count is 0 while idev->event has been 1,
> that's how the fake interrupt happens.

Why not have just one instance talking to the hardware and then do the
locking in userspace for who ever needs to access the device?

thanks,

greg k-h

      parent reply	other threads:[~2013-08-14 18:36 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-08-14 12:30 Xiaolong Ye
2013-08-14 12:30 ` [PATCH] uio: add uio_event_sync interface Xiaolong Ye
2013-08-14 18:34   ` Greg KH
2013-08-14 18:36 ` Greg KH [this message]

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=20130814183606.GB25715@kroah.com \
    --to=gregkh@linuxfoundation.org \
    --cc=hjk@hansjkoch.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=yexl@marvell.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®