Skip to contentSkip to conversation

backports: few enhancements still based on 20150626

PATCH Superseded Luis R. Rodriguez 1 participant 3 messages Jul 16, 2015

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

cover backports: few enhancements still based on 20150626

A few enhancements still based on next-20150626.

Luis R. Rodriguez (2):
patches: replace most of 0002-no_dmabuf with SmPL
ckmake: address directory max depth

 devel/ckmake                                       | 132 +++++----
 .../media/0002-no_dmabuf.cocci                     |  75 +++++
 .../media/0002-no_dmabuf/v4l2.patch                | 305 +--------------------
 3 files changed, 163 insertions(+), 349 deletions(-)
 create mode 100644 patches/collateral-evolutions/media/0002-no_dmabuf.cocci
Signature · 4 lines
2.3.2.209.gd67f9d5.dirty

--
To unsubscribe from this list: send the line "unsubscribe backports" in
#1 lore raw

PATCH 1/2 patches: replace most of 0002-no_dmabuf with SmPL

The 0002-no_dmabuf patch series creates the largest delta for backports, and it turns out we can generalize it thorugh SmPL. There's just a few changes we can't get rid of as they relate to other build things.

1   3.0-rc0300101       [  OK  ]
2   3.1-rc030110        [  OK  ]
3   3.2-rc030268        [  OK  ]
4   3.3-rc030308        [  OK  ]
5   3.4-rc0304107       [  OK  ]
6   3.5-rc03050712      [  OK  ]
7   3.6-rc030611        [  OK  ]
8   3.7-rc030710        [  OK  ]
9   3.8-rc030813        [  OK  ]
10  3.9-rc030911        [  OK  ]
11  3.10-rc031075       [  OK  ]
12  3.11-rc031110       [  OK  ]
13  3.12-rc031240       [  OK  ]
14  3.13-rc031311       [  OK  ]
15  3.14-rc031439       [  OK  ]
16  3.15-rc031510       [  OK  ]
17  3.16-rc031607       [  OK  ]
18  3.17-rc031708       [  OK  ]
19  3.18-rc031812       [  OK  ]
20  3.19-rc031905       [  OK  ]
21  4.0-rc040000        [  OK  ]
22  4.1-rc8             [  OK  ]
---
 .../media/0002-no_dmabuf.cocci                     |  75 +++++
 .../media/0002-no_dmabuf/v4l2.patch                | 305 +--------------------
 2 files changed, 79 insertions(+), 301 deletions(-)
 create mode 100644 patches/collateral-evolutions/media/0002-no_dmabuf.cocci
patches/collateral-evolutions/media/0002-no_dmabuf.cocci new file +75 -0
new file mode 100644
index 000000000000..edcfd1db91df
@@ -0,0 +1,75 @@
+/* c5384048 */
+
+@ vb2_mem_ops @
+identifier s, dma_fn;
+identifier dma_op =~ "(get_dma|map_dma|unmap_dma|attach_dma|detach_dma)";
+@@
+
+ struct vb2_mem_ops s = {
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,5,0)
+ 	.dma_op = dma_fn,
++#endif /* LINUX_VERSION_CODE >= KERNEL_VERSION(3,5,0) */
+};
+
+@ mod_dma_fn depends on vb2_mem_ops @
+identifier vb2_mem_ops.dma_fn;
+@@
+
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,5,0)
+ dma_fn(...)
+ {
+ 	...
+ }
++#endif /* LINUX_VERSION_CODE >= KERNEL_VERSION(3,5,0) */
+
+@ v4l_ioctl_ops @
+identifier s, ioctl_fn;
+identifier ioctl_op =~ "(vidioc_expbuf)";
+@@
+struct v4l2_ioctl_ops s = {
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,5,0)
+	.ioctl_op = ioctl_fn,
++#endif
+};
+
+@ mod_ioctl_fn depends on v4l_ioctl_ops @
+identifier v4l_ioctl_ops.ioctl_fn;
+@@
+
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,5,0)
+ ioctl_fn(...)
+ {
+ 	...
+ }
++#endif /* LINUX_VERSION_CODE >= KERNEL_VERSION(3,5,0) */
+
+@ dma_buf_op_add_ifdef @
+identifier s, dma_fn;
+@@
+
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,5,0)
+ struct dma_buf_ops s = {
+ ...
+};
++#endif /* LINUX_VERSION_CODE >= KERNEL_VERSION(3,5,0) */
+
+@ dma_buf_op @
+identifier s, dma_fn;
+identifier dma_op;
+@@
+
+ struct dma_buf_ops s = {
+	.dma_op = dma_fn,
+};
+
+@ modify_dma_fn depends on dma_buf_op @
+identifier dma_buf_op.dma_fn;
+@@
+
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,5,0)
+ dma_fn(...)
+ {
+ 	...
+ }
++#endif /* LINUX_VERSION_CODE >= KERNEL_VERSION(3,5,0) */
+
patches/collateral-evolutions/media/0002-no_dmabuf/v4l2.patch +4 -301

