Skip to contentSkip to conversation

Few updates for next-20130429

PATCH Applied Luis R. Rodriguez 2 participants 9 messages May 16, 2013 – May 17, 2013

lore
Share & tools
lore
#0 lore raw

v2 cover Few updates for next-20130429

From: "Luis R. Rodriguez" <[email protected]>

Here are a few updates for next-20130429. The nouveau stuff still needs to be figured out.

Luis R. Rodriguez (4):
backports: revert remove_proc_subtree() for backport
backports: add PDE_DATA() case when CONFIG_PROC_FS is disabled
backports: add proc_set_size() and proc_set_user() gentree.py: do not skip /dev/null patches

 backport/backport-include/linux/proc_fs.h          |   12 +++-
 backport/compat/backport-3.10.c                    |   23 +++++++-
 gentree.py                                         |    2 +-
 .../drm/12-revert-remove_proc_subtree/INFO         |   25 ++++++++
 .../drivers_gpu_drm_drm_proc.patch                 |   62 ++++++++++++++++++++
 5 files changed, 119 insertions(+), 5 deletions(-)
 create mode 100644 patches/collateral-evolutions/drm/12-revert-remove_proc_subtree/INFO
 create mode 100644 patches/collateral-evolutions/drm/12-revert-remove_proc_subtree/drivers_gpu_drm_drm_proc.patch
Signature · 1 line
1.7.10.4
#1 lore raw

PATCH v2 1/4 backports: revert remove_proc_subtree() for backport

From: "Luis R. Rodriguez" <[email protected]>

Intorduced in next-20130429 and Linus has merged it onto v3.10-rc1. We cannot backport remove_proc_subtree() modularly [0] so just go ahead and revert this change.

The alternative is to go and review each procfs usage for each driver we have issues and see if it makes sense to replace procs with debugfs upstream.

commit 8ce584c7416d8a85a6f3edc17d1cddefe331e87e

Author: Al Viro <[email protected]>
Date:   Sat Mar 30 20:13:46 2013 -0400

procfs: add proc_remove_subtree()

just what it sounds like; do that only to procfs subtrees you've created - doing that to something shared with another driver is not only antisocial, but might cause interesting races with proc_create() and its ilk.

[0] http://marc.info/?t=136841961600002&r=1&w=2

---
 .../drm/12-revert-remove_proc_subtree/INFO         |   25 ++++++++
 .../drivers_gpu_drm_drm_proc.patch                 |   62 ++++++++++++++++++++
 2 files changed, 87 insertions(+)
 create mode 100644 patches/collateral-evolutions/drm/12-revert-remove_proc_subtree/INFO
 create mode 100644 patches/collateral-evolutions/drm/12-revert-remove_proc_subtree/drivers_gpu_drm_drm_proc.patch
patches/collateral-evolutions/drm/12-revert-remove_proc_subtree/INFO new file +25 -0
new file mode 100644
index 0000000..8dbcf8a
@@ -0,0 +1,25 @@
+We cannot backport remove_proc_subtree() modularly so the
+only thing we can do is revert its usage. This patch reverts
+all of its usage and the commits that added them are listed
+below.
+
+Another thing we could do is look at each driver's usage of
+proc and see if its reasonable to instead covert it to use
+debugfs. This needs to be dealt with on a case by case basis.
+
+From 8bc742e13fb2c9cd64988816749295e9ddf53101 Mon Sep 17 00:00:00 2001
+From: David Howells <[email protected]>
+Date: Fri, 12 Apr 2013 16:15:07 +0100
+Subject: [PATCH] drm: proc: Use remove_proc_subtree()
+
+Use remove_proc_subtree() rather than remove_proc_entry() to remove a
+minor-specific drm proc directory and all its children.
+
+Things could theoretically be improved by storing the drm_minor pointer in the
+minor-specific dir proc_dir_entry struct data and then scrapping the list of
+proc files - but that's shared with the debugfs interface where you can't do
+that, so I don't see an easy way of doing it.
+
+Signed-off-by: David Howells <[email protected]>
+cc: [email protected]
+Signed-off-by: Al Viro <[email protected]>
patches/collateral-evolutions/drm/12-revert-remove_proc_subtree/drivers_gpu_drm_drm_proc.patch new file +62 -0

