aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux/brcm2708/patches-3.10/0144-vc_mem-tidy-up-debug-procfs-code.patch
diff options
context:
space:
mode:
authorFlorian Fainelli <florian@openwrt.org>2014-02-28 20:30:08 +0000
committerFlorian Fainelli <florian@openwrt.org>2014-02-28 20:30:08 +0000
commitbb39b8d99aae1f7eb13a97bd874838da91080de6 (patch)
tree3046f53937c0bc5dc13e2b2ab7b688a1932199bf /target/linux/brcm2708/patches-3.10/0144-vc_mem-tidy-up-debug-procfs-code.patch
parentc6c0d09f85c211560a1405441925681cfa25e8b1 (diff)
downloadupstream-bb39b8d99aae1f7eb13a97bd874838da91080de6.tar.gz
upstream-bb39b8d99aae1f7eb13a97bd874838da91080de6.tar.bz2
upstream-bb39b8d99aae1f7eb13a97bd874838da91080de6.zip
brcm2708: update against latest rpi-3.10.y branch
Update our copies of the brcm2708 patches to the latest rpi-3.10-y rebased against linux-3.10.y stable (3.10.32). This should hopefully make it easier for us in the future to leverage the raspberry/rpi-* branches. Signed-off-by: Florian Fainelli <florian@openwrt.org> SVN-Revision: 39770
Diffstat (limited to 'target/linux/brcm2708/patches-3.10/0144-vc_mem-tidy-up-debug-procfs-code.patch')
-rw-r--r--target/linux/brcm2708/patches-3.10/0144-vc_mem-tidy-up-debug-procfs-code.patch193
1 files changed, 193 insertions, 0 deletions
diff --git a/target/linux/brcm2708/patches-3.10/0144-vc_mem-tidy-up-debug-procfs-code.patch b/target/linux/brcm2708/patches-3.10/0144-vc_mem-tidy-up-debug-procfs-code.patch
new file mode 100644
index 0000000000..06c10295a4
--- /dev/null
+++ b/target/linux/brcm2708/patches-3.10/0144-vc_mem-tidy-up-debug-procfs-code.patch
@@ -0,0 +1,193 @@
+From e9db9a1035224a30ebb6be44e760e57518d19533 Mon Sep 17 00:00:00 2001
+From: Luke Diamand <luked@broadcom.com>
+Date: Sat, 28 Dec 2013 07:39:51 +0000
+Subject: [PATCH 144/174] vc_mem: tidy up debug procfs code
+
+Remove commented-out procfs code, which was generating
+a warning and no longer worked. Replace this with
+equivalent debugfs entries.
+
+Signed-off-by: Luke Diamand <luked@broadcom.com>
+---
+ arch/arm/mach-bcm2708/vc_mem.c | 119 +++++++++++++++++------------------------
+ 1 file changed, 49 insertions(+), 70 deletions(-)
+
+--- a/arch/arm/mach-bcm2708/vc_mem.c
++++ b/arch/arm/mach-bcm2708/vc_mem.c
+@@ -19,7 +19,7 @@
+ #include <linux/cdev.h>
+ #include <linux/mm.h>
+ #include <linux/slab.h>
+-#include <linux/proc_fs.h>
++#include <linux/debugfs.h>
+ #include <asm/uaccess.h>
+ #include <linux/dma-mapping.h>
+
+@@ -51,8 +51,9 @@ static struct class *vc_mem_class = NULL
+ static struct cdev vc_mem_cdev;
+ static int vc_mem_inited = 0;
+
+-// Proc entry
+-static struct proc_dir_entry *vc_mem_proc_entry;
++#ifdef CONFIG_DEBUG_FS
++static struct dentry *vc_mem_debugfs_entry;
++#endif
+
+ /*
+ * Videocore memory addresses and size
+@@ -280,75 +281,60 @@ static const struct file_operations vc_m
+ .mmap = vc_mem_mmap,
+ };
+
+-/****************************************************************************
+-*
+-* vc_mem_proc_read
+-*
+-***************************************************************************/
+-
+-static int
+-vc_mem_proc_read(char *buf, char **start, off_t offset, int count, int *eof,
+- void *data)
++#ifdef CONFIG_DEBUG_FS
++static void vc_mem_debugfs_deinit(void)
+ {
+- char *p = buf;
+-
+- (void) start;
+- (void) count;
+- (void) data;
+-
+- if (offset > 0) {
+- *eof = 1;
+- return 0;
+- }
+- // Get the videocore memory size first
+- vc_mem_get_size();
+-
+- p += sprintf(p, "Videocore memory:\n");
+- if (mm_vc_mem_phys_addr != 0)
+- p += sprintf(p, " Physical address: 0x%p\n",
+- (void *) mm_vc_mem_phys_addr);
+- else
+- p += sprintf(p, " Physical address: 0x00000000\n");
+- p += sprintf(p, " Length (bytes): %u\n", mm_vc_mem_size);
+-
+- *eof = 1;
+- return p - buf;
++ debugfs_remove_recursive(vc_mem_debugfs_entry);
++ vc_mem_debugfs_entry = NULL;
+ }
+
+-/****************************************************************************
+-*
+-* vc_mem_proc_write
+-*
+-***************************************************************************/
+
+-static int
+-vc_mem_proc_write(struct file *file, const char __user * buffer,
+- unsigned long count, void *data)
++static int vc_mem_debugfs_init(
++ struct device *dev)
+ {
+- int rc = -EFAULT;
+- char input_str[10];
+-
+- memset(input_str, 0, sizeof (input_str));
+-
+- if (count > sizeof (input_str)) {
+- LOG_ERR("%s: input string length too long", __func__);
+- goto out;
+- }
+-
+- if (copy_from_user(input_str, buffer, count - 1)) {
+- LOG_ERR("%s: failed to get input string", __func__);
+- goto out;
++ vc_mem_debugfs_entry = debugfs_create_dir(DRIVER_NAME, NULL);
++ if (!vc_mem_debugfs_entry) {
++ dev_warn(dev, "could not create debugfs entry\n");
++ return -EFAULT;
++ }
++
++ if (!debugfs_create_x32("vc_mem_phys_addr",
++ 0444,
++ vc_mem_debugfs_entry,
++ (u32 *)&mm_vc_mem_phys_addr)) {
++ dev_warn(dev, "%s:could not create vc_mem_phys entry\n",
++ __func__);
++ goto fail;
++ }
++
++ if (!debugfs_create_x32("vc_mem_size",
++ 0444,
++ vc_mem_debugfs_entry,
++ (u32 *)&mm_vc_mem_size)) {
++ dev_warn(dev, "%s:could not create vc_mem_size entry\n",
++ __func__);
++ goto fail;
++ }
++
++ if (!debugfs_create_x32("vc_mem_base",
++ 0444,
++ vc_mem_debugfs_entry,
++ (u32 *)&mm_vc_mem_base)) {
++ dev_warn(dev, "%s:could not create vc_mem_base entry\n",
++ __func__);
++ goto fail;
+ }
+
+- if (strncmp(input_str, "connect", strlen("connect")) == 0) {
+- // Get the videocore memory size from the videocore
+- vc_mem_get_size();
+- }
++ return 0;
+
+- out:
+- return rc;
++fail:
++ vc_mem_debugfs_deinit();
++ return -EFAULT;
+ }
+
++#endif /* CONFIG_DEBUG_FS */
++
++
+ /****************************************************************************
+ *
+ * vc_mem_init
+@@ -398,21 +384,14 @@ vc_mem_init(void)
+ goto out_class_destroy;
+ }
+
+-#if 0
+- vc_mem_proc_entry = create_proc_entry(DRIVER_NAME, 0444, NULL);
+- if (vc_mem_proc_entry == NULL) {
+- rc = -EFAULT;
+- LOG_ERR("%s: create_proc_entry failed", __func__);
+- goto out_device_destroy;
+- }
+- vc_mem_proc_entry->read_proc = vc_mem_proc_read;
+- vc_mem_proc_entry->write_proc = vc_mem_proc_write;
++#ifdef CONFIG_DEBUG_FS
++ /* don't fail if the debug entries cannot be created */
++ vc_mem_debugfs_init(dev);
+ #endif
+
+ vc_mem_inited = 1;
+ return 0;
+
+- out_device_destroy:
+ device_destroy(vc_mem_class, vc_mem_devnum);
+
+ out_class_destroy:
+@@ -441,8 +420,8 @@ vc_mem_exit(void)
+ LOG_DBG("%s: called", __func__);
+
+ if (vc_mem_inited) {
+-#if 0
+- remove_proc_entry(vc_mem_proc_entry->name, NULL);
++#if CONFIG_DEBUG_FS
++ vc_mem_debugfs_deinit();
+ #endif
+ device_destroy(vc_mem_class, vc_mem_devnum);
+ class_destroy(vc_mem_class);