From patchwork Fri Jun 7 03:10:05 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Haojian Zhuang X-Patchwork-Id: 2684051 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from casper.infradead.org (casper.infradead.org [85.118.1.10]) by patchwork2.kernel.org (Postfix) with ESMTP id 4B46CDF23A for ; Fri, 7 Jun 2013 03:10:54 +0000 (UTC) Received: from merlin.infradead.org ([2001:4978:20e::2]) by casper.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1Ukn4j-0005P2-Vn; Fri, 07 Jun 2013 03:10:50 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1Ukn4h-0000Qa-AM; Fri, 07 Jun 2013 03:10:47 +0000 Received: from mail-pa0-x22e.google.com ([2607:f8b0:400e:c03::22e]) by merlin.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1Ukn4f-0000Py-5H for linux-arm-kernel@lists.infradead.org; Fri, 07 Jun 2013 03:10:45 +0000 Received: by mail-pa0-f46.google.com with SMTP id fa11so2217934pad.19 for ; Thu, 06 Jun 2013 20:10:19 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=from:to:cc:subject:date:message-id:x-mailer:x-gm-message-state; bh=H3B7YsjW/K51mFXfv1maTbndfnpqKMDnDsreE41TnAo=; b=iwgnZpfkDFQ8Gmw9U+/aLjN4tkmJ3+o8eHb9Pu6D/TlmWwPcYxre7W/C0W5fpuM2PK 6nP2Y4DucvUhe2n4iVlYOn0yCD4tPyceuNQGbx/u+GnermgIS5fKib1kYOr9QXqDpVSg 1MWD81W5tbydRghVsUuleKLbrbZAcPnPPe2pdLlmHxdiPNmKuNsslpBO7wFMZngE7i8/ 9acoiE/OV7wveP9mcR9Wh6H2QQojimq89NLFwWKhhDv68jATZLNCXUdRmkyhGVWECTGX N8OUDDwW0pAjwZVi2XVUznI9tj4OtlWjQNS/6WZYhRI56+XomHkix0e4FGr1lOxBYDqi yYAw== X-Received: by 10.68.11.232 with SMTP id t8mr41081128pbb.128.1370574617592; Thu, 06 Jun 2013 20:10:17 -0700 (PDT) Received: from localhost.localdomain ([27.115.121.40]) by mx.google.com with ESMTPSA id lq4sm815582pab.19.2013.06.06.20.10.13 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 06 Jun 2013 20:10:16 -0700 (PDT) From: Haojian Zhuang To: baohua.song@csr.com, linux@arm.linux.org.uk, linux-arm-kernel@lists.infradead.org, arnd@arndb.de, olof@lixom.net Subject: [PATCH] ARM: prima2: fix incorrect panic usage Date: Fri, 7 Jun 2013 11:10:05 +0800 Message-Id: <1370574605-30505-1-git-send-email-haojian.zhuang@linaro.org> X-Mailer: git-send-email 1.8.1.2 X-Gm-Message-State: ALoCoQlwgF4oSRJlmHCa81SAhN8Bu4YVkeNOBRttScGkrqRTK4FJwc6BeB4+cJf6poG8P3tbfV1p X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20130606_231045_303535_556326EF X-CRM114-Status: GOOD ( 13.19 ) X-Spam-Score: -1.9 (-) X-Spam-Report: SpamAssassin version 3.3.2 on merlin.infradead.org summary: Content analysis details: (-1.9 points) pts rule name description ---- ---------------------- -------------------------------------------------- -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] Cc: Haojian Zhuang , patches@linaro.org X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org In prima2, some functions of checking DT is registered in initcall level. If it doesn't match the compatible name of sirf, kernel will panic. It blocks the usage of multiplatform on other verndor. The error message is in below. Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(0,255) CPU: 0 PID: 1 Comm: swapper/0 Not tainted 3.10.0-rc3-00006-gd7f26ea-dirty #87 [] (unwind_backtrace+0x0/0xf8) from [] (show_stack+0x10/0x1) [] (show_stack+0x10/0x14) from [] (panic+0x90/0x1e8) [] (panic+0x90/0x1e8) from [] (mount_block_root+0x250/0x298) [] (mount_block_root+0x250/0x298) from [] (prepare_namespac) [] (prepare_namespace+0x120/0x174) from [] (kernel_init_fre) [] (kernel_init_freeable+0x17c/0x1c4) from [] (kernel_init+) [] (kernel_init+0x8/0xe4) from [] (ret_from_fork+0x14/0x3c) Signed-off-by: Haojian Zhuang --- arch/arm/mach-prima2/pm.c | 6 ++++-- arch/arm/mach-prima2/rstc.c | 6 ++++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/arch/arm/mach-prima2/pm.c b/arch/arm/mach-prima2/pm.c index 9936c18..8f595c0 100644 --- a/arch/arm/mach-prima2/pm.c +++ b/arch/arm/mach-prima2/pm.c @@ -101,8 +101,10 @@ static int __init sirfsoc_of_pwrc_init(void) struct device_node *np; np = of_find_matching_node(NULL, pwrc_ids); - if (!np) - panic("unable to find compatible pwrc node in dtb\n"); + if (!np) { + pr_err("unable to find compatible sirf pwrc node in dtb\n"); + return -ENOENT; + } /* * pwrc behind rtciobrg is not located in memory space diff --git a/arch/arm/mach-prima2/rstc.c b/arch/arm/mach-prima2/rstc.c index 435019c..d5e0cbc 100644 --- a/arch/arm/mach-prima2/rstc.c +++ b/arch/arm/mach-prima2/rstc.c @@ -28,8 +28,10 @@ static int __init sirfsoc_of_rstc_init(void) struct device_node *np; np = of_find_matching_node(NULL, rstc_ids); - if (!np) - panic("unable to find compatible rstc node in dtb\n"); + if (!np) { + pr_err("unable to find compatible sirf rstc node in dtb\n"); + return -ENOENT; + } sirfsoc_rstc_base = of_iomap(np, 0); if (!sirfsoc_rstc_base)