From: Xiaolong Ye <yexl@marvell.com>
To: <hjk@hansjkoch.de>, <greg@kroah.com>, <linux-kernel@vger.kernel.org>
Cc: Xiaolong Ye <yexl@marvell.com>
Subject: [PATCH] uio: add uio_event_sync interface
Date: Wed, 14 Aug 2013 20:30:23 +0800 [thread overview]
Message-ID: <1376483423-603-2-git-send-email-yexl@marvell.com> (raw)
In-Reply-To: <1376483423-603-1-git-send-email-yexl@marvell.com>
This interface is called to sync listener->event_count and device
event count in multi-instances case.
Change-Id: Ibb1e4888ce55b4993394b61e4bcd6dce8b8291f0
Signed-off-by: Xiaolong Ye <yexl@marvell.com>
---
drivers/uio/uio.c | 12 ++++++++++++
include/linux/uio_driver.h | 1 +
2 files changed, 13 insertions(+)
diff --git a/drivers/uio/uio.c b/drivers/uio/uio.c
index ba47563..95d559f 100644
--- a/drivers/uio/uio.c
+++ b/drivers/uio/uio.c
@@ -408,6 +408,18 @@ void uio_event_notify(struct uio_info *info)
EXPORT_SYMBOL_GPL(uio_event_notify);
/**
+ * uio_event_sync - sync listener's event count with UIO device
+ * @listener: uio_listener structure
+ */
+void uio_event_sync(struct uio_listener *listener)
+{
+ struct uio_device *idev = listener->dev;
+
+ listener->event_count = atomic_read(&idev->event);
+}
+EXPORT_SYMBOL_GPL(uio_event_sync);
+
+/**
* uio_interrupt - hardware interrupt handler
* @irq: IRQ number, can be UIO_IRQ_CYCLIC for cyclic timer
* @dev_id: Pointer to the devices uio_device structure
diff --git a/include/linux/uio_driver.h b/include/linux/uio_driver.h
index 1ad4724..d10e634 100644
--- a/include/linux/uio_driver.h
+++ b/include/linux/uio_driver.h
@@ -108,6 +108,7 @@ extern int __must_check
extern void uio_unregister_device(struct uio_info *info);
extern void uio_event_notify(struct uio_info *info);
+extern void uio_event_sync(struct uio_listener *listener);
/* defines for uio_info->irq */
#define UIO_IRQ_CUSTOM -1
--
1.7.9.5
next prev parent reply other threads:[~2013-08-14 12:36 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-08-14 12:30 [PATCH] Add uio_sync_event interface to support mulit-instances case in UIO framework Xiaolong Ye
2013-08-14 12:30 ` Xiaolong Ye [this message]
2013-08-14 18:34 ` [PATCH] uio: add uio_event_sync interface Greg KH
2013-08-14 18:36 ` [PATCH] Add uio_sync_event interface to support mulit-instances case in UIO framework Greg KH
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=1376483423-603-2-git-send-email-yexl@marvell.com \
--to=yexl@marvell.com \
--cc=greg@kroah.com \
--cc=hjk@hansjkoch.de \
--cc=linux-kernel@vger.kernel.org \
/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®