Received: from mail.onstor.com ([66.201.51.107]) by onstor-exch02.onstor.net with Microsoft SMTPSVC(6.0.3790.1830);
	 Mon, 4 Aug 2008 10:45:22 -0700
Received: from chiesmta2-1.messageone.com ([216.203.30.55]) by mail.onstor.com with Microsoft SMTPSVC(6.0.3790.1830);
	 Mon, 4 Aug 2008 10:45:22 -0700
Received: from ftp.linux-mips.org (ftp.linux-mips.org [213.58.128.207])
	by chiesmta2-1.messageone.com (8.13.8/8.13.8) with ESMTP id m74HjKXI029891
	for <andy.sharp@onstor.com>; Mon, 4 Aug 2008 12:45:21 -0500
Received: from localhost.localdomain ([127.0.0.1]:1480 "EHLO
	ftp.linux-mips.org") by ftp.linux-mips.org with ESMTP
	id S20039745AbYHDRpD (ORCPT <rfc822;andy.sharp@onstor.com>);
	Mon, 4 Aug 2008 18:45:03 +0100
Received: with ECARTIS (v1.0.0; list linux-mips); Mon, 04 Aug 2008 18:44:46 +0100 (BST)
Received: from elvis.franken.de ([193.175.24.41]:3248 "EHLO elvis.franken.de")
	by ftp.linux-mips.org with ESMTP id S20039720AbYHDRoj (ORCPT
	<rfc822;linux-mips@linux-mips.org>); Mon, 4 Aug 2008 18:44:39 +0100
Received: from uucp (helo=solo.franken.de)
	by elvis.franken.de with local-bsmtp (Exim 3.36 #1)
	id 1KQ46n-0003vC-00; Mon, 04 Aug 2008 19:44:37 +0200
Received: by solo.franken.de (Postfix, from userid 1000)
	id 7BD6FC2EAC; Mon,  4 Aug 2008 19:44:34 +0200 (CEST)
From: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
Subject: [PATCH] Fix data bus error recovery
To: linux-mips@linux-mips.org
cc: ralf@linux-mips.org
Message-Id: <20080804174434.7BD6FC2EAC@solo.franken.de>
Date: 	Mon,  4 Aug 2008 19:44:34 +0200 (CEST)
X-archive-position: 20088
X-ecartis-version: Ecartis v1.0.0
Sender: linux-mips-bounce@linux-mips.org
Errors-to: linux-mips-bounce@linux-mips.org
X-original-sender: tsbogend@alpha.franken.de
Precedence: bulk
X-list: 	linux-mips
X-MessageOne-Virus-Version: vendor=fsecure engine=4.65.7161:2.4.4,1.2.40,4.0.164 definitions=2008-08-04_08:2008-07-30,2008-08-04,2008-08-04 signatures=0
X-MessageOne-Virus-Scanned: Clean
X-MessageOne-Envelope-Sender: linux-mips-bounce@linux-mips.org
X-MessageOne-Spam-Details: rule=m773emszm_notspam policy=m773emszm score=0 spamscore=0 ipscore=0 phishscore=0 bulkscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx engine=3.1.0-0805090000 definitions=main-0808040079
X-MessageOne-Spam-Score: 0
X-MessageOne-Spam-Bar: 
Return-Path: linux-mips-bounce@linux-mips.org
X-OriginalArrivalTime: 04 Aug 2008 17:45:22.0312 (UTC) FILETIME=[DE5B8080:01C8F659]

With -ffunction-section the entries in __dbe_table aren't no longer
sorted, so the lookup of exception addresses in do_be() failed for
some addresses. To avoid this we now sort __dbe_table.

Signed-off-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
---

 arch/mips/kernel/traps.c |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/arch/mips/kernel/traps.c b/arch/mips/kernel/traps.c
index 426cced..1f579a8 100644
--- a/arch/mips/kernel/traps.c
+++ b/arch/mips/kernel/traps.c
@@ -373,8 +373,8 @@ void __noreturn die(const char * str, const struct pt_regs * regs)
 	do_exit(SIGSEGV);
 }
 
-extern const struct exception_table_entry __start___dbe_table[];
-extern const struct exception_table_entry __stop___dbe_table[];
+extern struct exception_table_entry __start___dbe_table[];
+extern struct exception_table_entry __stop___dbe_table[];
 
 __asm__(
 "	.section	__dbe_table, \"a\"\n"
@@ -1682,4 +1682,6 @@ void __init trap_init(void)
 
 	flush_icache_range(ebase, ebase + 0x400);
 	flush_tlb_handlers();
+
+	sort_extable(__start___dbe_table, __stop___dbe_table);
 }

