<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel/linux.git/drivers/tty/serial/earlycon.c, branch linux-4.4.y</title>
<subtitle>Linux kernel stable tree (mirror)</subtitle>
<id>https://git.radix-linux.su/kernel/linux.git/atom?h=linux-4.4.y</id>
<link rel='self' href='https://git.radix-linux.su/kernel/linux.git/atom?h=linux-4.4.y'/>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/'/>
<updated>2015-12-13T07:05:28+00:00</updated>
<entry>
<title>serial: earlycon: Add missing spinlock initialization</title>
<updated>2015-12-13T07:05:28+00:00</updated>
<author>
<name>Geert Uytterhoeven</name>
<email>geert+renesas@glider.be</email>
</author>
<published>2015-11-27T10:13:48+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=e1dd3bef6d03c908b173259229b96074d57fccc8'/>
<id>urn:sha1:e1dd3bef6d03c908b173259229b96074d57fccc8</id>
<content type='text'>
If an earlycon console driver needs to acquire the uart_port.lock
spinlock for serial console output, and CONFIG_DEBUG_SPINLOCK=y:

    BUG: spinlock bad magic on CPU#0, swapper/0
     lock: sci_ports+0x0/0x3480, .magic: 00000000, .owner: &lt;none&gt;/-1, .owner_cpu: 0
    CPU: 0 PID: 0 Comm: swapper Not tainted 4.4.0-rc2-koelsch-g62ea5edf143bb1d0-dirty #2083
    Hardware name: Generic R8A7791 (Flattened Device Tree)
    [&lt;c00173a0&gt;] (unwind_backtrace) from [&lt;c0013094&gt;] (show_stack+0x10/0x14)
    [&lt;c0013094&gt;] (show_stack) from [&lt;c01f2338&gt;] (dump_stack+0x70/0x8c)
    [&lt;c01f2338&gt;] (dump_stack) from [&lt;c00702d8&gt;] (do_raw_spin_lock+0x20/0x190)
    [&lt;c00702d8&gt;] (do_raw_spin_lock) from [&lt;c0267590&gt;] (serial_console_write+0x4c/0x130)
    [&lt;c0267590&gt;] (serial_console_write) from [&lt;c00734c4&gt;] (call_console_drivers.constprop.13+0xc8/0xec)
    [&lt;c00734c4&gt;] (call_console_drivers.constprop.13) from [&lt;c0074ef0&gt;] (console_unlock+0x354/0x440)
    [&lt;c0074ef0&gt;] (console_unlock) from [&lt;c0075bb4&gt;] (register_console+0x2a0/0x394)
    [&lt;c0075bb4&gt;] (register_console) from [&lt;c06cb750&gt;] (of_setup_earlycon+0x90/0xa4)
    [&lt;c06cb750&gt;] (of_setup_earlycon) from [&lt;c06cfb60&gt;] (setup_of_earlycon+0x118/0x13c)
    [&lt;c06cfb60&gt;] (setup_of_earlycon) from [&lt;c06b34ac&gt;] (do_early_param+0x64/0xb4)
    [&lt;c06b34ac&gt;] (do_early_param) from [&lt;c00472c0&gt;] (parse_args+0x254/0x350)
    [&lt;c00472c0&gt;] (parse_args) from [&lt;c06b3860&gt;] (parse_early_options+0x2c/0x3c)
    [&lt;c06b3860&gt;] (parse_early_options) from [&lt;c06b389c&gt;] (parse_early_param+0x2c/0x40)
    [&lt;c06b389c&gt;] (parse_early_param) from [&lt;c06b5b08&gt;] (setup_arch+0x520/0xaf0)
    [&lt;c06b5b08&gt;] (setup_arch) from [&lt;c06b3948&gt;] (start_kernel+0x94/0x370)
    [&lt;c06b3948&gt;] (start_kernel) from [&lt;40008090&gt;] (0x40008090)

Initialize the spinlock in of_setup_earlycon() and register_earlycon(),
to fix this for both DT-based and legacy earlycon.  If the driver would
reinitialize the spinlock again, this is harmless, as it's allowed to
reinitialize an unlocked spinlock.

Alternatives are:
  - Drivers having an early_serial_console_write() that only performs
    the core functionality of serial_console_write(), without acquiring
    the lock (which may be unsafe, depending on the hardware),
  - Drivers initializing the spinlock in their private earlycon setup
    functions.

