Module: xenomai-forge
Branch: next
Commit: 442b3b3c76be9008f82f97f2c3324aaf37b0f9d7
URL:    
http://git.xenomai.org/?p=xenomai-forge.git;a=commit;h=442b3b3c76be9008f82f97f2c3324aaf37b0f9d7

Author: Philippe Gerum <r...@xenomai.org>
Date:   Wed Jul  2 14:43:18 2014 +0200

drivers/testing: fix adaptive switch for ioctl() rt/nrt pair

bec5d0d introduced a subtle regression causing switchtest to fail
initializing, due to ioctl() calls receiving ENOTTY.

As ioctl() became a conforming call, a Xenomai thread now runs the
ioctl_rt handler first, which should therefore implement all requests
that may be submitted in such context, or cause the adaptive switch to
take place by returning ENOSYS, so that ioctl_nrt is probed next.

---

 kernel/drivers/testing/switchtest.c |    7 +------
 kernel/drivers/testing/timerbench.c |   12 +-----------
 2 files changed, 2 insertions(+), 17 deletions(-)

diff --git a/kernel/drivers/testing/switchtest.c 
b/kernel/drivers/testing/switchtest.c
index 8adb69e..535a447 100644
--- a/kernel/drivers/testing/switchtest.c
+++ b/kernel/drivers/testing/switchtest.c
@@ -685,11 +685,6 @@ static int rtswitch_ioctl_rt(struct rtdm_fd *fd,
        struct rttst_swtest_dir fromto;
 
        switch (request) {
-       case RTTST_RTIOC_SWTEST_REGISTER_UTASK:
-       case RTTST_RTIOC_SWTEST_CREATE_KTASK:
-       case RTTST_RTIOC_SWTEST_GET_SWITCHES_COUNT:
-               return -ENOSYS;
-
        case RTTST_RTIOC_SWTEST_PEND:
                if (!rtdm_read_user_ok(fd, arg, sizeof(task)))
                        return -EFAULT;
@@ -721,7 +716,7 @@ static int rtswitch_ioctl_rt(struct rtdm_fd *fd,
                return 0;
 
        default:
-               return -ENOTTY;
+               return -ENOSYS;
        }
 }
 
diff --git a/kernel/drivers/testing/timerbench.c 
b/kernel/drivers/testing/timerbench.c
index acf85d1..9d35eac 100644
--- a/kernel/drivers/testing/timerbench.c
+++ b/kernel/drivers/testing/timerbench.c
@@ -411,11 +411,6 @@ static int rt_tmbench_ioctl_nrt(struct rtdm_fd *fd,
        case RTTST_RTIOC_TMBENCH_STOP:
                err = rt_tmbench_stop(ctx, arg);
                break;
-
-       case RTTST_RTIOC_INTERM_BENCH_RES:
-               err = -ENOSYS;
-               break;
-
        default:
                err = -ENOTTY;
        }
@@ -451,13 +446,8 @@ static int rt_tmbench_ioctl_rt(struct rtdm_fd *fd,
 
                break;
 
-       case RTTST_RTIOC_TMBENCH_START:
-       case RTTST_RTIOC_TMBENCH_STOP:
-               err = -ENOSYS;
-               break;
-
        default:
-               err = -ENOTTY;
+               err = -ENOSYS;
        }
 
        return err;


_______________________________________________
Xenomai-git mailing list
Xenomai-git@xenomai.org
http://www.xenomai.org/mailman/listinfo/xenomai-git

Reply via email to