[PATCH] UBUNTU: [Upstream] Stop ARM boards crashing when CUPS is loaded

From: Lee Jones
Date: Tue Jul 13 2010 - 10:02:17 EST


BugLink: http://bugs.launchpad.net/bugs/601226

When CUPS loads, it tries to load several drivers that it may need.
When one of these drivers, specifically parport_pc is loaded on ARM
based systems, it causes a segmentation fault as the ISA addresses
which are attempted are not writable on non-PC based architectures.
This code prevents ISA addresses from being attempted except on x86.

Signed-off-by: Lee Jones <lee.jones@xxxxxxxxxxxxx>
---
arch/arm/include/asm/parport.h | 7 +++++--
1 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/arch/arm/include/asm/parport.h b/arch/arm/include/asm/parport.h
index 26e94b0..a1874f8 100644
--- a/arch/arm/include/asm/parport.h
+++ b/arch/arm/include/asm/parport.h
@@ -9,10 +9,13 @@
#ifndef __ASMARM_PARPORT_H
#define __ASMARM_PARPORT_H

-static int __devinit parport_pc_find_isa_ports (int autoirq, int autodma);
static int __devinit parport_pc_find_nonpci_ports (int autoirq, int autodma)
{
- return parport_pc_find_isa_ports (autoirq, autodma);
+/* parport_pc_find_isa_ports uses direct register addresses which are
+ * only correct on x86 architectures. This may have undesirable
+ * consequences (including segfaults) when used on other architectures.
+ */
+ return 0;
}

#endif /* !(_ASMARM_PARPORT_H) */
--
1.7.0.4
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/