From patchwork Sat May 24 17:24:15 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Lezcano X-Patchwork-Id: 4237791 Return-Path: X-Original-To: patchwork-linux-samsung-soc@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 5D7C6BF90B for ; Sat, 24 May 2014 17:24:08 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 71F262028D for ; Sat, 24 May 2014 17:24:07 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 949B82026D for ; Sat, 24 May 2014 17:24:05 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751133AbaEXRYE (ORCPT ); Sat, 24 May 2014 13:24:04 -0400 Received: from mail-wi0-f170.google.com ([209.85.212.170]:53640 "EHLO mail-wi0-f170.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750882AbaEXRYD (ORCPT ); Sat, 24 May 2014 13:24:03 -0400 Received: by mail-wi0-f170.google.com with SMTP id bs8so2475371wib.3 for ; Sat, 24 May 2014 10:24:01 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=clOFXcWww7RkwcxmMFt8zgHbSZsPHSHJaCyZ0ZFSTrk=; b=M3TKj/a5a+lh+pMI+xH4eLnjjbM1h3N0RnkHXpGB1uG2r+Zim6eitI3azgO17HzdoQ n4IlPYPMMoAVhbMOHqrTwt+kE7WBM6qvzS0Gg12QYUtIiDfmZnVF8DC5VjOJ3nLOX5Jh 5nQE4Trv5DrWRmPRM4oBBx2f2YFnFtjesht1U9NzHhQTTgkQGEAzOaLINsRN7jQnkAI/ vQQW9cUp/6wQ7HCw0FaXv26nryRMa2so83Q6Tp/diRW3xZ+PEteTBgvhqpqAtgGVfgFd gmDvXubtDjkEdKEOLi2/0qdJr3eSGWj7aBIOEML8MXWcOB7tyiBDTqK6FTPy+gkMwRUB zvLg== X-Gm-Message-State: ALoCoQm6Js4x+K8LP3NfIsU7C3ZlCVfYSWZVABatjqEZZQyNTHkHG2pvTMOIktwNJN9Pgoggqe47 X-Received: by 10.180.221.229 with SMTP id qh5mr12430828wic.33.1400952241329; Sat, 24 May 2014 10:24:01 -0700 (PDT) Received: from localhost.localdomain (AToulouse-654-1-404-187.w82-125.abo.wanadoo.fr. [82.125.3.187]) by mx.google.com with ESMTPSA id gr6sm11623320wib.8.2014.05.24.10.23.59 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sat, 24 May 2014 10:24:00 -0700 (PDT) From: Daniel Lezcano To: kgene.kim@samsung.com, tomasz.figa@gmail.com Cc: linux-samsung-soc@vger.kernel.org, rjw@rjwysocki.net, linaro-kernel@lists.linaro.org, linux-arm-kernel@lists.infradead.org, arnd.bergmann@linaro.org, sachin.kamat@linaro.org, heiko@sntech.de Subject: [PATCH] ARM: exynos: Fix kernel panic when unplugging CPU1 on 4210 Date: Sat, 24 May 2014 19:24:15 +0200 Message-Id: <1400952255-13750-1-git-send-email-daniel.lezcano@linaro.org> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <537FBE42.7050608@gmail.com> References: <537FBE42.7050608@gmail.com> Sender: linux-samsung-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.org X-Spam-Status: No, score=-7.5 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP A look at the code reveals use of S5P_VA_SYSRAM macro, in case of certain SoC revisions, which is not valid any longer, after SYSRAM started to be mapped dynamically. The new dynamic mapping is stored in sysram_base_addr variable, which is declared static in platsmp.c This fix makes sysram_base_addr non-static, declared it in common.h and used in pm.c instead of S5P_VA_SYSRAM. Signed-off-by: Daniel Lezcano Suggested-by: Tomasz Figa Reviewed-by: Tomasz Figa --- arch/arm/mach-exynos/common.h | 1 + arch/arm/mach-exynos/platsmp.c | 2 +- arch/arm/mach-exynos/pm.c | 4 ++-- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/arch/arm/mach-exynos/common.h b/arch/arm/mach-exynos/common.h index e2d0954..a012bc1 100644 --- a/arch/arm/mach-exynos/common.h +++ b/arch/arm/mach-exynos/common.h @@ -88,6 +88,7 @@ void mct_init(void __iomem *base, int irq_g0, int irq_l0, int irq_l1); struct map_desc; extern void __iomem *sysram_ns_base_addr; +extern void __iomem *sysram_base_addr; void exynos_init_io(void); void exynos_restart(enum reboot_mode mode, const char *cmd); void exynos_cpuidle_init(void); diff --git a/arch/arm/mach-exynos/platsmp.c b/arch/arm/mach-exynos/platsmp.c index 9c16da2..f2bea78 100644 --- a/arch/arm/mach-exynos/platsmp.c +++ b/arch/arm/mach-exynos/platsmp.c @@ -32,7 +32,7 @@ extern void exynos4_secondary_startup(void); -static void __iomem *sysram_base_addr; +void __iomem *sysram_base_addr; void __iomem *sysram_ns_base_addr; static void __init exynos_smp_prepare_sysram(void) diff --git a/arch/arm/mach-exynos/pm.c b/arch/arm/mach-exynos/pm.c index d10c351..87c0d34 100644 --- a/arch/arm/mach-exynos/pm.c +++ b/arch/arm/mach-exynos/pm.c @@ -168,10 +168,10 @@ int exynos_cluster_power_state(int cluster) #define EXYNOS_BOOT_VECTOR_ADDR (samsung_rev() == EXYNOS4210_REV_1_1 ? \ S5P_INFORM7 : (samsung_rev() == EXYNOS4210_REV_1_0 ? \ - (S5P_VA_SYSRAM + 0x24) : S5P_INFORM0)) + (sysram_base_addr + 0x24) : S5P_INFORM0)) #define EXYNOS_BOOT_VECTOR_FLAG (samsung_rev() == EXYNOS4210_REV_1_1 ? \ S5P_INFORM6 : (samsung_rev() == EXYNOS4210_REV_1_0 ? \ - (S5P_VA_SYSRAM + 0x20) : S5P_INFORM1)) + (sysram_base_addr + 0x20) : S5P_INFORM1)) #define S5P_CHECK_AFTR 0xFCBA0D10 #define S5P_CHECK_SLEEP 0x00000BAD