r1839 - in trunk/kernel/source/kernel-source-2.6.8-2.6.8/debian: . patches patches/series

Dann Frazier dannf@haydn.debian.org
Thu, 11 Nov 2004 14:03:06 -0700


Author: dannf
Date: 2004-11-11 14:02:57 -0700 (Thu, 11 Nov 2004)
New Revision: 1839

Added:
   trunk/kernel/source/kernel-source-2.6.8-2.6.8/debian/patches/drivers-serial-8250-ioremap-fix.dpatch
Modified:
   trunk/kernel/source/kernel-source-2.6.8-2.6.8/debian/changelog
   trunk/kernel/source/kernel-source-2.6.8-2.6.8/debian/patches/series/2.6.8-9
Log:
fix a bug in the 8250 driver that was making setserial crash systems on boot


Modified: trunk/kernel/source/kernel-source-2.6.8-2.6.8/debian/changelog
===================================================================
--- trunk/kernel/source/kernel-source-2.6.8-2.6.8/debian/changelog	2004-11-11 17:36:56 UTC (rev 1838)
+++ trunk/kernel/source/kernel-source-2.6.8-2.6.8/debian/changelog	2004-11-11 21:02:57 UTC (rev 1839)
@@ -3,8 +3,11 @@
   * [SECURITY] Fix problems in binfmt_elf loader; see
     http://isec.pl/vulnerabilities/isec-0017-binfmt_elf.txt for more
     details (Andres Salomon).
+  * Adding drivers-serial-8250-ioremap-fix.dpatch: a patch from Alex
+    Williamson that prevents setserial from crashing the kernel.
+    See: http://marc.theaimsgroup.com/?l=linux-kernel&m=109913237604338&w=2
 
- -- Andres Salomon <dilinger@voxel.net>  Thu, 11 Nov 2004 12:13:59 -0500
+ -- dann frazier <dannf@debian.org>  Thu, 11 Nov 2004 13:50:35 -0700
 
 kernel-source-2.6.8 (2.6.8-8) unstable; urgency=medium
 

Added: trunk/kernel/source/kernel-source-2.6.8-2.6.8/debian/patches/drivers-serial-8250-ioremap-fix.dpatch
===================================================================
--- trunk/kernel/source/kernel-source-2.6.8-2.6.8/debian/patches/drivers-serial-8250-ioremap-fix.dpatch	2004-11-11 17:36:56 UTC (rev 1838)
+++ trunk/kernel/source/kernel-source-2.6.8-2.6.8/debian/patches/drivers-serial-8250-ioremap-fix.dpatch	2004-11-11 21:02:57 UTC (rev 1839)
@@ -0,0 +1,50 @@
+#! /bin/sh -e
+## <PATCHNAME>.dpatch by <PATCH_AUTHOR@EMAI>
+##
+## All lines beginning with `## DP:' are a description of the patch.
+## DP: Description: Don't ioremap if MMIO uart has a mapbase, but no membase
+## DP: Patch author: Alex Williamson <alex.williamson@hp.com>
+## DP: Upstream status: submitted; but not accepted as code is being rewritten
+
+. $(dirname $0)/DPATCH
+
+@DPATCH@
+
+  The iounmap/ioremap path in serial8250_release/request_port is
+terribly unbalanced.  The UPF_IOREMAP flag is used to determine if a
+port gets ioremap'd, but plays no part in whether it gets iounmap'd.
+It's easy to see how an MMIO serial port can be passed through
+uart_set_info and end up with an unmapped membase.  The results is a
+non-functional UART or worse.  I've tried to generate some discussion on
+the proper fix for this, but I haven't succeeded.  I propose the patch
+below as a safe compromise.  An MMIO uart w/ a mapbase, but no membase
+doesn't seem viable to me.  Thanks,
+
+	Alex
+
+-- 
+Signed-off-by: Alex Williamson <alex.williamson@hp.com>
+
+===== drivers/serial/8250.c 1.77 vs edited =====
+--- 1.77/drivers/serial/8250.c	2004-10-25 06:05:26 -06:00
++++ edited/drivers/serial/8250.c	2004-10-28 13:18:01 -06:00
+@@ -1858,7 +1858,11 @@
+ 	/*
+ 	 * If we have a mapbase, then request that as well.
+ 	 */
+-	if (ret == 0 && up->port.flags & UPF_IOREMAP) {
++	if (ret == 0 && ((up->port.flags & UPF_IOREMAP) ||
++	                 (up->port.iotype == UPIO_MEM &&
++	                  up->port.mapbase &&
++	                  !up->port.membase))) {
++
+ 		int size = res->end - res->start + 1;
+ 
+ 		up->port.membase = ioremap(up->port.mapbase, size);
+
+
+-
+To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
+the body of a message to majordomo@vger.kernel.org
+More majordomo info at  http://vger.kernel.org/majordomo-info.html
+Please read the FAQ at  http://www.tux.org/lkml/
\ No newline at end of file

Modified: trunk/kernel/source/kernel-source-2.6.8-2.6.8/debian/patches/series/2.6.8-9
===================================================================
--- trunk/kernel/source/kernel-source-2.6.8-2.6.8/debian/patches/series/2.6.8-9	2004-11-11 17:36:56 UTC (rev 1838)
+++ trunk/kernel/source/kernel-source-2.6.8-2.6.8/debian/patches/series/2.6.8-9	2004-11-11 21:02:57 UTC (rev 1839)
@@ -1 +1,2 @@
 + elf-loader-fixes.dpatch
++ drivers-serial-8250-ioremap-fix.dpatch