Merge tag 'vmwgfx-fixes-3.14-2014-02-18' of git://people.freedesktop.org/~thomash...
[platform/adaptation/renesas_rcar/renesas_kernel.git] / kernel / printk / printk.c
index be7c86b..4dae9cb 100644 (file)
@@ -757,14 +757,10 @@ void __init setup_log_buf(int early)
                return;
 
        if (early) {
-               unsigned long mem;
-
-               mem = memblock_alloc(new_log_buf_len, PAGE_SIZE);
-               if (!mem)
-                       return;
-               new_log_buf = __va(mem);
+               new_log_buf =
+                       memblock_virt_alloc(new_log_buf_len, PAGE_SIZE);
        } else {
-               new_log_buf = alloc_bootmem_nopanic(new_log_buf_len);
+               new_log_buf = memblock_virt_alloc_nopanic(new_log_buf_len, 0);
        }
 
        if (unlikely(!new_log_buf)) {
@@ -1080,7 +1076,6 @@ static int syslog_print_all(char __user *buf, int size, bool clear)
                next_seq = log_next_seq;
 
                len = 0;
-               prev = 0;
                while (len >= 0 && seq < next_seq) {
                        struct printk_log *msg = log_from_idx(idx);
                        int textlen;
@@ -1599,10 +1594,13 @@ asmlinkage int vprintk_emit(int facility, int level,
                 * either merge it with the current buffer and flush, or if
                 * there was a race with interrupts (prefix == true) then just
                 * flush it out and store this line separately.
+                * If the preceding printk was from a different task and missed
+                * a newline, flush and append the newline.
                 */
-               if (cont.len && cont.owner == current) {
-                       if (!(lflags & LOG_PREFIX))
-                               stored = cont_add(facility, level, text, text_len);
+               if (cont.len) {
+                       if (cont.owner == current && !(lflags & LOG_PREFIX))
+                               stored = cont_add(facility, level, text,
+                                                 text_len);
                        cont_flush(LOG_NEWLINE);
                }
 
@@ -2789,7 +2787,6 @@ bool kmsg_dump_get_buffer(struct kmsg_dumper *dumper, bool syslog,
        next_idx = idx;
 
        l = 0;
-       prev = 0;
        while (seq < dumper->next_seq) {
                struct printk_log *msg = log_from_idx(idx);