Module: xenomai-2.5
Branch: master
Commit: 6bc3c76a01f004c80518497d9d1a205d73babf2e
URL:    
http://git.xenomai.org/?p=xenomai-2.5.git;a=commit;h=6bc3c76a01f004c80518497d9d1a205d73babf2e

Author: Alexis Berlemont <alexis.berlem...@gmail.com>
Date:   Tue May  4 23:38:30 2010 +0200

analogy: make the command registering perform in NRT context

Theorically, the command ioctl could be performed in
real-time. However, with the introduction of rtdm_rt_capable(), we
were able to notice a problem in the NI driver: some
pci_alloc_consistent() calls could be done inside some command
callbacks. So, the quickest fix was to confine cmd ioctls to NRT
domain. The influence is minimal as the next syscall (insn trigger or
read / write) will make the process switch.

---

 ksrc/drivers/analogy/command.c |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/ksrc/drivers/analogy/command.c b/ksrc/drivers/analogy/command.c
index 7550fbc..a6c1dec 100644
--- a/ksrc/drivers/analogy/command.c
+++ b/ksrc/drivers/analogy/command.c
@@ -304,8 +304,11 @@ int a4l_ioctl_cmd(a4l_cxt_t * cxt, void *arg)
        __a4l_dbg(1, core_dbg, 
                  "a4l_ioctl_cmd: minor=%d\n", a4l_get_minor(cxt));
 
-       if (!rtdm_in_rt_context() && rtdm_rt_capable(cxt->user_info))
+       /* The command launching cannot be done in real-time because
+          of some possible buffer allocations in the drivers */
+       if (rtdm_in_rt_context()) {
                return -ENOSYS;
+       }
 
        /* Basically check the device */
        if (!test_bit(A4L_DEV_ATTACHED, &dev->flags)) {


_______________________________________________
Xenomai-git mailing list
Xenomai-git@gna.org
https://mail.gna.org/listinfo/xenomai-git

Reply via email to