336 lines not on this page · raw message

Signature · 4 lines
2.3.2.209.gd67f9d5.dirty

--
To unsubscribe from this list: send the line "unsubscribe backports" in
#2 lore raw

PATCH 2/2 ckmake: address directory max depth

In reply to Luis R. Rodriguez

It seems new versions of python make the os walk recurse more than we used to before, our ckmake implementation was picking up more kernels targets than obviously we want to build then. Fix this by replacing the os.walk() with a simple os.listdir() which just keeps us at the top level directory of lib/modules.

There are issues still with the way kernels are reported but that's a cosmetic thing which we can fix next.

---
 devel/ckmake | 132 +++++++++++++++++++++++++++++++++++++----------------------
 1 file changed, 84 insertions(+), 48 deletions(-)
devel/ckmake +84 -48
index 0c238a65de8d..23f3819221f8 100755
@@ -455,52 +455,58 @@ class kernel_set():
                 return
         self.releases.insert(new_rel['idx'], new_rel)
 
-    def parse_releases(self, target_kranges):
+    def parse_releases(self, target_kranges, args):
         self.target_kranges = target_kranges
-        for dirname, dirnames, filenames in os.walk(modules):
-            rels = []
-            for subdirname in dirnames:
-                specifics = get_rel_spec_ubuntu(subdirname)
-                if (not specifics):
-                    continue
-                base_specs = get_base_spec(specifics)
-                if (not base_specs):
-                    continue
-                rc = False
-
-                ver = specifics['VERSION'] + '.' + \
-                    specifics['PATCHLEVEL']
-
-                if ("rc" in subdirname):
-                    rc = True
-                    ver = ver + '-rc' + specifics['EXTRAVERSION']
-                else:
-                    ver = ver + '.' + specifics['SUBLEVEL']
-
-                get_rel_spec_base(subdirname)
-                rel = dict(name=subdirname,
-                           full_path=dirname + '/' +
-                           subdirname,
-                           version=ver,
-                           is_rc=rc,
-                           ver=specifics['VERSION'],
-                           pat=specifics['PATCHLEVEL'],
-                           sub=specifics['SUBLEVEL'],
-                           ext=specifics['EXTRAVERSION'],
-                           base_weight=compute_rel_weight_base(base_specs),
-                           weight=compute_rel_weight(specifics),
-                           processed=False,
-                           log='',
-                           status=1234)
-                rels.append(rel)
-
-            def relsort(rel):
-                return int(rel['ver']), int(rel['pat']), int(rel['sub'])
-            rels.sort(key=relsort)
-            for rel in rels:
-                rel['idx'] = len(self.releases)
-                self.evaluate_new_rel(rel)
-        self.refresh()
+        rels = []
+        if args.develdebug:
+            sys.stdout.write("Paths for kernels:\n")
+        for path in os.listdir(os.path.abspath(modules)):
+            subdirname = os.path.abspath(os.path.join(modules, path))
+            if not os.path.isdir(subdirname):
+                continue
+            if args.develdebug:
+                sys.stdout.write("%s\n" % (subdirname))
+            specifics = get_rel_spec_ubuntu(path)
+            if (not specifics):
+                continue
+            base_specs = get_base_spec(specifics)
+            if (not base_specs):
+                continue
+            rc = False
+
+            ver = specifics['VERSION'] + '.' + \
+                specifics['PATCHLEVEL']
+
+            if ("rc" in subdirname):
+                rc = True
+                ver = ver + '-rc' + specifics['EXTRAVERSION']
+            else:
+                ver = ver + '.' + specifics['SUBLEVEL']
+
+            get_rel_spec_base(subdirname)
+            rel = dict(name=subdirname,
+                       full_path=subdirname,
+                       version=ver,
+                       is_rc=rc,
+                       ver=specifics['VERSION'],
+                       pat=specifics['PATCHLEVEL'],
+                       sub=specifics['SUBLEVEL'],
+                       ext=specifics['EXTRAVERSION'],
+                       base_weight=compute_rel_weight_base(base_specs),
+                       weight=compute_rel_weight(specifics),
+                       processed=False,
+                       log='',
+                       status=1234)
+            rels.append(rel)
+
+        def relsort(rel):
+            return int(rel['ver']), int(rel['pat']), int(rel['sub'])
+        rels.sort(key=relsort)
+        for rel in rels:
+            rel['idx'] = len(self.releases)
+            self.evaluate_new_rel(rel)
+        if not args.develdebug:
+            self.refresh()
 
     def setup_screen(self):
         for i in range(0, len(self.releases)):
