From patchwork Tue Oct 9 02:27:31 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rob Herring X-Patchwork-Id: 1567591 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) by patchwork2.kernel.org (Postfix) with ESMTP id 167B6DF238 for ; Tue, 9 Oct 2012 02:29:35 +0000 (UTC) Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1TLPXn-0003Fg-Q2; Tue, 09 Oct 2012 02:27:39 +0000 Received: from mail-oa0-f49.google.com ([209.85.219.49]) by merlin.infradead.org with esmtps (Exim 4.76 #1 (Red Hat Linux)) id 1TLPXk-0003FS-B1 for linux-arm-kernel@lists.infradead.org; Tue, 09 Oct 2012 02:27:37 +0000 Received: by mail-oa0-f49.google.com with SMTP id l10so867225oag.36 for ; Mon, 08 Oct 2012 19:27:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:content-type:content-transfer-encoding; bh=kTDKUYUH7ip6ZMEGB/LFBgIJ9uaTD9E7H71SzzeZcgU=; b=ENnuVoWWqxQFQumrba2KThDxmxopNjDIqbe5XnXXvNzgi+Oo3wGu4T20vV2Xqrv7bq +rV6oiW93XpnqwaFcvrdPu/gHScE1cu+U/MWLAcV1jHaZPRdQuSOmNpiaNP01gZanaYy 5QfuoWUk1YlOqSrKvNpVM6M36fTySSzfp/CZKI8gtJAbw0jWje47KFsrLrMMwr8Qfim0 jDWMn99J80LvucDiGEqzsItdnIV2pe7Bodkmt8l4FxYEG/nh/iaAZ+Ugf7G+3/o0T8AJ 62dWQUvFnTjYDee2YEvZE8+BIbfCkqVHT79Musyc0fDKV9fpEBQrnfZoB5IJQ9a+8c77 y2iQ== Received: by 10.182.117.74 with SMTP id kc10mr1672333obb.63.1349749655009; Mon, 08 Oct 2012 19:27:35 -0700 (PDT) Received: from [192.168.1.103] (65-36-73-129.dyn.grandenetworks.net. [65.36.73.129]) by mx.google.com with ESMTPS id b7sm14326244oef.12.2012.10.08.19.27.32 (version=SSLv3 cipher=OTHER); Mon, 08 Oct 2012 19:27:33 -0700 (PDT) Message-ID: <50738B93.6090704@gmail.com> Date: Mon, 08 Oct 2012 21:27:31 -0500 From: Rob Herring User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:15.0) Gecko/20120912 Thunderbird/15.0.1 MIME-Version: 1.0 To: Shawn Guo Subject: Re: [PATCH v2 3/5] ARM: use generic unaligned.h References: <1344129840-16447-1-git-send-email-robherring2@gmail.com> <1344129840-16447-4-git-send-email-robherring2@gmail.com> <20121008164353.GB6140@S2101-09.ap.freescale.net> <507338F1.7030604@gmail.com> <20121008232853.GA21822@S2101-09.ap.freescale.net> In-Reply-To: <20121008232853.GA21822@S2101-09.ap.freescale.net> X-Spam-Note: CRM114 invocation failed X-Spam-Score: -2.5 (--) X-Spam-Report: SpamAssassin version 3.3.2 on merlin.infradead.org summary: Content analysis details: (-2.5 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/, low trust [209.85.219.49 listed in list.dnswl.org] 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (robherring2[at]gmail.com) -0.0 SPF_PASS SPF: sender matches SPF record 0.2 FREEMAIL_ENVFROM_END_DIGIT Envelope-from freemail username ends in digit (robherring2[at]gmail.com) -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature Cc: Olof Johansson , Russell King , Arnd Bergmann , linux-arm-kernel@lists.infradead.org, Nicolas Pitre X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: linux-arm-kernel-bounces@lists.infradead.org Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org On 10/08/2012 06:28 PM, Shawn Guo wrote: > On Mon, Oct 08, 2012 at 03:34:57PM -0500, Rob Herring wrote: >> On 10/08/2012 11:43 AM, Shawn Guo wrote: >>> This patch has been merged into mainline as commit below. >>> >>> d25c881 ARM: 7493/1: use generic unaligned.h >>> >>> It introduces a regression for me. Check out the commit on mainline, >>> build a v7 only kernel (imx5/6) with imx_v6_v7_defconfig, the kernel >>> halts in decompressor. But v6/v7 kernel (imx3/5/6) works fine. The >>> kernel built on the parent commit below works all fine. >> >> It actually fails in the decompressor or that's the last output you get? > > I think it fails in the decompressor, because what I see is > > Uncompressing Linux... > > not > > Uncompressing Linux... done, booting the kernel. > >> I compared the decompressor disassembly of both cases and get the same >> number of ldrb/strb instructions, so I don't think it is directly >> related to alignment. >> >> I tried the XY decompressor as that is one difference, but that works >> fine for me on highbank. >> >> Does it work with an empty uncompress.h functions? That should be the >> only difference in our decompressor code. > > No, empty putc() in uncompress.h does not help. > > New finding is that it only fails with LZO decompressor while the other > 3 Gzip, LZMA and XZ all work good. We happen to have LZO as the default > one in imx_v6_v7_defconfig. I must have had an old config with XZ. LZO fails because of this: lib/decompress_unlzo.c: version = get_unaligned_be16(parse); lib/decompress_unlzo.c: if (get_unaligned_be32(parse) & HEADER_HAS_FILTER) lib/decompress_unlzo.c: dst_len = get_unaligned_be32(in_buf); lib/decompress_unlzo.c: src_len = get_unaligned_be32(in_buf); This was what I was afraid of. The decompressor runs with the sysctrl register A bit in whatever state the bootloader left it in. In the case of u-boot it is set, and the maintainers are pretty set on not allowing unaligned accesses if you've seen the recent discussion. This should fix things. Rob 8<--------------------------------------------------------------------- Tested-by: Shawn Guo Acked-by: Nicolas Pitre diff --git a/arch/arm/boot/compressed/head.S b/arch/arm/boot/compressed/head.S index bc67cbf..1f87d22 100644 --- a/arch/arm/boot/compressed/head.S +++ b/arch/arm/boot/compressed/head.S @@ -654,6 +654,7 @@ __armv7_mmu_cache_on: #endif mrc p15, 0, r0, c1, c0, 0 @ read control reg bic r0, r0, #1 << 28 @ clear SCTLR.TRE + bic r0, r0, #1 << 1 @ clear SCTLR.A orr r0, r0, #0x5000 @ I-cache enable, RR cache replacement orr r0, r0, #0x003c @ write buffer #ifdef CONFIG_MMU