Commit ca1f5df2 authored by Linus Torvalds's avatar Linus Torvalds
Browse files
Pull printk updates from Petr Mladek:

 - Benjamin Herrenschmidt solved a problem with non-matched console
   aliases by first checking consoles defined on the command line. It is
   a more conservative approach than the previous attempts.

 - Benjamin also made sure that the console accessible via /dev/console
   always has CON_CONSDEV flag.

 - Andy Shevchenko added the %ptT modifier for printing struct time64_t.
   It extends the existing %ptR handling for struct rtc_time.

 - Bruno Meneguele fixed /dev/kmsg error value returned by unsupported
   SEEK_CUR.

 - Tetsuo Handa removed unused pr_cont_once().

... and a few small fixes.

* tag 'printk-for-5.8' of git://git.kernel.org/pub/scm/linux/kernel/git/printk/linux:
  printk: Remove pr_cont_once()
  printk: handle blank console arguments passed in.
  kernel/printk: add kmsg SEEK_CUR handling
  printk: Fix a typo in comment "interator"->"iterator"
  usb: pulse8-cec: Switch to use %ptT
  ARM: bcm2835: Switch to use %ptT
  lib/vsprintf: Print time64_t in human readable format
  lib/vsprintf: update comment about simple_strto<foo>() functions
  printk: Correctly set CON_CONSDEV even when preferred console was not registered
  printk: Fix preferred console selection with multiple matches
  printk: Move console matching logic into a separate function
  printk: Convert a use of sprintf to snprintf in console_unlock
parents 4d67829e 8b390ab7
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -56,6 +56,11 @@ Description: The /dev/kmsg character device node provides userspace access
		  seek after the last record available at the time
		  the last SYSLOG_ACTION_CLEAR was issued.

		Due to the record nature of this interface with a "read all"
		behavior and the specific positions each seek operation sets,
		SEEK_CUR is not supported, returning -ESPIPE (invalid seek) to
		errno whenever requested.

		The output format consists of a prefix carrying the syslog
		prefix including priority and facility, the 64 bit message
		sequence number and the monotonic timestamp in microseconds,
+12 −10
Original line number Diff line number Diff line
@@ -482,21 +482,23 @@ Examples (OF)::
	%pfwf	/ocp@68000000/i2c@48072000/camera@10/port/endpoint - Full name
	%pfwP	endpoint				- Node name

Time and date (struct rtc_time)
-------------------------------
Time and date
-------------

::

	%ptR		YYYY-mm-ddTHH:MM:SS
	%ptRd		YYYY-mm-dd
	%ptRt		HH:MM:SS
	%ptR[dt][r]
	%pt[RT]			YYYY-mm-ddTHH:MM:SS
	%pt[RT]d		YYYY-mm-dd
	%pt[RT]t		HH:MM:SS
	%pt[RT][dt][r]

For printing date and time as represented by struct rtc_time structure in
human readable format.
For printing date and time as represented by
	R  struct rtc_time structure
	T  time64_t type
in human readable format.

By default year will be incremented by 1900 and month by 1. Use %ptRr (raw)
to suppress this behaviour.
By default year will be incremented by 1900 and month by 1.
Use %pt[RT]r (raw) to suppress this behaviour.

Passed by reference.

+3 −9
Original line number Diff line number Diff line
@@ -182,16 +182,10 @@ rpi_firmware_print_firmware_revision(struct rpi_firmware *fw)
					RPI_FIRMWARE_GET_FIRMWARE_REVISION,
					&packet, sizeof(packet));

	if (ret == 0) {
		struct tm tm;

		time64_to_tm(packet, 0, &tm);
	if (ret)
		return;

		dev_info(fw->cl.dev,
			 "Attached to firmware from %04ld-%02d-%02d %02d:%02d\n",
			 tm.tm_year + 1900, tm.tm_mon + 1, tm.tm_mday,
			 tm.tm_hour, tm.tm_min);
	}
	dev_info(fw->cl.dev, "Attached to firmware from %ptT\n", &packet);
}

static void
+1 −5
Original line number Diff line number Diff line
@@ -661,7 +661,6 @@ static int pulse8_setup(struct pulse8 *pulse8, struct serio *serio,
	u8 *data = pulse8->data + 1;
	u8 cmd[2];
	int err;
	struct tm tm;
	time64_t date;

	pulse8->vers = 0;
@@ -682,10 +681,7 @@ static int pulse8_setup(struct pulse8 *pulse8, struct serio *serio,
	if (err)
		return err;
	date = (data[0] << 24) | (data[1] << 16) | (data[2] << 8) | data[3];
	time64_to_tm(date, 0, &tm);
	dev_info(pulse8->dev, "Firmware build date %04ld.%02d.%02d %02d:%02d:%02d\n",
		 tm.tm_year + 1900, tm.tm_mon + 1, tm.tm_mday,
		 tm.tm_hour, tm.tm_min, tm.tm_sec);
	dev_info(pulse8->dev, "Firmware build date %ptT\n", &date);

	dev_dbg(pulse8->dev, "Persistent config:\n");
	cmd[0] = MSGCODE_GET_AUTO_ENABLED;
+1 −1
Original line number Diff line number Diff line
@@ -134,7 +134,7 @@ static inline int con_debug_leave(void)
 */

#define CON_PRINTBUFFER	(1)
#define CON_CONSDEV	(2) /* Last on the command line */
#define CON_CONSDEV	(2) /* Preferred console, /dev/console */
#define CON_ENABLED	(4)
#define CON_BOOT	(8)
#define CON_ANYTIME	(16) /* Safe to call when cpu is offline */
Loading