[kernel] r22087 - in dists/sid/linux/debian: . patches patches/bugfix/all

Ian James Campbell ijc at moszumanska.debian.org
Thu Nov 27 10:15:57 UTC 2014


Author: ijc
Date: Thu Nov 27 10:15:57 2014
New Revision: 22087

Log:
[device-tree] Reserve memreserve regions whcih overlap with existing reservations.

Fixes boot on Midway.

Added:
   dists/sid/linux/debian/patches/bugfix/all/of-fdt-memblock_reserve-memreserve-regions-in-the-ca.patch
Modified:
   dists/sid/linux/debian/changelog
   dists/sid/linux/debian/patches/series

Modified: dists/sid/linux/debian/changelog
==============================================================================
--- dists/sid/linux/debian/changelog	Thu Nov 27 09:28:52 2014	(r22086)
+++ dists/sid/linux/debian/changelog	Thu Nov 27 10:15:57 2014	(r22087)
@@ -18,6 +18,8 @@
   * Honour stdout-path from Device Tree. (Closes: #770212)
   * [armhf] Add udeb modules to support video and keyboard for imx6. Patch from
     Vagrant Cascadian (Closes: #770635)
+  * [device-tree] Reserve memreserve regions even if they partially overlap
+    with an existing reservation. Fixes boot on Midway.
 
  -- Ben Hutchings <ben at decadent.org.uk>  Sun, 09 Nov 2014 10:13:09 +0000
 

Added: dists/sid/linux/debian/patches/bugfix/all/of-fdt-memblock_reserve-memreserve-regions-in-the-ca.patch
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ dists/sid/linux/debian/patches/bugfix/all/of-fdt-memblock_reserve-memreserve-regions-in-the-ca.patch	Thu Nov 27 10:15:57 2014	(r22087)
@@ -0,0 +1,53 @@
+From a636289fb6037392c3551aeed1033576c3aef426 Mon Sep 17 00:00:00 2001
+From: Ian Campbell <ian.campbell at citrix.com>
+Date: Tue, 25 Nov 2014 15:05:13 +0000
+Subject: [PATCH] of/fdt: memblock_reserve /memreserve/ regions in the case of
+ partial overlap
+Origin: https://git.kernel.org/cgit/linux/kernel/git/glikely/linux.git/commit/?h=devicetree/merge&id=094cb98179f19b75acf9ff471daabf3948ce98e6
+
+memblock_is_region_reserved() returns true in the case of a partial
+overlap, meaning that the current code fails to reserve the
+non-overlapping portion.
+
+This call was introduced as part of d1552ce449eb "of/fdt: move
+memreserve and dtb memory reservations into core" which went into
+v3.16.
+
+I observed this causing a Midway system with a buggy fdt (the header
+declares itself to be larger than it really is) failing to boot
+because the over-inflated size of the fdt was causing it to seem to
+run into the swapper_pg_dir region, meaning the DT wasn't reserved.
+The symptoms were failing to find an disks or network and failing to
+boot.
+
+However given the ambiguity of whether things like the initrd are
+covered by /memreserve/ and similar I think it is best to also
+register the region rather than just ignoring it.
+
+Since memblock_reserve() handles overlaps just fine lets just warn and
+carry on.
+
+Signed-off-by: Ian Campbell <ian.campbell at citrix.com>
+Signed-off-by: Grant Likely <grant.likely at linaro.org>
+Cc: Rob Herring <robh+dt at kernel.org>
+Cc: stable at vger.kernel.org # v3.16+
+---
+ drivers/of/fdt.c | 2 --
+ 1 file changed, 2 deletions(-)
+
+diff --git a/drivers/of/fdt.c b/drivers/of/fdt.c
+index 379ad4f..94a8511 100644
+--- a/drivers/of/fdt.c
++++ b/drivers/of/fdt.c
+@@ -960,8 +960,6 @@ void __init __weak early_init_dt_add_memory_arch(u64 base, u64 size)
+ int __init __weak early_init_dt_reserve_memory_arch(phys_addr_t base,
+ 					phys_addr_t size, bool nomap)
+ {
+-	if (memblock_is_region_reserved(base, size))
+-		return -EBUSY;
+ 	if (nomap)
+ 		return memblock_remove(base, size);
+ 	return memblock_reserve(base, size);
+-- 
+2.1.3
+

Modified: dists/sid/linux/debian/patches/series
==============================================================================
--- dists/sid/linux/debian/patches/series	Thu Nov 27 09:28:52 2014	(r22086)
+++ dists/sid/linux/debian/patches/series	Thu Nov 27 10:15:57 2014	(r22087)
@@ -173,6 +173,7 @@
 bugfix/all/xen-netback-make-feature-rx-notify-mandatory.patch
 bugfix/all/xen-netback-fix-unlimited-guest-Rx-internal-queue-an.patch
 bugfix/all/xen-netback-reintroduce-guest-Rx-stall-detection.patch
+bugfix/all/of-fdt-memblock_reserve-memreserve-regions-in-the-ca.patch
 
 # memfd_create() & kdbus backport
 features/all/kdbus/mm-allow-drivers-to-prevent-new-writable-mappings.patch



More information about the Kernel-svn-changes mailing list