From patchwork Tue Apr 26 12:37:46 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tony Lindgren X-Patchwork-Id: 732562 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id p3QCc0Of026021 for ; Tue, 26 Apr 2011 12:38:02 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752325Ab1DZMhy (ORCPT ); Tue, 26 Apr 2011 08:37:54 -0400 Received: from mho-03-ewr.mailhop.org ([204.13.248.66]:45566 "EHLO mho-01-ewr.mailhop.org" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751129Ab1DZMhx (ORCPT ); Tue, 26 Apr 2011 08:37:53 -0400 Received: from c-98-234-237-12.hsd1.ca.comcast.net ([98.234.237.12] helo=localhost.localdomain) by mho-01-ewr.mailhop.org with esmtpa (Exim 4.72) (envelope-from ) id 1QEhWX-00002e-Ks; Tue, 26 Apr 2011 12:37:49 +0000 Received: from Mutt by mutt-smtp-wrapper.pl 1.2 (www.zdo.com/articles/mutt-smtp-wrapper.shtml) X-Mail-Handler: MailHop Outbound by DynDNS X-Originating-IP: 98.234.237.12 X-Report-Abuse-To: abuse@dyndns.com (see http://www.dyndns.com/services/mailhop/outbound_abuse.html for abuse reporting information) X-MHO-User: U2FsdGVkX18a2h+uNInlmpnNUjRzPF4F Date: Tue, 26 Apr 2011 05:37:46 -0700 From: Tony Lindgren To: Nicolas Pitre Cc: Shawn Guo , linux-arm-kernel@lists.infradead.org, patches@linaro.org, Aaro Koskinen , linux-omap@vger.kernel.org Subject: [PATCH] ARM: Fix bad SP address after relocating kernel Message-ID: <20110426123746.GC3755@atomide.com> References: <20110420165514.GE10402@atomide.com> <20110421055945.GB13688@atomide.com> <20110421104954.GH13688@atomide.com> <20110422062843.GA841@atomide.com> <20110426085700.GJ16892@atomide.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20110426085700.GJ16892@atomide.com> User-Agent: Mutt/1.5.20 (2009-06-14) Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter1.kernel.org [140.211.167.41]); Tue, 26 Apr 2011 12:38:04 +0000 (UTC) Otherwise cache_clean_flush can overwrite some of the relocated area depending on where the kernel image gets loaded. This fixes booting on n900 after commit 6d7d0ae51574943bf571d269da3243257a2d15db (ARM: 6750/1: improvements to compressed/head.S). Thanks to Aaro Koskinen for debugging the address of the relocated area that gets corrupted, and to Nicolas Pitre for the other uncompress related fixes. Signed-off-by: Tony Lindgren --- I think this is the right fix.. And we don't want to mess with the ZBOOT_ROM sp address, right? -- To unsubscribe from this list: send the line "unsubscribe linux-omap" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html --- a/arch/arm/boot/compressed/head.S +++ b/arch/arm/boot/compressed/head.S @@ -253,6 +253,15 @@ restart: adr r0, LC0 /* Preserve offset to relocated code. */ sub r6, r9, r6 +#ifndef CONFIG_ZBOOT_ROM + /* + * Fix sp to use the relocated address in case old sp is + * within the relocated area. Otherwise cache_clean_flush + * will trash some of the relocated area. + */ + add sp, r6 +#endif + bl cache_clean_flush adr r0, BSYM(restart)