<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel.git/arch/mips/kernel/setup.c, branch linux-4.18.y</title>
<subtitle>Hosts the 0x221E linux distro kernel.
</subtitle>
<id>https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-4.18.y</id>
<link rel='self' href='https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-4.18.y'/>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/'/>
<updated>2018-10-18T07:18:17Z</updated>
<entry>
<title>MIPS: Fix CONFIG_CMDLINE handling</title>
<updated>2018-10-18T07:18:17Z</updated>
<author>
<name>Paul Burton</name>
</author>
<published>2018-09-27T22:59:18Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=baa63c6a5b113efdbcf983f34510c2840052bb4a'/>
<id>urn:sha1:baa63c6a5b113efdbcf983f34510c2840052bb4a</id>
<content type='text'>
commit 951d223c6c16ed5d2a71a4d1f13c1e65d6882156 upstream.

Commit 8ce355cf2e38 ("MIPS: Setup boot_command_line before
plat_mem_setup") fixed a problem for systems which have
CONFIG_CMDLINE_BOOL=y &amp; use a DT with a chosen node that has either no
bootargs property or an empty one. In this configuration
early_init_dt_scan_chosen() copies CONFIG_CMDLINE into
boot_command_line, but the MIPS code doesn't know this so it appends
CONFIG_CMDLINE (via builtin_cmdline) to boot_command_line again. The
result is that boot_command_line contains the arguments from
CONFIG_CMDLINE twice.

That commit took the approach of simply setting up boot_command_line
from the MIPS code before early_init_dt_scan_chosen() runs, causing it
not to copy CONFIG_CMDLINE to boot_command_line if a chosen node with no
bootargs property is found.

Unfortunately this is problematic for systems which do have a non-empty
bootargs property &amp; CONFIG_CMDLINE_BOOL=y. There
early_init_dt_scan_chosen() will overwrite boot_command_line with the
arguments from DT, which means we lose those from CONFIG_CMDLINE
entirely. This breaks CONFIG_MIPS_CMDLINE_DTB_EXTEND. If we have
CONFIG_MIPS_CMDLINE_FROM_BOOTLOADER or
CONFIG_MIPS_CMDLINE_BUILTIN_EXTEND selected and the DT has a bootargs
property which we should ignore, it will instead be honoured breaking
those configurations too.

Fix this by reverting commit 8ce355cf2e38 ("MIPS: Setup
boot_command_line before plat_mem_setup") to restore the former
behaviour, and fixing the CONFIG_CMDLINE duplication issue by
initializing boot_command_line to a non-empty string that
early_init_dt_scan_chosen() will not overwrite with CONFIG_CMDLINE.

This is a little ugly, but cleanup in this area is on its way. In the
meantime this is at least easy to backport &amp; contains the ugliness
within arch/mips/.

Signed-off-by: Paul Burton &lt;paul.burton@mips.com&gt;
Fixes: 8ce355cf2e38 ("MIPS: Setup boot_command_line before plat_mem_setup")
References: https://patchwork.linux-mips.org/patch/18804/
Patchwork: https://patchwork.linux-mips.org/patch/20813/
Cc: Frank Rowand &lt;frowand.list@gmail.com&gt;
Cc: Jaedon Shin &lt;jaedon.shin@gmail.com&gt;
Cc: Mathieu Malaterre &lt;malat@debian.org&gt;
Cc: Rob Herring &lt;robh+dt@kernel.org&gt;
Cc: devicetree@vger.kernel.org
Cc: linux-kernel@vger.kernel.org
Cc: linux-mips@linux-mips.org
Cc: stable@vger.kernel.org # v4.16+
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
</entry>
<entry>
<title>treewide: use PHYS_ADDR_MAX to avoid type casting ULLONG_MAX</title>
<updated>2018-06-14T22:55:25Z</updated>
<author>
<name>Stefan Agner</name>
</author>
<published>2018-06-14T22:28:02Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=d7dc899abefb4412388a5d3ec690070197d07d20'/>
<id>urn:sha1:d7dc899abefb4412388a5d3ec690070197d07d20</id>
<content type='text'>
With PHYS_ADDR_MAX there is now a type safe variant for all bits set.
Make use of it.

Patch created using a semantic patch as follows:

// &lt;smpl&gt;
@@
typedef phys_addr_t;
@@
-(phys_addr_t)ULLONG_MAX
+PHYS_ADDR_MAX
// &lt;/smpl&gt;

Link: http://lkml.kernel.org/r/20180419214204.19322-1-stefan@agner.ch
Signed-off-by: Stefan Agner &lt;stefan@agner.ch&gt;
Reviewed-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Acked-by: Ard Biesheuvel &lt;ard.biesheuvel@linaro.org&gt;
Acked-by: Catalin Marinas &lt;catalin.marinas@arm.com&gt;	[arm64]
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>MIPS: Remove a warning when PHYS_OFFSET is 0x0</title>
<updated>2018-02-19T10:55:38Z</updated>
<author>
<name>Mathieu Malaterre</name>
</author>
<published>2018-01-02T18:53:15Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=ab3d8441290bcd648f487b69ea87cfe5b37d9e02'/>
<id>urn:sha1:ab3d8441290bcd648f487b69ea87cfe5b37d9e02</id>
<content type='text'>
Rewrite the comparison in `else if` statement, case where `min_low_pfn &gt;
ARCH_PFN_OFFSET` has already been checked in the first `if` statement:

  if (min_low_pfn &gt; ARCH_PFN_OFFSET) {

Fix non-fatal warning during compilation using W=1:

arch/mips/kernel/setup.c: In function ‘bootmem_init’:
arch/mips/kernel/setup.c:461:25: warning: comparison of unsigned expression &lt; 0 is always false [-Wtype-limits]
  } else if (min_low_pfn &lt; ARCH_PFN_OFFSET) {
                         ^

Signed-off-by: Mathieu Malaterre &lt;malat@debian.org&gt;
Reviewed-by: James Hogan &lt;jhogan@kernel.org&gt;
Cc: Ralf Baechle &lt;ralf@linux-mips.org&gt;
Cc: linux-mips@linux-mips.org
Patchwork: https://patchwork.linux-mips.org/patch/18176/
Signed-off-by: James Hogan &lt;jhogan@kernel.org&gt;
</content>
</entry>
<entry>
<title>MIPS: Make declaration for function `memory_region_available` static</title>
<updated>2018-02-19T10:55:38Z</updated>
<author>
<name>Mathieu Malaterre</name>
</author>
<published>2018-01-02T18:52:21Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=427aeea072acd7afa6ffe20fc76f887b0f8b232c'/>
<id>urn:sha1:427aeea072acd7afa6ffe20fc76f887b0f8b232c</id>
<content type='text'>
Fix non-fatal warning during compilation using W=1:

arch/mips/kernel/setup.c:158:13: warning: no previous prototype for ‘memory_region_available’ [-Wmissing-prototypes]
 bool __init memory_region_available(phys_addr_t start, phys_addr_t size)
             ^~~~~~~~~~~~~~~~~~~~~~~

Signed-off-by: Mathieu Malaterre &lt;malat@debian.org&gt;
Cc: Ralf Baechle &lt;ralf@linux-mips.org&gt;
Cc: linux-mips@linux-mips.org
Patchwork: https://patchwork.linux-mips.org/patch/18175/
[jhogan@kernel.org: tweak whitespace]
Signed-off-by: James Hogan &lt;jhogan@kernel.org&gt;
</content>
</entry>
<entry>
<title>MIPS: Fix incorrect mem=X@Y handling</title>
<updated>2018-02-13T13:14:41Z</updated>
<author>
<name>Marcin Nowakowski</name>
</author>
<published>2018-02-01T11:37:21Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=67a3ba25aa955198196f40b76b329b3ab9ad415a'/>
<id>urn:sha1:67a3ba25aa955198196f40b76b329b3ab9ad415a</id>
<content type='text'>
Commit 73fbc1eba7ff ("MIPS: fix mem=X@Y commandline processing") added a
fix to ensure that the memory range between PHYS_OFFSET and low memory
address specified by mem= cmdline argument is not later processed by
free_all_bootmem.  This change was incorrect for systems where the
commandline specifies more than 1 mem argument, as it will cause all
memory between PHYS_OFFSET and each of the memory offsets to be marked
as reserved, which results in parts of the RAM marked as reserved
(Creator CI20's u-boot has a default commandline argument 'mem=256M@0x0
mem=768M@0x30000000').

Change the behaviour to ensure that only the range between PHYS_OFFSET
and the lowest start address of the memories is marked as protected.

This change also ensures that the range is marked protected even if it's
only defined through the devicetree and not only via commandline
arguments.

Reported-by: Mathieu Malaterre &lt;mathieu.malaterre@gmail.com&gt;
Signed-off-by: Marcin Nowakowski &lt;marcin.nowakowski@mips.com&gt;
Fixes: 73fbc1eba7ff ("MIPS: fix mem=X@Y commandline processing")
Cc: Ralf Baechle &lt;ralf@linux-mips.org&gt;
Cc: linux-mips@linux-mips.org
Cc: &lt;stable@vger.kernel.org&gt; # v4.11+
Tested-by: Mathieu Malaterre &lt;malat@debian.org&gt;
Patchwork: https://patchwork.linux-mips.org/patch/18562/
Signed-off-by: James Hogan &lt;jhogan@kernel.org&gt;
</content>
</entry>
<entry>
<title>MIPS: Setup boot_command_line before plat_mem_setup</title>
<updated>2018-01-18T22:06:07Z</updated>
<author>
<name>Paul Burton</name>
</author>
<published>2018-01-16T15:47:57Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=8ce355cf2e38afdb364d03d12b23d9cf44c3b7f1'/>
<id>urn:sha1:8ce355cf2e38afdb364d03d12b23d9cf44c3b7f1</id>
<content type='text'>
Platforms using DT will typically call __dt_setup_arch from
plat_mem_setup. This in turn calls early_init_dt_scan. When
CONFIG_CMDLINE is set, this leads to its value being copied into
boot_command_line by early_init_dt_scan_chosen. If this happens before
the code setting up boot_command_line in arch_mem_init runs, that code
will go on to append CONFIG_CMDLINE (via builtin_cmdline) to
boot_command_line again, duplicating it. For some command line
parameters (eg. earlycon) this can be a problem. Set up
boot_command_line before early_init_dt_scan_chosen gets called such that
it will not write CONFIG_CMDLINE in this scenario &amp; the arguments aren't
duplicated.

Signed-off-by: Paul Burton &lt;paul.burton@mips.com&gt;
Acked-by: Mathieu Malaterre &lt;malat@debian.org&gt;
Cc: Ralf Baechle &lt;ralf@linux-mips.org&gt;
Cc: Maarten ter Huurne &lt;maarten@treewalker.org&gt;
Cc: linux-mips@linux-mips.org
Patchwork: https://patchwork.linux-mips.org/patch/18483/
Signed-off-by: James Hogan &lt;jhogan@kernel.org&gt;
</content>
</entry>
<entry>
<title>MIPS: Add iomem resource for kernel bss section.</title>
<updated>2017-11-13T17:40:49Z</updated>
<author>
<name>David Daney</name>
</author>
<published>2017-10-12T19:50:34Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=e0c5f36b2a638fc3298200c385af7f196d3b5cd4'/>
<id>urn:sha1:e0c5f36b2a638fc3298200c385af7f196d3b5cd4</id>
<content type='text'>
The kexec/kdump tools need to know where the .bss is so it can be
included in the core dump.  This allows vmcore-dmesg to have access to
the dmesg buffers of the crashed kernel as well as allowing the
debugger to examine variables in the bss section.

Add a request for the bss resource in addition to the already
requested code and data sections.

Signed-off-by: David Daney &lt;david.daney@cavium.com&gt;
Cc: Ralf Baechle &lt;ralf@linux-mips.org&gt;
Cc: Steven J. Hill &lt;steven.hill@cavium.com&gt;,
Cc: linux-mips@linux-mips.org
Patchwork: https://patchwork.linux-mips.org/patch/17485/
Signed-off-by: James Hogan &lt;jhogan@kernel.org&gt;
</content>
</entry>
<entry>
<title>MIPS: cmdline: Add support for 'memmap' parameter</title>
<updated>2017-06-29T00:42:23Z</updated>
<author>
<name>Miodrag Dinic</name>
</author>
<published>2017-06-19T15:50:08Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=296a7624f5b292af610d728e7e347fda341a985e'/>
<id>urn:sha1:296a7624f5b292af610d728e7e347fda341a985e</id>
<content type='text'>
Implement support for parsing 'memmap' kernel command line parameter.

This patch covers parsing of the following two formats for 'memmap'
parameter values:

  - nn[KMG]@ss[KMG]
  - nn[KMG]$ss[KMG]

  ([KMG] = K M or G (kilo, mega, giga))

These two allowed formats for parameter value are already documented
in file kernel-parameters.txt in Documentation/admin-guide folder.
Some architectures already support them, but Mips did not prior to
this patch.

Excerpt from Documentation/admin-guide/kernel-parameters.txt:

memmap=nn[KMG]@ss[KMG]
    [KNL] Force usage of a specific region of memory.
    Region of memory to be used is from ss to ss+nn.

memmap=nn[KMG]$ss[KMG]
    Mark specific memory as reserved.
    Region of memory to be reserved is from ss to ss+nn.
    Example: Exclude memory from 0x18690000-0x1869ffff
        memmap=64K$0x18690000
        or
        memmap=0x10000$0x18690000

There is no need to update this documentation file with respect to
this patch.

Signed-off-by: Miodrag Dinic &lt;miodrag.dinic@imgtec.com&gt;
Signed-off-by: Goran Ferenc &lt;goran.ferenc@imgtec.com&gt;
Signed-off-by: Aleksandar Markovic &lt;aleksandar.markovic@imgtec.com&gt;
Cc: James.Hogan@imgtec.com
Cc: Paul.Burton@imgtec.com
Cc: Raghu.Gandham@imgtec.com
Cc: Leonid.Yegoshin@imgtec.com
Cc: Douglas.Leung@imgtec.com
Cc: Petar.Jovanovic@imgtec.com
Cc: linux-mips@linux-mips.org
Patchwork: https://patchwork.linux-mips.org/patch/16508/
Signed-off-by: Ralf Baechle &lt;ralf@linux-mips.org&gt;
</content>
</entry>
<entry>
<title>MIPS: kexec: Do not reserve invalid crashkernel memory on boot</title>
<updated>2017-01-03T15:34:46Z</updated>
<author>
<name>Marcin Nowakowski</name>
</author>
<published>2016-11-23T13:43:50Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=a8f108d70c74d83574c157648383eb2e4285a190'/>
<id>urn:sha1:a8f108d70c74d83574c157648383eb2e4285a190</id>
<content type='text'>
Do not reserve memory for the crashkernel if the commandline argument
points to a wrong location. This can happen if the location is specified
wrong or if the same commandline is reused when starting the crashkernel
- in the latter case the reserved memory would point to the location
from which the crashkernel is executing.

Signed-off-by: Marcin Nowakowski &lt;marcin.nowakowski@imgtec.com&gt;
Cc: linux-mips@linux-mips.org
Patchwork: https://patchwork.linux-mips.org/patch/14612/
Signed-off-by: Ralf Baechle &lt;ralf@linux-mips.org&gt;
</content>
</entry>
<entry>
<title>MIPS: fix mem=X@Y commandline processing</title>
<updated>2017-01-03T15:34:45Z</updated>
<author>
<name>Marcin Nowakowski</name>
</author>
<published>2016-11-23T13:43:49Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=73fbc1eba7ffa3bf0ad12486232a8a1edb4e4411'/>
<id>urn:sha1:73fbc1eba7ffa3bf0ad12486232a8a1edb4e4411</id>
<content type='text'>
When a memory offset is specified through the commandline, add the
memory in range PHYS_OFFSET:Y as reserved memory area.
Otherwise the bootmem allocator is initialised with low page equal to
min_low_pfn = PHYS_OFFSET, and in free_all_bootmem will process pages
starting from min_low_pfn instead of PFN(Y).

Signed-off-by: Marcin Nowakowski &lt;marcin.nowakowski@imgtec.com&gt;
Cc: linux-mips@linux-mips.org
Patchwork: https://patchwork.linux-mips.org/patch/14613/
Signed-off-by: Ralf Baechle &lt;ralf@linux-mips.org&gt;
</content>
</entry>
</feed>