As uart_port is owned by generic serial_core, and uart_port.lock is
initialized by uart_add_one_port() for the normal case, this can better
be handled in the earlycon core.

Signed-off-by: Geert Uytterhoeven &lt;geert+renesas@glider.be&gt;
Reviewed-by: Peter Hurley &lt;peter@hurleysoftware.com&gt;
Reported-by: Bjorn Andersson &lt;bjorn.andersson@sonymobile.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>serial: earlycon: Add support for big-endian MMIO accesses</title>
<updated>2015-05-31T21:55:12+00:00</updated>
<author>
<name>Noam Camus</name>
<email>noamc@ezchip.com</email>
</author>
<published>2015-05-25T03:54:28+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=6e63be3fee141cc6d122f648b524a66160dbe6aa'/>
<id>urn:sha1:6e63be3fee141cc6d122f648b524a66160dbe6aa</id>
<content type='text'>
Support command line parameters of the form:
earlycon=&lt;name&gt;,io|mmio|mmio32|mmio32be,&lt;addr&gt;,&lt;options&gt;

This commit seem to be needed even after commit:
serial: 8250: Add support for big-endian MMIO accesses
c627f2ceb692e8a9358b64ac2d139314e7bb0d17

Signed-off-by: Noam Camus &lt;noamc@ezchip.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>earlycon: Revert log warnings</title>
<updated>2015-05-08T12:20:50+00:00</updated>
<author>
<name>Peter Hurley</name>
<email>peter@hurleysoftware.com</email>
</author>
<published>2015-05-07T18:19:21+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=66c53aaa9c82766d4e9253748c6988441d8c2dc1'/>
<id>urn:sha1:66c53aaa9c82766d4e9253748c6988441d8c2dc1</id>
<content type='text'>
Log warnings meant to help diagnose problems setting up earlycon
are reporting false positives for 'console='. Revert to the
previous behavior which reported nothing.

Cc: Maciej W. Rozycki &lt;macro@linux-mips.org&gt;
Cc: Robert Schwebel &lt;r.schwebel@pengutronix.de&gt;
Signed-off-by: Peter Hurley &lt;peter@hurleysoftware.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>serial: earlycon: Enable earlycon without command line param</title>
<updated>2015-03-26T16:25:27+00:00</updated>
<author>
<name>Peter Hurley</name>
<email>peter@hurleysoftware.com</email>
</author>
<published>2015-03-09T20:27:21+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=470ca0de69feaba5df215ad804cec1859883a5ed'/>
<id>urn:sha1:470ca0de69feaba5df215ad804cec1859883a5ed</id>
<content type='text'>
Earlycon matching can only be triggered if 'earlycon=...' has been
specified on the kernel command line. To workaround this limitation
requires tight coupling between arches and specific serial drivers
in order to start an earlycon. Devicetree avoids this limitation
with a link table that contains the required data to match earlycons.

Mirror this approach for earlycon match by name. Re-purpose
EARLYCON_DECLARE to generate a table entry which associates name with
setup() function. Re-purpose setup_earlycon() to scan this table for
an earlycon match, which is registered if found.

Declare one "earlycon" early_param, which calls setup_earlycon().

This design allows setup_earlycon() to be called directly with a
param string (as if 'earlycon=...' had been set on the command line).
Re-registration (either directly or by early_param) is prevented.

Acked-by: Rob Herring &lt;robh@kernel.org&gt;
Signed-off-by: Peter Hurley &lt;peter@hurleysoftware.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>serial: earlycon: Refactor earlycon registration</title>
<updated>2015-03-26T16:25:27+00:00</updated>
<author>
<name>Peter Hurley</name>
<email>peter@hurleysoftware.com</email>
</author>
<published>2015-03-09T20:27:20+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=7c53cb3de493573dc3b7f2468a542a9f11cc5079'/>
<id>urn:sha1:7c53cb3de493573dc3b7f2468a542a9f11cc5079</id>
<content type='text'>
Separate earlycon matching from registration; add register_earlycon
which initializes and registers the matched earlycon.

