]> code.ossystems Code Review - meta-freescale.git/commitdiff
linux-imx-2.6.35.3: Added IPU patches fixing ERESTARTSYS behaviour.
authorLeon Woestenberg <leon@sidebranch.com>
Wed, 15 Feb 2012 18:38:31 +0000 (19:38 +0100)
committerOtavio Salvador <otavio@ossystems.com.br>
Thu, 8 Mar 2012 15:34:16 +0000 (15:34 +0000)
Posted by Phil Endecott on imxcommunity.org.

Signed-off-by: Leon Woestenberg <leon@sidebranch.com>
Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
meta-fsl-arm/recipes-kernel/linux/linux-imx/001_Add_accept4_syscall.patch [new file with mode: 0644]
meta-fsl-arm/recipes-kernel/linux/linux-imx/002_Return_ERESTARTSYS_from_IPU_GET_EVENT.patch [new file with mode: 0644]
meta-fsl-arm/recipes-kernel/linux/linux-imx/003_Sanitise_ipu_interrupt_return_value.patch [new file with mode: 0644]
meta-fsl-arm/recipes-kernel/linux/linux-imx_2.6.35.3.bb

diff --git a/meta-fsl-arm/recipes-kernel/linux/linux-imx/001_Add_accept4_syscall.patch b/meta-fsl-arm/recipes-kernel/linux/linux-imx/001_Add_accept4_syscall.patch
new file mode 100644 (file)
index 0000000..6480145
--- /dev/null
@@ -0,0 +1,30 @@
+commit 4ac884455c992c7250eae2cdbd6ad1fbbe5d1dc0
+Author: Phil Endecott <git@chezphil.org>
+Date:   Mon Oct 31 20:23:38 2011 +0000
+
+    Add accept4 syscall
+
+diff --git a/arch/arm/include/asm/unistd.h b/arch/arm/include/asm/unistd.h
+index dd2bf53..d02cfb6 100644
+--- a/arch/arm/include/asm/unistd.h
++++ b/arch/arm/include/asm/unistd.h
+@@ -392,6 +392,7 @@
+ #define __NR_rt_tgsigqueueinfo                (__NR_SYSCALL_BASE+363)
+ #define __NR_perf_event_open          (__NR_SYSCALL_BASE+364)
+ #define __NR_recvmmsg                 (__NR_SYSCALL_BASE+365)
++#define __NR_accept4                  (__NR_SYSCALL_BASE+366)
+ /*
+  * The following SWIs are ARM private.
+diff --git a/arch/arm/kernel/calls.S b/arch/arm/kernel/calls.S
+index 37ae301..afeb71f 100644
+--- a/arch/arm/kernel/calls.S
++++ b/arch/arm/kernel/calls.S
+@@ -375,6 +375,7 @@
+               CALL(sys_rt_tgsigqueueinfo)
+               CALL(sys_perf_event_open)
+ /* 365 */     CALL(sys_recvmmsg)
++              CALL(sys_accept4)
+ #ifndef syscalls_counted
+ .equ syscalls_padding, ((NR_syscalls + 3) & ~3) - NR_syscalls
+ #define syscalls_counted
diff --git a/meta-fsl-arm/recipes-kernel/linux/linux-imx/002_Return_ERESTARTSYS_from_IPU_GET_EVENT.patch b/meta-fsl-arm/recipes-kernel/linux/linux-imx/002_Return_ERESTARTSYS_from_IPU_GET_EVENT.patch
new file mode 100644 (file)
index 0000000..08cf608
--- /dev/null
@@ -0,0 +1,23 @@
+commit 0ffabfea6c190d28e25587c95e282eb777b3feb2
+Author: Phil Endecott <git@chezphil.org>
+Date:   Mon Oct 31 21:21:41 2011 +0000
+
+    Return ERESTARTSYS from IPU_GET_EVENT
+
+Index: git/drivers/mxc/ipu/ipu_device.c
+===================================================================
+--- git.orig/drivers/mxc/ipu/ipu_device.c      2012-01-24 15:34:37.000000000 +0100
++++ git/drivers/mxc/ipu/ipu_device.c   2012-01-31 16:21:19.599303457 +0100
+@@ -411,8 +411,10 @@
+                       r = get_events(&info);
+                       if (r == -1) {
+-                              wait_event_interruptible_timeout(waitq,
+-                                              (pending_events != 0), 2 * HZ);
++                              if (wait_event_interruptible_timeout(waitq,
++                                              (pending_events != 0), 2 * HZ)) < 0) {
++                                      return -ERESTARTSYS;
++                              }
+                               r = get_events(&info);
+                       }
+                       ret = -1;
diff --git a/meta-fsl-arm/recipes-kernel/linux/linux-imx/003_Sanitise_ipu_interrupt_return_value.patch b/meta-fsl-arm/recipes-kernel/linux/linux-imx/003_Sanitise_ipu_interrupt_return_value.patch
new file mode 100644 (file)
index 0000000..c199959
--- /dev/null
@@ -0,0 +1,50 @@
+commit 7237ebd59bf1cd8bcc9508ec4bc5674dc7cc6c58
+Author: Phil Endecott <git@chezphil.org>
+Date:   Tue Nov 1 18:16:56 2011 +0000
+
+    Sanitise ipu interrupt return value, and loop waiting for interrupt
+
+diff --git a/drivers/mxc/ipu3/ipu_device.c b/drivers/mxc/ipu3/ipu_device.c
+index 1955f09..d66b8f8 100644
+--- a/drivers/mxc/ipu3/ipu_device.c
++++ b/drivers/mxc/ipu3/ipu_device.c
+@@ -311,7 +311,7 @@ static int mxc_ipu_ioctl(struct inode *inode, struct file *file,
+               structure and pass the pointer in arg */
+               {
+                       ipu_event_info info;
+-                      int r = -1;
++                      int r;
+                       if (copy_from_user
+                                       (&info, (ipu_event_info *) arg,
+@@ -319,7 +319,7 @@ static int mxc_ipu_ioctl(struct inode *inode, struct file *file,
+                               return -EFAULT;
+                       r = get_events(&info);
+-                      if (r == -1) {
++                      while (r == -1) {
+                               if ((file->f_flags & O_NONBLOCK) &&
+                                       (irq_info[info.irq].irq_pending == 0))
+                                       return -EAGAIN;
+@@ -328,13 +328,15 @@ static int mxc_ipu_ioctl(struct inode *inode, struct file *file,
+                                       return -ERESTARTSYS;
+                               }
+                               r = get_events(&info);
++                              if (r == -1) {
++                                      /* Shouldn't happen? */
++                                      printk(KERN_ERR "no events after waiting\n");
++                              }
+                       }
+-                      ret = -1;
+-                      if (r == 0) {
+-                              if (!copy_to_user((ipu_event_info *) arg,
+-                                      &info, sizeof(ipu_event_info)))
+-                                      ret = 0;
+-                      }
++                      if (copy_to_user((ipu_event_info *) arg,
++                              &info, sizeof(ipu_event_info)))
++                              return -EFAULT;
++                      ret = 0;
+               }
+               break;
+       case IPU_ALOC_MEM:
index a7f081211c83bdddc6a3343e4a237242e0e50eb0..a1c074296986bb513f037821dfdd6ed447f03068 100644 (file)
@@ -4,7 +4,7 @@
 DESCRIPTION = "Linux kernel for imx platforms"
 LICENSE = "GPLv2"
 LIC_FILES_CHKSUM = "file://COPYING;md5=d7810fab7487fb0aad327b76f1be7cd7"
-PR = "r11"
+PR = "r12"
 
 inherit kernel
 COMPATIBLE_MACHINE = "(imx53qsb|imx53ard|imx51evk)"
@@ -27,6 +27,9 @@ SRC_URI = "git://opensource.freescale.com/pub/scm/imx/linux-2.6-imx.git;tag=rel_
            file://1147-ENGR00170244-2-ARM-AHCI-Enable-PDDQ-mode-when-no-d.patch \
            file://no-unaligned-access.patch \
            file://0001-mx53_loco-add-USR-led-support.patch \
+           file://001_Add_accept4_syscall.patch \
+           file://002_Return_ERESTARTSYS_from_IPU_GET_EVENT.patch \
+           file://003_Sanitise_ipu_interrupt_return_value.patch \
            file://defconfig \
           "