Loading drivers/soc/qcom/boot_marker.c +12 −12 Original line number Diff line number Diff line Loading @@ -24,7 +24,7 @@ #include <linux/list.h> #include <linux/export.h> #include <linux/types.h> #include <linux/mutex.h> #include <linux/spinlock.h> #include <linux/mm.h> #include <asm/arch_timer.h> #include <soc/qcom/boot_stats.h> Loading @@ -37,7 +37,7 @@ struct boot_marker { char marker_name[BOOT_MARKER_MAX_LEN]; unsigned long long int timer_value; struct list_head list; struct mutex lock; spinlock_t slock; }; static struct dentry *dent_bkpi, *dent_bkpi_status, *dent_mpm_timer; Loading @@ -48,7 +48,7 @@ static void _destroy_boot_marker(const char *name) struct boot_marker *marker; struct boot_marker *temp_addr; mutex_lock(&boot_marker_list.lock); spin_lock(&boot_marker_list.slock); list_for_each_entry_safe(marker, temp_addr, &boot_marker_list.list, list) { if (strnstr(marker->marker_name, name, Loading @@ -57,7 +57,7 @@ static void _destroy_boot_marker(const char *name) kfree(marker); } } mutex_unlock(&boot_marker_list.lock); spin_unlock(&boot_marker_list.slock); } static void _create_boot_marker(const char *name, Loading @@ -70,7 +70,7 @@ static void _create_boot_marker(const char *name, ((timer_value % TIMER_KHZ) * 1000) / TIMER_KHZ); new_boot_marker = kmalloc(sizeof(*new_boot_marker), GFP_KERNEL); new_boot_marker = kmalloc(sizeof(*new_boot_marker), GFP_ATOMIC); if (!new_boot_marker) return; Loading @@ -78,9 +78,9 @@ static void _create_boot_marker(const char *name, sizeof(new_boot_marker->marker_name)); new_boot_marker->timer_value = timer_value; mutex_lock(&boot_marker_list.lock); spin_lock(&boot_marker_list.slock); list_add_tail(&(new_boot_marker->list), &(boot_marker_list.list)); mutex_unlock(&boot_marker_list.lock); spin_unlock(&boot_marker_list.slock); } static void set_bootloader_stats(void) Loading Loading @@ -143,7 +143,7 @@ static ssize_t bootkpi_reader(struct file *fp, char __user *user_buffer, if (!buf) return -ENOMEM; mutex_lock(&boot_marker_list.lock); spin_lock(&boot_marker_list.slock); list_for_each_entry(marker, &boot_marker_list.list, list) { temp += scnprintf(buf + temp, PAGE_SIZE - temp, "%-41s:%llu.%03llu seconds\n", Loading @@ -152,7 +152,7 @@ static ssize_t bootkpi_reader(struct file *fp, char __user *user_buffer, (((marker->timer_value % TIMER_KHZ) * 1000) / TIMER_KHZ)); } mutex_unlock(&boot_marker_list.lock); spin_unlock(&boot_marker_list.slock); rc = simple_read_from_buffer(user_buffer, count, position, buf, temp); kfree(buf); return rc; Loading Loading @@ -256,7 +256,7 @@ static int __init init_bootkpi(void) } INIT_LIST_HEAD(&boot_marker_list.list); mutex_init(&boot_marker_list.lock); spin_lock_init(&boot_marker_list.slock); set_bootloader_stats(); return 0; } Loading @@ -268,13 +268,13 @@ static void __exit exit_bootkpi(void) struct boot_marker *temp_addr; debugfs_remove_recursive(dent_bkpi); mutex_lock(&boot_marker_list.lock); spin_lock(&boot_marker_list.slock); list_for_each_entry_safe(marker, temp_addr, &boot_marker_list.list, list) { list_del(&marker->list); kfree(marker); } mutex_unlock(&boot_marker_list.lock); spin_unlock(&boot_marker_list.slock); boot_stats_exit(); } module_exit(exit_bootkpi); Loading Loading
drivers/soc/qcom/boot_marker.c +12 −12 Original line number Diff line number Diff line Loading @@ -24,7 +24,7 @@ #include <linux/list.h> #include <linux/export.h> #include <linux/types.h> #include <linux/mutex.h> #include <linux/spinlock.h> #include <linux/mm.h> #include <asm/arch_timer.h> #include <soc/qcom/boot_stats.h> Loading @@ -37,7 +37,7 @@ struct boot_marker { char marker_name[BOOT_MARKER_MAX_LEN]; unsigned long long int timer_value; struct list_head list; struct mutex lock; spinlock_t slock; }; static struct dentry *dent_bkpi, *dent_bkpi_status, *dent_mpm_timer; Loading @@ -48,7 +48,7 @@ static void _destroy_boot_marker(const char *name) struct boot_marker *marker; struct boot_marker *temp_addr; mutex_lock(&boot_marker_list.lock); spin_lock(&boot_marker_list.slock); list_for_each_entry_safe(marker, temp_addr, &boot_marker_list.list, list) { if (strnstr(marker->marker_name, name, Loading @@ -57,7 +57,7 @@ static void _destroy_boot_marker(const char *name) kfree(marker); } } mutex_unlock(&boot_marker_list.lock); spin_unlock(&boot_marker_list.slock); } static void _create_boot_marker(const char *name, Loading @@ -70,7 +70,7 @@ static void _create_boot_marker(const char *name, ((timer_value % TIMER_KHZ) * 1000) / TIMER_KHZ); new_boot_marker = kmalloc(sizeof(*new_boot_marker), GFP_KERNEL); new_boot_marker = kmalloc(sizeof(*new_boot_marker), GFP_ATOMIC); if (!new_boot_marker) return; Loading @@ -78,9 +78,9 @@ static void _create_boot_marker(const char *name, sizeof(new_boot_marker->marker_name)); new_boot_marker->timer_value = timer_value; mutex_lock(&boot_marker_list.lock); spin_lock(&boot_marker_list.slock); list_add_tail(&(new_boot_marker->list), &(boot_marker_list.list)); mutex_unlock(&boot_marker_list.lock); spin_unlock(&boot_marker_list.slock); } static void set_bootloader_stats(void) Loading Loading @@ -143,7 +143,7 @@ static ssize_t bootkpi_reader(struct file *fp, char __user *user_buffer, if (!buf) return -ENOMEM; mutex_lock(&boot_marker_list.lock); spin_lock(&boot_marker_list.slock); list_for_each_entry(marker, &boot_marker_list.list, list) { temp += scnprintf(buf + temp, PAGE_SIZE - temp, "%-41s:%llu.%03llu seconds\n", Loading @@ -152,7 +152,7 @@ static ssize_t bootkpi_reader(struct file *fp, char __user *user_buffer, (((marker->timer_value % TIMER_KHZ) * 1000) / TIMER_KHZ)); } mutex_unlock(&boot_marker_list.lock); spin_unlock(&boot_marker_list.slock); rc = simple_read_from_buffer(user_buffer, count, position, buf, temp); kfree(buf); return rc; Loading Loading @@ -256,7 +256,7 @@ static int __init init_bootkpi(void) } INIT_LIST_HEAD(&boot_marker_list.list); mutex_init(&boot_marker_list.lock); spin_lock_init(&boot_marker_list.slock); set_bootloader_stats(); return 0; } Loading @@ -268,13 +268,13 @@ static void __exit exit_bootkpi(void) struct boot_marker *temp_addr; debugfs_remove_recursive(dent_bkpi); mutex_lock(&boot_marker_list.lock); spin_lock(&boot_marker_list.slock); list_for_each_entry_safe(marker, temp_addr, &boot_marker_list.list, list) { list_del(&marker->list); kfree(marker); } mutex_unlock(&boot_marker_list.lock); spin_unlock(&boot_marker_list.slock); boot_stats_exit(); } module_exit(exit_bootkpi); Loading