62 lines not on this page · raw message

Signature · 1 line
1.7.10.4
#2 lore raw

PATCH v2 2/4 backports: add PDE_DATA() case when CONFIG_PROC_FS is disabled

In reply to Luis R. Rodriguez

From: "Luis R. Rodriguez" <[email protected]>

This was missing.

---
 backport/backport-include/linux/proc_fs.h |    3 +++
 1 file changed, 3 insertions(+)
backport/backport-include/linux/proc_fs.h +3 -0
index 5a1bec1..22a7b54 100644
@@ -4,6 +4,7 @@
 #include <linux/version.h>
 
 #if LINUX_VERSION_CODE < KERNEL_VERSION(3,10,0)
+#ifdef CONFIG_PROC_FS
 /*
  * backport of:
  * procfs: new helper - PDE_DATA(inode)
@@ -12,6 +13,8 @@ static inline void *PDE_DATA(const struct inode *inode)
 {
 	return PROC_I(inode)->pde->data;
 }
+#else
+static inline void *PDE_DATA(const struct inode *inode) {BUG(); return NULL;}
 #endif
 
 #endif /* __BACKPORT_PROC_FS_H */
Signature · 1 line
1.7.10.4
#3 lore raw

PATCH v2 3/4 backports: add proc_set_size() and proc_set_user()

In reply to Luis R. Rodriguez

From: "Luis R. Rodriguez" <[email protected]>

mcgrof@frijol ~/linux-stable (git::master)$ git describe --contains 271a15ea v3.10-rc1~129^2~24

commit 271a15eabe094538d958dc68ccfc9c36b699247a

Author: David Howells <[email protected]>
Date:   Fri Apr 12 00:38:51 2013 +0100

proc: Supply PDE attribute setting accessor functions

Supply accessor functions to set attributes in proc_dir_entry structs.

The following are supplied: proc_set_size() and proc_set_user().

---
 backport/backport-include/linux/proc_fs.h |    9 ++++++++-
 backport/compat/backport-3.10.c           |   23 ++++++++++++++++++++---
 2 files changed, 28 insertions(+), 4 deletions(-)
backport/backport-include/linux/proc_fs.h +8 -1
index 22a7b54..05851d2 100644
@@ -4,6 +4,7 @@
 #include <linux/version.h>
 
 #if LINUX_VERSION_CODE < KERNEL_VERSION(3,10,0)
+
 #ifdef CONFIG_PROC_FS
 /*
  * backport of:
@@ -13,8 +14,14 @@ static inline void *PDE_DATA(const struct inode *inode)
 {
 	return PROC_I(inode)->pde->data;
 }
+extern void proc_set_size(struct proc_dir_entry *, loff_t);
+extern void proc_set_user(struct proc_dir_entry *, kuid_t, kgid_t);
 #else
 static inline void *PDE_DATA(const struct inode *inode) {BUG(); return NULL;}
-#endif
+static inline void proc_set_size(struct proc_dir_entry *de, loff_t size) {}
+static inline void proc_set_user(struct proc_dir_entry *de, kuid_t uid, kgid_t gid) {}
+#endif /* CONFIG_PROC_FS */
+
+#endif /* LINUX_VERSION_CODE < KERNEL_VERSION(3,10,0) */
 
 #endif /* __BACKPORT_PROC_FS_H */
backport/compat/backport-3.10.c +20 -3
index 69c3788..980ed59 100644
@@ -8,14 +8,17 @@
  * published by the Free Software Foundation.
  */
 
-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,6,0))
 #include <linux/kernel.h>
+#include <linux/module.h>
+#include <linux/err.h>
+#include <linux/proc_fs.h>
+
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,6,0))
 #include <linux/init.h>
 #include <linux/debugfs.h>
 #include <linux/device.h>
 #include <linux/slab.h>
 #include <linux/async.h>
-#include <linux/err.h>
 #include <linux/mutex.h>
 #include <linux/suspend.h>
 #include <linux/delay.h>
@@ -26,8 +29,9 @@
 #include <linux/regulator/consumer.h>
 #include <linux/regulator/driver.h>
 #include <linux/regulator/machine.h>
