From 068b443151ef21c9cba8d73585aa2ff9e963cdcb Mon Sep 17 00:00:00 2001 From: "kt920.kim" Date: Wed, 11 May 2011 12:11:29 +0900 Subject: [PATCH] Modified arch/x86/configs/i386_defconfig for logger feature. Added CONFIG_ANDROID_LOGGER symbol and modified drivers/staging/android/Kconfig to support android driver. Defined LOGGER_LOG_SYSTEM macro for system and framework messages. Changed size of LOGGER_LOG_MAIN and LOGGER_LOG_RADIO from 64*1024 to 128*1024. --- arch/x86/configs/i386_defconfig | 1 + drivers/staging/android/Kconfig | 3 +-- drivers/staging/android/binder.c | 12 ++++++++++-- drivers/staging/android/logger.c | 12 ++++++++++-- drivers/staging/android/logger.h | 1 + 5 files changed, 23 insertions(+), 6 deletions(-) diff --git a/arch/x86/configs/i386_defconfig b/arch/x86/configs/i386_defconfig index c211d07cda52..ca55f28b7cf9 100644 --- a/arch/x86/configs/i386_defconfig +++ b/arch/x86/configs/i386_defconfig @@ -2108,6 +2108,7 @@ CONFIG_EEEPC_LAPTOP=y # CONFIG_ACPI_WMI is not set # CONFIG_ACPI_ASUS is not set # CONFIG_ACPI_TOSHIBA is not set +CONFIG_ANDROID_LOGGER=y # # Firmware Drivers diff --git a/drivers/staging/android/Kconfig b/drivers/staging/android/Kconfig index eb675635ae60..95bc43af89c5 100644 --- a/drivers/staging/android/Kconfig +++ b/drivers/staging/android/Kconfig @@ -2,8 +2,7 @@ menu "Android" config ANDROID bool "Android Drivers" - depends on BROKEN - default N + default y ---help--- Enable support for various drivers needed on the Android platform diff --git a/drivers/staging/android/binder.c b/drivers/staging/android/binder.c index 99010d4b3044..17e5c24eae16 100644 --- a/drivers/staging/android/binder.c +++ b/drivers/staging/android/binder.c @@ -46,6 +46,7 @@ static struct proc_dir_entry *binder_proc_dir_entry_proc; static struct binder_node *binder_context_mgr_node; static uid_t binder_context_mgr_uid = -1; static int binder_last_id; +static struct workqueue_struct *binder_deferred_workqueue; static int binder_read_proc_proc(char *page, char **start, off_t off, int count, int *eof, void *data); @@ -3025,11 +3026,14 @@ static void binder_deferred_release(struct binder_proc *proc) int i; for (i = 0; i < proc->buffer_size / PAGE_SIZE; i++) { if (proc->pages[i]) { + void *page_addr = proc->buffer + i * PAGE_SIZE; binder_debug(BINDER_DEBUG_BUFFER_ALLOC, "binder_release: %d: " "page %d at %p not freed\n", proc->pid, i, - proc->buffer + i * PAGE_SIZE); + page_addr); + unmap_kernel_range((unsigned long)page_addr, + PAGE_SIZE); __free_page(proc->pages[i]); page_count++; } @@ -3099,7 +3103,7 @@ binder_defer_work(struct binder_proc *proc, enum binder_deferred_state defer) if (hlist_unhashed(&proc->deferred_work_node)) { hlist_add_head(&proc->deferred_work_node, &binder_deferred_list); - schedule_work(&binder_deferred_work); + queue_work(binder_deferred_workqueue, &binder_deferred_work); } mutex_unlock(&binder_deferred_lock); } @@ -3727,6 +3731,10 @@ static int __init binder_init(void) { int ret; + binder_deferred_workqueue = create_singlethread_workqueue("binder"); + if (!binder_deferred_workqueue) + return -ENOMEM; + binder_proc_dir_entry_root = proc_mkdir("binder", NULL); if (binder_proc_dir_entry_root) binder_proc_dir_entry_proc = proc_mkdir("proc", diff --git a/drivers/staging/android/logger.c b/drivers/staging/android/logger.c index 6c10b456c6cc..3b5a3606d8af 100644 --- a/drivers/staging/android/logger.c +++ b/drivers/staging/android/logger.c @@ -17,6 +17,7 @@ * GNU General Public License for more details. */ +#include #include #include #include @@ -553,9 +554,10 @@ static struct logger_log VAR = { \ .size = SIZE, \ }; -DEFINE_LOGGER_DEVICE(log_main, LOGGER_LOG_MAIN, 64*1024) +DEFINE_LOGGER_DEVICE(log_main, LOGGER_LOG_MAIN, 128*1024) DEFINE_LOGGER_DEVICE(log_events, LOGGER_LOG_EVENTS, 256*1024) -DEFINE_LOGGER_DEVICE(log_radio, LOGGER_LOG_RADIO, 64*1024) +DEFINE_LOGGER_DEVICE(log_radio, LOGGER_LOG_RADIO, 128*1024) +DEFINE_LOGGER_DEVICE(log_system, LOGGER_LOG_SYSTEM, 128*1024) static struct logger_log *get_log_from_minor(int minor) { @@ -565,6 +567,8 @@ static struct logger_log *get_log_from_minor(int minor) return &log_events; if (log_radio.misc.minor == minor) return &log_radio; + if (log_system.misc.minor == minor) + return &log_system; return NULL; } @@ -601,6 +605,10 @@ static int __init logger_init(void) if (unlikely(ret)) goto out; + ret = init_log(&log_system); + if (unlikely(ret)) + goto out; + out: return ret; } diff --git a/drivers/staging/android/logger.h b/drivers/staging/android/logger.h index a562434d7419..2cb06e9d8f98 100644 --- a/drivers/staging/android/logger.h +++ b/drivers/staging/android/logger.h @@ -32,6 +32,7 @@ struct logger_entry { #define LOGGER_LOG_RADIO "log_radio" /* radio-related messages */ #define LOGGER_LOG_EVENTS "log_events" /* system/hardware events */ +#define LOGGER_LOG_SYSTEM "log_system" /* system/framework messages */ #define LOGGER_LOG_MAIN "log_main" /* everything else */ #define LOGGER_ENTRY_MAX_LEN (4*1024) -- 2.34.1