@@ -519,6 +525,16 @@ class kernel_set():
             self.stdscr.refresh()
             self.lock.release()
 
+    def setup_screen_debug(self):
+        sys.stdout.write("%-4s" % ("IDX"))
+        sys.stdout.write("%-20s" % ("VERSION"))
+        sys.stdout.write("%-60s\n" % ("DIRECTORY"))
+        for i in range(0, len(self.releases)):
+            rel = self.releases[i]
+            sys.stdout.write("%-4d" % (rel['idx'] + 1))
+            sys.stdout.write("%-20s" % (rel['version']))
+            sys.stdout.write("%-60s\n" % (rel['full_path']))
+
     def create_threads(self, cmdline_args):
         for rel in self.releases:
             th = Thread(target=process_kernel, args=(0, self, cmdline_args))
@@ -552,9 +568,19 @@ class kernel_set():
 def main(stdscr, args, target_kranges):
     kset = kernel_set(stdscr)
 
-    kset.set_locale()
-    kset.parse_releases(target_kranges)
+    if args.develdebug:
+        kill_curses()
+    else:
+        kset.set_locale()
+
+    kset.parse_releases(target_kranges, args)
+
+    if args.develdebug:
+        kset.setup_screen_debug()
+        sys.exit(0)
+
     kset.setup_screen()
+
     kset.create_threads(args)
     kset.kick_threads()
     kset.wait_threads()
@@ -602,6 +628,9 @@ if __name__ == "__main__":
                         help='Build this defconfig rather than only backport code.')
     parser.add_argument('--revs', metavar='<revision-list>', type=str,
                         help='Optional list of kernel revisions to test for, example: 2.6.24,2.6.30,2.6.32..3.2,3.4')
+    parser.add_argument(
+        '--develdebug', const=True, default=False, action="store_const",
+        help='Development debug - use to debug which kernels we are going to process')
     args = parser.parse_args()
 
     target_kranges = []
@@ -624,8 +653,15 @@ if __name__ == "__main__":
         os.remove(ckmake_report)
     if os.path.exists(tmp_path):
         rmtree(tmp_path)
-    os.makedirs(tmp_path)
+
+    if not args.develdebug:
+        os.makedirs(tmp_path)
+
     curses.wrapper(main, args, target_kranges)
+
+    if args.develdebug:
+        sys.exit(ckmake_return)
+
     kill_curses()
     process_logs()
     clean()
Signature · 4 lines
2.3.2.209.gd67f9d5.dirty

--
To unsubscribe from this list: send the line "unsubscribe backports" in