From patchwork Wed Nov 28 21:35:24 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: dromede@gmail.com X-Patchwork-Id: 1818681 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) by patchwork1.kernel.org (Postfix) with ESMTP id 70DA440AE5 for ; Wed, 28 Nov 2012 21:40:22 +0000 (UTC) Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1TdpJn-0000jy-IQ; Wed, 28 Nov 2012 21:37:19 +0000 Received: from mail-ee0-f49.google.com ([74.125.83.49]) by merlin.infradead.org with esmtps (Exim 4.76 #1 (Red Hat Linux)) id 1TdpJj-0000ja-Os for linux-arm-kernel@lists.infradead.org; Wed, 28 Nov 2012 21:37:16 +0000 Received: by mail-ee0-f49.google.com with SMTP id c4so6097208eek.36 for ; Wed, 28 Nov 2012 13:37:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:x-mailer; bh=3FW4hJ8M9/IrvpYaD2P8zjrNGBymq76RaQucITBkYpU=; b=kUrrBBOeWvgoYmKxHfgsInR0vcoe3jkPHyF7fXQliKO2AjtXSaYbfjUzpKFIJ621Dj awD+ytrfTfdqJdMXRLW+1moGo1oxf/gQq4ntNWhjvgJQ0rJfiyTVnqTdpXXa3GkAa+yw y5h3NbL/TIq/c9Q+OPXeYZrRMIFsHxlI7RqU/yZM6wRrWq3WHgr4onKK9pFhDsO0adMu lBW20rreLZh2tJ4gFTaG8dgGKrh0EHJnhDxiLT9uRGX7La5lW38BBm236/IrDDtE892V 2yleYMpRy8bmMWMMVLW8Ce2JFZiegDpanGAuGjE/GrYPsd0zZ7vIFdVTc048xznL6Gzs 54qQ== Received: by 10.14.213.134 with SMTP id a6mr74055804eep.45.1354138631817; Wed, 28 Nov 2012 13:37:11 -0800 (PST) Received: from localhost.localdomain (93-142-246-232.adsl.net.t-com.hr. [93.142.246.232]) by mx.google.com with ESMTPS id y44sm49642011eel.14.2012.11.28.13.37.09 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 28 Nov 2012 13:37:10 -0800 (PST) From: dromede@gmail.com To: linux-arm-kernel@lists.infradead.org Subject: [PATCH] ARM: sharpsl_param: Fix hang on boot in sharpsl_save_param(). Date: Wed, 28 Nov 2012 22:35:24 +0100 Message-Id: <1354138524-12543-1-git-send-email-dromede@gmail.com> X-Mailer: git-send-email 1.7.10.4 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20121128_163716_010804_27ABADBB X-CRM114-Status: GOOD ( 13.26 ) X-Spam-Score: -2.7 (--) X-Spam-Report: SpamAssassin version 3.3.2 on merlin.infradead.org summary: Content analysis details: (-2.7 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/, low trust [74.125.83.49 listed in list.dnswl.org] 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (dromede[at]gmail.com) -0.0 SPF_PASS SPF: sender matches SPF record -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: Marko Katic , will.deacon@arm.com, linux@arm.linux.org.uk 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: , MIME-Version: 1.0 Sender: linux-arm-kernel-bounces@lists.infradead.org Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org From: Marko Katic Devices that call sharpsl_save_param() will hang on boot due to a memcpy call that uses a physical address that is no longer accessible. This is caused by the following commit: commit 72662e01088394577be4a3f14da94cf87bea2591 Author: Will Deacon Date: Wed Nov 23 12:03:27 2011 +0000 ARM: head.S: only include __turn_mmu_on in the initial identity mapping I suspect that due to the abovementioned commit the mmu gets turned on earlier and thus, memcpy in sharpsl_save_param() will fail. Fix this by converting the physical address into a virtual one. Signed-off-by: Marko Katic Tested-by: Andrea Adami --- arch/arm/common/sharpsl_param.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/arch/arm/common/sharpsl_param.c b/arch/arm/common/sharpsl_param.c index d56c932..04555dc 100644 --- a/arch/arm/common/sharpsl_param.c +++ b/arch/arm/common/sharpsl_param.c @@ -14,6 +14,7 @@ #include #include #include +#include #include /* @@ -41,7 +42,8 @@ EXPORT_SYMBOL(sharpsl_param); void sharpsl_save_param(void) { - memcpy(&sharpsl_param, (void *)PARAM_BASE, sizeof(struct sharpsl_param_info)); + void *param_start = phys_to_virt(PARAM_BASE); + memcpy(&sharpsl_param, param_start, sizeof(struct sharpsl_param_info)); if (sharpsl_param.comadj_keyword != COMADJ_MAGIC) sharpsl_param.comadj=-1;