Acked-by: Rob Herring &lt;robh@kernel.org&gt;
Signed-off-by: Peter Hurley &lt;peter@hurleysoftware.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>serial: earlycon: Skip parse_options() if empty string</title>
<updated>2015-03-26T16:25:27+00:00</updated>
<author>
<name>Peter Hurley</name>
<email>peter@hurleysoftware.com</email>
</author>
<published>2015-03-09T20:27:19+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=60846880384f00713c7f54243f749c1923e6c0e3'/>
<id>urn:sha1:60846880384f00713c7f54243f749c1923e6c0e3</id>
<content type='text'>
Earlycon param strings of the form
   earlycon=&lt;name&gt;
are rejected from parse_options() with an error (which, in turn,
results in a NULL argument for the setup() method options parameter).

Only pass non-empty string to parse_options(); this will enable
handling actual parse errors differently than expected and allow
formats.

Acked-by: Rob Herring &lt;robh@kernel.org&gt;
Signed-off-by: Peter Hurley &lt;peter@hurleysoftware.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>serial: earlycon: Ignore parse_options() error code</title>
<updated>2015-03-26T15:17:56+00:00</updated>
<author>
<name>Peter Hurley</name>
<email>peter@hurleysoftware.com</email>
</author>
<published>2015-03-09T20:27:18+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=526ebc3f56491fe971cd2b51cfc859a879e11e93'/>
<id>urn:sha1:526ebc3f56491fe971cd2b51cfc859a879e11e93</id>
<content type='text'>
Because setup_earlycon() continues to attempt console registration
if an error occurred parsing the option string, the actual value of
the error code from parse_options() is ignored.

Acked-by: Rob Herring &lt;robh@kernel.org&gt;
Signed-off-by: Peter Hurley &lt;peter@hurleysoftware.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>serial: earlycon: Move -&gt;uartclk initialize</title>
<updated>2015-03-26T15:17:55+00:00</updated>
<author>
<name>Peter Hurley</name>
<email>peter@hurleysoftware.com</email>
</author>
<published>2015-03-09T20:27:15+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=feed5bab0d33feb5dbe5365b34d044c79f93dc6b'/>
<id>urn:sha1:feed5bab0d33feb5dbe5365b34d044c79f93dc6b</id>
<content type='text'>
Initializing the -&gt;uartclk field is not related to option parsing;
relocate from parse_options() to setup_earlycon() (which mirrors the
behavior of of_setup_earlycon()).

Acked-by: Rob Herring &lt;robh@kernel.org&gt;
Signed-off-by: Peter Hurley &lt;peter@hurleysoftware.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>serial: earlycon: Refactor parse_options into serial core</title>
<updated>2015-03-07T02:55:07+00:00</updated>
<author>
<name>Peter Hurley</name>
<email>peter@hurleysoftware.com</email>
</author>
<published>2015-03-01T16:05:46+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=73abaf87f01be6fa6da3c0aa9c138a1b6b281068'/>
<id>urn:sha1:73abaf87f01be6fa6da3c0aa9c138a1b6b281068</id>
<content type='text'>
Prepare to support console-defined matching; refactor the command
line parameter string processing from parse_options() into a
new core function, uart_parse_earlycon(), which decodes command line
parameters of the form:
   earlycon=&lt;name&gt;,io|mmio|mmio32,&lt;addr&gt;,&lt;options&gt;
   console=&lt;name&gt;,io|mmio|mmio32,&lt;addr&gt;,&lt;options&gt;
   earlycon=&lt;name&gt;,0x&lt;addr&gt;,&lt;options&gt;
   console=&lt;name&gt;,0x&lt;addr&gt;,&lt;options&gt;

Signed-off-by: Peter Hurley &lt;peter@hurleysoftware.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>tty/serial: earlycon: Fix print for implied MMIO case</title>
<updated>2014-11-06T03:45:52+00:00</updated>
<author>
<name>Kumar Gala</name>
<email>galak@codeaurora.org</email>
</author>
<published>2014-10-17T09:01:11+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=fe655de1718e063bd0b1c7a4305b8eea54d199d9'/>
<id>urn:sha1:fe655de1718e063bd0b1c7a4305b8eea54d199d9</id>
<content type='text'>
For the case in which we just provide an address as an argument to the
earlycon console type like:

earlycon=msm_serial_dm,0xf991e000

We would report this as an IO port based mapping and not as MMIO.  Simple
fix to use the port-&gt;iotype to decide which message to print.

Signed-off-by: Kumar Gala &lt;galak@codeaurora.org&gt;
Acked-by: Mark RUtland &lt;mark.rutland@arm.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
</feed>