-#include <linux/module.h>
+#endif /* (LINUX_VERSION_CODE >= KERNEL_VERSION(3,6,0)) */
 
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,6,0))
 /**
  * regulator_map_voltage_ascend - map_voltage() for ascendant voltage list
  *
@@ -60,3 +64,16 @@ int regulator_map_voltage_ascend(struct regulator_dev *rdev,
 EXPORT_SYMBOL_GPL(regulator_map_voltage_ascend);
 
 #endif /* (LINUX_VERSION_CODE >= KERNEL_VERSION(3,6,0)) */
+
+void proc_set_size(struct proc_dir_entry *de, loff_t size)
+{
+	de->size = size;
+}
+EXPORT_SYMBOL_GPL(proc_set_size);
+
+void proc_set_user(struct proc_dir_entry *de, kuid_t uid, kgid_t gid)
+{
+	de->uid = uid;
+	de->gid = gid;
+}
+EXPORT_SYMBOL_GPL(proc_set_user);
Signature · 1 line
1.7.10.4
#4 lore raw

PATCH v2 4/4 gentree.py: do not skip /dev/null patches

In reply to Luis R. Rodriguez

From: "Luis R. Rodriguez" <[email protected]>

Patches where the origin is /dev/null should
be considered as needed.

---
 gentree.py |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
gentree.py +1 -1
index 9d0f3ae..372587f 100755
@@ -368,7 +368,7 @@ def process(kerneldir, outdir, copy_list_file, git_revision=None,
         # assume the patch needs to be applied -- otherwise continue
         patched_file = '/'.join(p.items[0].source.split('/')[1:])
         fullfn = os.path.join(args.outdir, patched_file)
-        if not os.path.exists(fullfn):
+        if ((patched_file != "null") and (not os.path.exists(fullfn))):
             if args.verbose:
                 logwrite("Not applying %s, not needed" % print_name)
             continue
Signature · 1 line
1.7.10.4
#5 lore raw

Re: [PATCH v2 4/4] gentree.py: do not skip /dev/null patches

gentree.py def process(kerneldir, outdir, copy_list_file, git_revision=None, · line 371

Quoted 8 lines · Luis R. Rodriguez
gentree.py +1 -1
@@ -368,7 +368,7 @@ def process(kerneldir, outdir, copy_list_file, git_revision=None,
         # assume the patch needs to be applied -- otherwise continue
         patched_file = '/'.join(p.items[0].source.split('/')[1:])
         fullfn = os.path.join(args.outdir, patched_file)
-        if not os.path.exists(fullfn):
+        if ((patched_file != "null") and (not os.path.exists(fullfn))):

Do you actually have patches adding completely new files? That seems a bit odd to me?

johannes

#6 lore raw

Re: [PATCH v2 4/4] gentree.py: do not skip /dev/null patches

Quoted 13 lines · Johannes Berg

gentree.py def process(kerneldir, outdir, copy_list_file, git_revision=None, · line 371

Quoted 8 lines · Luis R. Rodriguez
gentree.py +1 -1
@@ -368,7 +368,7 @@ def process(kerneldir, outdir, copy_list_file, git_revision=None,
         # assume the patch needs to be applied -- otherwise continue
         patched_file = '/'.join(p.items[0].source.split('/')[1:])
         fullfn = os.path.join(args.outdir, patched_file)
-        if not os.path.exists(fullfn):
+        if ((patched_file != "null") and (not os.path.exists(fullfn))):

Do you actually have patches adding completely new files? That seems a bit odd to me?

For nouveau I did during some of my tests but no, I don't now.

Luis

#7 lore raw
In reply to Luis R. Rodriguez
Quoted 4 lines · Luis R. Rodriguez

From: "Luis R. Rodriguez" <[email protected]>

Here are a few updates for next-20130429. The nouveau stuff still needs to be figured out.

Applied, with patch 4 replaced by a patch to error out on patches creating files.

johannes

#8 lore raw
In reply to Luis R. Rodriguez
Quoted 4 lines · Luis R. Rodriguez

From: "Luis R. Rodriguez" <[email protected]>

Here are a few updates for next-20130429. The nouveau stuff still needs to be figured out.

Applied, with patch 4 replaced by a patch to error out on patches creating files.

johannes