Lines Matching full:console
10 * to the console. Added hook for sending the console messages
11 * elsewhere, in preparation for a serial line console (someday).
26 #include <linux/console.h>
74 EXPORT_TRACEPOINT_SYMBOL_GPL(console);
84 * console_mutex protects console_list updates and console->flags updates.
86 * accessible via the console list.
91 * console_sem protects updates to console->seq
92 * and also provides serialization for console printing.
241 * console_list_lock - Lock the console list
243 * For console list or console->flags updates
265 * console_list_unlock - Unlock the console list
277 * SRCU-protected console list
279 * Use for_each_console_srcu() to iterate the console list
292 * the SRCU-protected console list
319 * because spindump/WARN/etc from under console ->lock will in __down_trylock_console_sem()
352 * keeping track if we have the console semaphore held. It's
355 * paths in the console code where we end up in places I want
356 * locked without the console semaphore held).
361 * Array of consoles built from command line options (console=)
372 /* Flag: console code may call schedule() */
444 * panic and risk deadlock on console resources.
1250 "ignore loglevel setting (prints all kernel messages to the console)");
1748 /* Disable logging to console */ in do_syslog()
1754 /* Enable logging to console */ in do_syslog()
1761 /* Set level of messages printed to console */ in do_syslog()
1768 /* Implicitly re-enable logging to console */ in do_syslog()
1970 * The owner passed the console lock to us. in console_trylock_spinning()
1971 * Since we did not spin on console lock, annotate in console_trylock_spinning()
2297 * Try to acquire and then immediately release the console in vprintk_emit()
2336 static bool __pr_flush(struct console *con, int timeout_ms, bool reset_on_progress);
2349 static bool __pr_flush(struct console *con, int timeout_ms, bool reset_on_progress) { return true; } in __pr_flush()
2354 struct console *early_console;
2379 * @c console was defined by the user on the command line. in set_user_specified()
2383 /* At least one console defined by the user on the command line. */ in set_user_specified()
2394 * We use a signed short index for struct console for device drivers to in __add_preferred_console()
2396 * value is not valid for preferred console. in __add_preferred_console()
2439 * Set up a console. Called via do_early_param() in init/main.c
2440 * for each "console=" parameter in the boot command line.
2449 * console="" or console=null have been suggested as a way to in console_setup()
2450 * disable console output. Use ttynull that has been created in console_setup()
2489 __setup("console=", console_setup);
2495 * @options: options for this console
2497 * The last preferred console added will be used for kernel messages
2499 * above to handle user-supplied console arguments; however it can also
2501 * commonly to provide a default console (ie from PROM variables) when
2520 MODULE_PARM_DESC(console_suspend, "suspend console during suspend"
2533 MODULE_PARM_DESC(console_no_auto_verbose, "Disable console loglevel raise to highest on oops/panic/…
2536 * suspend_console - suspend the console subsystem
2542 struct console *con; in suspend_console()
2546 pr_info("Suspending console(s) (use no_console_suspend to debug)\n"); in suspend_console()
2565 struct console *con; in resume_console()
2586 * console_cpu_notify - print deferred console messages after CPU hotplug
2590 * will be printed on the console only if there are CON_ANYTIME consoles.
2625 * console_lock - block the console subsystem from printing
2647 * console_trylock - try to block the console subsystem from printing
2674 * Check if the given console is currently capable and allowed to print
2679 static inline bool console_is_usable(struct console *con) in console_is_usable()
2693 * Console drivers may assume that per-cpu resources have been in console_is_usable()
2768 * console output.
2819 /* Skip record that has level above the console loglevel. */ in printk_get_next_message()
2836 * Used as the printk buffers for non-panic, serialized console printing.
2843 * Print one record for the given console. The record printed is whatever
2844 * record is the next available record for the given console.
2852 * Returns false if the given console has no next record to print, otherwise
2857 static bool console_emit_next_record(struct console *con, bool *handover, int cookie) in console_emit_next_record()
2915 static bool console_emit_next_record(struct console *con, bool *handover, int cookie) in console_emit_next_record()
2937 * Returns true when there was at least one usable console and all messages
2949 struct console *con; in console_flush_all()
3002 * console_unlock - unblock the console subsystem from printing
3005 * the console subsystem.
3007 * While the console_lock was held, console output may have been buffered
3021 * Console drivers are called with interrupts disabled, so in console_unlock()
3024 * console registration path, and should invoke cond_resched() in console_unlock()
3026 * scheduling stall on a slow console leading to RCU stall and in console_unlock()
3051 * console_flush_all() but before unlocking the console. in console_unlock()
3062 * If the console code is currently allowed to sleep, and
3078 struct console *c; in console_unblank()
3084 * console lock, which in particular can be dangerous if in console_unblank()
3099 * Stop console printing because the unblank() callback may in console_unblank()
3100 * assume the console is not within its write() callback. in console_unblank()
3111 * Attempting to trylock the console lock can deadlock in console_unblank()
3138 * console_flush_on_panic - flush console content on panic
3149 * Ignore the console lock and flush out the messages. Attempting a in console_flush_on_panic()
3159 * If another context is holding the console lock, in console_flush_on_panic()
3166 struct console *c; in console_flush_on_panic()
3194 * Return the console tty driver structure and its associated index
3198 struct console *c; in console_device()
3204 * other console operations. For example, fg_console is in console_device()
3224 * Prevent further output on the passed console device so that (for example)
3225 * serial drivers can disable console output before suspending a port, and can
3228 void console_stop(struct console *console) in console_stop() argument
3230 __pr_flush(console, 1000, true); in console_stop()
3232 console_srcu_write_flags(console, console->flags & ~CON_ENABLED); in console_stop()
3237 * be able to see that this console is disabled so that (for example) in console_stop()
3245 void console_start(struct console *console) in console_start() argument
3248 console_srcu_write_flags(console, console->flags | CON_ENABLED); in console_start()
3250 __pr_flush(console, 1000, true); in console_start()
3259 pr_info("debug: skip boot console de-registration.\n"); in keep_bootcon_setup()
3268 * the newly registered console with any of the ones selected
3275 static int try_enable_preferred_console(struct console *newcon, in try_enable_preferred_console()
3322 /* Try to enable the console unconditionally */
3323 static void try_enable_default_console(struct console *newcon) in try_enable_default_console()
3337 static void console_init_seq(struct console *newcon, bool bootcon_registered) in console_init_seq()
3339 struct console *con; in console_init_seq()
3354 * device as @newcon. Since it is not known which boot console in console_init_seq()
3356 * start with the message of the enabled boot console that is in console_init_seq()
3361 * Hold the console_lock to stop console printing and in console_init_seq()
3362 * guarantee safe access to console->seq. in console_init_seq()
3367 * Flush all consoles and set the console to start at in console_init_seq()
3399 hlist_entry(console_list.first, struct console, node)
3401 static int unregister_console_locked(struct console *console);
3404 * The console driver calls this routine during kernel initialization
3405 * to register the console printing procedure with printk() and to
3407 * console driver was initialized.
3417 * - As soon as a "real" console is registered, all bootconsoles
3419 * - Once a "real" console is registered, any attempt to register a
3422 void register_console(struct console *newcon) in register_console()
3424 struct console *con; in register_console()
3432 if (WARN(con == newcon, "console '%s%d' already registered\n", in register_console()
3452 * Ensure the nbcon console buffers can be allocated in register_console()
3460 * See if we want to enable this console driver by default. in register_console()
3462 * Nope when a console is preferred by the command line, device in register_console()
3465 * The first real console with tty binding (driver) wins. More in register_console()
3468 * Note that a console with tty binding will have CON_CONSDEV in register_console()
3478 /* See if this console matches one we selected on the command line */ in register_console()
3485 /* printk() messages are not printed to the Braille console. */ in register_console()
3493 * If we have a bootconsole, and are switching to a real console, in register_console()
3494 * don't print everything out again, since when the boot console, and in register_console()
3495 * the real console are the same physical device, it's annoying to in register_console()
3510 * Put this console in the list - keep the in register_console()
3529 * on all contexts being able to see the new console before in register_console()
3536 * By unregistering the bootconsoles after we enable the real console in register_console()
3537 * we get the "console xxx enabled" message on all the consoles - in register_console()
3540 * went to the bootconsole (that they do not see on the real console) in register_console()
3559 static int unregister_console_locked(struct console *console) in unregister_console_locked() argument
3565 con_printk(KERN_INFO, console, "disabled\n"); in unregister_console_locked()
3567 res = _braille_unregister_console(console); in unregister_console_locked()
3574 console_srcu_write_flags(console, console->flags & ~CON_ENABLED); in unregister_console_locked()
3576 if (!console_is_registered_locked(console)) in unregister_console_locked()
3579 hlist_del_init_rcu(&console->node); in unregister_console_locked()
3583 * If this isn't the last console and it has CON_CONSDEV set, we in unregister_console_locked()
3584 * need to set it on the next preferred console. in unregister_console_locked()
3588 * console has any device attached. Oh well.... in unregister_console_locked()
3590 if (!hlist_empty(&console_list) && console->flags & CON_CONSDEV) in unregister_console_locked()
3595 * must not be able to see this console in the list so that any in unregister_console_locked()
3600 if (console->flags & CON_NBCON) in unregister_console_locked()
3601 nbcon_free(console); in unregister_console_locked()
3605 if (console->exit) in unregister_console_locked()
3606 res = console->exit(console); in unregister_console_locked()
3611 int unregister_console(struct console *console) in unregister_console() argument
3616 res = unregister_console_locked(console); in unregister_console()
3623 * console_force_preferred_locked - force a registered console preferred
3624 * @con: The registered console to force preferred.
3628 void console_force_preferred_locked(struct console *con) in console_force_preferred_locked()
3630 struct console *cur_pref_con; in console_force_preferred_locked()
3642 * Delete, but do not re-initialize the entry. This allows the console in console_force_preferred_locked()
3644 * checks), even though it was briefly removed from the console list. in console_force_preferred_locked()
3649 * Ensure that all SRCU list walks have completed so that the console in console_force_preferred_locked()
3650 * can be added to the beginning of the console list and its forward in console_force_preferred_locked()
3665 * Initialize the console device. This is called *early*, so
3680 * set up the console device so that later boot sequences can in console_init()
3684 trace_initcall_level("console"); in console_init()
3700 * module, the real console hasn't registered yet at this point, there will
3701 * be a brief interval in which no messages are logged to the console, which
3706 * get unregistered when the real preferred console is registered.
3711 struct console *con; in printk_late_init()
3749 /* If @con is specified, only wait for that console. Otherwise wait for all. */
3750 static bool __pr_flush(struct console *con, int timeout_ms, bool reset_on_progress) in __pr_flush()
3754 struct console *c; in __pr_flush()
3778 * console->seq. Releasing console_lock flushes more in __pr_flush()
3844 * Context: Process context. May sleep while acquiring console lock.
3906 * and the console printing of those records has already occurred or is
3919 * console printing in a deferred context
3922 * this context is responsible for console printing those records, but
3923 * the current context is not allowed to perform the console printing.
3924 * Trigger an irq_work context to perform the console printing. This